Processing method and device for eliminating background noise of sound wave signal
The method and device address the issue of missed and false detections in ultrasonic gas leakage detection by adaptively framing and subtracting background noise from acoustic signals, enhancing detection accuracy.
Patent Information
- Application Number
- CN202411121646.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-13
AI Technical Summary
Conventional ultrasonic gas leakage detection schemes based on preset frequency bands are prone to missed and false detections due to background noise interference, particularly in the low frequency band, which are not effectively filtered or utilized.
A method and device using an acoustic wave sensor to sample acoustic signals, adaptively frame them, and apply reference spectral subtraction to eliminate background noise across the full frequency band, ensuring effective signal extraction.
Reduces missed and false detection rates in gas leakage detection by effectively processing acoustic signals across the full frequency band.
Smart Images

Figure CN119132269A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a processing method and device for eliminating background noise of sound wave signals. Background Art
[0002] In modern industrial production, pressure gas leakage (such as gas leakage in gas storage tanks, gas leakage in gas pipelines, etc.) will not only cause waste of resources, but may also cause environmental pollution and even lead to safety accidents; in order to reduce the waste and harm caused by gas leakage, it is necessary to provide a technical solution that can detect gas leaks in gas storage or gas transmission devices. Ultrasonic detection scheme is a commonly used gas leakage detection scheme. The implementation principle of this scheme is to first perform low-frequency filtering on the sound wave signal, and then identify the sound pressure, energy and other parameters of the effective voice signal in a preset ultrasonic frequency point or frequency band in the filtered signal, and judge whether a gas leakage occurs based on the identification result and the corresponding set threshold. Through practice, we found that this conventional scheme is only based on a preset ultrasonic frequency point or frequency band for detection, which is easy to lead to missed detection.
[0003] To solve this problem, we have improved this conventional detection scheme, expanded the bandwidth of the detection sound wave signal to the full frequency band range (low frequency band, sub-high frequency band, ultrasonic frequency band), and performed gas leakage detection within the full frequency band. To implement this full-band sound wave detection scheme, the sound wave signal cannot be low-frequency filtered, otherwise the sound wave signal information in the low frequency band will be filtered out, resulting in missed detection; nor can the low-frequency sound wave signal information be used directly for detection, because the effective sound wave information in the low frequency band is easily interfered by background noise, and if used directly, it is easy to cause false detection. In other words, to implement this full-band sound wave detection scheme, a background noise elimination mechanism that can retain effective signals in the full frequency band range (low frequency band, sub-high frequency band, ultrasonic frequency band) must be provided, and this is the technical problem that the present invention needs to solve. Summary of the invention
[0004] The object of the present invention is to provide a processing method, device, electronic device and computer-readable storage medium for eliminating background noise of acoustic signals in view of the defects of the prior art. The present invention uses an acoustic wave sensor to receive acoustic signals, samples the received original acoustic signals, and initializes a corresponding denoising signal sequence based on the sequence length of the original signal sequence obtained by sampling; and provides two frame division modes (maximum frame number mode and minimum frame number mode) to adaptively divide the original signal sequence into an original signal frame sequence; and refers to spectral subtraction to eliminate background noise from the original signal frame sequence to obtain a denoised signal frame sequence; and sets the denoised signal sequence based on the denoised signal frame sequence; and uses the finally set denoised signal sequence as the background noise elimination processing result of the original acoustic signal. Through the present invention, effective acoustic signals in the full frequency band of the original acoustic signal can be extracted, and applying the solution of the present invention to the full-frequency band acoustic detection solution helps to reduce the missed detection rate and false detection rate of gas leakage detection.
[0005] To achieve the above object, a first aspect of an embodiment of the present invention provides a processing method for eliminating background noise of acoustic signals, the method including:
[0006] Use an acoustic wave sensor to receive an acoustic signal, and use the acoustic signal received by the acoustic wave sensor in the most recent first time period as a corresponding first acoustic signal;
[0007] Perform signal sampling processing on the first acoustic signal based on a preset first sampling frequency to obtain a corresponding first signal sequence; and initialize a corresponding second signal sequence based on the sequence length L of the first signal sequence; the first signal sequence includes a plurality of first signals sa i , 1 ≤ signal index i ≤ L, L = floor(first time period / first sampling frequency), floor() is the floor function; the second signal sequence includes a plurality of second signals sb i , and each of the second signals sb i is set to 0 during initialization;
[0008] Based on a preset first frame length L M and a first frame division mode, perform adaptive frame division processing on the first signal sequence to obtain a corresponding first signal frame sequence; the first signal frame sequence includes a plurality of first signal frames Y h ; 1 < L M < L; 1 ≤ frame index h ≤ N, N is the total number of signal frames obtained after adaptive frame division of the first signal frame sequence; the first signal frame Y h includes L M first noisy signals y h,k , 1 ≤ signal index k ≤ L M ; two adjacent first signal frames Yh , Y h+1 Not completely the same but partially overlapping; the first framing mode includes a maximum frame number mode and a minimum frame number mode;
[0009] The reference spectrum subtraction method is used to perform background noise elimination processing on the first signal frame sequence to obtain a corresponding second signal frame sequence; the second signal frame sequence includes a plurality of second signal frames X h The second signal frame X h Including L M The first denoised signal x h,k The second signal frame X h With the first signal frame Y h One-to-one correspondence; the first denoised signal x h,k and the first noisy signal y h,k One to one correspondence;
[0010] Setting the second signal sequence based on the second signal frame sequence;
[0011] The second signal sequence that has been set is output as a background noise elimination processing result of the first sound wave signal.
[0012] Preferably, the first frame length L is based on a preset M The method of performing adaptive framing processing on the first signal sequence using a first framing mode to obtain a corresponding first signal frame sequence specifically includes:
[0013] Set the calculation formula for the total number of signal frames and the corresponding restrictions:
[0014]
[0015] Where d is the sliding step variable, 1≤d <L M , the total number of signal frames N is a positive integer greater than 0;
[0016] Based on the known first frame length L M The value range of the sliding step variable is limited to obtain the corresponding sliding step value range; and each sliding step value in the sliding step value range is used as the corresponding current sliding step value one by one, and the current sliding step value is brought into the calculation formula Calculate to obtain a corresponding current calculation result, and when the current calculation result is a positive integer greater than 0, use the current calculation result as a corresponding total number of signal frames to be selected, and use the current sliding step value as a corresponding sliding step to be selected;
[0017] and identify the first framing mode; if the first framing mode is the maximum frame number mode, the maximum total number of the candidate signal frames is used as the corresponding total number of signal frames N, and the candidate sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * If the first framing mode is the minimum frame number mode, the minimum total number of the selected signal frames is used as the corresponding total number of signal frames N, and the selected sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * ;
[0018] Based on the obtained first sliding step length d * and the first frame length L M From the first signal sa of the first signal sequence i Start sliding frame processing to obtain the corresponding N first signal frames Y h ; The first signal frame Y h Including L M The first noisy signal y h,k ; The first signal frame Y of the hth frame h The kth first noisy signal y h,k and the first signal sequence i=(h-1)×d * +k of the first signals sa i Consistency;
[0019] The N first signal frames Y obtained by h The first signal frame sequences are arranged in chronological order to form the corresponding first signal frame sequences.
[0020] Preferably, the reference spectrum subtraction method performs background noise elimination processing on the first signal frame sequence to obtain a corresponding second signal frame sequence, specifically comprising:
[0021] The reference spectrum subtraction principle is used to set each of the first signal frames Y of the first signal frame sequence h The second signal frame X corresponding to the second signal frame sequence h The corresponding relationship is:
[0022] Y h =X h +Z h ,
[0023]
[0024] Among them, Z h For the first signal frame Y h The first noise signal frame of the corresponding additive background noise signal, For the first signal frame Y h , the second signal frame X h and the first noise signal frame Z h The amplitude spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal amplitude spectrum, denoised signal amplitude spectrum and noise signal amplitude spectrum;
[0025] Based on the corresponding relation of spectral subtraction Construct a one-step estimating system of equations:
[0026]
[0027]
[0028] Among them, α h For the first signal frame Y h The corresponding single-step noise update coefficient, The first signal frame Y h-1 The corresponding noise signal amplitude spectrum, The noise signal amplitude spectrum The corresponding single-step noise amplitude spectrum, θ h For the first signal frame Y h The phase spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal phase spectrum;
[0029] And update the single-step noise coefficients α for all the single-step estimation equations h Make estimates;
[0030] and estimating the first single-step noise amplitude spectrum in the single-step estimation equation group;
[0031] And all the single-step noise update coefficients α h and the first single-step noise amplitude spectrum Substitute the single-step estimation equation group into the calculation to obtain the corresponding N noise reduction signal amplitude spectra
[0032] And the amplitude spectrum of each noise reduction signal Perform inverse discrete Fourier transform to obtain the corresponding second signal frame X h ;
[0033] And the obtained N second signal frames X h The corresponding second signal frame sequence is formed by chronological order.
[0034] Furthermore, all the single-step noise update coefficients α of the single-step estimation equation group are h Make an estimate, including:
[0035] Each of the single-step noise update coefficients α h The corresponding original signal amplitude spectrum as the corresponding current amplitude spectrum;
[0036] The frequency points in the current amplitude spectrum whose amplitude exceeds the preset minimum amplitude and whose frequency value exceeds the preset minimum ultrasonic frequency threshold are taken as corresponding first ultrasonic frequency points; and the corresponding amplitudes of the first ultrasonic frequency points are recorded as first frequency point amplitudes A;
[0037] The energy of each first ultrasonic frequency point is calculated by using each first frequency point amplitude A to obtain the corresponding first frequency point energy E, Wherein, ρ is a preset density parameter of the sound wave propagation medium, and v is a preset propagation speed parameter of the sound wave in the propagation medium;
[0038] The energy E of all the first frequency points corresponding to the current amplitude spectrum is summed up and the result is used as the total energy E of the corresponding ultrasonic segment. h ;
[0039] The total energy E of the ultrasonic segment h The ratio of the preset acoustic sensor background noise energy threshold E0 is used as the corresponding energy change rate p h =E h / E0;
[0040] And based on the energy change rate p h , the preset update coefficient expected value α0 and the preset exponential function base parameter β determine the corresponding single-step noise update coefficient α h ,
[0041] Furthermore, estimating the first single-step noise amplitude spectrum in the single-step estimation equation group specifically includes:
[0042] The original signal amplitude spectrum The amplitude points exceeding the preset minimum amplitude are recorded as valid signal amplitude points; and the original signal amplitude spectrum with all the valid signal amplitude points deleted is As the first single-step noise amplitude spectrum estimated
[0043] Preferably, the setting of the second signal sequence based on the second signal frame sequence specifically includes:
[0044] For all the second signals sb in the second signal frame sequence i traverse; and during the traversal, the second signal sb currently traversed i As the corresponding current signal sbi ; and use the signal index i of the current signal sb i as the corresponding current index value i * ; and for each frame index h and signal index k in the second signal sequence that satisfy i * =(h - 1)×d * +k, mark the first denoised signal x h,k as the corresponding candidate denoised signal, where d * is the first sliding step size confirmed during the adaptive frame processing; and use the candidate denoised signal with the latest time as the corresponding current denoised signal; and set the current signal sb i based on the current denoised signal.
[0045] In the second aspect of the embodiments of the present invention, there is provided an apparatus for implementing the processing method for eliminating background noise of acoustic signals described in the first aspect above. The apparatus includes: a raw signal receiving module, a raw signal preprocessing module, a raw signal frame splitting module, a raw signal background noise elimination module, a denoised signal sequence setting module, and a denoised signal output module;
[0046] The raw signal receiving module is used to receive acoustic signals using an acoustic wave sensor, and use the acoustic signals received by the acoustic wave sensor within the most recent first time period as the corresponding first acoustic signals;
[0047] The raw signal preprocessing module is used to perform signal sampling processing on the first acoustic signals based on a preset first sampling frequency to obtain a corresponding first signal sequence; and initialize a corresponding second signal sequence based on the sequence length L of the first signal sequence; the first signal sequence includes multiple first signals sa i , where 1 ≤ signal index i ≤ L, L = floor(first time period / first sampling frequency), and floor() is the floor function; the second signal sequence includes multiple second signals sb i , and each of the second signals sb i is set to 0 during initialization;
[0048] The raw signal frame splitting module is used to perform adaptive frame splitting processing on the first signal sequence based on a preset first frame length L M and a first frame splitting mode to obtain a corresponding first signal frame sequence; the first signal frame sequence includes multiple first signal frames Y h ; 1 < L M < L; 1 ≤ frame index h ≤ N, where N is the total number of signal frames obtained after adaptive frame splitting of the first signal frame sequence; the first signal frame Y h includes L M first noisy signals yh,k ,1≤signal indexk≤L M ; Two adjacent first signal frames Y h , Y h+1 Not completely the same but partially overlapping; the first framing mode includes a maximum frame number mode and a minimum frame number mode;
[0049] The original signal background noise elimination module is used to perform background noise elimination processing on the first signal frame sequence by reference spectrum subtraction to obtain a corresponding second signal frame sequence; the second signal frame sequence includes a plurality of second signal frames X h The second signal frame X h Including L M The first denoised signal x h,k The second signal frame X h With the first signal frame Y h One-to-one correspondence; the first denoised signal x h,k and the first noisy signal y h,k One to one correspondence;
[0050] The denoising signal sequence setting module is used to set the second signal sequence based on the second signal frame sequence;
[0051] The denoising signal output module is used to output the set second signal sequence as the background noise elimination processing result of the first sound wave signal.
[0052] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0053] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0054] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0055] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0056] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for eliminating the background noise of an acoustic wave signal. As can be seen from the above content, the embodiment of the present invention uses an acoustic wave sensor to receive an acoustic wave signal, samples the received original acoustic wave signal, and initializes a corresponding denoised signal sequence based on the sequence length of the sampled original signal sequence; and provides two framing modes (maximum frame number mode and minimum frame number mode) to adaptively frame the original signal sequence to obtain an original signal frame sequence; and reference spectral subtraction is used to eliminate the background noise of the original signal frame sequence to obtain a denoised signal frame sequence; and the denoised signal sequence is set based on the denoised signal frame sequence; and the denoised signal sequence finally set is used as the background noise elimination processing result of the original acoustic wave signal. Through the embodiment of the present invention, the effective acoustic wave signal of the full frequency band in the original acoustic wave signal can be extracted, and the application of the embodiment of the present invention in the full frequency band acoustic wave detection scheme helps to reduce the missed detection rate and false detection rate of gas leak detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a processing method for eliminating background noise of an acoustic wave signal provided in Embodiment 1 of the present invention;
[0058] Figure 2 A module structure diagram of a processing device for eliminating background noise of a sound wave signal provided in Embodiment 2 of the present invention;
[0059] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] Embodiment 1 of the present invention provides a processing method for eliminating background noise of an acoustic signal, such as Figure 1 As shown in the schematic diagram of a processing method for eliminating background noise of an acoustic signal provided in the first embodiment of the present invention, the method mainly comprises the following steps:
[0062] Step 1: Use an acoustic wave sensor to receive an acoustic wave signal, and use the acoustic wave signal received by the acoustic wave sensor within a recent first time period as a corresponding first acoustic wave signal.
[0063] Here, the first duration is a preset time length. The acoustic wave sensor used in the embodiments of the present invention is preferably a full-band sensor, and other sensors that only cover part of the full band can also be selected. However, no matter which sensor is used, it is default required to effectively cover at least the ultrasonic band in the full band.
[0064] Step 2: Perform signal sampling processing on the first acoustic wave signal based on a preset first sampling frequency to obtain a corresponding first signal sequence; and initialize a corresponding second signal sequence based on the sequence length L of the first signal sequence.
[0065] Here, the first sampling frequency is a preset signal sampling frequency;
[0066] The first signal sequence includes a plurality of first signals sa i , where 1 ≤ signal index i ≤ L, L = floor(first duration / first sampling frequency), and floor() is the floor function;
[0067] The second signal sequence includes a plurality of second signals sb i , where each second signal sb i is set to 0 during initialization.
[0068] Step 3: Perform adaptive framing processing on the first signal sequence based on a preset first frame length L M and a first framing mode to obtain a corresponding first signal frame sequence;
[0069] Here, the first frame length L M is a preset frame length parameter, 1 < L M < L; the first framing mode provides two modes: the maximum number of frames mode and the minimum number of frames mode; the first signal frame sequence includes a plurality of first signal frames Y h , where 1 ≤ frame index h ≤ N, and N is the total number of signal frames obtained after adaptive framing of the first signal frame sequence; two adjacent first signal frames Y h 、Y h+1 are not all the same but partially overlap; the first signal frame Y h includes L M first noisy signals y h,k , where 1 ≤ signal index k ≤ L M ;
[0070] Specifically, it includes: Step 31: Set the calculation formula for the total number of signal frames and the corresponding limiting conditions:
[0071]
[0072] where d is a sliding step variable, 1 ≤ d < L M, the total number of signal frames N is a positive integer greater than 0;
[0073] Step 32, and based on the known first frame length L M The value range of the sliding step variable is limited to obtain the corresponding sliding step value range; and each sliding step value in the sliding step value range is used as the corresponding current sliding step value one by one, and the current sliding step value is brought into the calculation formula Calculate to obtain a corresponding current calculation result, and when the current calculation result is a positive integer greater than 0, use the current calculation result as a corresponding total number of signal frames to be selected, and use the current sliding step value as a corresponding sliding step to be selected;
[0074] For example, if L=7, L M =4, then,
[0075] The obtained sliding step size ranges from [1, 2, 3],
[0076] Substitute d=1 into the calculation formula The calculated result = 4,
[0077] Substitute d=2 into the calculation formula The calculated result = 2.5,
[0078] Substitute d=3 into the calculation formula The calculated result = 2,
[0079] From this, we can see that we can get 2 valid pairs of (total number of signal frames to be selected, sliding step size to be selected), namely (2, 3) and (4, 1);
[0080] Step 33, and identify the first framing mode; if the first framing mode is the maximum frame number mode, the maximum total number of signal frames to be selected is used as the corresponding total number of signal frames N, and the selected sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * If the first framing mode is the minimum frame number mode, the minimum total number of signal frames to be selected is used as the corresponding total number of signal frames N, and the selected sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * ;
[0081] For example, given that there are two valid pairs of (total number of signal frames to be selected, sliding step length to be selected): (2, 3) and (4, 1), then:
[0082] When the first framing mode is the maximum frame number mode, (4, 1) is selected as the final selection result, that is, the total number of signal frames N=4, the first sliding step length d * =1;
[0083] When the first framing mode is the minimum frame number mode, (2, 3) is selected as the final selection result, that is, the total number of signal frames N=2, the first sliding step d * =3;
[0084] Step 34, and based on the obtained first sliding step length d * and the first frame length L M From the first first signal sa of the first signal sequence i Start sliding frame processing to obtain the corresponding N first signal frames Y h ;
[0085] Among them, the first signal frame Y h Including L M The first noisy signal y h,k ; hth frame first signal frame Y h The kth first noisy signal y h,k and the first signal sequence i=(h-1)×d * +k first signals sa i Consistency;
[0086] Step 35, the obtained N first signal frames Y h The first signal frames are arranged in chronological order to form a corresponding first signal frame sequence.
[0087] Step 4, performing background noise elimination processing on the first signal frame sequence by reference spectral subtraction to obtain a corresponding second signal frame sequence;
[0088] The second signal frame sequence includes a plurality of second signal frames X h ; The second signal frame X h Including L M The first denoised signal x h,k ; The second signal frame X h With the first signal frame Y h One-to-one correspondence; the first denoised signal x h,k With the first noisy signal y h,k One to one correspondence;
[0089] Specifically, step 41, referring to the spectrum subtraction principle, sets each first signal frame Y of the first signal frame sequence h The second signal frame X corresponding to the second signal frame sequence h The corresponding relationship is:
[0090] Y h =X h +Z h ,
[0091]
[0092] Among them, Z h The first signal frame Y h The first noise signal frame of the corresponding additive background noise signal, For the first signal frame Y h , the second signal frame X h and the first noise signal frame Z h The amplitude spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal amplitude spectrum, denoised signal amplitude spectrum and noise signal amplitude spectrum;
[0093] Step 42, and based on the corresponding relationship of spectral subtraction Construct a one-step estimating system of equations:
[0094]
[0095]
[0096] Among them, α h The first signal frame Y h The corresponding single-step noise update coefficient, The first signal frame Y h-1 The corresponding noise signal amplitude spectrum, is the amplitude spectrum of the noise signal The corresponding single-step noise amplitude spectrum, θ h For the first signal frame Y h The phase spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal phase spectrum;
[0097] Step 43, and update the coefficients α of all single-step noises in the single-step estimation equations h Make estimates;
[0098] Specifically, step 431 includes: updating each single-step noise coefficient α h The corresponding original signal amplitude spectrum as the corresponding current amplitude spectrum;
[0099] Step 432, taking the frequency points in the current amplitude spectrum whose amplitude exceeds the preset minimum amplitude and whose frequency value exceeds the preset minimum ultrasonic frequency threshold as the corresponding first ultrasonic frequency points; and recording the corresponding amplitude of each first ultrasonic frequency point as the first frequency point amplitude A;
[0100] Here, the minimum amplitude is a preset empirical amplitude;
[0101] Step 433, calculating the energy of each first ultrasonic frequency point according to each first frequency point amplitude A to obtain the corresponding first frequency point energy E;
[0102] in,
[0103] ρ is the preset density parameter of the sound wave propagation medium, and v is the preset propagation speed parameter of the sound wave in the propagation medium;
[0104] Step 434, the sum of all first frequency point energies E corresponding to the current amplitude spectrum is calculated and the calculation result is used as the corresponding total energy E of the ultrasonic segment. h ;
[0105] Step 435, the total energy E of the ultrasonic segment is h The ratio of the preset acoustic sensor background noise energy threshold E0 is used as the corresponding energy change rate p h ;
[0106] Among them, p h =E h / E0;
[0107] Step 436, and based on the energy change rate p h , the preset update coefficient expected value α0 and the preset exponential function base parameter β determine the corresponding single-step noise update coefficient α h ;
[0108] in,
[0109] Here, the expected value of the update coefficient α0 and the exponential function base parameter β are two preset parameters;
[0110] Step 44, estimating the first single-step noise amplitude spectrum in the single-step estimation equation group;
[0111] Specifically include: the original signal amplitude spectrum The amplitude points exceeding the preset minimum amplitude are recorded as valid signal amplitude points; and the original signal amplitude spectrum with all valid signal amplitude points deleted is As the first single-step noise amplitude spectrum estimated
[0112] Step 45, and update all the single-step noise coefficients α h and the first single-step noise amplitude spectrum Substitute the single-step estimation equation group to calculate the corresponding N noise reduction signal amplitude spectra
[0113] Step 46, and calculate the amplitude spectrum of each noise reduction signal Perform inverse discrete Fourier transform to obtain the corresponding second signal frame X h ;
[0114] Step 47, and the obtained N second signal frames X hThe frames are arranged in chronological order to form a corresponding second signal frame sequence.
[0115] Step 5, setting the second signal sequence based on the second signal frame sequence;
[0116] Specifically comprising: for all second signals sb in the second signal frame sequence i Traverse; and during the traversal, the second signal sb currently traversed i As the corresponding current signal sb i ; and the current signal sb i The signal index i is used as the corresponding current index value i * ; and each frame index h and signal index k in the second signal sequence satisfies i * =(h-1)×d * +k's first denoised signal x h,k Denoted as the corresponding candidate denoising signal, d * is the first sliding step length confirmed in the adaptive frame processing process; and the candidate denoised signal with the latest time is used as the corresponding current denoised signal; and the current signal sb is calculated based on the current denoised signal i to set it up.
[0117] Step 6: output the set second signal sequence as the background noise elimination processing result of the first sound wave signal.
[0118] Figure 2 The module structure diagram of a processing device for eliminating background noise of sound wave signals provided in the second embodiment of the present invention is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment. For example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: an original signal receiving module 201, an original signal preprocessing module 202, an original signal framing module 203, an original signal background noise elimination module 204, a denoised signal sequence setting module 205 and a denoised signal output module 206.
[0119] The original signal receiving module 201 is used to use the sound wave sensor to receive the sound wave signal, and use the sound wave signal received by the sound wave sensor within the most recent first time period as the corresponding first sound wave signal.
[0120] The original signal preprocessing module 202 is used to perform signal sampling processing on the first sound wave signal based on a preset first sampling frequency to obtain a corresponding first signal sequence; and initialize a corresponding second signal sequence based on the sequence length L of the first signal sequence; the first signal sequence includes a plurality of first signals sa i, where 1 ≤ signal index i ≤ L, L = floor(first duration / first sampling frequency), and floor() is the floor function; the second signal sequence includes a plurality of second signals sb i , each second signal sb i is set to 0 during initialization.
[0121] The original signal framing module 203 is configured to perform adaptive framing processing on the first signal sequence based on a preset first frame length L M and a first framing mode to obtain a corresponding first signal frame sequence; the first signal frame sequence includes a plurality of first signal frames Y h ; 1 < L M < L; 1 ≤ frame index h ≤ N, where N is the total number of signal frames obtained after adaptive framing of the first signal frame sequence; the first signal frame Y h includes L M first noisy signals y h,k , where 1 ≤ signal index k ≤ L M ; two adjacent first signal frames Y h and Y h+1 are not completely the same but partially overlap; the first framing mode includes a maximum number of frames mode and a minimum number of frames mode.
[0122] The original signal background noise cancellation module 204 is configured to perform background noise cancellation processing on the first signal frame sequence with reference to spectral subtraction to obtain a corresponding second signal frame sequence; the second signal frame sequence includes a plurality of second signal frames X h ; the second signal frame X h includes L M first denoised signals x h,k ; the second signal frame X h corresponds to the first signal frame Y h one by one; the first denoised signal x h,k corresponds to the first noisy signal y h,k one by one.
[0123] The denoised signal sequence setting module 205 is configured to set the second signal sequence based on the second signal frame sequence.
[0124] The denoised signal output module 206 is configured to output the second signal sequence after being set as the background noise cancellation processing result of the first acoustic wave signal.
[0125] The processing device for eliminating background noise of an acoustic wave signal provided by an embodiment of the present invention can execute the method steps in the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.
[0126] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the original signal receiving module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0127] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0128] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0129] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0130] exist Figure 3The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0131] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (Network Processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0132] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0133] An embodiment of the present invention further provides a chip for executing instructions, wherein the chip is used to execute the processing steps described in the aforementioned method embodiment.
[0134] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for eliminating the background noise of an acoustic wave signal. As can be seen from the above content, the embodiment of the present invention uses an acoustic wave sensor to receive an acoustic wave signal, samples the received original acoustic wave signal, and initializes a corresponding denoised signal sequence based on the sequence length of the sampled original signal sequence; and provides two framing modes (maximum frame number mode and minimum frame number mode) to adaptively frame the original signal sequence to obtain an original signal frame sequence; and reference spectral subtraction is used to eliminate the background noise of the original signal frame sequence to obtain a denoised signal frame sequence; and the denoised signal sequence is set based on the denoised signal frame sequence; and the denoised signal sequence finally set is used as the background noise elimination processing result of the original acoustic wave signal. Through the embodiment of the present invention, the effective acoustic wave signal of the full frequency band in the original acoustic wave signal can be extracted, and the application of the embodiment of the present invention in the full frequency band acoustic wave detection scheme helps to reduce the missed detection rate and false detection rate of gas leak detection.
[0135] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0136] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0137] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A processing method for eliminating background noise of an acoustic signal, characterized in that: The method comprises: Using an acoustic wave sensor to receive an acoustic wave signal, and using the acoustic wave signal received by the acoustic wave sensor within a recent first time period as a corresponding first acoustic wave signal; Based on a preset first sampling frequency, the first sound wave signal is sampled to obtain a corresponding first signal sequence; and a corresponding second signal sequence is initialized based on the sequence length L of the first signal sequence; the first signal sequence includes a plurality of first signals sa i , 1≤signal index i≤L, L=floor(first duration / first sampling frequency), floor() is a floor rounding function; the second signal sequence includes a plurality of second signals sb i , each of the second signals sb i It is set to 0 during initialization; Based on a preset first frame length L M and a first sub - frame mode, adaptively perform sub - framing processing on the first signal sequence to obtain a corresponding first signal frame sequence; the first signal frame sequence includes a plurality of first signal frames Y h ; 1 < L M < L; 1 ≤ frame index h ≤ N, where N is the total number of signal frames obtained after adaptive sub - framing of the first signal frame sequence; the first signal frame Y h includes L M first noisy signals y h,k , 1 ≤ signal index k ≤ L M ; two adjacent first signal frames Y h and Y h+1 are not completely the same but partially overlap; the first sub - frame mode includes a maximum number of frames mode and a minimum number of frames mode; The reference spectrum subtraction method is used to perform background noise elimination processing on the first signal frame sequence to obtain a corresponding second signal frame sequence; the second signal frame sequence includes a plurality of second signal frames X h The second signal frame X h Including L M The first denoised signal x h,k The second signal frame X h With the first signal frame Y h One-to-one correspondence; the first denoised signal x h,k and the first noisy signal y h,k One to one correspondence; Setting the second signal sequence based on the second signal frame sequence; The second signal sequence that has been set is output as a background noise elimination processing result of the first sound wave signal.
2. The method for eliminating background noise of an acoustic signal according to claim 1, characterized in that: The first frame length L is preset M The method of performing adaptive framing processing on the first signal sequence using a first framing mode to obtain a corresponding first signal frame sequence specifically includes: Set the calculation formula for the total number of signal frames and the corresponding restrictions: Where d is the sliding step variable, 1≤d <L M , the total number of signal frames N is a positive integer greater than 0; Based on the known first frame length L M The value range of the sliding step variable is limited to obtain the corresponding sliding step value range; and each sliding step value in the sliding step value range is used as the corresponding current sliding step value one by one, and the current sliding step value is brought into the calculation formula Calculate to obtain a corresponding current calculation result, and when the current calculation result is a positive integer greater than 0, use the current calculation result as a corresponding total number of signal frames to be selected, and use the current sliding step value as a corresponding sliding step to be selected; and identify the first framing mode; if the first framing mode is the maximum frame number mode, the maximum total number of the candidate signal frames is used as the corresponding total number of signal frames N, and the candidate sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * If the first framing mode is the minimum frame number mode, the minimum total number of the selected signal frames is used as the corresponding total number of signal frames N, and the selected sliding step corresponding to the total number of signal frames N obtained this time is used as the corresponding first sliding step d * ; Based on the obtained first sliding step length d * and the first frame length L M From the first signal sa of the first signal sequence i Start sliding frame processing to obtain the corresponding N first signal frames Y h ; The first signal frame Y h Including L M The first noisy signal y h,k ; The first signal frame Y of the hth frame h The kth first noisy signal y h,k and the first signal sequence i=(h-1)×d * +k of the first signals sa i Consistency; The N first signal frames Y obtained by h The first signal frame sequences are arranged in chronological order to form the corresponding first signal frame sequences.
3. The method for eliminating background noise of an acoustic signal according to claim 1, characterized in that: The reference spectrum subtraction method performs background noise elimination processing on the first signal frame sequence to obtain a corresponding second signal frame sequence, specifically comprising: The reference spectrum subtraction principle is used to set each of the first signal frames Y of the first signal frame sequence h The second signal frame X corresponding to the second signal frame sequence h The corresponding relationship is: Y h =X h +Z h , Among them, Z h For the first signal frame Y h The first noise signal frame of the corresponding additive background noise signal, For the first signal frame Y h , the second signal frame X h and the first noise signal frame Z h The amplitude spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal amplitude spectrum, denoised signal amplitude spectrum and noise signal amplitude spectrum; Based on the corresponding relation of spectral subtraction Construct a one-step estimating system of equations: Among them, α h For the first signal frame Y h The corresponding single-step noise update coefficient, The first signal frame Y h-1 The corresponding noise signal amplitude spectrum, The noise signal amplitude spectrum The corresponding single-step noise amplitude spectrum, θ h For the first signal frame Y h The phase spectrum obtained after discrete Fourier transform is recorded as the corresponding original signal phase spectrum; And update the single-step noise coefficients α for all the single-step estimation equations h Make estimates; and estimating the first single-step noise amplitude spectrum in the single-step estimation equation group; And all the single-step noise update coefficients α h and the first single-step noise amplitude spectrum Substitute the single-step estimation equation group into the calculation to obtain the corresponding N noise reduction signal amplitude spectra And the amplitude spectrum of each noise reduction signal Perform inverse discrete Fourier transform to obtain the corresponding second signal frame X h ; And the obtained N second signal frames X h The corresponding second signal frame sequence is formed by chronological order.
4. The method for eliminating background noise of an acoustic signal according to claim 3, characterized in that: The single-step noise update coefficients α for all the single-step estimation equations h Make an estimate, including: Each of the single-step noise update coefficients α h The corresponding original signal amplitude spectrum as the corresponding current amplitude spectrum; The frequency points in the current amplitude spectrum whose amplitude exceeds the preset minimum amplitude and whose frequency value exceeds the preset minimum ultrasonic frequency threshold are taken as corresponding first ultrasonic frequency points; and the corresponding amplitudes of the first ultrasonic frequency points are recorded as first frequency point amplitudes A; The energy of each first ultrasonic frequency point is calculated by using each first frequency point amplitude A to obtain the corresponding first frequency point energy E, Wherein, ρ is a preset density parameter of the sound wave propagation medium, and v is a preset propagation speed parameter of the sound wave in the propagation medium; The energy E of all the first frequency points corresponding to the current amplitude spectrum is summed up and the result is used as the total energy E of the corresponding ultrasonic segment. h ; The total energy E of the ultrasonic segment h The ratio of the preset acoustic sensor background noise energy threshold E0 is used as the corresponding energy change rate p h =E h / E0; And based on the energy change rate p h , the preset update coefficient expected value α0 and the preset exponential function base parameter β determine the corresponding single-step noise update coefficient α h , 5. The method for eliminating background noise of an acoustic signal according to claim 3, characterized in that: The estimating the first single-step noise amplitude spectrum in the single-step estimation equation group specifically includes: The original signal amplitude spectrum The amplitude points exceeding the preset minimum amplitude are recorded as valid signal amplitude points; and the original signal amplitude spectrum with all the valid signal amplitude points deleted is As the first single-step noise amplitude spectrum estimated 6. The method for eliminating background noise of an acoustic signal according to claim 1, characterized in that: The setting the second signal sequence based on the second signal frame sequence specifically includes: For all the second signals sb in the second signal frame sequence i traverse; and during the traversal, the second signal sb currently traversed i As the corresponding current signal sb i ; and the current signal sb i The signal index i is used as the corresponding current index value i * ; and each of the frame index h and the signal index k in the second signal sequence satisfies i * =(h-1)×d * +kThe first denoised signal x h,k Denoted as the corresponding candidate denoising signal, d * is the first sliding step length confirmed in the adaptive framing process; and the denoised signal to be selected at the latest time is used as the corresponding current denoised signal; and the current signal sb is denoised based on the current denoised signal. i to set it up.
7. A device for executing the processing method for eliminating background noise of an acoustic signal according to any one of claims 1 to 6, characterized in that: The device comprises: an original signal receiving module, an original signal preprocessing module, an original signal framing module, an original signal background noise elimination module, a denoising signal sequence setting module and a denoising signal output module; The original signal receiving module is used to use the sound wave sensor to receive the sound wave signal, and use the sound wave signal received by the sound wave sensor within the most recent first time period as the corresponding first sound wave signal; The original signal preprocessing module is used to perform signal sampling processing on the first sound wave signal based on a preset first sampling frequency to obtain a corresponding first signal sequence; and initialize a corresponding second signal sequence based on the sequence length L of the first signal sequence; the first signal sequence includes multiple first signals sa i , 1≤signal index i≤L, L=floor(first duration / first sampling frequency), floor() is a floor rounding function; the second signal sequence includes a plurality of second signals sb i , each of the second signals sb i It is set to 0 during initialization; The original signal framing module is used to perform adaptive framing processing on the first signal sequence based on a preset first frame length L M and a first framing mode to obtain a corresponding first signal frame sequence; the first signal frame sequence includes a plurality of first signal frames Y h ; 1 < L M < L; 1 ≤ frame index h ≤ N, where N is the total number of signal frames obtained after adaptive framing of the first signal frame sequence; the first signal frame Y h includes L M first noisy signals y h,k , 1 ≤ signal index k ≤ L M ; two adjacent first signal frames Y h and Y h+1 are not completely the same but partially overlap; the first framing mode includes a maximum number of frames mode and a minimum number of frames mode; The original signal background noise elimination module is used to perform background noise elimination processing on the first signal frame sequence by reference spectrum subtraction to obtain a corresponding second signal frame sequence; the second signal frame sequence includes a plurality of second signal frames X h The second signal frame X h Including L M The first denoised signal x h,k The second signal frame X h With the first signal frame Y h One-to-one correspondence; the first denoised signal x h,k and the first noisy signal y h,k One to one correspondence; The denoising signal sequence setting module is used to set the second signal sequence based on the second signal frame sequence; The denoising signal output module is used to output the set second signal sequence as the background noise elimination processing result of the first sound wave signal.
8. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 6; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.
