Echo cancellation method and device, equipment and storage medium
By introducing an NLMS filter bank into the Kalman filter for parallel filtering, the problem of difficulty in distinguishing the energy of the near-end signal and the echo signal in the prior art is solved, and the efficiency and accuracy of echo cancellation are improved.
Patent Information
- Application Number
- CN202411973190.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-30
AI Technical Summary
When existing adaptive filters accurately estimate the echo path coefficient, it is difficult to effectively distinguish the energy of the near-end signal and the echo signal, resulting in insufficient echo cancellation efficiency and accuracy.
An NLMS filter bank is introduced into the Kalman filter, and the parallel filtering is performed through multiple NLMS filters to estimate the measured noise (i.e. the energy of the near-end signal), and update the coefficients of the Kalman filter based on the estimated measured noise, thereby echoing.
By introducing an NLMS filter bank, it can quickly converge when the echo path changes, improving the efficiency and accuracy of echo cancellation, effectively distinguishing the energy of the near-end signal and the echo signal.
Smart Images

Figure CN119626242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio technology, and in particular to an echo cancellation method, device, equipment and storage medium. Background Art
[0002] Acoustic Echo Cancellation (AEC) is widely used in voice calls, video conferencing and smart devices to eliminate the echo interference caused by the speaker signal returning to the microphone through the acoustic coupling path. The core of AEC is to build an adaptive filter, such as an adaptive filter based on algorithms such as NLMS (Normalized Least Mean Squares), RLS (Recursive Least Squares), and Kalman Filter, to estimate and eliminate the echo component of the far-end signal in the microphone.
[0003] Currently, in the field of echo cancellation, Kalman filters have shown significant advantages over traditional NLMS algorithms, especially in complex double talk scenarios and rapidly changing echo paths. Kalman filters can continuously estimate and track echo path coefficients, while NLMS algorithms need to suspend coefficient updates to avoid performance degradation. This continuous tracking capability makes Kalman filters more robust in dynamic acoustic environments, but the accuracy of Kalman filters depends on accurate estimation of near-end signal energy (i.e., measurement noise in Kalman filters). Accurate estimation of near-end signal energy is crucial to preventing adaptive filter coefficients from diverging and preventing the filter from deviating from the true echo path coefficients.
[0004] However, the current adaptive filter needs to know the energy of the near-end signal when accurately estimating the coefficient of the echo path, and the near-end speech and / or background noise are mixed with the echo signal, making it difficult to effectively distinguish the energy of the near-end signal and the echo signal. Therefore, how to effectively distinguish the energy of the near-end signal and the echo signal to eliminate the echo is a problem that needs to be further solved in the field. Summary of the invention
[0005] In view of this, the purpose of this application is to provide an echo cancellation method, device, equipment and storage medium, which can improve the efficiency and accuracy of echo cancellation. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses an echo cancellation method, comprising:
[0007] Acquire the audio signal played by the current sound playing device and the audio signal collected by the sound collecting device to obtain a far-end audio signal and a near-end audio signal;
[0008] Acquire a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device, and input the historical residual signal and the historical remote reference signal into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain a plurality of filtered residual signals;
[0009] Calculating a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculating a Kalman gain based on the current measurement noise estimate, the historical remote reference signal, and the process noise of the Kalman filter;
[0010] The Kalman filter coefficient estimation value obtained in the last iteration of the Kalman filter is updated based on the Kalman gain and the historical residual signal to obtain the current filter coefficient estimation value;
[0011] The echo generated on the echo path between the sound collecting device and the sound playing device is eliminated based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
[0012] Optionally, the historical residual signal obtained in the last iteration of the Kalman filter and the historical remote reference signal played by the sound playing device are obtained, and the historical residual signal and the historical remote reference signal are input into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals, including:
[0013] Acquire a frequency domain residual signal obtained in the last iteration of a Kalman filter pre-created based on an NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device to obtain a historical residual signal and a historical far-end reference signal;
[0014] The historical residual signal and the historical far-end reference signal are input into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
[0015] Optionally, the step of obtaining a frequency domain residual signal obtained in a previous iteration of a Kalman filter pre-created based on an NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device to obtain a historical residual signal and a historical far-end reference signal includes:
[0016] Performing frequency domain transformation on the near-end audio signal and the far-end audio signal respectively to obtain a near-end frequency domain signal and a far-end frequency domain signal;
[0017] A frequency domain residual signal obtained in the last iteration of the Kalman filter pre-created based on the NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device are obtained to obtain a historical residual signal and a historical far-end reference signal.
[0018] Optionally, the canceling the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimate, the far-end audio signal, and the near-end audio signal to obtain an echo-cancelled signal includes:
[0019] The far-end frequency domain signal is updated based on the historical far-end reference signal to obtain a current audio signal, and a residual signal of a current frame is calculated based on the current filter coefficient estimate and the near-end frequency domain signal to obtain a current residual signal;
[0020] The current residual signal is transformed in the time domain to obtain an audio signal after the echo generated on the echo path between the sound collection device and the sound playback device is eliminated, thereby obtaining an echo-cancelled signal.
[0021] Optionally, the inputting the historical residual signal and the historical remote reference signal into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals includes:
[0022] The frequency domain buffer of the historical remote reference signal is subjected to time block processing to obtain a plurality of frequency domain signal blocks, and the historical residual signal and each of the frequency domain signal blocks are input into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
[0023] Optionally, the calculating the current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals comprises:
[0024] Recursively smoothing each of the filtered residual signals to obtain a plurality of smoothed residuals;
[0025] The minimum value of all the smoothed residuals is calculated to obtain a current measurement noise estimate of the Kalman filter.
[0026] Optionally, the calculating the Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter includes:
[0027] Using process noise to update the posterior offset matrix obtained in the previous iteration of the Kalman filter to obtain a priori offset matrix;
[0028] A Kalman gain is calculated based on the a priori misalignment matrix, the current measurement noise estimate, and the historical far-end reference signal.
[0029] In a second aspect, the present application discloses an echo cancellation device, comprising:
[0030] A first signal acquisition module, used to acquire the audio signal played by the current sound playback device and the audio signal collected by the sound collection device to obtain a far-end audio signal and a near-end audio signal;
[0031] A second signal acquisition module is used to acquire a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device;
[0032] A filtering module, used for inputting the historical residual signal and the historical remote reference signal into the NLMS filter group located in the Kalman filter to perform NLMS filtering to obtain a plurality of filtered residual signals;
[0033] A calculation module, configured to calculate a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculate a Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter;
[0034] An updating module, configured to update the Kalman filter coefficient estimation value obtained in the last iteration of the Kalman filter based on the Kalman gain and the historical residual signal to obtain a current filter coefficient estimation value;
[0035] The echo cancellation module is used to cancel the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
[0036] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the processor implements the aforementioned echo cancellation method when executing a computer program stored in the memory.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned echo cancellation method is implemented.
[0038] It can be seen that in the present application, the audio signal played by the current sound playing device and the audio signal collected by the sound collecting device are first obtained to obtain the far-end audio signal and the near-end audio signal, and then the historical residual signal obtained in the previous iteration of the Kalman filter and the historical far-end reference signal played by the sound playing device are obtained, and the historical residual signal and the historical far-end reference signal are input into the NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals, and then the current measurement noise estimate of the Kalman filter is calculated based on the multiple filtered residual signals, and the Kalman gain is calculated based on the current measurement noise estimate, the historical far-end reference signal and the process noise of the Kalman filter, and then the Kalman filter coefficient estimate obtained in the previous iteration of the Kalman filter is updated based on the Kalman gain and the historical residual signal to obtain the current filter coefficient estimate, and finally the echo generated on the echo path between the sound collecting device and the sound playing device is eliminated based on the current filter coefficient estimate, the far-end audio signal and the near-end audio signal to obtain the echo-cancelled signal. The present application first acquires the near-end audio signal collected by the sound collection device and the far-end reference signal played by the sound playback device, and then inputs the historical residual signal and the historical far-end reference signal into the NLMS filter group of the Kalman filter, so as to perform NLMS filtering through multiple NLMS filters in the NLMS filter group to obtain multiple filtered residual signals, and calculates the filter coefficient estimation value of the current Kalman filter based on the multiple filtered residual signals, and finally obtains the echo-cancelled signal based on the filter coefficient estimation value, the far-end audio signal and the near-end audio signal. It can be seen that the present application adds an NLMS filter group to the Kalman filter, and obtains the echo-cancelled signal through multiple NLMS filters in the NLMS filter group. The device performs parallel filtering processing to estimate the measurement noise (i.e., the energy of the near-end signal) in the Kalman filter, and eliminates the echo on the echo path between the sound collection device and the sound playback device based on the estimated measurement noise. This solution introduces a group of parallel NLMS filters into the NLMS filter, and performs filtering processing through multiple NLMS filters in the group, so that each NLMS filter only estimates a small number of coefficients, so that it can converge quickly when the echo path changes, thereby improving the efficiency of echo cancellation. At the same time, by combining the NLMS filter with the Kalman filter, the energy of the near-end signal and the echo signal can be effectively distinguished, thereby improving the accuracy of echo cancellation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flow chart of an echo cancellation method disclosed in this application;
[0041] Figure 2 A block diagram of a specific echo cancellation method disclosed in this application;
[0042] Figure 3 This is a schematic diagram of the structure of an echo cancellation device disclosed in this application;
[0043] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The present application discloses an echo cancellation method. Figure 1 As shown, the method includes:
[0046] Step S11: Acquire the audio signal currently played by the sound playing device and the audio signal collected by the sound collecting device to obtain a far-end audio signal and a near-end audio signal.
[0047] In this embodiment, when it is necessary to eliminate the echo generated on the echo path between the sound playback device (such as a speaker) and the sound collection device (such as a microphone), the audio signal played by the current sound playback device (such as a speaker) and the audio signal collected by the sound collection device (such as a microphone) can be obtained respectively to obtain the corresponding remote audio signal. and near-end audio signals For details, see Figure 2 As shown, the near-end audio signal Contains all sounds collected by the near-end microphone, which can be specifically expressed as:
[0048] ;
[0049] In the formula, Represents a mixed signal of speech and / or background noise picked up by the near-end microphone.
[0050] Specifically, the far-end audio signal Refers to the signal that will be played from the local speaker. The signal collected by the microphone after being reflected by the speaker and the room is , Specifically, it can be expressed as:
[0051] ;
[0052] In the formula, Indicates the echo path.
[0053] Step S12: Obtain a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playback device, and input the historical residual signal and the historical remote reference signal into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals.
[0054] It is understandable that if the echo path changes, the estimation of the echo signal is inaccurate, in which case the estimated near-end energy / measurement noise Deviations will occur. In order to solve the above problem, the present application introduces a set of parallel NLMS filters after the sub-band Kalman filter. The filter group takes the residual error signal (ResidualError) of the Kalman filter as input and processes it in combination with the remote signal after block division (i.e., the audio signal played by the sound playback device). Since each NLMS filter only needs to estimate a small number of filter coefficients, it can converge quickly when the echo path changes.
[0055] In this embodiment, the remote audio signal played by the current sound playback device is obtained. And the near-end audio signal collected by the sound collection device After that, further, the historical residual signal obtained in the last iteration of the Kalman filter pre-created based on the NLMS filter group and the historical far-end reference signal played by the sound playback device are obtained, and then the above historical residual signal and the above historical far-end reference signal are input into multiple NLMS filters in the NLMS filter group for parallel NLMS filtering, thereby obtaining multiple filtered residual signals. It should be pointed out that the present application pre-creates a Kalman filter including multiple NLMS filters, and not only can parallel filtering operations be performed through multiple NLMS filters, but also the accuracy of echo cancellation can be improved by combining the Kalman filter with multiple NLMS filters.
[0056] Specifically, the method of obtaining a historical residual signal obtained in the previous iteration of the Kalman filter and a historical far-end reference signal played by the sound playing device, and inputting the historical residual signal and the historical far-end reference signal into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals may include: obtaining a frequency domain residual signal obtained in the previous iteration of the Kalman filter created in advance based on the NLMS filter group and a frequency domain far-end reference signal played by the sound playing device to obtain a historical residual signal and a historical far-end reference signal; and inputting the historical residual signal and the historical far-end reference signal into the NLMS filter group for NLMS filtering to obtain multiple filtered residual signals. In this embodiment, the residual signal obtained in the previous iteration of the Kalman filter created in advance based on the NLMS filter group and the audio signal played by the sound playback device can be obtained to obtain the corresponding historical residual signal and the historical far-end reference signal. Then, the historical residual signal and the historical far-end reference signal are input into the NLMS filter group located in the Kalman filter to perform parallel NLMS filtering through multiple NLMS filters in the NLMS filter group to obtain corresponding multiple filtered residual signals.
[0057] In this embodiment, the frequency domain residual signal obtained in the previous iteration of the Kalman filter pre-created based on the NLMS filter group and the frequency domain far-end reference signal played by the sound playback device to obtain the historical residual signal and the historical far-end reference signal may specifically include: performing frequency domain transformation on the near-end audio signal and the far-end audio signal respectively to obtain the near-end frequency domain signal and the far-end frequency domain signal; obtaining the frequency domain residual signal obtained in the previous iteration of the Kalman filter pre-created based on the NLMS filter group and the frequency domain far-end reference signal played by the sound playback device to obtain the historical residual signal and the historical far-end reference signal. In this embodiment, in order to improve the echo cancellation speed, the time domain audio signal is converted into a frequency domain audio signal. For example, the near-end audio signal collected by the microphone is converted into a frequency domain audio signal. signal and the far-end audio signal played by the loudspeaker The near-end frequency domain signal is obtained by performing frame division, mixed and superimposed window processing respectively, and M-point short-time Fourier transform (STFT) and far-end frequency domain signal , where n is the frame index and k is the frequency index. Then, the residual signal obtained in the last iteration of the Kalman filter and the audio signal played by the sound player are obtained to obtain the historical residual signal and historical remote reference signal Among them, the historical remote reference signal Specifically, it can be expressed as:
[0058] ;
[0059] Where L is the maximum number of taps of the Kalman filter and T represents transposition.
[0060] It can be understood that framing is to divide an infinitely long speech signal into segments, because the speech signal has short-term stability and is easy to process. Windowing is to make the framed speech signal more stable.
[0061] In this embodiment, the inputting of the historical residual signal and the historical remote reference signal into the NLMS filter group for NLMS filtering to obtain multiple filtered residual signals may specifically include: performing time block processing on the frequency domain cache of the historical remote reference signal to obtain multiple frequency domain signal blocks, and inputting the historical residual signal and each of the frequency domain signal blocks into the NLMS filter group for NLMS filtering to obtain multiple filtered residual signals. In this embodiment, the historical remote audio signal played by the speaker is first After block processing, p blocks are obtained. The length of each block is l. The i-th block can be expressed as:
[0062] ;
[0063] in, .
[0064] Next, the historical residual signal and each frequency domain signal block Input into the NLMS filter bank for NLMS filtering to obtain multiple filtered residual signals Specifically, the filter coefficients of the i-th filter in the (n-1)th iteration of the Kalman filter can be obtained first. , where the filter coefficients It can be expressed as:
[0065] ;
[0066] Further, As a remote reference signal, As the microphone signal, it traverses p NLMS filters, that is, , and finally obtain multiple filtered residual signals , Specifically, it can be expressed as:
[0067] .
[0068] In addition, the residual signal can be filtered Calculate the current filter coefficients of the NLMS filter , the specific calculation formula is:
[0069] ;
[0070] Where μ is the filter step size, This is to avoid the stabilization factor of 0.
[0071] Step S13: Calculate a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculate a Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter.
[0072] In this embodiment, after NLMS filtering is performed by multiple filters in the Kalman filter, the residual signal after the multiple filtering can be Calculate the current measurement noise estimate of the Kalman filter , then based on the above current measurement noise estimate , the above historical remote reference signal and process noise of Kalman filter Calculate the Kalman gain of the current frame .
[0073] Specifically, the calculation of the current measurement noise estimate of the Kalman filter based on the multiple filtered residual signals may include: recursively smoothing each of the filtered residual signals to obtain multiple smoothed residuals; calculating the minimum value of all the smoothed residuals to obtain the current measurement noise estimate of the Kalman filter. In this embodiment, when calculating the current measurement noise estimate of the Kalman filter, When , we can first calculate all the residual signals after filtering. Recursive smoothing is performed to obtain multiple smoothed residuals, and then the minimum value of all smoothed residuals is calculated, and the minimum value is used as the current measurement noise estimate of the Kalman filter. The specific calculation steps include:
[0074] ;
[0075] ;
[0076] In the formula, is the smoothing coefficient;
[0077] Next, calculate all Minimum :
[0078] ;
[0079] Finally, the minimum As That is, after calculating the energy of the output residual signal of the NLMS filter bank, the minimum energy value is selected as the estimated value of the near-end signal energy. , The specific calculation formula is:
[0080] .
[0081] In this embodiment, the calculation of the Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter may specifically include: using the process noise to update the a posteriori offset matrix obtained in the previous iteration of the Kalman filter to obtain the a priori offset matrix; and calculating the Kalman gain based on the a priori offset matrix, the current measurement noise estimate and the historical remote reference signal. For example, first using the process noise of the Kalman filter Update the posterior misalignment matrix obtained in the previous iteration to obtain the prior misalignment matrix (posteriori misalignment) , The specific calculation formula is:
[0082] ;
[0083] In the formula, represents the posterior misalignment matrix obtained at the (n - 1)th iteration, and I is the identity matrix.
[0084] Further, based on and Calculate the Kalman gain. The specific calculation formula is:
[0085] ;
[0086] .
[0087] Step S14: updating the estimated value of the Kalman filter coefficient obtained in the previous iteration of the Kalman filter based on the Kalman gain and the historical residual signal to obtain the estimated value of the current filter coefficient.
[0088] In this embodiment, based on the above Kalman gain And the above historical residual signal Update the Kalman filter coefficient estimate obtained in the previous iteration of the Kalman filter to obtain the current filter coefficient estimate The current filter coefficient estimate The specific calculation process includes:
[0089] First, using the Kalman gain Calculate the posterior misalignment matrix for the current frame , the specific calculation formula is:
[0090] ;
[0091] Furthermore, the filter coefficients obtained at the (n - 1)th iteration are obtained. , and combined with Update the filter coefficient of the Kalman filter to obtain the current filter coefficient estimate. The specific calculation formula is:
[0092] ;
[0093] .
[0094] Step S15: Eliminate the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
[0095] In this embodiment, the echo generated on the echo path between the sound collecting device and the sound playing device may be eliminated based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal.
[0096] In this embodiment, the echo generated on the echo path between the sound collection device and the sound playback device is eliminated based on the current filter coefficient estimate, the far-end audio signal and the near-end audio signal to obtain a signal after echo cancellation. Specifically, the far-end frequency domain signal is updated based on the historical far-end reference signal to obtain the current audio signal, and the residual signal of the current frame is calculated based on the current filter coefficient estimate and the near-end frequency domain signal to obtain the current residual signal; the current residual signal is transformed in the time domain to obtain the audio signal after the echo generated on the echo path between the sound collection device and the sound playback device is eliminated to obtain the signal after echo cancellation. Specifically, the far-end frequency domain signal of the nth frame can be used. renew , get the updated audio signal , the specific update formula is:
[0097] ;
[0098] In the formula, express The first L-1 elements of .
[0099] Next, calculate the current residual signal , the specific calculation formula is:
[0100] .
[0101] Finally, the current residual signal is transformed by inverse short-time Fourier transform (ISTFT, Inverse Short-Time Fourier Transform) Perform inverse Fourier transform and merge the frames together by overlap-add (OLA) to obtain the time domain signal .
[0102] It can be seen that the embodiment of the present application first obtains the audio signal played by the current sound playback device and the audio signal collected by the sound collection device to obtain the far-end audio signal and the near-end audio signal, then obtains the historical residual signal obtained in the previous iteration of the Kalman filter and the historical far-end reference signal played by the sound playback device, and inputs the historical residual signal and the historical far-end reference signal into the NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals, then, calculates the current measurement noise estimate of the Kalman filter based on the multiple filtered residual signals, and calculates the Kalman gain based on the current measurement noise estimate, the historical far-end reference signal and the process noise of the Kalman filter, and then updates the Kalman filter coefficient estimate obtained in the previous iteration of the Kalman filter based on the Kalman gain and the historical residual signal to obtain the current filter coefficient estimate, and finally eliminates the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimate, the far-end audio signal and the near-end audio signal to obtain the echo-cancelled signal. In the embodiment of the present application, the near-end audio signal collected by the sound collection device and the far-end reference signal played by the sound playback device are first acquired, and then the historical residual signal and the historical far-end reference signal are input into the NLMS filter group of the Kalman filter, so as to perform NLMS filtering through multiple NLMS filters in the NLMS filter group to obtain multiple filtered residual signals, and the filter coefficient estimation value of the current Kalman filter is calculated based on the multiple filtered residual signals, and finally the echo-cancelled signal is obtained based on the filter coefficient estimation value, the far-end audio signal and the near-end audio signal. It can be seen that the present application adds an NLMS filter group to the Kalman filter, and uses multiple NLMS in the NLMS filter group to obtain a plurality of filtered residual signals. The filter performs parallel filtering processing to estimate the measurement noise (i.e., the energy of the near-end signal) in the Kalman filter, and eliminates the echo on the echo path between the sound collection device and the sound playback device based on the estimated measurement noise. This solution introduces a group of parallel NLMS filters into the NLMS filter, and performs filtering processing through multiple NLMS filters in the group, so that each NLMS filter only estimates a small number of coefficients, so that it can converge quickly when the echo path changes, thereby improving the efficiency of echo cancellation. At the same time, by combining the NLMS filter with the Kalman filter, the energy of the near-end signal and the echo signal can be effectively distinguished, thereby improving the accuracy of echo cancellation.
[0103] Correspondingly, the embodiment of the present application also discloses an echo cancellation device, see Figure 3 As shown, the device comprises:
[0104] A first signal acquisition module 11 is used to acquire the audio signal played by the current sound playback device and the audio signal collected by the sound collection device to obtain a far-end audio signal and a near-end audio signal;
[0105] A second signal acquisition module 12 is used to acquire a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device;
[0106] A filtering module 13 is used to input the historical residual signal and the historical remote reference signal into an NLMS filter group located in the Kalman filter to perform NLMS filtering to obtain a plurality of filtered residual signals;
[0107] A calculation module 14, configured to calculate a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculate a Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter;
[0108] An updating module 15 is used to update the Kalman filter coefficient estimation value obtained in the previous iteration of the Kalman filter based on the Kalman gain and the historical residual signal to obtain a current filter coefficient estimation value;
[0109] The echo cancellation module 16 is used to cancel the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
[0110] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0111] It can be seen that in the embodiment of the present application, the audio signal played by the current sound playback device and the audio signal collected by the sound collection device are first obtained to obtain the far-end audio signal and the near-end audio signal, and then the historical residual signal obtained in the previous iteration of the Kalman filter and the historical far-end reference signal played by the sound playback device are obtained, and the historical residual signal and the historical far-end reference signal are input into the NLMS filter group located in the Kalman filter for NLMS filtering to obtain multiple filtered residual signals, and then the current measurement noise estimate of the Kalman filter is calculated based on the multiple filtered residual signals, and the Kalman gain is calculated based on the current measurement noise estimate, the historical far-end reference signal and the process noise of the Kalman filter, and then the Kalman filter coefficient estimate obtained in the previous iteration of the Kalman filter is updated based on the Kalman gain and the historical residual signal to obtain the current filter coefficient estimate, and finally the echo generated on the echo path between the sound collection device and the sound playback device is eliminated based on the current filter coefficient estimate, the far-end audio signal and the near-end audio signal to obtain the echo-cancelled signal. In the embodiment of the present application, the near-end audio signal collected by the sound collection device and the far-end audio signal played by the sound playback device are first acquired, and then the historical residual signal and the historical far-end reference signal are input into the NLMS filter group of the Kalman filter, so as to perform NLMS filtering through multiple NLMS filters in the NLMS filter group to obtain multiple filtered residual signals, and the filter coefficient estimation value of the current Kalman filter is calculated based on the multiple filtered residual signals, and finally the echo-cancelled signal is obtained based on the filter coefficient estimation value, the far-end audio signal and the near-end audio signal. It can be seen that the present application adds an NLMS filter group to the Kalman filter, and uses multiple NLMS in the NLMS filter group to obtain a plurality of filtered residual signals. The filter performs parallel filtering processing to estimate the measurement noise (i.e., the energy of the near-end signal) in the Kalman filter, and eliminates the echo on the echo path between the sound collection device and the sound playback device based on the estimated measurement noise. This solution introduces a group of parallel NLMS filters into the NLMS filter, and performs filtering processing through multiple NLMS filters in the group, so that each NLMS filter only estimates a small number of coefficients, so that it can converge quickly when the echo path changes, thereby improving the efficiency of echo cancellation. At the same time, by combining the NLMS filter with the Kalman filter, the energy of the near-end signal and the echo signal can be effectively distinguished, thereby improving the accuracy of echo cancellation.
[0112] In some specific embodiments, the second signal acquisition module 12 may specifically include:
[0113] A first signal acquisition unit is used to acquire a frequency domain residual signal obtained in the last iteration of a Kalman filter pre-created based on an NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device, to obtain a historical residual signal and a historical far-end reference signal;
[0114] Accordingly, the filtering module 13 may specifically include:
[0115] The first filtering unit is used for inputting the historical residual signal and the historical remote reference signal into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
[0116] In some specific embodiments, the first signal acquisition unit may specifically include:
[0117] A frequency domain transform unit, configured to perform frequency domain transform on the near-end audio signal and the far-end audio signal to obtain a near-end frequency domain signal and a far-end frequency domain signal;
[0118] The second signal acquisition unit is used to acquire the frequency domain residual signal obtained in the previous iteration of the Kalman filter created in advance based on the NLMS filter group and the frequency domain far-end reference signal played by the sound playing device to obtain the historical residual signal and the historical far-end reference signal.
[0119] In some specific embodiments, the echo cancellation module 16 may specifically include:
[0120] A first updating unit, configured to update the remote frequency domain signal based on the historical remote reference signal to obtain a current audio signal;
[0121] A first calculation unit, configured to calculate a residual signal of a current frame based on the current filter coefficient estimation value and the near-end frequency domain signal to obtain a current residual signal;
[0122] The time domain transform unit is used to perform time domain transform on the current residual signal to obtain an audio signal after eliminating the echo generated on the echo path between the sound collection device and the sound playback device, thereby obtaining an echo-cancelled signal.
[0123] In some specific embodiments, the first filtering unit may specifically include:
[0124] A block division unit, configured to perform time block processing on the frequency domain buffer of the historical remote reference signal to obtain a plurality of frequency domain signal blocks;
[0125] The second filtering unit is used to input the historical residual signal and each of the frequency domain signal blocks into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
[0126] In some specific embodiments, the calculation module 14 may specifically include:
[0127] A smoothing processing unit, used for recursively smoothing each of the filtered residual signals to obtain a plurality of smoothed residuals;
[0128] The second calculation unit is used to calculate the minimum value of all the smoothed residuals to obtain the current measurement noise estimation value of the Kalman filter.
[0129] In some specific embodiments, the calculation module 14 may specifically include:
[0130] A second updating unit is used to update the posterior offset matrix obtained in the last iteration of the Kalman filter by using process noise to obtain a priori offset matrix;
[0131] The third calculation unit is used to calculate the Kalman gain based on the prior offset matrix, the current measurement noise estimate and the historical remote reference signal.
[0132] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0133] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the echo cancellation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0134] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0135] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0136] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the echo cancellation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0137] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the echo cancellation method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.
[0138] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which implements the steps of the echo cancellation method disclosed above when executed by a processor.
[0139] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0140] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in 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 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 may 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 this application.
[0141] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly 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.
[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0143] The above is a detailed introduction to an echo cancellation method, device, equipment and storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An echo cancellation method, characterized in that: include: Acquire the audio signal played by the current sound playing device and the audio signal collected by the sound collecting device to obtain a far-end audio signal and a near-end audio signal; Acquire a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device, and input the historical residual signal and the historical remote reference signal into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain a plurality of filtered residual signals; Calculating a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculating a Kalman gain based on the current measurement noise estimate, the historical remote reference signal, and the process noise of the Kalman filter; The Kalman filter coefficient estimation value obtained in the last iteration of the Kalman filter is updated based on the Kalman gain and the historical residual signal to obtain the current filter coefficient estimation value; The echo generated on the echo path between the sound collecting device and the sound playing device is eliminated based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
2. The echo cancellation method according to claim 1, characterized in that: The method further comprises: obtaining a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device, and inputting the historical residual signal and the historical remote reference signal into an NLMS filter group located in the Kalman filter for NLMS filtering to obtain a plurality of filtered residual signals, including: Acquire a frequency domain residual signal obtained in the last iteration of a Kalman filter pre-created based on an NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device to obtain a historical residual signal and a historical far-end reference signal; The historical residual signal and the historical far-end reference signal are input into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
3. The echo cancellation method according to claim 2, characterized in that: The step of obtaining a frequency domain residual signal obtained in a previous iteration of a Kalman filter pre-created based on an NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device to obtain a historical residual signal and a historical far-end reference signal includes: Performing frequency domain transformation on the near-end audio signal and the far-end audio signal respectively to obtain a near-end frequency domain signal and a far-end frequency domain signal; A frequency domain residual signal obtained in the last iteration of the Kalman filter pre-created based on the NLMS filter bank and a frequency domain far-end reference signal played by the sound playing device are obtained to obtain a historical residual signal and a historical far-end reference signal.
4. The echo cancellation method according to claim 3, characterized in that: The method of eliminating the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimation value, the far-end audio signal, and the near-end audio signal to obtain an echo-cancelled signal includes: The far-end frequency domain signal is updated based on the historical far-end reference signal to obtain a current audio signal, and a residual signal of a current frame is calculated based on the current filter coefficient estimate and the near-end frequency domain signal to obtain a current residual signal; The current residual signal is transformed in the time domain to obtain an audio signal after the echo generated on the echo path between the sound collection device and the sound playback device is eliminated, thereby obtaining an echo-cancelled signal.
5. The echo cancellation method according to claim 4, characterized in that: The step of inputting the historical residual signal and the historical remote reference signal into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals includes: The frequency domain buffer of the historical remote reference signal is subjected to time block processing to obtain a plurality of frequency domain signal blocks, and the historical residual signal and each of the frequency domain signal blocks are input into the NLMS filter bank for NLMS filtering to obtain a plurality of filtered residual signals.
6. The echo cancellation method according to claim 1, characterized in that: The calculating the current measurement noise estimation value of the Kalman filter based on the plurality of filtered residual signals comprises: Recursively smoothing each of the filtered residual signals to obtain a plurality of smoothed residuals; The minimum value of all the smoothed residuals is calculated to obtain a current measurement noise estimate of the Kalman filter.
7. The echo cancellation method according to any one of claims 1 to 6, characterized in that: The calculating of the Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter comprises: Using process noise to update the posterior offset matrix obtained in the previous iteration of the Kalman filter to obtain a priori offset matrix; A Kalman gain is calculated based on the a priori misalignment matrix, the current measurement noise estimate, and the historical far-end reference signal.
8. An echo cancellation device, characterized in that: include: A first signal acquisition module, used to acquire the audio signal played by the current sound playback device and the audio signal collected by the sound collection device to obtain a far-end audio signal and a near-end audio signal; A second signal acquisition module is used to acquire a historical residual signal obtained in the last iteration of the Kalman filter and a historical remote reference signal played by the sound playing device; A filtering module, used for inputting the historical residual signal and the historical remote reference signal into the NLMS filter group located in the Kalman filter to perform NLMS filtering to obtain a plurality of filtered residual signals; A calculation module, configured to calculate a current measurement noise estimate of the Kalman filter based on the plurality of filtered residual signals, and calculate a Kalman gain based on the current measurement noise estimate, the historical remote reference signal and the process noise of the Kalman filter; An updating module, configured to update the Kalman filter coefficient estimation value obtained in the last iteration of the Kalman filter based on the Kalman gain and the historical residual signal to obtain a current filter coefficient estimation value; The echo cancellation module is used to cancel the echo generated on the echo path between the sound collection device and the sound playback device based on the current filter coefficient estimation value, the far-end audio signal and the near-end audio signal to obtain an echo-cancelled signal.
9. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the echo cancellation method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the echo cancellation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Broadband acoustics echo eliminating method
CN101227537A
Echo cancellation method and device
CN112687285A
Adaptive echo cancellation
CN117636834A
Echo cancellation method and device, equipment and storage medium
CN118136037A
Multi-channel echo cancellation method and related apparatus
US20230403506A1