Ultrasonic reflection wave signal processing operation method, chip and storage medium
By combining a multi-stage series programmable gain amplifier and a threshold comparator, the gain and threshold are dynamically adjusted, which solves the problems of insufficient signal attenuation adaptability and noise suppression in traditional ultrasonic reflected wave signal processing, and achieves higher signal recognition accuracy and stability.
Patent Information
- Application Number
- CN202510795887.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-16
AI Technical Summary
Traditional ultrasonic reflected wave signal processing methods rely on software algorithms and ignore the key impact of hardware on signal quality, resulting in poor adaptability to signal attenuation and insufficient noise suppression, affecting the signal-to-noise ratio and recognition accuracy.
A multi-stage cascaded programmable gain amplifier and threshold comparator combined with an analog-to-digital converter is used to dynamically adjust the gain and threshold by real-time monitoring of signal amplitude and environmental factors, optimize the signal processing process, and reduce noise interference.
It improves the adaptive ability of signal strength fluctuations, enhances the stability and anti-interference ability in complex environments, and improves the signal recognition accuracy and measurement accuracy.
Smart Images

Figure CN120334892B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to an ultrasonic reflection wave signal processing operation method, chip, and storage medium. Background Art
[0002] Ultrasonic waves are mechanical waves with frequencies exceeding 20 kHz. Their propagation relies on the elastic vibrations of the medium, and they possess strong directionality, concentrated energy, and strong penetrating power. When ultrasonic waves propagate through a medium, they are reflected at interfaces with different acoustic impedances. The time delay of the reflected wave is proportional to the propagation distance, while the amplitude of the reflected wave is related to the interface characteristics. This velocity difference and interface reflection characteristics form the physical basis of ultrasonic signal processing.
[0003] The processing of ultrasonic reflected wave signals directly affects the performance of the application system. Since actual signals often contain interference such as noise, multipath reflections, and signal attenuation, signal processing technology is needed to improve the signal-to-noise ratio and recognition accuracy. Traditional ultrasonic reflected wave signal processing methods rely solely on software algorithms to process ultrasonic reflected wave signals, ignoring the key impact of hardware on signal quality. Fixed-gain hardware amplification circuits cannot adapt to signal attenuation under different propagation distances, which can easily cause signal saturation or insufficient amplification, causing the signal amplitude collected by the analog-to-digital converter (ADC) to exceed the effective quantization range, increasing the quantization error; secondly, the lack of hardware-level noise suppression measures causes high-frequency noise to be amplified simultaneously with the effective signal, resulting in significant interference in the ultrasonic reflected wave signal. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide an ultrasonic reflection wave signal processing operation method, chip and storage medium. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for processing ultrasonic reflected wave signals, the method comprising the following steps:
[0006] The collected ultrasonic reflected wave signal is amplified by a multi-stage series programmable gain amplifier, and the amplified reflected wave signal is distributed to a threshold comparator and an analog-to-digital converter respectively; wherein the reflected wave signal is a voltage signal;
[0007] The reflected wave signal processing in the threshold comparator includes: (1) first determining the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with a preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier;
[0008] (2) Analyze the relationship between the reflected wave signal propagation process, the frequency, and the ambient temperature to determine the attenuation coefficient of the reflected wave signal propagation; determine the threshold control coefficient for the current reflected wave signal acquisition based on the distribution of the reflected wave signal amplitude, the attenuation coefficient, and the current environmental noise conditions;
[0009] (3) using the threshold control coefficient and the reference voltage value of the analog-to-digital converter to obtain a trigger threshold for the analog-to-digital converter to collect the reflected wave signal;
[0010] For a single transmitted ultrasonic signal, each group of reflected wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold is obtained; based on the distribution of all groups of reflected wave signal sequences, the true reflected wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflected wave are determined.
[0011] In one embodiment, determining the target gain of the multi-stage cascaded programmable gain amplifier includes:
[0012] When the amplitude of the reflected wave signal input to the threshold comparator is greater than the upper limit of the preset switching threshold range, or less than the lower limit of the preset switching threshold range, the gain of the multi-stage cascade programmable gain amplifier is adjusted, specifically:
[0013] The ratio of half the reference voltage of the analog-to-digital converter to the input voltage of the threshold comparator is calculated, and the target gain of the multi-stage cascade programmable gain amplifier is obtained by combining the ratio with the current gain of the multi-stage cascade programmable gain amplifier.
[0014] In one embodiment, the target gain of the multi-stage cascade programmable gain amplifier is a product of the ratio and a current gain of the multi-stage cascade programmable gain amplifier.
[0015] In one embodiment, determining the attenuation coefficient includes:
[0016] The product of the square root value of the current ambient temperature and the frequency of the ultrasonic reflected wave is calculated and recorded as a first product. The first product is used as the exponent of an exponential function with a natural constant as the base, and the attenuation coefficient is the calculation result of the exponential function.
[0017] In one embodiment, determining the threshold control coefficient includes:
[0018] Sampling the ultrasonic reflected wave signal, calculating the average of the ultrasonic reflected wave signal amplitudes at a preset number of moments before the current moment, calculating the product of the average and the attenuation coefficient (recorded as a second product), and collecting the noise signal within a preset time period before the single ultrasonic signal is transmitted;
[0019] The root mean square value of the noise signal is calculated and combined with the second product to determine the threshold control coefficient.
[0020] In one embodiment, the threshold control coefficient is calculated as follows:
[0021] Where, is the threshold control coefficient for the current reflected wave signal acquisition, is the attenuation coefficient of the reflected wave signal propagation, is the mean value, is the first preset constraint factor, is the second preset constraint factor, is the root mean square value;
[0022] The trigger threshold is the product of the normalized value of the threshold control coefficient and the reference voltage value of the analog-to-digital converter.
[0023] In one embodiment, the process of acquiring each group of reflected wave signal sequences is as follows:
[0024] When the input voltage of the threshold comparator is greater than the trigger threshold, the analog-to-digital converter is started to enter the continuous acquisition mode. When the input voltage of the threshold comparator is less than or equal to the trigger threshold, the analog-to-digital converter stops acquiring. For a single ultrasonic signal emitted, the voltage data collected by the analog-to-digital converter each time is arranged in time sequence to form each group of reflected wave signal sequences.
[0025] In one embodiment, the real reflected wave is the reflected wave signal sequence with the largest peak value among all groups of reflected wave signal sequences, and interpolation fitting is performed on the reflected wave signal sequence with the largest peak value to obtain the zero-crossing time corresponding to the real reflected wave.
[0026] In a second aspect, an embodiment of the present application further provides an ultrasonic reflection wave signal processing chip, the chip comprising:
[0027] Ultrasonic reflected wave amplification unit: used to amplify the collected ultrasonic reflected wave signal using a multi-stage series programmable gain amplifier, and distribute the amplified reflected wave signal to the threshold comparator and analog-to-digital converter respectively;
[0028] Ultrasonic reflected wave amplification and correction unit: used to determine the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with the preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier;
[0029] The analog-to-digital converter acquisition control unit is used to analyze the relationship between the reflected wave signal propagation process, the frequency, and the ambient temperature, and determine the attenuation coefficient of the reflected wave signal propagation; based on the distribution of the reflected wave signal amplitude, combined with the attenuation coefficient and the current environmental noise conditions, determine the threshold control coefficient for the current reflected wave signal acquisition; and using the threshold control coefficient and the reference voltage value of the analog-to-digital converter to obtain the trigger threshold of the analog-to-digital converter for reflected wave signal acquisition;
[0030] Ultrasonic reflection wave extraction unit: For a single transmitted ultrasonic signal, obtain each group of reflection wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold; based on the distribution of all groups of reflection wave signal sequences, determine the true reflection wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflection wave.
[0031] In a third aspect, an embodiment of the present application further provides an ultrasonic reflection wave signal processing operation storage medium, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.
[0032] This application has at least the following beneficial effects:
[0033] The present application uses a multi-stage cascade programmable gain amplifier to amplify the collected ultrasonic reflected wave signal, and distributes the amplified reflected wave signal to a threshold comparator and an analog-to-digital converter respectively; wherein the reflected wave signal is a voltage signal; the reflected wave signal is amplified in stages by the multi-stage programmable gain amplifier, thereby improving the adaptive ability to signal intensity fluctuations. During the propagation of ultrasonic signals, the long-distance reflected signal may be weak due to attenuation, while the short-distance reflected signal may be saturated. The multi-stage gain can automatically switch the amplification factor according to the current signal amplitude, ensuring that reflected waves at different distances can be effectively processed; the reflected wave signal processing in the threshold comparator includes: (1) first, by comparing the amplified reflected wave signal amplitude with the preset switching threshold range, combined with the current gain of the multi-stage cascade programmable gain amplifier, determining the target gain of the multi-stage cascade programmable gain amplifier; based on the real-time comparison of the reflected wave amplitude with the preset switching threshold, the real-time performance and accuracy of the gain adjustment are optimized. By combining the matching logic of the current gain state with the target gain, it is possible to quickly respond to the dynamic changes of the signal strength and avoid signal distortion caused by gain lag; (2) Analyze the relationship between the reflected wave signal propagation process and the frequency and ambient temperature to determine the attenuation coefficient of the reflected wave signal propagation; Based on the distribution of the reflected wave signal amplitude, combined with the attenuation coefficient and the noise conditions of the current environment, determine the threshold control coefficient for the current reflected wave signal acquisition; The threshold control coefficient enhances the adaptability to complex physical environments, so that stable detection can still be maintained in high temperature or high noise scenarios; Using the threshold control coefficient and the reference voltage value of the analog-to-digital converter, the trigger threshold of the analog-to-digital converter for reflected wave signal acquisition is obtained; The environmental robustness of the trigger threshold is improved, which can significantly reduce the false alarm rate; For a single ultrasonic signal emitted, obtain each group of reflected wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold; Based on the distribution of all groups of reflected wave signal sequences, determine the true reflected wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflected wave, thereby improving the identification accuracy of the true reflected wave, optimizing the anti-interference ability of the ultrasonic reflected wave measurement, and enhancing the stability under extreme working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0035] Figure 1 A flowchart of a method for processing ultrasonic reflected wave signals according to an embodiment of the present application;
[0036] Figure 2 This is a schematic diagram of the hardware connection for ultrasonic reflected wave signal processing;
[0037] Figure 3 Flowchart for determining the trigger threshold in the threshold comparator. DETAILED DESCRIPTION
[0038] To further illustrate the technical means and effectiveness of this application's implementation of the intended invention, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effectiveness of the ultrasonic reflection wave signal processing method, chip, and storage medium proposed in this application. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0039] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0040] The following describes in detail the ultrasonic reflection wave signal processing operation method, chip and storage medium provided by the present application with reference to the accompanying drawings.
[0041] See also Figure 1 , which shows a flowchart of a method for processing ultrasonic reflected wave signals provided by an embodiment of the present application, the method comprising the following steps:
[0042] S1, amplifying the collected ultrasonic reflected wave signal using a multi-stage series programmable gain amplifier, and distributing the amplified reflected wave signal to a threshold comparator and an analog-to-digital converter respectively; wherein the reflected wave signal is a voltage signal.
[0043] This embodiment uses an STM32 microcontroller as the device for collecting ultrasonic reflected waves, and a temperature sensor to collect the ambient temperature at the current location. This embodiment assumes that the ambient temperature at the current location remains constant for a short period of time. The STM32 microcontroller is a 32-bit microcontroller (MCU) based on the ARM Cortex-M series core from STMicroelectronics. It features high performance, low power consumption, a rich set of peripherals, and a flexible development environment. It supports ADCs (analog-to-digital converters), DMA (direct memory access), GPIOs (general purpose input and output), and timers, generating precise sampling clocks to trigger ADC acquisition and flexibly controlling gain switching.
[0044] Because ultrasonic reflected wave signals can experience significant amplitude variations during propagation due to factors such as distance and dielectric attenuation, a single-stage fixed-gain amplifier cannot simultaneously maintain strong signal distortion while ensuring weak signal detection. Therefore, this embodiment utilizes a three-stage PGA (Programmable Gain Amplifier) in series to extend the dynamic amplification range. This, combined with real-time monitoring and gain switching by an STM32 microcontroller, ensures that the reflected wave signal amplitude consistently matches the ADC input range, thus avoiding quantization errors when the signal is too weak and saturation distortion when the signal is too strong.
[0045] In this embodiment, after receiving the ultrasonic reflected wave signal using the ultrasonic sensor, it is first amplified to the ADC recognizable range through a 3-stage PGA. After the 3-stage amplification, the reflected wave signal is connected to the ADC inside the STM32 microcontroller for collection, and the other is input to the threshold comparator. Among them, the reflected wave signal after PGA amplification is an analog signal. In the process of comparing the threshold value of the reflected wave signal in the threshold comparator, the ultrasonic reflected wave signal is sampled. The sampling frequency is 1MHz. The implementer can set it according to the actual situation. This embodiment does not limit it here. The ultrasonic reflected wave signal hardware processing connection diagram is shown in the figure. Figure 2 shown.
[0046] It should be noted that, in this embodiment, the ultrasonic reflected wave signal is converted into a voltage signal, that is, the voltage signal is subsequently analyzed.
[0047] S2, performing ultrasonic reflected wave signal processing in the threshold comparator, specifically including: (1) first determining the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with the preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier.
[0048] The PGA is a circuit that dynamically adjusts the gain factor via a control signal. In this embodiment, a three-stage series PGA circuit is used, with each stage capable of switching between 1x and 10x gain, for a total gain range of 1-1000x. Each PGA stage contains an analog switch and a feedback resistor network, and the gain mode is switched via the STM32's GPIO control signal. The three stages are connected in series, and the total gain is the product of the gains of each stage. The STM32 monitors the reflected wave signal amplitude in real time. When the reflected wave signal amplitude exceeds a preset switching threshold, it triggers a PGA gain switching instruction, adjusting the gain factor of each stage to achieve dynamic optimization of the signal amplitude.
[0049] The preset switching threshold range in this embodiment is , Indicates the reference voltage value of the ADC, that is, the voltage range of the ADC input signal. When the amplitude of the reflected wave signal is lower than the lower limit of the switching threshold, the PGA gain is triggered to increase. When the amplitude of the reflected wave signal is higher than the upper limit of the switching threshold, the PGA gain is triggered to decrease. The ideal input range of the ADC is usually In this embodiment, the switching threshold is set to cover 90% of the ADC input range, leaving room for signal fluctuations and reducing frequent gain switching. By avoiding the nonlinear regions at both ends, it prevents both weak signals from causing excessive quantization noise and strong signals from causing ADC saturation.
[0050] The switching threshold is compared by inputting the reflected wave signal into the threshold comparator, thereby realizing the gain switching of the three-stage series PGA. The specific steps are as follows:
[0051] First, according to the input voltage of the threshold comparator Determine the gain adjustment direction when Increase the gain when Reduce the gain. When the gain needs to be adjusted, calculate the target gain of the 3-stage cascade PGA using the expression: ,in, represents the target gain of the 3-stage cascaded PGA, Indicates the current gain of the 3-stage series PGA, that is, the product of the amplification factor of the 3-stage series PGA circuit. Represents half of the ADC reference voltage to balance anti-saturation and anti-noise capabilities. Selecting half of the ADC reference voltage avoids frequent adjustments while leaving room for fluctuations in the reflected wave signal.
[0052] It should be noted that when adjusting the gain, the final stage gain, that is, the gain of the third stage PGA, is adjusted first. If the final stage gain has reached the limit, that is, 10 times or 1 times, it is adjusted forward in sequence. The STM32 outputs a control level signal through the GPIO to drive the analog switch inside the PGA to switch the feedback resistor network, achieving fast switching of 1x or 10x gain at each stage. Re-collect after switching , if it still exceeds the switching threshold range, repeat the adjustment.
[0053] By dynamically adjusting the gain, the ultrasonic reflected wave signal is amplified to the optimal range before being acquired by the ADC, maximizing the signal-to-noise ratio (SNR) and acquisition accuracy. Furthermore, the three-stage cascade design reduces noise accumulation caused by excessive gain in a single stage while maintaining amplification capability, improving anti-interference capabilities and ensuring the accuracy and robustness of measurement results.
[0054] (2) Analyze the relationship between the reflected wave signal propagation process and the frequency and ambient temperature to determine the attenuation coefficient of the reflected wave signal propagation; based on the distribution of the reflected wave signal amplitude, combined with the attenuation coefficient and the current environmental noise conditions, determine the threshold control coefficient for the current reflected wave signal acquisition.
[0055] If the ADC uses a fixed trigger or continuous acquisition mode when acquiring ultrasonic reflection wave signals, a large amount of redundant data will be generated when there are no valid reflection waves, occupying storage resources and increasing the CPU processing burden. By using a threshold comparator to monitor signal strength in real time and triggering ADC acquisition only when the reflection wave signal amplitude reaches the set acquisition threshold, it ensures that only valid signals are sampled, avoiding interference from invalid data. Furthermore, using DMA to transfer data bypasses the CPU and directly writes ADC conversion results to memory, reducing data transfer time and enabling efficient operation even in high-frequency acquisition scenarios. This makes it suitable for complex working conditions with rapidly alternating multiple reflection waves.
[0056] During ADC acquisition, if a fixed acquisition threshold is used, the signal strength will fluctuate significantly during the acquisition of reflected wave signals due to factors such as propagation distance and medium characteristics. The fixed threshold cannot be dynamically adjusted according to the actual situation of the reflected wave signal. If the threshold is set too high, weak signals may be missed; if it is set too low, a large amount of noise may be collected, and it will be impossible to effectively distinguish between valid signals and interference signals. In addition, the threshold requirements vary in different application environments. This embodiment collects ambient temperature and historical reflected wave signal data in real time to obtain a signal strength reference value suitable for the current environment, and then determines the acquisition threshold based on the noise level. This can dynamically adjust the trigger acquisition according to the actual scenario. This can more accurately capture valid reflected wave signals, reduce invalid signal acquisition, and improve measurement accuracy and reliability.
[0057] Because ultrasonic reflected waves attenuate during propagation and collection, the air's absorption of ultrasonic waves is related to the frequency f of the ultrasonic reflected waves and the ambient temperature T. When ultrasonic reflected waves propagate through the air, due to effects such as viscosity, heat conduction, and molecular relaxation between air molecules, the higher the frequency, the more violent the air molecules vibrate, the faster the energy loss, and the more ultrasonic reflected waves are absorbed. Regarding temperature, rising temperatures intensify the thermal motion of air molecules and increase intermolecular collisions, thus affecting the propagation of ultrasonic reflected waves. Generally, as temperature rises, air's absorption of ultrasonic waves increases, but this enhancement is not a linear relationship, as the increased activity of molecules at high temperatures causes the absorption effect to exhibit a specific trend.
[0058] Based on the above analysis, this embodiment calculates the attenuation coefficient of the reflected wave signal propagation. The specific expression is: , where e is a natural constant, is the attenuation coefficient of the reflected wave signal propagation, f is the frequency of the ultrasonic reflected wave, and T is the current ambient temperature. This attenuation coefficient takes into account the environmental impact, making the threshold setting more in line with the actual situation. The use of exponential form to calculate the attenuation coefficient reflects the exponential growth trend of the attenuation of the ultrasonic reflected wave propagation process with the increase of frequency and temperature, which is consistent with the characteristic that the energy of the ultrasonic reflected wave decays exponentially when propagating in the air. Recorded as the first product.
[0059] Furthermore, the average of the ultrasonic reflected wave signal amplitudes at a preset number of moments before the current moment is calculated and recorded as the signal strength average. The signal strength average is used as the reference amplitude to compensate for the attenuation of the signal due to environmental factors. When there is no ultrasonic emission, that is, before the ultrasonic signal is emitted, the background noise signal within a preset time period is collected using a noise monitoring device with a collection frequency of 1MHz. The root mean square value of all the collected background noise signals is calculated. , in order to quantify the current environmental noise level and avoid noise triggering false collection. In this embodiment, the preset number is set to 100, and the preset time period is set to 1ms. The implementer can set them according to the actual situation, and this embodiment does not limit them here.
[0060] Environmental noise, such as circuit thermal noise and electromagnetic interference, and dynamic noise characteristics, such as sudden interference, can severely impact signal triggering accuracy. Relying solely on a fixed threshold after attenuation compensation for ultrasonic reflected wave signals can lead to false triggering (noise being misinterpreted as signal) or missed triggering (noise being drowned out by noise) when the noise amplitude approaches or exceeds the valid signal. By monitoring the noise level in real time and adjusting the trigger conditions based on the noise level, we can ensure that the acquisition threshold remains above the current noise level, thereby isolating the noise interference and improving the signal processing's anti-interference capabilities.
[0061] Based on the above analysis, this embodiment calculates the threshold control coefficient for reflected wave signal acquisition, and the expression is: Where, is the threshold control coefficient for the current reflected wave signal acquisition, is the attenuation coefficient of the reflected wave signal propagation, is the mean value, is the first preset constraint factor, is the second preset constraint factor, is the root mean square value, where The value range is (0.2~0.4), The value range of is (1.2~1.8). In this embodiment A value of 0.3 allows the effective reflected wave signal amplitude to be 30% lower than the compensated reference value and still be triggered. This balances the reflected wave signal attenuation compensation and noise interference, and avoids missed triggering due to a sudden drop in the reflected wave signal amplitude. A value of 1.5 means that the noise level is amplified by 1.5 times to ensure that the true signal amplitude is significantly higher than the noise, thus avoiding false triggering caused by noise signals. Recorded as the second product.
[0062] (3) Using the threshold control coefficient and the reference voltage value of the analog-to-digital converter, a trigger threshold for the analog-to-digital converter to collect the reflected wave signal is obtained.
[0063] The trigger threshold for the analog-to-digital converter to collect reflected wave signals is calculated as follows: , where is the trigger threshold for the current analog-to-digital converter to collect the reflected wave signal, norm() is the normalization function, Indicates the reference voltage value of ADC.
[0064] The trigger threshold of ADC acquisition is determined by combining signal attenuation compensation and dynamic noise suppression. The noise level is used to ensure that the trigger condition of the ADC acquisition signal is always higher than the ambient noise to avoid false triggering and missed detection; by tracking noise changes in real time, it adapts to high noise or weak signal scenarios and enhances the robustness of signal processing; acquisition is triggered only when the ultrasonic reflected wave signal meets both signal validity and noise immunity, reducing invalid data and hardware loss; through dual constraints, the accuracy and stability of measurement are guaranteed in complex environments. The trigger threshold determination flow chart in the threshold comparator is as follows: Figure 3 shown.
[0065] S3, for a single ultrasonic signal transmitted, obtain each group of reflected wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold; based on the distribution of all groups of reflected wave signal sequences, determine the true reflected wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflected wave.
[0066] The trigger threshold is compared by inputting the ultrasonic reflected wave signal into the threshold comparator, thereby realizing the ADC acquisition trigger. The specific steps are as follows:
[0067] For a single ultrasonic signal transmitted, its reflected wave signal is analyzed. When the input voltage of the threshold comparator When the value is greater than the trigger threshold, a capture interrupt signal is sent to the STM32 CPU. After the CPU responds to the interrupt, it immediately starts ADC acquisition through hardware configuration and transmits data through DMA. At this time, the ADC enters the continuous acquisition mode. The ultrasonic reflected wave signal is sampled at regular time intervals, and the DMA controller directly transfers the digital signal converted by the ADC from the register to the internal RAM without CPU intervention.
[0068] If continuous If the amplitude of the internal ultrasonic reflected wave signal is less than or equal to the trigger threshold, it indicates that there is no valid reflected wave signal, triggering the stop mechanism. Furthermore, when a complete reflected wave signal acquisition is completed (i.e., all reflected waves of a single ultrasonic signal are acquired when the trigger threshold is met), the stop mechanism is also triggered, terminating ADC acquisition and DMA transfer, reducing invalid data storage and conserving memory resources. The STM32 also records the time when ADC acquisition is started, providing a benchmark for subsequent calculation of reflected wave propagation time. By combining the acquisition start time with the ultrasonic reflected wave's "zero crossing" time, the time difference between ultrasonic transmission and reception can be accurately calculated.
[0069] It should be noted that 、 These are all examples of the present application, and implementers can make adjustments based on actual conditions. This example does not limit this.
[0070] In actual ultrasonic measurement scenarios, ultrasonic waves encounter various obstacles and reflective surfaces during propagation. In addition to the reflected waves from the surface being measured, they also generate interfering reflections such as multiple reflections and sidelobe reflections. These interfering reflections are received by the acquisition device along with the actual reflections, resulting in multiple sets of sampled data during a single measurement. If not effectively distinguished, these interfering reflections can seriously affect measurement accuracy.
[0071] Therefore, for a single ultrasonic signal transmitted, the voltage data collected by the analog-to-digital converter each time is arranged in time sequence to form each group of reflected wave signal sequences.
[0072] Typically, the true reflection wave from the measured surface has a larger amplitude than other interfering reflection waves due to its relatively short propagation path and minimal energy loss. Therefore, amplitude can be used as an important feature to distinguish true reflection waves from interfering reflection waves.
[0073] Therefore, based on the principle that true reflected waves have relatively greater energy, manifesting as higher amplitudes on the waveform, this embodiment obtains the peak value (i.e., the maximum value) of each reflected wave signal sequence for all collected reflected wave signal sequences. These peak values are then compared, and the reflected wave corresponding to the reflected wave signal sequence with the largest peak value is selected as the true reflected wave.
[0074] After determining the true reflection wave signal sequence, the time of the reflection wave needs to be determined. Because ultrasonic reflection waves are periodic signals, their waveforms alternate between positive and negative, and the points where they intersect the time axis are called "zero crossings." This embodiment interpolates and fits the reflection wave signal sequence with the largest peak value to obtain the zero crossing time corresponding to the true reflection wave.
[0075] The zero-crossing time can more accurately reflect the arrival time of the ultrasonic reflected wave because it avoids the error that may be caused by simply using the peak value as the arrival time. For example, the different slopes of the rising or falling edges of the reflected wave waveform may lead to deviations in the peak time.
[0076] By selecting the reflected wave with the largest amplitude as the true reflected wave and using the zero-crossing time as the reflected wave timing, the influence of interfering reflected waves can be effectively eliminated, more accurately determining the time it takes for the ultrasonic wave to return to the receiving device after being reflected from the surface after being emitted. This precise timing, combined with the propagation speed of the ultrasonic wave in the medium, improves measurement accuracy. This embodiment can stably identify the true reflected wave in the presence of multiple reflected waves, ensuring reliable operation under various operating conditions, reducing measurement errors and fluctuations caused by interference, and enhancing the stability and reliability of signal processing.
[0077] Based on the same inventive concept as the above method, an embodiment of the present application further provides an ultrasonic reflection wave signal processing chip, the chip comprising:
[0078] Ultrasonic reflected wave amplification unit: used to amplify the collected ultrasonic reflected wave signal using a multi-stage series programmable gain amplifier, and distribute the amplified reflected wave signal to the threshold comparator and analog-to-digital converter respectively;
[0079] Ultrasonic reflected wave amplification and correction unit: used to determine the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with the preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier;
[0080] The analog-to-digital converter acquisition control unit is used to analyze the relationship between the reflected wave signal propagation process and the frequency and ambient temperature, and determine the attenuation coefficient of the reflected wave signal propagation; based on the distribution of the reflected wave signal amplitude, combined with the attenuation coefficient and the current environmental noise conditions, determine the threshold control coefficient for the current reflected wave signal acquisition; and using the threshold control coefficient and the reference voltage value of the analog-to-digital converter to obtain the trigger threshold of the analog-to-digital converter for reflected wave signal acquisition;
[0081] Ultrasonic reflection wave extraction unit: For a single transmitted ultrasonic signal, obtain each group of reflection wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold; based on the distribution of all groups of reflection wave signal sequences, determine the true reflection wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflection wave.
[0082] Based on the same inventive concept as the above method, an embodiment of the present application also provides an ultrasonic reflection wave signal processing operation storage medium, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned ultrasonic reflection wave signal processing operation methods are implemented.
[0083] It should be noted that the order in which the embodiments of the present application are presented is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0084] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0085] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for processing ultrasonic reflected wave signals, characterized in that: The method comprises the following steps: The collected ultrasonic reflected wave signal is amplified by a multi-stage series programmable gain amplifier, and the amplified reflected wave signal is distributed to a threshold comparator and an analog-to-digital converter respectively; wherein the reflected wave signal is a voltage signal; The reflected wave signal processing in the threshold comparator includes: (1) first determining the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with a preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier; (2) Analyze the relationship between the reflected wave signal propagation process and the frequency and ambient temperature to determine the attenuation coefficient of the reflected wave signal propagation; sample the ultrasonic reflected wave signal, calculate the average of the ultrasonic reflected wave signal amplitudes at a preset number of moments before the current moment, calculate the product of the average and the attenuation coefficient, record it as the second product, collect the noise signal within a preset time period before the single ultrasonic signal is transmitted, calculate the root mean square value of the noise signal, and combine the second product to determine the threshold control coefficient for the current reflected wave signal acquisition; (3) using the threshold control coefficient and the reference voltage value of the analog-to-digital converter to obtain a trigger threshold for the analog-to-digital converter to collect the reflected wave signal; For a single transmitted ultrasonic signal, each group of reflected wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold is obtained; based on the distribution of all groups of reflected wave signal sequences, the true reflected wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflected wave are determined.
2. The ultrasonic reflected wave signal processing method according to claim 1, wherein: Determining the target gain of the multi-stage cascaded programmable gain amplifier includes: When the amplitude of the reflected wave signal input to the threshold comparator is greater than the upper limit of the preset switching threshold range, or less than the lower limit of the preset switching threshold range, the gain of the multi-stage cascade programmable gain amplifier is adjusted, specifically: The ratio of half the reference voltage of the analog-to-digital converter to the input voltage of the threshold comparator is calculated, and the target gain of the multi-stage cascade programmable gain amplifier is obtained by combining the ratio with the current gain of the multi-stage cascade programmable gain amplifier.
3. The ultrasonic reflected wave signal processing method according to claim 2, wherein: The target gain of the multi-stage cascade programmable gain amplifier is a product of the ratio and a current gain of the multi-stage cascade programmable gain amplifier.
4. The ultrasonic reflected wave signal processing method according to claim 1, wherein: Determining the attenuation coefficient includes: The product of the square root value of the current ambient temperature and the frequency of the ultrasonic reflected wave is calculated and recorded as a first product. The first product is used as the exponent of an exponential function with a natural constant as the base, and the attenuation coefficient is the calculation result of the exponential function.
5. The ultrasonic reflected wave signal processing method according to claim 1, wherein: The threshold control coefficient is calculated as follows: Where, is the threshold control coefficient for the current reflected wave signal acquisition, is the attenuation coefficient of the reflected wave signal propagation, is the mean value, is the first preset constraint factor, is the second preset constraint factor, is the root mean square value; The trigger threshold is the product of the normalized value of the threshold control coefficient and the reference voltage value of the analog-to-digital converter.
6. The ultrasonic reflected wave signal processing method according to claim 1, wherein: The acquisition process of each group of reflected wave signal sequences is as follows: When the input voltage of the threshold comparator is greater than the trigger threshold, the analog-to-digital converter is started to enter the continuous acquisition mode. When the input voltage of the threshold comparator is less than or equal to the trigger threshold, the analog-to-digital converter stops acquiring. For a single ultrasonic signal emitted, the voltage data collected by the analog-to-digital converter each time is arranged in time sequence to form each group of reflected wave signal sequences.
7. The ultrasonic reflected wave signal processing method according to claim 1, wherein: The real reflected wave is the reflected wave signal sequence with the largest peak value among all groups of reflected wave signal sequences. Interpolation fitting is performed on the reflected wave signal sequence with the largest peak value to obtain the zero-crossing time corresponding to the real reflected wave.
8. An ultrasonic reflected wave signal processing chip, applying the ultrasonic reflected wave signal processing method according to claim 1, characterized in that: The chip includes: Ultrasonic reflected wave amplification unit: used to amplify the collected ultrasonic reflected wave signal using a multi-stage series programmable gain amplifier, and distribute the amplified reflected wave signal to the threshold comparator and analog-to-digital converter respectively; Ultrasonic reflected wave amplification and correction unit: used to determine the target gain of the multi-stage cascade programmable gain amplifier by comparing the amplitude of the amplified reflected wave signal with the preset switching threshold range and combining the current gain of the multi-stage cascade programmable gain amplifier; The analog-to-digital converter acquisition control unit is used to analyze the relationship between the reflected wave signal propagation process, the frequency, and the ambient temperature, and determine the attenuation coefficient of the reflected wave signal propagation; based on the distribution of the reflected wave signal amplitude, combined with the attenuation coefficient and the current environmental noise conditions, determine the threshold control coefficient for the current reflected wave signal acquisition; and using the threshold control coefficient and the reference voltage value of the analog-to-digital converter to obtain the trigger threshold of the analog-to-digital converter for reflected wave signal acquisition; Ultrasonic reflection wave extraction unit: For a single transmitted ultrasonic signal, obtain each group of reflection wave signal sequences collected under the condition that the analog-to-digital converter meets the trigger threshold; based on the distribution of all groups of reflection wave signal sequences, determine the true reflection wave of the single ultrasonic signal and the zero-crossing time corresponding to the true reflection wave.
9. An ultrasonic reflection wave signal processing operation storage medium, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Signal processing method and device, and computer readable storage medium
CN110531361A
Automatic gain control method and circuit for ultrasonic flow metering device
CN119642912A