# Real-Time Method and Implementation of Head-Wave Extraction for Ultrasonic Imaging While Drilling
###### Abstract  
Extracting head waves and subsequently uploading their results from the downhole to the surface system in real time could improve the real-time guidance of ultrasonic imaging logging while drilling (UILWD) for drilling operations. To realize the downhole real-time extraction of head waves in this logging, three aspects were explored in this study. First, an improved energy ratio head-wave arrival extraction algorithm based on the weighting coefficients and characteristic functions, along with an amplitude detection method relying on peak-to-peak values, was proposed. Second, an echo reception pre-processing analog circuit and a digital signal processing circuit based on FPGA were designed. A pipeline algorithm was developed in FPGA to extract the arrival time and amplitude of the head wave. Finally, software simulations, laboratory tests, and field experiments related to this method were conducted. Our results showed that the real-time head-wave extraction method demonstrated a strong anti-noise ability in real time. The maximum relative error of the arrival time was less than 5%. The relative error of the amplitude was acceptable, and 90% of this value was within 5%. Through the measurement, the time of processing a single-channel waveform by a downhole algorithm was less than 15 ms, thus meeting the requirements for the real-time processing of downholes. ultrasonic imaging; logging while drilling; circuit; head wave extraction; FPGA; logging tool +
Footnote †: journal: Medical Imaging  
**Citation:** [PERSON]. so as to ensure drilling safety and does not have the advantages of drilling and logging integration [8; 9]. Consequently, a possible solution to this problem could be to use the working mode of processing echo signals in a downhole tool in real time and subsequently upload the extracted head-wave results only after storing all the data. Currently, there are two methods for achieving head-wave extraction--the downhole analogue circuit method and the surface computer software method. The former includes special circuits for determining the arrival time and peaks of the head wave, which are widely used in conventional acoustic logging tools [10; 11]. Although this method is simple and has a fast response time, it is considerably affected by various factors, such as the temperature, drilling noise, mud density, and wellbore lithology, which may render threshold level determination difficult and also lead to low accuracy or even detection failure missing detection in UILWD. There are many algorithms for calculating the arrival time and amplitude of the head wave in the surface computer software method. According to the information used, head-wave arrival time extraction methods can be divided into three types. The first type is based on the instantaneous form of waveform recording, such as the short-term to long-term average (STA/LTA) method proposed by [PERSON] et al. and the improved energy ratio algorithm published by other scholars [12; 13; 14; 15]. However, despite the fact that this method has good response sensitivity and occupies less hardware resources, it is sensitive to noise and also works poorly with data that have a low signal-to-noise ratio (SNR). The second type uses the overall waveform recording form, such as the cross-correlation method of adjacent waveforms, the autoregressive arrival detection method and the AIC algorithm based on statistical laws [15; 16; 17]. This method has a certain anti-noise ability, but the processing result is poor when dealing with complex waveform recording forms. Finally, the third type utilizes multi-dimensional information recorded in waveforms, such as the arrival time detection method based on an artificial neural network, wavelet transform, and fractal dimension [18; 19; 20]. Although this approach can suppress noise and improve the accuracy of head-wave extraction, it is a rather complex and inefficient method. The head-wave amplitude detection mainly involves peak-to-peak, main-frequency amplitude, and envelope amplitude methods [21].