Optimization of the Unambiguity of Cross-Correlated Ultrasonic Signals through Coded Excitation Sequences for Robust Time-of-Flight Measurements

: The cross-correlation function (CCF) is an established technique to calculate time-of-ﬂight for ultrasonic signals. However, the quality of the CCF depends on the shape of the input signals. In many use cases, the CCF can exhibit secondary maxima in the same order of magnitude as the main maximum, making its interpretation less robust against external disturbances. This paper describes an approach to optimize ultrasonic signals for time-of-ﬂight measurements through coded excitation sequences. The main challenge for applying coded excitation sequences to ultrasonic signals is the inﬂuence of the piezoelectric transducer on the outgoing signal. Thus, a simulation model to describe the transfer function of an experimental setup was developed and validated with common code sequences such as pseudo noise sequences (PN), Barker codes and chirp signals. Based on this model an automated optimization of ultrasonic echoes was conducted with random generated sequences, resulting in a decrease in the secondary positive maximum of the CCF to 56.6%. Based on these results, further empiric optimization leveraging the nonlinear regime of the piezoelectric transducer resulted in an even lower secondary positive maximum of the CCF with a height of 25% of the ﬁrst maximum. Experiments were conducted on different samples to show that the ﬁndings hold true for small variations in the experimental setup; however, further work is necessary to develop transfer functions and simulations able to include a wider parameter space, such as varying transducer types or part geometry.


Introduction
Cross-correlation is an established technique to calculate the time-of-flight of ultrasonic signals with applications ranging from medicine to industrial quality control [1][2][3]. The cross-correlation function, CCF, takes two ultrasonic echoes as inputs and returns a function that mathematically quantifies the similarity of two signals in the time-regime [4]. The maximum of the CCF marks the best match and provides the possibility to determine a relative shift between the signals.
In an ultrasonic system, the shape of the signals and, therefore, the shape of the CCF is influenced by many factors in practice. Major parameters include defects in the material, positioning of the sensor, coupling conditions, damping and reflections [5][6][7]. For regular excitation patterns, such as a sine wave or an impulse stimulation, the CCF exhibits many local maxima with similar correlation factors as the global maximum because of the resonant eigenfrequencies of the transducer, causing ambiguity [8][9][10].
There are different strategies to address the problem of ambiguous CCF results. A recent study used a purely algorithmic approach, based on machine learning, to identify phase shifts in cross-correlated signals [11]. However, this requires prior training of the algorithms and the generation of large amounts of labeled training data. Another Signals 2021, 2 367 experimental approach, the so-called coded excitation, modulates the excitation signal to reduce the self-similarity of echoes [12,13]. This principle was originally developed for applications in radar technology like UWB short-range radar sensing or FMCW [14,15]. It was adapted to ultrasonic methods but is so far mainly used in medical applications, such as commercial scanners or other medical imaging applications [16][17][18]. When using coded excitation signals, excessive natural frequency behavior [19,20] and nonlinear piezoelectric behavior [21][22][23] are usually seen as inconveniences and the experimental limits are set in a way that they do not influence the signals.
The approach presented in this paper modulates the ultrasound signal based on coded excitation both in the linear and nonlinear regime of the piezoelectric sensor to generate cross-correlation results with optimized unambiguity and, thus, achieves a higher robustness against disturbance. To explore a wide range of coded excitation signals, a simulation model was first developed and experimentally validated. Based on the resulting optimal excitation signals, further empirical optimization of the signal-to-noise ratio leveraging the nonlinear piezo regime yields improvement of robustness for CCFbased time-of-flight measurements.

Coded Excitation
Coded excitation describes the variation in the stimulation of an ultrasonic transducer using a code sequence instead of a default sine wave or impulse stimulation. There are many parameters that can be varied, including the signal shape, length, amplitude or the minimal and maximal pulse width. Coded excitation sequences evaluated in this work include pseudo noise sequences (PN) [24], Barker codes [25], variations of chirp signals [15] as well as derived custom signals. The pseudo noise sequences were generated using linear feedback shift registers (e.g., PN 8 and 24) [26]. The Barker codes are defined as digital sequences with ideal autocorrelation properties. Only the three longest codes were tested because it is known that the ambiguity of their CCF decreases with increasing code length (e.g., Barker 7,11 and 13) [25]. For the chirp signals the factor between the lowest and the highest frequency and the direction of the frequency adaption are used to describe the sequence (e.g., Chirp Up-Down Freq. 1-4). The lookup tables for chirp sequences are generated with a frequency factor of 2 or 4 and linear or quadratic frequency increments according to the formula in the literature converted to create discrete signals [15,27]. The initial frequency, final frequency and duration of the signal are influenced by the measurement setup, which will be further elaborated in Section 2.2.
Limits in the variation of the waveforms were chosen taking into account the limitations of the testing system. The output stage of the ultrasonic system can only assume three states: positive output voltage, zero output voltage and negative output voltage. The output stage controls a MOSFET stage through which the burst voltage is switched to the transducer. The system can generate pulses with a width between 25 ns and 1 µs.
The code length must be limited to avoid overlay effects between the incoming and reflected waves in the specimens. To achieve an optimal comparability between the different experiments and simulations, the length of the echoes was limited to the frame size of the CCF (512 samples) while matching the center frequency of 4 MHz and the bandwidth of the transducer.

Experimental Setup
Ultrasonic measurements were performed using a custom-built testing system (cf. Figure 1a) based on an experimental workflow (cf. Figure 1b). The lookup table (LUT) contains the desired waveform sampled with 2048 datapoints and is the input of the digital system. To transmit the waveform while matching the center frequency of the transducer, the number of datapoints in the LUT must be reduced within the field programmable gate array (FPGA). Next, the signal is discretized in three levels that the output stage is able to replicate and transmit to the ultrasonic transducer (1506.301, Karl Deutsch, Wuppertal, Germany) with a center frequency of 4 MHz and a 6 dB bandwidth of 3 MHz. All measurements mentioned in Sections 3.1-3.4 were conducted on a steel reference with a thickness of 60 mm. The validation measurements in Section 3.5 were conducted on samples of the same steel with thicknesses of 30 mm and 15 mm. The ultrasonic echoes are recorded with the transducer connected to an electronic receiver and converted to a digital signal that can be further processed. The measurement system cannot record a complete impulse response because the receiver is highly overdriven during activity of the transmitter. Through electrical coupling between transmitter and receiver, the voltage at the input of the measurement electronics exceeds its limits, which prevents recording useful signals during transmission. Therefore, the recorded signal is delayed in time compared to the emission of the stimulation sequence data frame to include at least one backwall echo.
ducer, the number of datapoints in the LUT must be reduced within the field programmable gate array (FPGA). Next, the signal is discretized in three levels that the output stage is able to replicate and transmit to the ultrasonic transducer (1506.301, Karl Deutsch, Wuppertal, Germany) with a center frequency of 4 MHz and a 6 dB bandwidth of 3 MHz. All measurements mentioned in Sections 3.1-3.4 were conducted on a steel reference with a thickness of 60 mm. The validation measurements in Section 3.5 were conducted on samples of the same steel with thicknesses of 30 mm and 15 mm. The ultrasonic echoes are recorded with the transducer connected to an electronic receiver and converted to a digital signal that can be further processed. The measurement system cannot record a complete impulse response because the receiver is highly overdriven during activity of the transmitter. Through electrical coupling between transmitter and receiver, the voltage at the input of the measurement electronics exceeds its limits, which prevents recording useful signals during transmission. Therefore, the recorded signal is delayed in time compared to the emission of the stimulation sequence data frame to include at least one backwall echo.
The electronic components, such as the transmitter, receiver and controller board are custom-built. The AD and DA conversions are performed with 122.88 MHz. The hardware is capable of transmitting signals up to 20 MHz and the receiver has its -3 dB attenuation points at 800 kHz and 11 MHz.

Cross-Correlation-Based Ultrasound Signal Processing
Cross-correlation-based time of flight measurement is based on the relative shift of two backwall echoes (Figure 2a). This shift is calculated based on the position of the maximum of the normalized CCF (positive or absolute depending in the application) ( Figure   Figure 1. Experimental setup and flow diagram of the different components. (a) Testing system for experimental investigation of coded excitation signals; (b) separation of the testing system into several components for modelling: several elements were explicitly implemented in simulation (Section 1) while the second part of the workflow was included in simulation through a transfer function (Section 2).
The electronic components, such as the transmitter, receiver and controller board are custom-built. The AD and DA conversions are performed with 122.88 MHz. The hardware is capable of transmitting signals up to 20 MHz and the receiver has its −3 dB attenuation points at 800 kHz and 11 MHz.

Cross-Correlation-Based Ultrasound Signal Processing
Cross-correlation-based time of flight measurement is based on the relative shift of two backwall echoes (Figure 2a). This shift is calculated based on the position of the maximum of the normalized CCF (positive or absolute depending in the application) (Figure 2b) [28]. As illustrated in Figure 2b for the case of stimulation of the transducer with a sine-wave, the side maxima show very similar correlation values to the main maximum and the system is thus vulnerable to disturbances causing phase shifts [11].
Signals 2021, 2 FOR PEER REVIEW 4 2b) [28]. As illustrated in Figure 2b for the case of stimulation of the transducer with a sine-wave, the side maxima show very similar correlation values to the main maximum and the system is thus vulnerable to disturbances causing phase shifts [11].

Simulation
A model simulating the system was developed in Matlab2020a (Mathworks Inc., Natick, MA, USA) to predict resulting echoes from coded excitation signals and will be further described in the following section.

Results
To optimize the CCF based on coded excitation, a simulation model was developed in order to appropriately cover the parameter space.

Derivation of a Simulation Model from the Experimental Setup
The simulation model developed for this study is designed to predict the measured ultrasonic echoes from an input coded excitation signal and is divided in two sections: The first section covers the transformation of an ideal coded excitation signal from a userdefined parameter space to the output signal of the signal generator ( Figure 1b, Section 1). The second section predicts the resulting echoes taking into account both piezoelectric transducers (transmitter and receiver) as well as the interaction with the object under investigation ( Figure 1b, Section 2). The first section can be described numerically and is directly included in the simulation (Figure 3a-e), while the components in the second section are represented by an experimentally determined transfer function (Figure 3f red line) based on impulse-echo measurements (Figure 3f-h). The direct mathematical description of these components would require complex physical modeling. As in this study only the resulting echo is of interest for optimization, the replacement through the transfer function is appropriate.
To derive the simulation model, the different components of the testing system were subsequently modelled. The process is illustrated for a sine wave with four periods in Figure 3.
In a first step, a spectral analysis of the LUT-based signal Figure 3a is performed using an FFT (Figure 3b, zoomed in around center frequency in Figure 3c) to adjust the number of data points for each signal to match the center frequency of the piezoelectric transducer ( Figure 3d). The adjustment of the number of datapoints is necessary because the transmission of the signal is performed using a system sampling frequency of 122.88 MHz.
The next component, the output stage, is represented through conversion to the pulse-width-modulation (PWM) signal, shown in Figure 3e.
The remaining components of the testing system are represented through a transfer function [29]. This function is calculated through the Fast-Fourier-Transform (FFT) of a

Simulation
A model simulating the system was developed in Matlab2020a (Mathworks Inc., Natick, MA, USA) to predict resulting echoes from coded excitation signals and will be further described in the following section.

Results
To optimize the CCF based on coded excitation, a simulation model was developed in order to appropriately cover the parameter space.

Derivation of a Simulation Model from the Experimental Setup
The simulation model developed for this study is designed to predict the measured ultrasonic echoes from an input coded excitation signal and is divided in two sections: The first section covers the transformation of an ideal coded excitation signal from a userdefined parameter space to the output signal of the signal generator ( Figure 1b, Section 1). The second section predicts the resulting echoes taking into account both piezoelectric transducers (transmitter and receiver) as well as the interaction with the object under investigation (Figure 1b, Section 2). The first section can be described numerically and is directly included in the simulation (Figure 3a-e), while the components in the second section are represented by an experimentally determined transfer function (Figure 3f red line) based on impulse-echo measurements (Figure 3f-h). The direct mathematical description of these components would require complex physical modeling. As in this study only the resulting echo is of interest for optimization, the replacement through the transfer function is appropriate.
To derive the simulation model, the different components of the testing system were subsequently modelled. The process is illustrated for a sine wave with four periods in Figure 3.
In a first step, a spectral analysis of the LUT-based signal Figure 3a is performed using an FFT (Figure 3b, zoomed in around center frequency in Figure 3c) to adjust the number of data points for each signal to match the center frequency of the piezoelectric transducer (Figure 3d). The adjustment of the number of datapoints is necessary because the transmission of the signal is performed using a system sampling frequency of 122.88 MHz.    Figure 3h). The ACF of the calculated echo shape is taken as an approximation for the CCF expected in the experiments.
To quantify the effect of the signal shapes on the echo, the signals are normalized to the height of the main maximum and relative heights of the positive as well as absolute side maximum are evaluated. In the case of the sine wave, there is a difference of 3.2 percentage points for the absolute side maximum and 10.8 percentage points for the positive side maximum (Figure 3h).

Validation of the Simulation Model with Common Coded Excitation Signals
To validate the simulation model, coded excitation signals including pseudo noise sequences, Barker code sequences and chirp signals were empirically selected and evaluated with the simulation model.
Two reference signals are considered: the default sine-stimulation with four periods (Figure 3) and the impulse-stimulation of the system. In the case of the impulse-stimulation, the transmitted waveform contains a single pulse with a width of 25 µs. For these measurements the burst voltage is set to 7 V PP to perform the tests, mainly in the linear operating range of the system. Table 1 shows a summary of results based on the evaluation of the relative height of the positive and absolute side maximum in simulations and experiments. The sine function results in 89% and 96% height of the positive and absolute side maximum in the CCF, respectively. The impulse-stimulation results in 71% and 90% relative height of the positive and absolute side maximum in the CCF. For both reference signals, experimental and simulation results are in good agreement with 99.7% up to 100% for the positive and absolute side maximum of the CCF compared to the ACF out of the simulation. The agreement between experiment and simulation for the impulse stimulation is expected because the signal itself is used to calculate the transfer function of the system.

Automated Optimization of Coded Excitation Sequence
After validation of the simulation model, an automated optimization of the coded excitation signal sequence was conducted. The parameters for the sequences were chosen in a range were the transducer is expected to have linear behavior for the model to be applicable. Sequences with a maximum code length of 48 were generated based on the common waveforms amplitudes ranging from −1 V to +1 V and minimal pulse width of 25 µs. In total, 2 16 simulations were performed.
Among the tested coded excitation sequences, the sequence with lowest positive and absolute side maximum was further examined (Figure 4a). The analysis of the calculated echo (Figure 4b) resulted in reduced positive and absolute side maxima of 55.5% and 56.2%, respectively (Figure 4c). This is a reduction of 33.7 percentage points for the positive side maximum and 40.4 percentage points for the absolute maximum compared to sine-wave excitation as the reference. Similar discrepancies were observed in Section 3.2 for the Chirp-Up-Down signal with about 10 percentage points deviation between simulation and experiment for the positive side maximum. Both coded signals show promising reduction in the side maxima but at the same time lack the predictability through simulations. The large discrepancy indicates that the experimental system is not reacting linearly to the coded excitation and thus the linear model is not able to replicate its reaction.
As the best results were obtained when the coded excitation was influenced by nonlinear effects of the piezoelectric transducer, the next chapter leverages these effects to improve the unambiguity and, thereby, robustness of the cross-correlation-based time-offlight measurement even further. Analysis of the automated simulation of common coded excitation signals revealed that nonlinear effects were particularly prevalent in signals with sequences of up and down features, which were explored using physical constraints to maximize nonlinearity of the experimental system in the following section. Experiments with increased burst voltage showed that the match between the simulation and In the next step, the above sequence was evaluated on the experimental setup (Figure 4d). Figure 4e shows a comparison of the simulated and experimental echo. The shape of the waveform is comparable, while there are clear deviations in the amplitude. From the cross-correlation function (Figure 4f), the experimental positive and absolute maximum were determined to be 56.6% and 89.3%, respectively. While the positive maximum is in good agreement with the simulations, there is a deviation of 33.1 percentage points for the absolute side maximum.
Similar discrepancies were observed in Section 3.2 for the Chirp-Up-Down signal with about 10 percentage points deviation between simulation and experiment for the positive side maximum. Both coded signals show promising reduction in the side maxima but at the same time lack the predictability through simulations. The large discrepancy indicates that the experimental system is not reacting linearly to the coded excitation and thus the linear model is not able to replicate its reaction.
As the best results were obtained when the coded excitation was influenced by nonlinear effects of the piezoelectric transducer, the next chapter leverages these effects to improve the unambiguity and, thereby, robustness of the cross-correlation-based time-offlight measurement even further. Analysis of the automated simulation of common coded excitation signals revealed that nonlinear effects were particularly prevalent in signals with sequences of up and down features, which were explored using physical constraints to maximize nonlinearity of the experimental system in the following section. Experiments with increased burst voltage showed that the match between the simulation and the testing system decreases, while at the same time the nonlinear effects decrease the self-similarity of echoes, resulting in a reduction in the side maxima.

Empiric Optimisation of Ultrasonic Echoes
This section focusses on the use of nonlinear effects of the system to achieve unambiguous cross-correlation results. The stimulation of the piezoelectric ultrasonic transducer with higher voltage results in nonlinear effects, which is why a burst voltage of 120 V PP was used for the following experiments. Sequences of pulses with alternate direction of one to five pulses were investigated and the resulting cross-correlation functions, as well as first echoes, are displayed in Figure 5.
The burst sequence with a single pulse with higher burst voltage (Figure 5a) caused a backwall echo that was similar in shape to the echo caused by a pulse stimulation and resulted in a correlation factor of the positive and absolute side maximum of 63.6% and 87%, respectively (Figure 5d).
The burst sequence with two pulses exhibits an additional pulse placed near the zero crossing of the signal of the first sequence. The natural-frequency-dominated oscillation, as seen in the previous sequence, is thereby interrupted and the resulting echo deformed. The effect on the CCF is distinct as the highest positive side maximum decreases to 37% and the absolute side maximum to 76%.
Adding an additional positive pulse results in a sequence with three pulses, exhibiting distortion of the echo after the pulse and supporting the free oscillation of the transducer. The positive side maximum is further reduced by 3 percentage points compared to the two-pulse sequence.
Further deformation of the echo occurs through the placement of an additional, wider, negative pulse to generate a four-pulse sequence (Figure 5b). The placement of a pulse with the preceding pulse width could not achieve the desired impact on the echo as the natural frequency of the transducer would be dominating the echo shape. The positive side maximum is larger than in the previous sequence at 41.9%. However, the correlation factor of the absolute side maximum is smaller at 60% (Figure 5e).
The five-pulse sequence was generated by adding an additional negative pulse, attempting to reduce the positive side maximum by introducing more distortion to the signal (Figure 5c). While the absolute side maximum is larger compared to the previous sequence with a correlation factor of 73%, the positive side maximum was reduced to 25% (Figure 5f).

Discussion
To improve the unambiguity of cross-correlation-based time of flight measurements through coded excitation it is important to take into consideration the boundary conditions of the experimental setup. The transfer of coded excitation sequences into a signal that the signal-generator can process reduces the complexity of the sequences. Impulse

Validation with Different Testing Specimens
The transfer function and simulation model were established for a specific experimental setup including a sensor type as well as a testing specimen with set thickness of 60 mm. However, in addition to the coded excitation shape, the sample size, material and shape also have distinct influence on the resulting echoes. Especially thinner substrates exhibit more edge effects and, therefore, also contribute to the distortion of ultrasonic signals. In this section, specimens with a thickness of 15 mm and 30 mm were tested in addition to the 60 mm specimen to validate that the concept is applicable to a larger parameter space.
A summary of the results is shown in Table 2. Measurements on the 30 mm specimen are comparable to previous results on 60 mm samples with a variation of 1 percentage points for the sine wave and 3 percentage points for the five-pulse sequence (ccf. Figure 5c). The shape of the CCF is almost identical throughout the whole signal and also for subsequent lower order minima. The measurement on the 15 mm steel object shows variations of 8 percentage points for the sine wave and a variation of 4 percentage points for the five-pulse sequence compared to the 60 mm sample. Even for a sample with 25% thickness the overall signal shape of the CCF is still comparable.

Discussion
To improve the unambiguity of cross-correlation-based time of flight measurements through coded excitation it is important to take into consideration the boundary conditions of the experimental setup. The transfer of coded excitation sequences into a signal that the signal-generator can process reduces the complexity of the sequences. Impulse signals always have a limited width and, therefore, the resulting impulse echo shows deviations from idealized echoes. In addition, there are limitations related to the ultrasonic transducer. The transducer has an optimal operating frequency and inertia, which affect the outgoing signal. Furthermore, the linear model provided by the transfer function created by using the FFT on the impulse echo cannot completely describe the system.
Simulations were a very effective way to screen a large parameter space and guide the experimental setup (Sections 3.2 and 3.3). They showed that especially sequences with signals in alternate directions yield high reductions in side maxima values. However, the transfer function of the system is a linear model of the piezo-electric ultrasonic transducer and the testing material and, therefore, limited in its capability to fully reflect the reaction of the system. The maximum of the transfer function is also not evaluated at 4 MHz as expected. This deviation is connected to the preload of the transducer and excitation in the positive direction first. The stimulation with a negative pulse instead of a positive pulse produces an echo with a maximum power spectrum closer to the expected frequency of the transducer of 4 MHz.
In addition to simulations, it is very important to rely on experimental results to explore the potential of coded excitation. Table 3 shows a summary of the references and sequences with the greatest reduction in either positive or absolute side maximum in experiments on the 60 mm specimen (cf. Table 1 for all results). Both positive and absolute side maxima values were systematically evaluated throughout this work because it is not straightforward to determine which value is more important to evaluate for optimization. The absolute side maximum could be reduced by 37 percentage points and the positive side maximum by 64 percentage points. For both optimization strategies, the susceptibility to disturbance and the unambiguity of the signal could be improved. Determination of the most relevant strategy of optimization depends on the application and the desired signals.
Coded excitation is influenced by experimental boundary conditions (e.g., transducer type, electronic components, . . . ) and even more complex phenomena occur when the sample size is reduced. Size and edge effects contribute to a behavior which cannot be analytically described because of distortions in the plain wave propagation in a medium and require further investigation in future research projects.

Conclusions and Outlook
Coded excitation has the potential to reduce the ambiguity of signals used for ultrasound time-of-flight measurements. While not every signal sequence provided a large reduction in the side maxima, selected sequences such as the empiric pulse sequences ( Figure 5) resulted in a reduction of the absolute side maximum by 37 percentage points and 64 percentage points for the positive side maximum.
The definition of a general optimal stimulation sequence is not possible. Major components of the transmission chain are the piezoelectric ultrasonic transducer and the testing object itself. The usage of the same sequence in other testing object of the same material and the same transducer, but with another thickness, is possible. However, changing the specimen geometry to a more complex form or changing the transducer would require a completely new calculation of an optimized stimulation sequence. More amplitude levels in the stimulation signal would enable the use of different forces on the transducer without the need for a huge bandwidth, predefine the desired echo much more precisely and calculate the required stimulation signal. Further projects will investigate the replacement of the transfer function with physical models of the transducer and the material. This could offer added value for the automated estimation of an optimized stimulation sequence and would enable a quick estimation on the effect of changing different components in the experimental system. Furthermore, other transmitter technologies could result in further potential for optimization through coded excitation.