Fundamental frequency signal extraction method and system for vibrating wire sensor based on spectral subtraction noise reduction
By using spectral subtraction to denoise the coil resistance and combining Fourier transform with PWM frequency sweep excitation, the problem of noise interference on the vibrating wire sensor signal is solved, enabling reliable extraction and state determination of the fundamental frequency signal, and improving the accuracy and compatibility of the measurement.
Patent Information
- Application Number
- CN202511211256.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-28
AI Technical Summary
In complex environments, the signal of a vibrating wire sensor is easily affected by electromagnetic interference and crosstalk, which leads to the amplification of noise signals and makes it difficult to effectively extract the fundamental frequency signal.
The method of spectral subtraction denoising is adopted. The normality of the sensor is judged by detecting the resistance of the coil. The voltage amplitude sequence is collected and Fourier transform is performed to calculate the spectral amplitude sequence. The sequence is sorted and thresholded. Combined with PWM square wave frequency sweep excitation, the fundamental frequency signal is extracted and the third harmonic interference is eliminated.
It improves the reliability and accuracy of signal extraction from vibrating wire sensors, is compatible with analog signal measurement requirements, assists in determining abnormal operating conditions, eliminates noise interference, and enhances the reliability and accuracy of measurements.
Smart Images

Figure CN120721250B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fundamental frequency signal extraction technology for vibrating wire sensors, and particularly relates to a method and system for extracting fundamental frequency signals from vibrating wire sensors based on spectral subtraction denoising. Background Technology
[0002] Vibrating wire sensors are among the most widely used safety monitoring instruments in water conservancy and hydropower projects. They have advantages such as high measurement accuracy, small zero-point drift, and strong anti-interference ability. They are sensors designed using the vibration characteristics of a string. There is a physical relationship between the stress of the internal steel string and the frequency of the free oscillation of the steel string. Therefore, its working principle is to excite the permanent magnet oscillator on the internal steel string to make it oscillate freely. Under the principle of electromagnetic induction, an AC echo signal with the same oscillation frequency is generated in the coil near the oscillator. The stress of the steel string can be measured by measuring and picking up the frequency of the oscillating echo signal.
[0003] Vibrating wire sensors used in engineering projects are typically permanently buried in soil and rock during construction. Their signal measurement process faces several challenges. First, the complex environment in which the instrument is located, including proximity to high-power equipment and space constraints for cable routing, can cause electromagnetic induction, leading to interference from environmental noise. Second, when the vibrating wire instrument is connected to an automated measurement system powered by mains electricity, its signal is also affected by power frequency signals and their harmonics. Finally, limitations and variations in the circuit and manufacturing processes of vibrating wire instrument measurement systems can cause crosstalk due to coupling between multiple signal lines and mutual inductance and capacitance. The echo signal from a vibrating wire sensor is inherently weak, only in the millivolt or even sub-millivolt range, requiring amplification by thousands of times by the measuring equipment before extraction. However, after amplification, the noise in the noisy vibrating wire echo signal is also amplified, causing the true signal to be submerged in noise and impossible to extract effectively.
[0004] Noise filtering for vibrating wire sensors usually employs two approaches: (1) Hardware noise filtering. Based on the operating characteristics of vibrating wire sensors, which operate within a frequency range of 400Hz-5000Hz, a bandpass filter hardware circuit is designed and applied in the conditioning circuit of the echo signal to limit the echo signal of the vibrating wire sensor to its operating frequency range. Hardware noise filtering is used because it has a certain effect, but it has limitations when facing noise within the passband. (2) Software noise filtering. This refers to common digital filtering algorithms such as Kalman filtering and wavelet transform, which analyze and process the voltage amplitude data sequence collected in the time domain. However, these filtering algorithms are actually estimators and require a high degree of purity in the time domain waveform of the echo signal. They are ineffective when facing background noise signals with multiple strong amplitudes superimposed in the echo. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising, in order to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0007] A method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising, the method specifically includes the following steps:
[0008] Detect the coil resistance of the vibrating wire sensor to determine if the vibrating wire sensor is functioning properly;
[0009] When the vibrating wire sensor is working normally, the first voltage amplitude sequence is collected, Fourier transform is performed, the first spectrum amplitude sequence is calculated, sorted, the maximum value pre_amp_max is obtained, and it is determined whether it is less than the preset first threshold.
[0010] When the maximum value pre_amp_max is less than the first threshold, the vibrating wire sensor is subjected to PWM square wave frequency sweep excitation, the second voltage amplitude sequence is collected, Fourier transform is performed, and the second spectrum amplitude sequence is calculated.
[0011] The difference between the second spectral amplitude sequence and the first spectral amplitude sequence is calculated to obtain the signal spectral amplitude sequence. The fundamental frequency is estimated, the presence of a third harmonic signal is identified, and the corresponding fundamental frequency signal is extracted.
[0012] As a further limitation of the technical solution of this embodiment of the invention, the step of detecting the coil resistance of the vibrating wire sensor and determining whether the vibrating wire sensor is working properly specifically includes the following steps:
[0013] After the measurement begins, the I / O ports of the main control chip are set to push-pull output mode;
[0014] Detecting the coil resistance of a vibrating wire sensor;
[0015] When the coil resistance is greater than 2kΩ, it is determined that the instrument is disconnected.
[0016] When the coil resistance is less than 50Ω, it is determined that the instrument coil is short-circuited;
[0017] When the coil resistance is between 50Ω and 2kΩ, the coil resistance or connection status of the vibrating wire sensor is determined to be normal.
[0018] As a further limitation of the technical solution of this embodiment of the invention, the step of acquiring the first voltage amplitude sequence, performing Fourier transform, calculating the first spectral amplitude sequence, sorting the sequence, obtaining the maximum value pre_amp_max, and determining whether it is less than a preset first threshold when the vibrating wire sensor is working normally specifically includes the following steps:
[0019] The main control chip's I / O ports are set to push-pull output mode, and the first voltage amplitude sequence is acquired through an ADC device;
[0020] Perform a Fourier transform on the first voltage amplitude sequence to calculate the first spectral amplitude sequence;
[0021] Using a preset sorting algorithm, the maximum value pre_amp_max and the corresponding element index pre_max_index of a certain element interval in the first spectrum amplitude sequence are obtained.
[0022] Determine whether the maximum value pre_amp_max is less than a preset first threshold.
[0023] As a further limitation of the technical solution of this embodiment of the invention, the I / O port of the main control chip is set to push-pull output mode, and the acquisition of the first voltage amplitude sequence through the ADC device specifically includes the following steps:
[0024] The main control chip's I / O ports are set to push-pull output mode;
[0025] Perform measurement delay detection and judgment;
[0026] Start the timer, initiate A / D conversion in the timer's ISR, and acquire the first voltage amplitude sequence through the ADC device.
[0027] As a further limitation of the technical solution of this embodiment of the invention, the step of performing a Fourier transform on the first voltage amplitude sequence to calculate the first spectral amplitude sequence specifically includes the following steps:
[0028] Perform a Fourier transform on the first voltage amplitude sequence to obtain multiple real and imaginary sequences with spectral information;
[0029] Extraction and processing are performed on multiple real and imaginary sequences containing spectral information;
[0030] Calculate the first spectral amplitude sequence of the background signal in the measurement loop of the vibrating wire sensor.
[0031] As a further limitation of the technical solution of this embodiment of the invention, the step of performing PWM square wave frequency sweep excitation on the vibrating wire sensor when the maximum value pre_amp_max is less than the first threshold, acquiring the second voltage amplitude sequence, performing Fourier transform, and calculating the second spectrum amplitude sequence specifically includes the following steps:
[0032] The main control chip's I / O ports are set to PWM mode;
[0033] The vibrating wire sensor is excited by a PWM square wave frequency sweep with a preset frequency step increment and a duty cycle of 50%.
[0034] After the excitation is completed, the I / O ports of the main control chip are set to push-pull output mode;
[0035] The second voltage amplitude sequence is acquired using an ADC device;
[0036] Perform a Fourier transform on the second voltage amplitude sequence to calculate the second spectral amplitude sequence.
[0037] As a further limitation of the technical solution of this embodiment of the invention, the step of subtracting the second spectral amplitude sequence from the first spectral amplitude sequence to obtain the signal spectral amplitude sequence, estimating the fundamental frequency, identifying whether a third harmonic signal exists, and extracting the corresponding fundamental frequency signal specifically includes the following steps:
[0038] The difference between the second spectral amplitude sequence and the first spectral amplitude sequence is calculated to obtain the signal spectral amplitude sequence;
[0039] Find the index_max of the maximum extreme value and the index_sec of the second maximum extreme value in a certain interval of the signal spectrum amplitude sequence;
[0040] Determine whether the amplitude value corresponding to the index number index_max is greater than a preset second threshold;
[0041] If the amplitude value corresponding to the index number index_max is greater than the second threshold, then the fundamental frequency is estimated;
[0042] Based on the fundamental frequency, identify whether a third harmonic signal exists, and extract the corresponding fundamental frequency signal.
[0043] As a further limitation of the technical solution of this embodiment of the invention, if the amplitude value corresponding to the index number index_max is greater than the second threshold, then estimating the fundamental frequency specifically includes the following steps:
[0044] If the amplitude value corresponding to the index number index_max is greater than the second threshold, then the index number index_max, the index number index_sec, or the element number pre_max_index will be used as the input parameter of the frequency offset algorithm in the frequency estimation process of spectral interpolation.
[0045] Estimate the fundamental frequency, including the first frequency value f, the second frequency value f1, and the third frequency value f0.
[0046] As a further limitation of the technical solution of this embodiment of the invention, the step of identifying whether a third harmonic signal exists based on the fundamental frequency and extracting the corresponding fundamental frequency signal specifically includes the following steps:
[0047] Divide the first frequency value f by the second frequency value f1;
[0048] When 2.98≤f / f1≤3.02, the measurement frequency output of the vibrating wire sensor is f1;
[0049] When f / f1 < 2.98 or f / f1 > 3.02, the measurement frequency output of the vibrating wire sensor is f;
[0050] When the maximum value pre_amp_max is not less than the first threshold, the measurement frequency output of the vibrating wire sensor is f0.
[0051] A fundamental frequency signal extraction system for vibrating wire sensors based on spectral subtraction denoising is provided. The system comprises a main control unit, a frequency sweep excitation unit, and a signal pickup unit, wherein:
[0052] The main control unit, which consists of a microprocessor and its peripheral circuits, is used to control the frequency sweep excitation process and the signal acquisition process, receive data, and calculate the main frequency of the signal.
[0053] The frequency sweep excitation unit consists of a front-end circuit and a power amplification back-end circuit. It is used to output an excitation square wave to the coil to excite the steel string of the vibrating wire sensor. In the excitation circuit, it also serves as the circuit sampling resistor. The voltage divider relationship is used to calculate the coil resistance connected to the vibrating wire sensor.
[0054] The signal acquisition unit consists of a bidirectional limiting circuit, an amplification circuit, a bandpass filter circuit, and an A / D signal sampling circuit. It is used to amplify and filter the echo signal of the vibrating wire sensor, sample the voltage, and analyze the frequency signal of the echo of the vibrating wire sensor through an algorithm.
[0055] Compared with the prior art, the beneficial effects of the present invention are:
[0056] (1) It greatly improves the reliability of signal extraction from noisy vibrating wire instruments. During operation, the measurement signal of vibrating wire instruments is inevitably superimposed with background noise caused by channel crosstalk, power frequency and its resonance interference, environmental electromagnetic interference, etc., which makes the time-domain frequency measurement method unable to measure effectively. Ordinary frequency-domain frequency measurement methods are prone to mistakenly extracting noise signals as instrument signals. However, the embodiments of the present invention pre-obtain the spectrum information of the background signal (i.e. noise signal) in the measurement circuit of the vibrating wire instrument under no-excitation conditions, and then obtain the noisy spectrum information in the measurement circuit of the vibrating wire instrument after frequency sweep excitation. Through the spectrum subtraction algorithm, the superimposed background noise can be filtered out to a certain extent, which can greatly improve the reliability of signal extraction from noisy vibrating wire instruments.
[0057] (2) Frequency measurement accuracy can be improved based on the known type of vibrating wire instrument. When the frequency range of the vibrating wire instrument's design range is known, setting the range of spectral line search can eliminate noise spectral lines that are not within the frequency measurement range, greatly improving the reliability of extracting the main frequency of the vibrating wire instrument;
[0058] (3) It is compatible with the measurement requirements of the analog signal of the vibrating string instrument. In addition to supporting instrument access measurement, the vibrating string instrument measurement system also needs to be compatible with the detection measurement of the signal transmitter as the frequency signal of the vibrating string instrument. The spectrum subtraction and noise reduction measurement method filters out the stable signal input by the signal transmitter due to the two frequency measurement mechanisms, thus making it impossible to detect the signal; the embodiment of the present invention can identify the signal generator input detection mode by detecting the spectral characteristics in the background noise and setting an appropriate threshold, thereby eliminating the secondary frequency measurement link, directly extracting the instrument frequency measurement value, and realizing the detection measurement compatible with the analog signal of the vibrating string instrument.
[0059] (4) It can help determine three types of abnormal working conditions of the vibrating string instrument: 1) It can set a coil resistance detection link before the instrument measurement, and can identify the two abnormal working conditions of the currently connected vibrating string instrument: wire breakage and short circuit based on the characteristics of the measured coil resistance value; 2) It can analyze the spectrum amplitude sequence after the echo signal spectrum of the vibrating string instrument is reduced. When the amplitude in the sequence is lower than the preset amplitude threshold, it can provide feedback on the working state of the vibrating string instrument's steel string starting or excitation failure, which has a positive effect on further diagnosing and analyzing the working state and fault cause of the vibrating string instrument;
[0060] (5) After the spectrum subtraction and noise reduction in the embodiment of the present invention, the third harmonic identification process is carried out to eliminate the measurement results of the third harmonic interference signal, thereby further improving the reliability of the fundamental frequency signal extraction of the vibrating string instrument. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention.
[0062] Figure 1 A flowchart of the method provided by an embodiment of the present invention is shown.
[0063] Figure 2 An application architecture diagram of the system provided in an embodiment of the present invention is shown. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0065] This invention determines whether a vibrating wire sensor is functioning correctly by detecting the coil resistance of the vibrating wire sensor. When the vibrating wire sensor is functioning correctly, a first voltage amplitude sequence is acquired, subjected to Fourier transform, and a first spectral amplitude sequence is calculated and sorted. The maximum value, pre_amp_max, is then determined, and it is determined whether it is less than a preset first threshold. When the maximum value, pre_amp_max, is less than the first threshold, the vibrating wire sensor is subjected to PWM square wave frequency sweep excitation, a second voltage amplitude sequence is acquired, and a Fourier transform is performed to calculate the second spectral amplitude sequence. The difference between the second spectral amplitude sequence and the first spectral amplitude sequence is calculated to obtain the signal spectral amplitude sequence, and the fundamental frequency is estimated. The presence of a third harmonic signal is identified, and the corresponding fundamental frequency signal is extracted. This method can display potentially chaotic echo signals in the time domain in the frequency domain, exhibiting anti-interference capabilities and further improving the reliability of frequency measurement using the vibrating wire sensor.
[0066] Figure 1 A flowchart of the method provided by an embodiment of the present invention is shown.
[0067] Specifically, the method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising includes the following steps:
[0068] Phase 1: Detect the coil resistance of the vibrating wire sensor to determine if the vibrating wire sensor is functioning properly.
[0069] In this embodiment of the invention, after the measurement begins, the I / O port of the main control chip is set to push-pull output mode, and the output is a high potential, i.e., 3.3V. At this time, the ADC measures the input voltage flowing through R1 as U0 and the output voltage as U1. The coil resistance of the vibrating wire sensor under test is calculated using the formula R=U1*R1 / (U0-U1). When R is greater than 2kΩ, it is determined that the instrument is disconnected; when it is less than 50Ω, it is determined that the instrument coil is short-circuited. In these two states, the instrument under test is malfunctioning, an error code is set to output, and the measurement is terminated directly; otherwise, the process proceeds to stage two.
[0070] Phase 2: When the vibrating wire sensor is working normally, the first voltage amplitude sequence is collected, Fourier transform is performed, the first spectral amplitude sequence is calculated, sorted, the maximum value pre_amp_max is obtained, and it is determined whether it is less than the preset first threshold.
[0071] In this embodiment of the invention, the I / O port of the main control chip is set to push-pull output mode, and the output is at a low potential. At this time, there is no current input in the coil inside the vibrating wire sensor, and it is approximately at the same potential as ground. Therefore, the steel wire is in a relatively free state. Then, after a certain delay, the timer is started, and the A / D conversion is initiated in the timer's ISR. The ADC device then outputs the signal at a low potential. 采The sampling frequency (f) is used to satisfy the Nyquist sampling theorem and optimize the FFT computation efficiency. 采 The value should be greater than 20000Hz, and N (N=f) should be guaranteed. 采 ( / 5) is a positive integer power of 2, and N=f is collected. 采 After obtaining 5 voltage amplitude values, the interrupt service routine ends, yielding the first voltage amplitude sequence {V1, V2...V4096} of the background noise signal within a time domain of t=200ms after passing through the signal pickup unit. A Fast Fourier Transform is then performed on this first voltage amplitude sequence to obtain the sampling resolution in 5Hz steps (0Hz, 5Hz, 10Hz). =5Hz), and kept increasing until ( Given N corresponding real and virtual sequences with spectral information, and considering that the frequency design limit for vibrating wire instruments is no more than 6000Hz, the sizes of the real and virtual sequences are reduced. The first 1500 elements of each sequence are extracted to form new real and virtual sequences, respectively. , Where k = 0, 1, 2, ..., 1499, through Where Re represents the real part Real, Im represents the imaginary part Im, and the content within square brackets represents a sequence / array, from which the first spectral amplitude sequence of the background signal in the vibrating wire sensor measurement circuit can be obtained. , , ..., Then, the first spectral amplitude sequence is obtained through a sorting algorithm. Among the elements, the maximum value pre_amp_max and its element index pre_max_inde of the i-th to j-th elements (the corresponding element range can be searched according to the design characteristics of the vibrating wire sensor, generally as a full-frequency matching search, i can be set to 80 and j to 1200) are compared with the preset first threshold. If the maximum value pre_amp_max is less than the first threshold, the process enters stage three.
[0072] Understandably, the delay needs to be specifically detected. A fast FFT transformation is performed on the background signal every 500ms, with a sampling time of 100ms. When the background signal is detected to be no less than 10 in amplitude, the delay is unnecessary, and subsequent processing can proceed directly.
[0073] Understandably, the first threshold setting is primarily to meet the requirement of a constant millivolt-level measured signal input to the signal generator in this system. If the first threshold is set too low, while signal detection by the signal generator can be fully achieved, if a vibrating wire instrument is used for measurement, the low threshold may prevent the shielding of noise in the measurement loop caused by the background environment, resulting in the noise being directly output as the frequency measurement value of the vibrating wire instrument. If the first threshold is set too high, the detection signal input to the signal generator may not be effectively extracted. In this embodiment of the invention, since the input echo signal is a gain of 30k times, the time-domain voltage signal sampled by the ADC device for the original millivolt-level echo signal is, under ideal conditions, a square wave signal of ±5V.
[0074] f 采 Taking a 1000Hz, ±5V, 50% duty cycle, and initial phase of 0 square wave signal as an example, with N sampling points, the time-domain expression of the original square wave signal is:
[0075] ;
[0076] in, The signal is a time-domain voltage signal; sgn() is the sign function. That is, a sine wave Converted into a square wave of alternating positive and negative step signals;
[0077] Expand its Fourier series:
[0078] ;
[0079] The square wave signal is actually a superposition of odd harmonics such as k=1, 3, 5, etc. Its amplitude decreases by 1 / k as the order increases, and the fundamental wave amplitude is 20 / π≈6.366V.
[0080] After discrete sampling, the unnormalized magnitude of the FFT is the product of the coefficients and N / 2, i.e.:
[0081] ;
[0082] Where N is the number of discrete sampling points; k represents the Fourier series, which is 1, 3, 5, ...;
[0083] Therefore, for the fundamental frequency (k=1, i.e., 1kHz), with N=4096 sampling points, the unnormalized amplitude value is A≈13028. Thus, the upper limit of this amplitude is 13028.
[0084] If the signal is a sine wave with a peak-to-peak value of ±5V and a frequency of 1kHz, the unnormalized amplitude of the FFT is: That is, the amplitude is 10240.
[0085] Therefore, the first threshold can be set at around 10,000. Considering the performance differences of the signal generator and the possible noise effects of the detection circuit, the amplitude threshold can also be set to other measured values between 8,000 and 12,000.
[0086] Phase 3: When the maximum value pre_amp_max is less than the first threshold, the vibrating wire sensor is subjected to PWM square wave frequency sweep excitation, the second voltage amplitude sequence is collected, Fourier transform is performed, and the second spectrum amplitude sequence is calculated.
[0087] In this embodiment of the invention, the I / O port of the main control chip is set to PWM mode. Under the action of timer 0, a series of PWM square waves with a duty cycle of 50% are input to the coil of the vibrating wire sensor, which are driven by a certain frequency step (for example, the sweep start frequency can be 400Hz, the sweep end frequency can be 6000Hz, and the sweep step can be set to 20Hz, 10Hz, or 5Hz, etc.). This effectively excites the vibrating wire sensor. After the excitation ends, the I / O port of the main control chip is set to push-pull output low-level mode, and the coil returns to a relatively free state with no current output. Then, after a certain delay (free oscillation setup time: can be 10ms~200ms), the ADC device is used to sample at the same frequency f taken in the first step. 采 With the number of sampling points N, the second voltage amplitude sequence {V1, V2, ... V} of the noisy vibrating string instrument signal over a 200ms time period is obtained. N Then, perform a Fast Fourier Transform on the second voltage amplitude sequence to obtain new real and imaginary sequences. Take the first 1500 real and imaginary sequences, which are respectively... , Where k = 0, 1, ..., 1499, through The second spectral amplitude sequence of the background signal in the measurement circuit of the vibrating wire sensor is obtained.
[0088] Phase 4: Calculate the difference between the second spectral amplitude sequence and the first spectral amplitude sequence to obtain the signal spectral amplitude sequence, estimate the fundamental frequency, identify whether a third harmonic signal exists, and extract the corresponding fundamental frequency signal.
[0089] In this embodiment of the invention, the difference between each element in the spectral amplitude sequence of the noisy signal and each element in the spectral amplitude sequence of the background noise is calculated. Elements with a difference less than 0 are set to 0 (a method for handling over-subtraction factors), and the 0th element (because it is the DC component) is set to 0. This yields the spectral amplitude sequence of the subtracted signal. Specifically, the formula for calculating the signal spectrum amplitude sequence is as follows:
[0090] ;
[0091] By obtaining the index_max and index_sec of the second largest extreme value of the spectral amplitude sequence corresponding to the i-th to j-th elements in the signal spectral amplitude sequence, and comparing the amplitude values of the main lobe's main spectral line... The relationship between the magnitude and the preset second threshold, if the amplitude value of the main lobe main spectrum line... If the value is greater than the second threshold, the index number index_max, index number index_sec, or element number pre_max_index is used as the input parameter of the frequency offset algorithm in the frequency estimation process of spectral interpolation. The fundamental frequency, including the first frequency value f, the second frequency value f1, and the third frequency value f0, is estimated. By dividing the first frequency value f by the second frequency value f1, when 2.98 ≤ f / f1 ≤ 3.02, the measured frequency output of the vibrating wire sensor is f1; when f / f1 < 2.98 or f / f1 > 3.02, the measured frequency output of the vibrating wire sensor is f; when the maximum value pre_amp_max is not less than the first threshold, the measured frequency output of the vibrating wire sensor is f0.
[0092] It is understandable that the index number is the sequence number of each point in the FFT output array (from 0 to N-1, where N is the FFT length, i.e., the number of sampling points).
[0093] Understandably, depending on the type of vibrating wire sensor, the corresponding element range to be searched will vary. Different manufacturers and different types of instruments have different signal frequency ranges designed for them. If a full-band 400Hz~6000Hz range matching search is used, i can be set to 80 and j to 1200. If a full-band 400Hz~6000Hz range matching search is used, the specific operation method for searching the index number of the maximum extreme value (index_max) and the index number of the second largest extreme value (index_sec) is as follows:
[0094] 1) Set up a variable-length integer array m[] and m_index[], and search for all the maxima in the corresponding spectrum amplitude array from the 80th element to the 1200th element (the determination of the maxima: if an element n is a maxima, then the maxima satisfy the condition of m[]). and ), store all maximum values in m[], corresponding to The sequence numbers are stored sequentially in the array m_index[].
[0095] 2) Find the maximum and second largest values in m[], and find the corresponding index values in m_index[]: index_max and index_sec. These two values are the indices of the main lobe main spectrum line and the main spectrum line of the largest side lobe, and their corresponding frequencies are respectively... and ;
[0096] 3) Among the elements of the differenced spectral amplitude sequence, the maximum and second-largest extreme values from the 80th to the 1200th element are respectively and These two values are the amplitudes of the main lobe main spectrum line and the main spectrum line of the largest side lobe.
[0097] Understandably, the specific spectral interpolation frequency estimation uses a frequency offset estimation algorithm to obtain the required frequency offset factor. The signal frequency of the vibrating wire sensor is calculated by taking the index number index_max, index number index_sec, or index number pre_max_index as input parameter k, and obtaining the estimated frequency (or estimated frequency of background signal) corresponding to the main lobe spectrum line and the main spectrum line of the largest side lobe of the noisy signal. .
[0098] ;
[0099] In the formula, =5Hz, Here, k is the frequency offset factor, and k is the index number corresponding to the frequency to be estimated. and The amplitudes of two adjacent spectral lines at the frequency to be estimated are calculated using the main spectral line of the noisy signal's main lobe and the main spectral line of its largest side lobe. They are f and f1, respectively.
[0100] Furthermore, Figure 2 An application architecture diagram of the system provided in an embodiment of the present invention is shown.
[0101] In another preferred embodiment of the present invention, the fundamental frequency signal extraction system for a vibrating wire sensor based on spectral subtraction denoising includes:
[0102] The main control unit, which consists of a microprocessor and its peripheral circuits, is used to control the frequency sweep excitation process and signal acquisition process, receive data, and perform signal frequency calculation.
[0103] The frequency sweep excitation unit consists of a front-end circuit and a power amplification back-end circuit. It is used to output an excitation square wave to the coil to excite the steel string of the vibrating wire sensor. In the excitation circuit, it also serves as the circuit sampling resistor, and the voltage division relationship is used to calculate the coil resistance connected to the vibrating wire sensor.
[0104] In this embodiment of the invention, the microprocessor-based PWM waveform (0~3.3V) generated by the frequency sweep excitation unit is used to generate a pre-stage circuit, which consists of an NPN transistor driver stage and a P-channel MOS transistor output stage. This circuit enables the output of a strong excitation square wave with a 50% duty cycle, 0~5V, and adjustable frequency to the coil, effectively exciting the steel string of the vibrating wire sensor. In addition, a known low-resistance (e.g., 50Ω) precision resistor is connected in series in the front stage of the vibrating wire sensor as a circuit sampling resistor. The voltage division relationship can be used to calculate the coil resistance connected to the vibrating wire sensor.
[0105] The signal acquisition unit consists of a bidirectional limiting circuit, an amplification circuit, a bandpass filter circuit, and an A / D signal sampling circuit. It is used to amplify and filter the echo signal of the vibrating wire sensor, sample the voltage, and analyze the frequency signal of the echo of the vibrating wire sensor through an algorithm.
[0106] In this embodiment of the invention, the signal acquisition unit consists of a bidirectional limiting circuit, an amplification circuit, a bandpass filter circuit, and an A / D signal sampling circuit. The bidirectional limiting circuit limits the signal to ±5V. The amplification circuit is designed as a three-stage inverting amplification circuit with a gain of 30kΩ. The bandpass filter circuit is designed with a passband of 400-6000Hz. The ADC is a 16-bit, bipolar, 200kSPS successive approximation high-speed ADC. The signal acquisition unit composed of the above circuits reliably amplifies and filters the echo signal of the vibrating string instrument, samples the voltage at a certain sampling frequency, and finally analyzes the frequency signal of the vibrating string instrument echo through an algorithm.
[0107] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0108] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0109] 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.
[0110] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
[0111] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising, characterized in that, The method specifically includes the following steps: Detect the coil resistance of the vibrating wire sensor to determine if the vibrating wire sensor is functioning properly; When the vibrating wire sensor is working normally, the first voltage amplitude sequence is collected, Fourier transform is performed, the first spectrum amplitude sequence is calculated, sorted, the maximum value pre_amp_max is obtained, and it is determined whether it is less than the preset first threshold. When the maximum value pre_amp_max is less than the first threshold, the vibrating wire sensor is subjected to PWM square wave frequency sweep excitation, the second voltage amplitude sequence is collected, Fourier transform is performed, and the second spectrum amplitude sequence is calculated. The difference between the second spectral amplitude sequence and the first spectral amplitude sequence is calculated to obtain the signal spectral amplitude sequence, and the fundamental frequency is estimated. The presence of a third harmonic signal is identified, and the corresponding fundamental frequency signal is extracted. The difference between each element in the spectral amplitude sequence of the noisy signal and each element in the spectral amplitude sequence of the background noise is calculated, and elements with a difference result lower than 0 are set to 0, and the 0th element is set to 0. The method of detecting the coil resistance of the vibrating wire sensor to determine whether the vibrating wire sensor is functioning properly includes the following steps: After the measurement begins, the I / O ports of the main control chip are set to push-pull output mode; Detecting the coil resistance of a vibrating wire sensor; When the coil resistance is greater than 2kΩ, it is determined that the instrument is disconnected. When the coil resistance is less than 50Ω, it is determined that the instrument coil is short-circuited; When the coil resistance is between 50Ω and 2kΩ, the coil resistance or connection status of the vibrating wire sensor is determined to be normal. When the vibrating wire sensor is functioning normally, the first voltage amplitude sequence is acquired, a Fourier transform is performed, the first spectral amplitude sequence is calculated, and the sequence is sorted. The maximum value, pre_amp_max, is then determined, and it is determined whether it is less than a preset first threshold. The specific steps include: The main control chip's I / O ports are set to push-pull output mode, and the first voltage amplitude sequence is acquired through an ADC device; Perform a Fourier transform on the first voltage amplitude sequence to calculate the first spectral amplitude sequence; Using a preset sorting algorithm, the maximum value pre_amp_max and the corresponding element index pre_max_index of a certain element interval in the first spectrum amplitude sequence are obtained. Determine whether the maximum value pre_amp_max is less than a preset first threshold; The main control chip's I / O ports are set to push-pull output mode. The acquisition of the first voltage amplitude sequence via an ADC device specifically includes the following steps: The main control chip's I / O ports are set to push-pull output mode; Perform measurement delay detection and judgment; Start the timer, initiate A / D conversion in the timer's ISR, and acquire the first voltage amplitude sequence through the ADC device.
2. The method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising according to claim 1, characterized in that, The calculation of the first spectral amplitude sequence by performing a Fourier transform on the first voltage amplitude sequence specifically includes the following steps: Perform a Fourier transform on the first voltage amplitude sequence to obtain multiple real and imaginary sequences with spectral information; Extraction and processing are performed on multiple real and imaginary sequences containing spectral information; Calculate the first spectral amplitude sequence of the background signal in the measurement loop of the vibrating wire sensor.
3. The method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising according to claim 1, characterized in that, When the maximum value pre_amp_max is less than the first threshold, the vibrating wire sensor is subjected to PWM square wave frequency sweep excitation, the second voltage amplitude sequence is acquired, Fourier transform is performed, and the calculation of the second spectrum amplitude sequence specifically includes the following steps: The main control chip's I / O ports are set to PWM mode; The vibrating wire sensor is excited by a PWM square wave frequency sweep with a preset frequency step increment and a duty cycle of 50%. After the excitation is completed, the I / O ports of the main control chip are set to push-pull output mode; The second voltage amplitude sequence is acquired using an ADC device; Perform a Fourier transform on the second voltage amplitude sequence to calculate the second spectral amplitude sequence.
4. The method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising according to claim 1, characterized in that, The process of subtracting the second spectral amplitude sequence from the first spectral amplitude sequence to obtain the signal spectral amplitude sequence, estimating the fundamental frequency, identifying the presence of a third harmonic signal, and extracting the corresponding fundamental frequency signal specifically includes the following steps: The difference between the second spectral amplitude sequence and the first spectral amplitude sequence is calculated to obtain the signal spectral amplitude sequence; Find the index_max of the maximum extreme value and the index_sec of the second maximum extreme value in a certain interval of the signal spectrum amplitude sequence; Determine whether the amplitude value corresponding to the index number index_max is greater than a preset second threshold; If the amplitude value corresponding to the index number index_max is greater than the second threshold, then the fundamental frequency is estimated; Based on the fundamental frequency, identify whether a third harmonic signal exists, and extract the corresponding fundamental frequency signal.
5. The method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising according to claim 4, characterized in that, If the amplitude value corresponding to the index number index_max is greater than the second threshold, the estimation of the fundamental frequency specifically includes the following steps: If the amplitude value corresponding to the index number index_max is greater than the second threshold, then the index number index_max, the index number index_sec, or the element number pre_max_index will be used as the input parameter of the frequency offset algorithm in the frequency estimation process of spectral interpolation. Estimate the fundamental frequency, including the first frequency value f, the second frequency value f1, and the third frequency value f0.
6. The method for extracting the fundamental frequency signal of a vibrating wire sensor based on spectral subtraction denoising according to claim 5, characterized in that, Based on the fundamental frequency, identifying the presence of a third harmonic signal and extracting the corresponding fundamental frequency signal specifically includes the following steps: Divide the first frequency value f by the second frequency value f1; When 2.98≤f / f1≤3.02, the measurement frequency output of the vibrating wire sensor is f1; When f / f1 < 2.98 or f / f1 > 3.02, the measurement frequency output of the vibrating wire sensor is f; When the maximum value pre_amp_max is not less than the first threshold, the measurement frequency output of the vibrating wire sensor is f0.
7. A fundamental frequency signal extraction system for vibrating wire sensors based on spectral subtraction denoising, characterized in that, The system includes a main control unit, a frequency sweep excitation unit, and a signal acquisition unit, wherein: The main control unit, which consists of a microprocessor and its peripheral circuits, is used to control the frequency sweep excitation process and the signal acquisition process, receive data, and calculate the main frequency of the signal. The frequency sweep excitation unit consists of a front-end circuit and a power amplification back-end circuit. It is used to output an excitation square wave to the coil to excite the steel string of the vibrating wire sensor. In the excitation circuit, it also serves as the circuit sampling resistor. The voltage divider relationship is used to calculate the coil resistance connected to the vibrating wire sensor. The signal acquisition unit consists of a bidirectional limiting circuit, an amplification circuit, a bandpass filter circuit, and an A / D signal sampling circuit. It is used to amplify and filter the echo signal of the vibrating wire sensor, sample the voltage, and analyze the frequency signal of the echo of the vibrating wire sensor through an algorithm.
Citation Information
Patent Citations
Vibration wire sensor triple-frequency shielding method
CN105628185A
Vibrating wire sensor frequency measurement method, device, and equipment
CN107255535A