An optimization method based on ultrasonic sensor aftershock processing
Patent Information
- Application Number
- CN202511125464.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-08-12
AI Technical Summary
这些余震信号会干扰正常的回波信号,导致测量结果出现偏差,降低传感器的精确度和可靠性
1、本发明采用自适应滤波技术,根据输入信号的特性自动调整滤波系数,与传统的固定滤波器相比,能够更好地适应不同的环境噪声条件,提高滤波效果。
Smart Images

Figure CN121325145B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor signal processing technology, specifically to an optimization method based on aftershock processing of ultrasonic sensors, which aims to improve the ranging performance and reliability of ultrasonic sensors in complex environments. Background Technology
[0002] Ultrasonic sensors are widely used in many fields such as distance measurement, object detection, non-destructive testing, and flow measurement due to their advantages such as low cost, simple structure, and wide measurement range. However, in practical applications, the mechanical vibration and signal reflection characteristics caused by the inherent properties of ultrasonic sensors often lead to problems such as aftershocks or echo interference.
[0003] Due to the inherent mechanical vibrations of ultrasonic sensors and environmental factors such as multiple reflections and scattering during signal propagation, aftershock signals are generated. These aftershock signals interfere with the normal echo signals, leading to measurement deviations and reducing the accuracy and reliability of the sensor. For example, in industrial automated production lines, errors in object detection caused by aftershock interference may disrupt the production process and affect product quality; in intelligent transportation systems, inaccurate distance measurement may cause traffic safety issues.
[0004] Currently, some solutions employ additional physical isolation measures to address aftershock issues, but this increases hardware costs and system complexity. Therefore, developing an efficient and economical aftershock handling algorithm is of significant practical importance. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an optimization method based on aftershock processing of ultrasonic sensors, which can effectively reduce the impact of aftershocks on measurement results, thereby improving the accuracy and reliability of ultrasonic sensors.
[0006] The present invention achieves the above objectives through the following technical solutions: An optimization method for aftershock processing based on ultrasonic sensors includes: Echo data is collected under different environments using ultrasonic sensors; An adaptive filter is used to dynamically adjust the filter coefficients according to the energy level of the input signal in order to adapt to different environmental noise conditions and suppress aftershock interference. Based on the Kalman filter algorithm, the Kalman gain is calculated by defining state variables, implementing prediction and update steps, in order to optimize the estimated value and reduce the measurement error caused by aftershocks. By integrating adaptive filters and Kalman filtering algorithms into existing ultrasonic sensor systems, an ultrasonic system capable of handling aftershock interference in real time can be formed.
[0007] An optimization method for aftershock processing based on ultrasonic sensors, provided by the present invention, collects echo data under different environments using ultrasonic sensors, including: The sensor emits periodic ultrasonic pulses s ( t Its mathematical expression is:
[0008] in, A The signal amplitude, f 0 is the center frequency. T p rect( is the pulse width) t () is a rectangular window function; the received echo signal r ( t )for:
[0009] in, α i For the first i The attenuation coefficient of each reflecting surface. t i To delay the transmission time, N The number of reflective surfaces, n ( t () refers to environmental noise.
[0010] According to the optimization method for aftershock processing based on ultrasonic sensors provided by the present invention, the adaptive filter is implemented through a recursive algorithm, including the following steps: Let the input signal sequence be x ( n The filter coefficients are w ( n )=[ w 1( n ), w 2( n ),..., w M ( n )],in M Let the filter order be denoted by the recursive update formula: w ( n +1)= w ( n )+ m e ( n ) x ( n ) in, m Step size factore ( n The error signal is defined as follows: e ( n )= d ( n ) y ( n )= d ( n ) w ( n ) T x ( n ) in, d ( n () represents the desired signal. y ( n () represents the filter output; Filter coefficients are based on the energy level of the input signal. E ( n The energy level is dynamically adjusted, and the formula for calculating the energy level is:
[0011] when E ( n Exceeding the preset threshold E threshold At that time, step size factor m Automatically reduce to m low Otherwise, keep it as m high This is to suppress coefficient oscillations caused by strong noise or aftershocks.
[0012] According to the optimization method for aftershock processing based on ultrasonic sensors provided by the present invention, the implementation of the Kalman filter algorithm includes: Define the state transition matrix F k Process noise covariance matrix Q k and the optimal covariance matrix at the previous time step Pk 1 | k 1. Calculate the prediction covariance matrix at the current time using the following formula:
[0013] in, The transpose of the state transition matrix, and the process noise covariance matrix. Q kThe statistical characteristics of aftershock disturbance were determined experimentally. These characteristics are dynamically adjusted according to the aftershock intensity. When the aftershock energy exceeds a preset threshold... Q k The diagonal elements are enlarged proportionally to reflect the increased uncertainty in the system model.
[0014] An optimization method based on ultrasonic sensor aftershock processing provided by the present invention, combined with the measurement noise covariance matrix R k and predicting covariance matrix P k∣k 1. Calculate the Kalman gain at the current time using the following formula:
[0015] Among them, the measurement matrix H k identity matrix I Combined with the observation dimension transformation matrix, it is used to map the state space to the measurement space; the measurement noise covariance matrix R k The value is obtained through offline training using historical sensor data and is related to the aftershock frequency. When the aftershock frequency is higher than a set value, R k Off-diagonal elements are added to characterize cross-interference between multiple sensors; During the aftershock phase, a correction factor is introduced. α k The Kalman gain is adjusted in real time, and the correction formula is as follows:
[0016] Where, Tr( ) represents the trace of the matrix; when the trace of the prediction covariance matrix is greater than the trace of the measurement noise covariance matrix, α k Linear decay to suppress over-reliance on predicted values; conversely, α k Keep it at 1 to make full use of the measurement data.
[0017] An optimization method for aftershock processing based on ultrasonic sensors, provided by the present invention, integrates an adaptive filter and a Kalman filter algorithm into an existing ultrasonic sensor system, comprising: A dedicated digital signal processor (DSP) is embedded in the signal processing module of an existing ultrasonic sensor system. This DSP supports parallel operation of adaptive filters and Kalman filtering algorithms. The sensor front end is connected to the DSP via the SPI interface to ensure that the echo signal is transmitted to the DSP memory buffer in real time at a sampling rate of ≥1MHz. In the DSP, separate storage areas are allocated to store the input signal queue of the adaptive filter and the state variable matrix of the Kalman filter, respectively.
[0018] According to the optimization method for aftershock processing based on ultrasonic sensors provided by the present invention, the DSP reads the original echo signal from the memory buffer. r ( t The filter coefficients are dynamically updated according to a recursive algorithm. w ( n Output the preprocessed signal. r ′( t ): in For the weight vector, For the order of the adaptive filter, They represent the times respectively. t The previous 1,…, M The input signal value at time -1 T This indicates that the vector is transposed.
[0019] An optimization method based on ultrasonic sensor aftershock processing provided by the present invention will... r ′( t ) as measurement input zk Combined with the predicted covariance matrix P k∣k 1. Kalman gain and state transition matrix F k Update the state estimate using the following formula:
[0020] Wherein, the state vector This indicates that at time k, based on the time to time k 1. Observational data for the system state vector x k The prior estimate, This is the observation matrix.
[0021] According to the optimization method based on ultrasonic sensor aftershock processing provided by the present invention, when the distance estimate output by the Kalman filter... d ^ k Compared with the previous time value d ^ k The difference of 1 exceeds the preset threshold Δ d threshold When this occurs, an alarm signal is triggered and output to an external control unit via the PWM interface; Implementing a dual-thread scheduling mechanism in a DSP: Adaptive filtering thread: Performs coefficient updates every 10μs, with high priority; Kalman filter thread: performs a state update every 50μs, with medium priority; When the system detects that the aftershock intensity exceeds the secondary threshold, it automatically increases the priority of thread 1 and suspends non-critical tasks. An interrupt is triggered by a hardware timer to ensure that the prediction step of the Kalman filter is synchronized with the output of the adaptive filter, with a synchronization error ≤1μs.
[0022] According to the optimization method for aftershock processing based on ultrasonic sensors provided by the present invention, a self-calibration process is automatically executed upon the first startup after system integration: Emits unmodulated ultrasonic pulses to collect reference echoes in open environments; The inherent time delay of the system is obtained by least squares fitting. t 0 and noise floor N 0; Will t 0 and N 0 is written to the DSP's non-volatile memory for subsequent filter parameter initialization; Continuous monitoring of estimation error during operation When the variance of the sampling error for 10 consecutive samplings exceeds s max2 When the time comes, restart the adaptive filter and reset the covariance matrix of the Kalman filter.
[0023] Therefore, compared with the prior art, the optimization method based on ultrasonic sensor aftershock processing proposed in this invention has the following beneficial effects: 1. This invention employs adaptive filtering technology, which automatically adjusts the filtering coefficients according to the characteristics of the input signal. Compared with traditional fixed filters, it can better adapt to different environmental noise conditions and improve the filtering effect.
[0024] 2. This invention combines the Kalman filter algorithm, which optimizes the estimated value through prediction and update steps. The Kalman filter can make the optimal estimate of the state by utilizing the dynamic model of the system and observation data, effectively reducing the error caused by aftershocks.
[0025] 3. This invention combines adaptive filtering and Kalman filtering, giving full play to the advantages of both. By reducing aftershock interference, the sensor can measure distance more accurately, improving the reliability and stability of the measurement, and achieving more effective processing of aftershock signals.
[0026] In summary, this invention, by combining adaptive filters and Kalman filtering algorithms and optimizing the estimated values through prediction and update steps, effectively reduces errors caused by aftershocks, optimizes the ranging performance of the sensor and system, and significantly improves the measurement accuracy and stability of ultrasonic sensors in different environments.
[0027] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0028] Figure 1 This is a flowchart of an embodiment of an optimization method for aftershock processing based on ultrasonic sensors according to the present invention.
[0029] Figure 2 This is a schematic diagram illustrating the effect of an optimized method for aftershock processing based on ultrasonic sensors in the present invention, specifically in the case where there is no PVC pipe echo superimposed on the aftershock.
[0030] Figure 3 This is a schematic diagram illustrating the effect of superimposing the echo of a PVC pipe into the aftershock in an embodiment of an optimized method for aftershock processing based on an ultrasonic sensor according to the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0032] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0033] See Figure 1 to Figure 3 This embodiment provides an optimization method for aftershock processing based on ultrasonic sensors, including: Step S1: Collect echo data under different environments using an ultrasonic sensor; Step S2: An adaptive filter is used to dynamically adjust the filter coefficients according to the energy level of the input signal in order to adapt to different environmental noise conditions and suppress aftershock interference. Step S3: Based on the Kalman filter algorithm, the Kalman gain is calculated by defining state variables, implementing prediction and update steps, in order to optimize the estimated value and reduce the measurement error caused by aftershocks. Step S4: Integrate the adaptive filter and Kalman filter algorithm into the existing ultrasonic sensor system to form an ultrasonic system that can process aftershock interference in real time.
[0034] In step S1 above, echo data under different environments are collected using an ultrasonic sensor, including: The sensor emits periodic ultrasonic pulses s ( t Its mathematical expression is:
[0035] in, A The signal amplitude, f 0 is the center frequency. T p rect( is the pulse width) t () is a rectangular window function; the received echo signal r ( t )for:
[0036] in, α i For the first i The attenuation coefficient of each reflecting surface. t i To delay the transmission time, N The number of reflective surfaces, n ( t () refers to environmental noise.
[0037] Furthermore, the multi-environment data collection strategy in this embodiment includes: Open environment: Acquire reference echo data under unobstructed conditions to calibrate sensor inherent noise and aftershock baseline; Obstacle environment: Introducing diameter D A 75cm PVC pipe was used as a typical reflector, and its distance from the sensor was adjusted. d (range 0≤) d ≤3m), record echo delay t and amplitude changes; Interference environment: Vibration sources or scatterers are placed around the sensor to simulate aftershock interference and collect echo data containing noise.
[0038] Furthermore, this embodiment also performs delay and energy parameter extraction, including: Time delay estimation: The time delay between the transmitted signal and the echo signal is calculated using a cross-correlation algorithm. :
[0039] Energy calculation: Perform piecewise energy integration on the echo signal and define energy characteristics. E echo:
[0040] in, Echo start time To analyze the window width.
[0041] The collected echo data were categorized by environmental type (open / obstacles / interference) and distance. d Delay t ,energy E echo Categorize and store data, and label it with the actual distance. d true This is used for subsequent algorithm training and validation.
[0042] In step S2 above, the adaptive filter is implemented using a recursive algorithm, including the following steps: Let the input signal sequence be x ( n The filter coefficients are w ( n )=[ w 1( n ), w 2( n ),..., w M ( n )],in M Let the filter order be denoted by the recursive update formula: w ( n +1)= w ( n )+ m e ( n ) x ( n ) in, m Step size factor e ( n The error signal is defined as follows: e ( n )= d ( n ) y ( n )=d ( n ) w ( n ) T x ( n ) in, d ( n () represents the desired signal. y ( n () represents the filter output; Filter coefficients are based on the energy level of the input signal. E ( n The energy level is dynamically adjusted, and the formula for calculating the energy level is:
[0043] when E ( n Exceeding the preset threshold E threshold At that time, step size factor m Automatically reduce to m low Otherwise, keep it as m high This is to suppress coefficient oscillations caused by strong noise or aftershocks.
[0044] In step S3 above, the Kalman filter algorithm is implemented in the following ways: Define the state transition matrix F k Process noise covariance matrix Q k and the optimal covariance matrix at the previous time step Pk 1 | k 1. Calculate the prediction covariance matrix at the current time using the following formula:
[0045] in, The transpose of the state transition matrix, and the process noise covariance matrix. Q k The statistical characteristics of aftershock disturbance were determined experimentally. These characteristics are dynamically adjusted according to the aftershock intensity. When the aftershock energy exceeds a preset threshold... Q k The diagonal elements are enlarged proportionally to reflect the increased uncertainty in the system model.
[0046] Combined with measurement noise covariance matrix R k and predicting covariance matrixP k∣k 1. Calculate the Kalman gain at the current time using the following formula:
[0047] Among them, the measurement matrix H k identity matrix I Combined with the observation dimension transformation matrix, it is used to map the state space to the measurement space; the measurement noise covariance matrix R k The value is obtained through offline training using historical sensor data and is related to the aftershock frequency. When the aftershock frequency is higher than a set value, R k Off-diagonal elements are added to characterize cross-interference between multiple sensors.
[0048] During the aftershock phase, a correction factor is introduced. α k The Kalman gain is adjusted in real time, and the correction formula is as follows:
[0049] Where, Tr( ) represents the trace of the matrix; when the trace of the prediction covariance matrix is greater than the trace of the measurement noise covariance matrix, α k Linear decay to suppress over-reliance on predicted values; conversely, α k Keep it at 1 to make full use of the measurement data.
[0050] Furthermore, it also includes the state update constraint step: By introducing physical constraints into the state update formula, the modified state estimation formula is as follows:
[0051] Among them Π( ) is a projection operator used to limit the state estimate to a reasonable range; the reasonable range is preset by the aftershock geological model, for example, the upper and lower limits of surface displacement are ±5m, and the upper and lower limits of velocity are ±2m / s.
[0052] In step S4 above, the adaptive filter and Kalman filter algorithm are integrated into the existing ultrasonic sensor system, including: A dedicated digital signal processor (DSP) is embedded in the signal processing module of an existing ultrasonic sensor system. This DSP supports parallel operation of adaptive filters and Kalman filtering algorithms. The sensor front end is connected to the DSP via the SPI interface to ensure that the echo signal is transmitted to the DSP memory buffer in real time at a sampling rate of ≥1MHz. In the DSP, separate storage areas are allocated to store the input signal queue of the adaptive filter (length ≥ 1024 points) and the state variable matrix of the Kalman filter (dimension ≥ 4×4).
[0053] The DSP reads the raw echo signal from the memory buffer. r ( t The filter coefficients are dynamically updated according to a recursive algorithm. w ( n Output the preprocessed signal. r ′( t ): in For the weight vector, For the order of the adaptive filter, They represent the times respectively. t The previous 1,…, M The input signal value at time -1 T This indicates that the vector is transposed.
[0054] Will r ′( t ) as measurement input zk Combined with the predicted covariance matrix P k∣k 1. Kalman gain and state transition matrix F k Update the state estimate using the following formula:
[0055] Wherein, the state vector This indicates that at time k, based on the time to time k 1. Observational data for the system state vector x k The prior estimates include four dimensions: distance, velocity, acceleration, and aftershock energy. This is the observation matrix.
[0056] When the distance estimate output by the Kalman filter d ^ k Compared with the previous time value d ^ k The difference of 1 exceeds the preset threshold Δ d thresholdWhen the value is 0.1-0.5m, an alarm signal is triggered and output to the external control unit through the PWM interface.
[0057] Implementing a dual-thread scheduling mechanism in a DSP: Thread 1 (Adaptive Filtering Thread): Performs coefficient updates every 10μs, with high priority; Thread 2 (Kalman filter thread): Performs a state update every 50μs, with medium priority; When the system detects that the aftershock intensity (determined by the energy monitoring module) exceeds the secondary threshold, it automatically increases the priority of thread 1 and suspends non-critical tasks (such as data logging). An interrupt is triggered by a hardware timer to ensure that the prediction step of the Kalman filter is synchronized with the output of the adaptive filter, with a synchronization error ≤1μs.
[0058] In this embodiment, a self-calibration process is automatically executed upon the first startup after system integration: Emits unmodulated ultrasonic pulses to collect reference echoes in open environments; The inherent time delay of the system is obtained by least squares fitting. t 0 and noise floor N 0; Will t 0 and N 0 is written to the DSP's non-volatile memory for subsequent filter parameter initialization; Continuous monitoring of estimation error during operation When the variance of the sampling error for 10 consecutive samplings exceeds s max2 When the time comes, restart the adaptive filter and reset the covariance matrix of the Kalman filter.
[0059] In practical applications, the optimization method provided in this embodiment is tested and evaluated. The tools used in the experiments include a laptop computer, a 12V regulated power supply, an ultrasonic sensor and controller system, a test bench, and a 75cm diameter PVC pipe. The laptop computer is used for data processing and algorithm execution, the 12V regulated power supply provides stable power support for the entire system, the ultrasonic sensor and controller system is the core component for distance measurement and signal processing, the test bench is used to fix the sensor and related equipment, and the PVC pipe serves as a simulation of obstacles or interference sources that may occur in the actual environment.
[0060] The experiment was conducted in an environment with a room temperature of 20-25℃ and an open space of 0-3m. The room temperature ensured the stability of the sensor and other equipment during the experiment, avoiding significant impacts on the measurement results due to temperature variations. The open space minimized reflections and interference during the propagation of the ultrasonic signal, allowing for a more accurate simulation of the ideal measurement scenario. It also facilitated the observation and analysis of the impact of interference introduced by the PVC pipe on the measurement results.
[0061] The experiment used precision, recall, F1 score, and processing time to evaluate the algorithm's performance. Precision reflects the accuracy of the algorithm's measurement results, i.e., the proportion of correctly measured measurements out of the total number of measurements; recall reflects the algorithm's ability to detect real aftershock signals, i.e., the proportion of correctly detected aftershock signals out of the actual number of aftershock signals; F1 score is a comprehensive evaluation index of precision and recall, and by considering these two indicators together, the algorithm's performance can be evaluated more comprehensively; processing time measures the algorithm's real-time performance, i.e., the time required from receiving the signal to outputting the processing result, which is crucial for systems requiring rapid response in practical applications.
[0062] like Figure 2 As shown, even without the superposition of PVC pipe echoes into the aftershocks, the aftershock signal still exhibits certain deviations and instability. This is due to the mechanical vibration of the ultrasonic sensor itself and minor environmental interference factors. However, after processing by the algorithm proposed in this embodiment, the overall aftershock signal shows almost no significant error due to aftershock deviations within a certain timeframe. This indicates that the algorithm can effectively filter and optimize the aftershock signal, reducing the impact of random interference on the measurement results and improving the stability and accuracy of the measurement. For example, in multiple consecutive measurements, the fluctuation range of the processed aftershock data is significantly smaller than that of the unprocessed aftershock data, making the measurement results more reliable.
[0063] like Figure 3 As shown, in the two sets of synchronous data, when the echo from the PVC pipe is superimposed on the aftershock, the data exhibits different changes over time. From Figure 3As can be clearly seen, the data points 969 to 973 in the circle represent aftershock data (in µs) after algorithm optimization, while the data points 1199, 1180...1389 in another circle represent unprocessed aftershock data. The actual aftershock data from the sensor is 970 µs. Comparison reveals that the unprocessed aftershock data is significantly affected by the PVC pipe echo, exhibiting noticeable fluctuations and making it difficult to accurately determine the true aftershock situation. In contrast, the aftershock data after algorithm optimization is relatively stable and more accurately reflects the actual aftershock state. At this point, the sensor can detect that the PVC pipe has entered the aftershock range and output an alarm, thus improving the sensor's ranging performance. This demonstrates that even under complex interference conditions, the algorithm can still effectively extract useful aftershock information, improving the sensor's ability to detect obstacles.
[0064] In summary, this embodiment combines adaptive filters and Kalman filtering algorithms, and optimizes the estimated value through prediction and update steps, effectively reducing errors caused by aftershocks and optimizing the ranging performance of the sensor and system. It can significantly improve the measurement accuracy and stability of ultrasonic sensors in different environments.
[0065] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0066] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. An optimization method for aftershock processing based on ultrasonic sensors, characterized in that, include: Echo data is collected under different environments using ultrasonic sensors; An adaptive filter is used to dynamically adjust the filter coefficients according to the energy level of the input signal in order to adapt to different environmental noise conditions and suppress aftershock interference. Based on the Kalman filter algorithm, the Kalman gain is calculated by defining state variables, implementing prediction and update steps, in order to optimize the estimated value and reduce the measurement error caused by aftershocks. By integrating adaptive filters and Kalman filtering algorithms into existing ultrasonic sensor systems, an ultrasonic system capable of handling aftershock interference in real time can be formed.
2. The method according to claim 1, characterized in that, Echo data is collected under different environments using ultrasonic sensors, including: The sensor emits periodic ultrasonic pulses Its mathematical expression is: in, The signal amplitude, For the center frequency, The pulse width. A rectangular window function; the received echo signal for: in, For the first The attenuation coefficient of each reflecting surface. To delay the transmission time, The number of reflective surfaces, This is environmental noise.
3. The method according to claim 1, characterized in that, The adaptive filter is implemented using a recursive algorithm, including the following steps: Let the input signal sequence be x ( n The filter coefficients are w ( n )=[ w 1( n ), w 2( n ),..., w M ( n )],in M Let the filter order be denoted by the recursive update formula: w ( n +1)= w ( n )+ μ e ( n ) x ( n ) in, μ Step size factor e ( n The error signal is defined as follows: e ( n )= d ( n ) y ( n )= d ( n ) w ( n ) T x ( n ) in, d ( n () represents the desired signal. y ( n () represents the filter output; Filter coefficients are based on the energy level of the input signal. The energy level is dynamically adjusted, and the formula for calculation is as follows: when E ( n Exceeding the preset threshold E threshold At that time, step size factor μ Automatically reduce to μ low Otherwise, keep it as μ high This is to suppress coefficient oscillations caused by strong noise or aftershocks.
4. The method according to claim 1, characterized in that, The Kalman filter algorithm can be implemented in the following ways: Define the state transition matrix Process noise covariance matrix and the optimal covariance matrix at the previous time step Calculate the prediction covariance matrix at the current time using the following formula: in, The transpose of the state transition matrix, and the process noise covariance matrix. The statistical characteristics of aftershock disturbance were determined experimentally. These characteristics are dynamically adjusted according to the aftershock intensity. When the aftershock energy exceeds a preset threshold... The diagonal elements are enlarged proportionally to reflect the increased uncertainty in the system model.
5. The method according to claim 4, characterized in that: Combined with measurement noise covariance matrix and predicting covariance matrix Calculate the Kalman gain at the current time using the following formula: Among them, the measurement matrix identity matrix I Combined with the observation dimension transformation matrix, it is used to map the state space to the measurement space; the measurement noise covariance matrix The value is obtained through offline training using historical sensor data and is related to the aftershock frequency. When the aftershock frequency is higher than a set value, Off-diagonal elements are added to characterize cross-interference between multiple sensors; During the aftershock phase, a correction factor is introduced. The Kalman gain is adjusted in real time, and the correction formula is as follows: Where, Tr( ) represents the trace of the matrix; when the trace of the prediction covariance matrix is greater than the trace of the measurement noise covariance matrix, α k Linear decay to suppress over-reliance on predicted values; conversely, α k Keep it at 1 to make full use of the measurement data.
6. The method according to any one of claims 1 to 5, characterized in that, Integrating adaptive filters and Kalman filtering algorithms into existing ultrasonic sensor systems includes: A dedicated digital signal processor (DSP) is embedded in the signal processing module of an existing ultrasonic sensor system. This DSP supports parallel operation of adaptive filters and Kalman filtering algorithms. The sensor front end is connected to the DSP via the SPI interface to ensure that the echo signal is transmitted to the DSP memory buffer in real time at a sampling rate of ≥1MHz. In the DSP, separate storage areas are allocated to store the input signal queue of the adaptive filter and the state variable matrix of the Kalman filter, respectively.
7. The method according to claim 6, characterized in that: The DSP reads the raw echo signal from the memory buffer. The filter coefficients are dynamically updated according to a recursive algorithm. Output preprocessed signal : )] T in For the weight vector, For the order of the adaptive filter, ) represent the times at time 1 and 2 respectively. t The previous 1,…, M The input signal value at time -1 T This indicates that the vector is transposed.
8. The method according to claim 7, characterized in that: Will r ′( t ) as measurement input Combined with the predicted covariance matrix Kalman gain and state transition matrix Update the state estimate using the following formula: Wherein, the state vector This indicates that at time k, based on the time to time k 1. Observational data for the system state vector x k The prior estimate, This is the observation matrix.
9. The method according to claim 8, characterized in that: When the distance estimate output by the Kalman filter Compared to the previous time value The difference exceeds the preset threshold Δ d threshold When this occurs, an alarm signal is triggered and output to an external control unit via the PWM interface; Implementing a dual-thread scheduling mechanism in a DSP: Adaptive filtering thread: Performs coefficient updates every 10μs, with high priority; Kalman filter thread: performs a state update every 50μs, with medium priority; When the system detects that the aftershock intensity exceeds the secondary threshold, it automatically increases the priority of thread 1 and suspends non-critical tasks. An interrupt is triggered by a hardware timer to ensure that the prediction step of the Kalman filter is synchronized with the output of the adaptive filter, with a synchronization error ≤1μs.
10. The method according to claim 9, characterized in that: Upon initial system startup after integration, a self-calibration process is automatically executed: Emits unmodulated ultrasonic pulses to collect reference echoes in open environments; The inherent time delay of the system is obtained by least squares fitting. τ 0 and noise floor N 0; Will τ 0 and N 0 is written to the DSP's non-volatile memory for subsequent filter parameter initialization; Continuous monitoring of estimation error during operation When the variance of the sampling error for 10 consecutive samplings exceeds When the time comes, restart the adaptive filter and reset the covariance matrix of the Kalman filter.
Citation Information
Patent Citations
Time difference ultrasonic flow measurement method based on improved Kalman filter
CN112484798A
Sensor detection method, computer equipment and computer program product
CN119087444A