Echo cancellation methods, apparatus, equipment and storage media
By simulating the echo path in a two-way call and adjusting the step size factor of the adaptive filter, the problem of poor echo cancellation effect when the echo path changes in traditional technology is solved, and a more efficient echo cancellation effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional two-way communication detection technology cannot distinguish between two-way conversations and changes in the echo path, resulting in a large difference between the estimated echo and the actual echo when the echo path changes, leading to poor echo cancellation.
The echo path is simulated using the echo cancellation filter at the current moment. The optimal step size is determined and the weight vector of the adaptive filter is updated. The step size factor is continuously adjusted to adapt to changes in the double-talk and echo path. Echo cancellation is performed using a frequency domain adaptive filter.
The robustness of the adaptive filter in two-way communication is enhanced, making the echo cancellation closer to the actual echo signal and improving the echo cancellation effect.
Smart Images

Figure CN116647621B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of double-talk, and in particular to an echo cancellation method, device, equipment and storage medium. BACKGROUND
[0002] When double-talk occurs, the near-end voice signal appears as a strong interference signal, which makes the performance of the adaptive filter for echo cancellation decline, and the situation that the adaptive filter diverges and the far-end speaker hears his own echo may occur. At present, the double-talk detection technology is mainly used to detect whether double-talk occurs, and when it is detected that double-talk occurs, the update of the weight value of the adaptive filter is stopped, so as to avoid the divergence of the filter. However, the traditional double-talk detection technology cannot distinguish between the occurrence of double-talk and the change of the echo path, and when the echo path changes, the update of the weight value of the adaptive filter is also stopped, which causes the estimated echo obtained by the adaptive filter to be quite different from the actual echo after the change of the echo path, and the effect of echo cancellation is poor.
[0003] The above content is only used to assist in understanding the technical solutions of the present application, and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0004] The main purpose of the present application is to provide an echo cancellation method, which aims to enhance the robustness of the adaptive echo cancellation algorithm to double-talk.
[0005] To achieve the above purpose, the present application provides an echo cancellation method, which comprises the following steps:
[0006] An estimated echo signal at the current moment is obtained by performing echo path simulation on the far-end reference signal received at the current moment through the echo cancellation filter at the current moment;
[0007] A current echo cancellation signal at the current moment is obtained by canceling the near-end reference signal at the current moment using the estimated echo signal at the current moment;
[0008] An optimal step size of the echo cancellation filter at the current moment is determined, and an iteration weight vector is calculated based on the optimal step size and the current weight vector of the echo cancellation filter at the current moment;
[0009] The echo cancellation filter at the next moment is obtained by updating the echo cancellation filter at the current moment using the iteration weight vector, and the near-end reference signal at the next moment is subjected to echo cancellation through the echo cancellation filter at the next moment.
[0010] Optionally, the echo cancellation method further comprises:
[0011] The preset weight value is used as an initial step of a frequency domain adaptive filter to obtain an initial time echo cancellation filter.
[0012] Optionally, before the step of using the preset weight value as an initial step of a frequency domain adaptive filter to obtain an initial time echo cancellation filter, the method further comprises:
[0013] Obtaining a scene sound signal in each speech scene;
[0014] Training the frequency domain adaptive filter using each of the scene sound signals to obtain a convergence step corresponding to each of the scene sound signals when the frequency domain adaptive filter converges;
[0015] Determining the preset weight value according to each of the convergence steps.
[0016] Optionally, the step of determining the preset weight value according to each of the convergence steps comprises:
[0017] Calculating an average value of each of the convergence steps, and using the average value as the preset weight value.
[0018] Optionally, before the step of obtaining a current time estimated echo signal by performing echo path simulation on a current time received remote reference signal using a current time echo cancellation filter, the method further comprises:
[0019] Performing nonlinear processing on a current time collected remote collection signal to obtain a remote reference signal.
[0020] Optionally, the step of performing nonlinear processing on a current time collected remote collection signal to obtain a remote reference signal comprises:
[0021] Mapping a dynamic range of the remote collection signal to a preset dynamic range to obtain the remote reference signal.
[0022] Optionally, the step of determining an optimal step of the current time echo cancellation filter comprises:
[0023] Calculating an estimated echo power of the current time estimated echo signal, and calculating an output signal power of the current time echo cancellation signal;
[0024] Recursively smoothing the estimated echo power and the output signal power to obtain a first correlation coefficient and a second correlation coefficient, wherein the first correlation coefficient is a cross-correlation coefficient between the current time estimated echo signal and the current time echo cancellation signal, and the second correlation coefficient is an autocorrelation coefficient of the current time echo cancellation signal;
[0025] Dividing the first correlation coefficient by the second correlation coefficient to obtain an estimated leakage coefficient;
[0026] The variance of the estimated echo signal at the current moment is calculated to obtain the first variance, and the variance of the echo cancellation signal at the current moment is calculated to obtain the second variance;
[0027] Divide the first variance by the second variance to obtain the quotient, and multiply the obtained quotient by the estimated leakage coefficient to calculate the estimated step size;
[0028] The minimum value between the estimated step size and the preset step size parameter is determined as the optimal step size.
[0029] To achieve the above objectives, the present invention also provides an echo cancellation device, the echo cancellation device comprising:
[0030] The echo simulation module is used to simulate the echo path of the far-end reference signal received at the current moment through an echo cancellation filter to obtain an estimated echo signal;
[0031] The echo cancellation module is used to cancel the near-end reference signal acquired at the current time using the estimated echo signal to obtain the echo-cancelled echo cancellation signal.
[0032] The determination module is used to determine the optimal step size of the echo cancellation filter at the current time, and to calculate the iterative weight vector based on the optimal step size and the current weight vector of the echo cancellation filter at the current time.
[0033] The update module is used to update the echo cancellation filter at the current time using the iterative weight vector to obtain the echo cancellation filter at the next time, and to perform echo cancellation on the near-end reference signal at the next time using the echo cancellation filter at the next time.
[0034] To achieve the above objectives, the present invention also provides an apparatus comprising: a memory, a processor, and an echo cancellation program stored in the memory and executable on the processor, wherein the echo cancellation program, when executed by the processor, implements the steps of the echo cancellation method as described above.
[0035] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing an echo cancellation program, which, when executed by a processor, implements the steps of the echo cancellation method as described above.
[0036] In this invention, the echo cancellation filter at the current moment simulates the echo path of the received far-end reference signal to obtain the estimated echo signal at the current moment. The estimated echo signal at the current moment is then used to cancel the near-end reference signal at the current moment to obtain the echo-cancelled signal at the current moment. The optimal step size of the echo cancellation filter at the current moment is determined, and an iterative weight vector is calculated based on the optimal step size and the current weight vector of the echo cancellation filter at the current moment. The iterative weight vector is used to update the echo cancellation filter at the current moment to obtain the echo cancellation filter at the next moment. The echo cancellation filter at the next moment is used to cancel the echo of the near-end reference signal at the next moment. Compared to dual-talk detection technology, which stops updating the adaptive filter when dual-talk occurs, this invention continuously adjusts the step size factor of the adaptive filter to adapt to the occurrence of dual-talk and changes in the echo path. This allows the adaptive filter to simulate the real echo path even when dual-talk occurs and the echo path changes, making the echo signal estimated by the adaptive filter closer to the actual echo signal, thereby enhancing the robustness of the adaptive echo cancellation algorithm for dual-talk. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the structure of the echo cancellation device in the hardware operating environment involved in the embodiments of the present invention;
[0038] Figure 2 This is a flowchart illustrating the first embodiment of the echo cancellation method of the present invention;
[0039] Figure 3 This is a schematic diagram of the functional modules of an embodiment of the echo cancellation device of the present invention.
[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0041] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0042] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0043] It should be noted that the echo cancellation device in this embodiment of the invention can be a headset, smartphone, personal computer, server, or other device, and no specific limitation is made here.
[0044] like Figure 1As shown, the echo cancellation device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or stable non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0045] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the echo cancellation device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0046] like Figure 1 As shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an echo cancellation program. The operating system is a program that manages and controls the device's hardware and software resources, supporting the operation of the echo cancellation program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the echo cancellation program stored in the memory 1005 and perform the following operations:
[0047] The estimated echo signal at the current moment is obtained by simulating the echo path of the far-end reference signal received at the current moment using the echo cancellation filter at the current moment.
[0048] The estimated echo signal at the current moment is used to cancel the near-end reference signal at the current moment to obtain the echo cancellation signal at the current moment;
[0049] Determine the optimal step size of the echo cancellation filter at the current moment, and calculate the iterative weight vector based on the optimal step size and the current weight vector of the echo cancellation filter at the current moment;
[0050] The echo cancellation filter at the current moment is updated using the iterative weight vector to obtain the echo cancellation filter at the next moment, and the echo cancellation filter at the next moment is used to cancel the echo of the near-end reference signal at the next moment.
[0051] Furthermore, the processor 1001 can also be used to call the echo cancellation program stored in the memory 1005 and perform the following operations:
[0052] The echo cancellation filter at the initial time is obtained by using the preset weights as the initial step size of the frequency domain adaptive filter.
[0053] Furthermore, before the operation of obtaining the initial echo cancellation filter by using the preset weights as the initial step size of the frequency domain adaptive filter, the processor 1001 can also call the echo cancellation program stored in the memory 1005 and perform the following operations:
[0054] Acquire scene sound signals in various voice scenarios;
[0055] The frequency domain adaptive filter is trained using the sound signals of each of the aforementioned scenes to obtain the convergence step size of each of the aforementioned scene sound signals when the frequency domain adaptive filter converges.
[0056] The preset weights are determined based on the convergence step size.
[0057] Furthermore, the operation of determining the preset weights based on each of the convergence step sizes includes:
[0058] Calculate the average value of each convergence step and use the average value as a preset weight.
[0059] Furthermore, before the operation of simulating the echo path of the far-end reference signal received at the current time using the echo cancellation filter at the current time to obtain the estimated echo signal at the current time, the processor 1001 can also call the echo cancellation program stored in the memory 1005 and perform the following operations:
[0060] The remote reference signal is obtained by performing nonlinear processing on the remote acquisition signal acquired at the current moment.
[0061] Furthermore, the operation of performing nonlinear processing on the remote acquisition signal acquired at the current time to obtain the remote reference signal includes:
[0062] The dynamic range of the remotely acquired signal is mapped to a preset dynamic range to obtain a remote reference signal.
[0063] Furthermore, the operation of determining the optimal step size of the echo cancellation filter at the current moment includes:
[0064] Calculate the estimated echo power of the estimated echo signal at the current moment, and calculate the output signal power of the echo cancellation signal at the current moment;
[0065] The estimated echo power and the output signal power are recursively smoothed to obtain a first correlation coefficient and a second correlation coefficient, wherein the first correlation coefficient is the cross-correlation coefficient between the estimated echo signal at the current time and the echo cancellation signal at the current time, and the second correlation coefficient is the autocorrelation coefficient of the echo cancellation signal at the current time.
[0066] The estimated leakage coefficient is obtained by dividing the first correlation coefficient by the second correlation coefficient.
[0067] The variance of the estimated echo signal at the current moment is calculated to obtain the first variance, and the variance of the echo cancellation signal at the current moment is calculated to obtain the second variance;
[0068] Divide the first variance by the second variance to obtain the quotient, and multiply the obtained quotient by the estimated leakage coefficient to calculate the estimated step size;
[0069] The minimum value between the estimated step size and the preset step size parameter is determined as the optimal step size.
[0070] Based on the above structure, various embodiments of the echo cancellation method are proposed.
[0071] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the echo cancellation method of the present invention.
[0072] This invention provides an embodiment of an echo cancellation method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order. In this embodiment, the executing entity of the echo cancellation method can be a device such as headphones, a personal computer, or a smartphone; this is not limited in this embodiment. For ease of description, the execution entity is omitted from the description of each embodiment. In this embodiment, the echo cancellation method includes:
[0073] Step S10: The estimated echo signal at the current moment is obtained by performing echo path simulation on the far-end reference signal received at the current moment through the echo cancellation filter at the current moment.
[0074] In a two-way call, the signal from the other party is called the far-end signal, and the signal you send to the other party is called the near-end signal. The far-end signal is converted into a sound signal by a speaker, and after multiple reflections in space, it produces an echo signal. The echo signal and the near-end signal are both picked up by the near-end microphone and transmitted to the far end. Therefore, the far end hears its own echo in addition to the near-end signal. Currently, echo cancellation is mainly achieved through adaptive filters. The specific process is as follows: the adaptive filter processes the far-end signal by estimating the characteristic parameters of the echo path to simulate the echo path and obtain a simulated echo signal (hereinafter referred to as the estimated echo signal for distinction). The estimated echo signal is then subtracted from the signal transmitted from the near-end microphone (hereinafter referred to as the near-end reference signal for distinction) to achieve echo cancellation.
[0075] When two-way communication occurs simultaneously, the near-end audio signal exhibits strong interference, degrading the performance of the adaptive filter used for echo cancellation. This can lead to filter divergence, causing the speaker at the far end to hear their own echo. Currently, two-way communication detection technology is mainly used to detect whether two-way communication has occurred. When two-way communication is detected, the update of the adaptive filter weights is stopped to prevent filter divergence. However, traditional two-way communication detection technology cannot distinguish between two-way communication and changes in the echo path. When the echo path changes, the update of the adaptive filter weights also stops, resulting in a significant difference between the estimated echo obtained by the adaptive filter and the actual echo after the change in the echo path, leading to poor echo cancellation.
[0076] In this embodiment, the adaptive filter used for echo cancellation is called the echo cancellation filter. In this embodiment, a frequency domain adaptive filter is used as the echo cancellation filter.
[0077] Specifically, in this embodiment, the estimated echo signal at the current moment is obtained by performing echo path simulation on the sound signal transmitted from the remote end (hereinafter referred to as the remote reference signal for distinction) received at the current moment through the echo cancellation filter at the current moment.
[0078] Step S20: Use the estimated echo signal at the current moment to cancel the near-end reference signal at the current moment to obtain the echo cancellation signal at the current moment;
[0079] In this embodiment, after obtaining the estimated echo signal at the current moment, the estimated echo signal at the current moment is used to cancel the near-end reference signal at the current moment to obtain the signal transmitted to the far end at the current moment (hereinafter referred to as the echo cancellation signal at the current moment for distinction). It can be understood that the near-end reference signal includes the speech signal of the near-end speech (hereinafter referred to as the near-end speech signal for distinction) and the echo signal obtained by the reflection of the sound signal played by the near-end microphone in the near-end space (hereinafter referred to as the true echo signal for distinction).
[0080] Step S30: Determine the optimal step size of the echo cancellation filter at the current time, and calculate the iterative weight vector based on the optimal step size and the current weight vector of the echo cancellation filter at the current time.
[0081] In this embodiment, after completing the echo cancellation at the current moment, the weights of the echo cancellation filter used to simulate the echo path at the current moment are updated. According to the weight iteration formula of the echo cancellation filter, the weights of the echo cancellation filter are related to the step size. For example, when the echo cancellation filter is an MDF filter (MultidelayBlock FrequencyDomain Adaptive Filter), the weight iteration formula of the echo cancellation filter is:
[0082]
[0083] in, It is the m-th weight vector, m = 1, 2, ..., M; μ B Indicates the block step size.
[0084] Therefore, in this embodiment, the optimal step size of the echo cancellation filter at the current moment is determined, and the weight vector of the echo cancellation filter at the next moment is calculated based on the optimal step size and the current weight vector of the echo cancellation filter at the current moment. For convenience, this is referred to as the iterative weight vector.
[0085] Step S40: Update the echo cancellation filter at the current time using the iterative weight vector to obtain the echo cancellation filter at the next time, and perform echo cancellation on the near-end reference signal at the next time using the echo cancellation filter at the next time.
[0086] In this embodiment, after determining the iterative weight vector, the echo cancellation filter at the current time is updated using the iterative weight vector to obtain the echo cancellation filter at the next time. The echo cancellation filter at the next time is then used to cancel the echo of the near-end reference signal at the next time.
[0087] Further, in one feasible implementation, step S30, the step of determining the optimal step size of the echo cancellation filter at the current moment, includes:
[0088] Step S301: Calculate the estimated echo power of the estimated echo signal at the current moment, and calculate the output signal power of the echo cancellation signal at the current moment;
[0089] In this embodiment, the step size of the adaptive filter is adjusted as a function of interference (near-end noise and dual-talk audio signals) and filter misalignment. Specifically, the optimal step size of the NLMS (Normalized Least Mean Square) adaptive filter in the presence of noise is first derived, and then applied to the frequency domain adaptive filter. The specific derivation process is as follows, where... To estimate the filter weights, W k Here, k is the actual filter weight, e(n) is the NLMS filter length, d(n) is the echo-cancelled signal, v(n) is the near-end reference signal, μ is the near-end speech signal, and n is the time step.
[0090] The formula for updating the weights of the NLMS filter is:
[0091]
[0092] Furthermore, based on the filter weight error: and d(n)=v(n)+∑ k w k From (n)x(nk), the weight error at the next time step can be derived:
[0093]
[0094] Based on the above formula and the filter offset calculation formula Λ(n)=∑ k δ k * (n)δ k (n) can be used to derive the filter offset at the next time step as:
[0095]
[0096] Assuming x(n) and v(n) are white noise signals and are uncorrelated, the expected value of the filter offset at the next time step can be obtained as follows:
[0097]
[0098] in,
[0099] Find the minimum of the expected value of the filter offset at the next time step by taking the partial derivative equal to 0.
[0100]
[0101] Therefore, the formula for calculating the optimal step size can be obtained as follows:
[0102]
[0103] Considering The mathematical expectation is equal to the variance of the residual echo. And the variance of the output signal is The optimal step size can then be approximated as:
[0104]
[0105] Extending this conclusion to frequency-domain adaptive filters, we can obtain the formula for calculating the optimal step size of the frequency filter:
[0106]
[0107] Where, μ max These are design parameters, with values less than or equal to 1, used to ensure that adjustments to the step size do not cause instability in the filter; The leakage coefficient is an estimate (hereinafter referred to as the estimated leakage coefficient) used to characterize the filter offset.
[0108] Specifically, the formula for estimating the leakage coefficient is as follows:
[0109]
[0110] Among them, the correlation value R EY (k,l),R YY (k,l) is obtained through recursive smoothing, and the following P E (k) represents the power of the echo cancellation signal, P Y (k) Estimate the power of the echo signal, specifically:
[0111] R EY (k,l)=(1-β(l))R EY (k,l-1)+β(l)P Y (k)P E (k);
[0112] R YY (k,l)=(1-β(l))R YY (k,l-1)+β(l)(P Y (k)) 2 ;
[0113] Therefore, in this embodiment, the power of the estimated echo signal at the current moment (hereinafter referred to as the estimated echo power for distinction) is calculated, and the power of the echo cancellation signal at the current moment (hereinafter referred to as the output signal power for distinction) is calculated.
[0114] Step S302: Recursively smooth the estimated echo power and the output signal power to obtain a first correlation coefficient and a second correlation coefficient, wherein the first correlation coefficient is the cross-correlation coefficient between the estimated echo signal at the current time and the echo cancellation signal at the current time, and the second correlation coefficient is the autocorrelation coefficient of the echo cancellation signal at the current time.
[0115] The estimated echo power and the output signal power are recursively smoothed to obtain the first correlation coefficient and the second correlation coefficient. The first correlation coefficient is the cross-correlation coefficient between the estimated echo signal and the echo cancellation signal at the current time, and the second correlation coefficient is the autocorrelation coefficient of the echo cancellation signal at the current time.
[0116] Step S303: Divide the first correlation coefficient by the second correlation coefficient to calculate the estimated leakage coefficient;
[0117] The estimated leakage coefficient is obtained by dividing the first correlation coefficient by the second correlation coefficient.
[0118] Step S304: Calculate the variance of the estimated echo signal at the current moment to obtain the first variance, and calculate the variance of the echo cancellation signal at the current moment to obtain the second variance;
[0119] In this embodiment, the instantaneous estimation formula (1) is used:
[0120]
[0121] Specifically, use estimate use Estimate E(k,l) 2 That is, using the estimated echo signal variance at the current time to estimate... The variance estimate E(k,l) of the echo-cancelled signal at the current time is used. 2
[0122] Specifically, in this embodiment, the variance of the estimated echo signal at the current moment is calculated to obtain the first variance, and the variance of the echo cancellation signal at the current moment is calculated to obtain the second variance.
[0123] Step S305: Divide the first variance by the second variance to obtain the quotient, and multiply the obtained quotient by the estimated leakage coefficient to calculate the estimated step size;
[0124] Divide the first variance by the second variance to obtain the quotient. Multiply the quotient by the estimated leakage coefficient to calculate the estimated step size corresponding to the target frequency (hereinafter referred to as the estimation step size for distinction).
[0125] Step S306: Determine the minimum value between the estimated step size and the preset step size parameter as the optimal step size.
[0126] The minimum value between the estimated step size and the preset step size parameter is determined as the optimal step size. That is:
[0127]
[0128] Where, μ max This is a design parameter (i.e., the preset step size parameter), whose value is always less than or equal to 1. It should be noted that, compared to using estimated compensation as the optimal step size factor, the preset step size parameter sets an upper limit on the step size factor, thereby ensuring that an excessively large step size factor will not cause the adaptive filter to become unstable.
[0129] It should be noted that since the spectrum of the residual echo (i.e., the sound signal after the real echo signal and the estimated echo signal cancel each other out) is highly correlated with the spectrum of the estimated echo, while there is no correlation between the spectrum of the estimated echo signal and the spectrum of the real echo signal, this embodiment determines the estimated leakage coefficient by linear regression between the power of the echo cancellation signal. This embodiment separates the effects of filter misalignment and two-way communication. Even if the estimation of the residual echo requires a longer time period, the optimal step size factor can respond quickly to the two-way communication, thereby ensuring the fast tracking capability of the adaptive filter and ensuring the effect of echo cancellation by the adaptive filter.
[0130] In this embodiment, the echo path of the received far-end reference signal at the current moment is simulated using the echo cancellation filter at the current moment to obtain the estimated echo signal at the current moment. The estimated echo signal at the current moment is used to cancel the near-end reference signal at the current moment to obtain the echo cancellation signal at the current moment. The optimal step size of the echo cancellation filter at the current moment is determined, and an iterative weight vector is calculated based on the optimal step size and the current weight vector of the echo cancellation filter at the current moment. The iterative weight vector is used to update the echo cancellation filter at the current moment to obtain the echo cancellation filter at the next moment. The echo cancellation filter at the next moment is used to cancel the echo of the near-end reference signal at the next moment.
[0131] Compared to dual-talk detection technology, which stops updating the adaptive filter when dual-talk occurs, this embodiment continuously adjusts the step size factor of the adaptive filter to adapt to the occurrence of dual-talk and changes in the echo path. This allows the adaptive filter to simulate the real echo path even when dual-talk occurs and the echo path changes, making the echo signal estimated by the adaptive filter closer to the actual echo signal, thereby improving the robustness of echo cancellation.
[0132] Furthermore, based on the first embodiment described above, a second embodiment of the echo cancellation algorithm of the present invention is proposed. In this embodiment, the echo cancellation method further includes:
[0133] Step S50: Use the preset weights as the initial step size of the frequency domain adaptive filter to obtain the echo cancellation filter at the initial time.
[0134] When the echo cancellation filter is initialized, the weights of all blocks are set to zero, and the step size is also zero. To facilitate a fast adaptive process, a constant is set as the initial step size in this embodiment (hereinafter referred to as the initial step size for convenience).
[0135] Specifically, in this embodiment, a preset weight (hereinafter referred to as the preset weight for distinction) is used as the initial step size of the frequency domain adaptive filter to obtain the echo cancellation filter at the initial time. In specific implementations, the preset weight can be set based on engineer experience, for example, the preset weight can be 0.25; the preset weight can also be obtained experimentally, and there is no limitation here.
[0136] Furthermore, in a feasible implementation, prior to step S40, the method further includes:
[0137] Step S60: Acquire scene sound signals for each voice scenario;
[0138] In this embodiment, preset weights are calculated based on actual experiments. Specifically, sound signals in various voice scenarios are acquired. For convenience, these are referred to as scene sound signals. In this specific embodiment, a voice scenario is a scenario in which voice calls can take place, including scenarios such as bedrooms, conference rooms, vehicles, and open outdoor environments.
[0139] Step S70: Train the frequency domain adaptive filter using the sound signals of each scene respectively to obtain the convergence step size of each sound signal of the scene when the frequency domain adaptive filter converges.
[0140] In this embodiment, the frequency domain adaptive filter is trained using sound signals from each scene to obtain the step size corresponding to each scene sound signal when the frequency domain adaptive filter converges (hereinafter referred to as the convergence step size for distinction).
[0141] Step S80: Determine the preset weights based on each of the convergence step sizes.
[0142] The preset weights are determined based on each convergence step size. In a specific implementation, a value can be taken from each convergence step size as the preset weight, for example, the median value of each convergence step size can be used as the preset weight; alternatively, the preset weights can be calculated based on each convergence step size, for example, the variance of each convergence step size can be used as the preset weight. The specific settings can be made according to actual needs and are not limited here.
[0143] It should be noted that this implementation method obtains the convergence step size by training the frequency domain adaptive filter in a real speech scenario, and determines preset weights based on each convergence step size. Compared to setting preset step sizes based on engineers' experience, the preset step sizes obtained in this implementation method are more in line with the actual situation, making the adaptive filter at the initial moment more stable.
[0144] Further, in one embodiment, step S80 includes:
[0145] Step S801: Calculate the average value of each convergence step and use the average value as a preset weight.
[0146] In this embodiment, preset weights are calculated based on each convergence step size. Specifically, the average value of each convergence step size is calculated and used as the preset weight. The specific calculation process is not detailed here. This embodiment uses the average value of each convergence step size as the preset weight. Compared to using arbitrary values from each convergence step size as the preset weight, the preset weight obtained in this embodiment will not cause the echo cancellation filter to converge too quickly or too slowly due to excessively extreme magnitudes, thus ensuring the stability of the echo cancellation filter and enhancing the robustness of the adaptive echo cancellation algorithm in dual-talk scenarios.
[0147] Furthermore, in a feasible implementation, before step S10, the method further includes:
[0148] Step S90: Perform nonlinear processing on the remote acquisition signal acquired at the current time to obtain the remote reference signal.
[0149] In this reverse implementation, the signal transmitted from the remote end is processed and then used as the reference signal for echo cancellation, so as to enhance the robustness of the adaptive cancellation algorithm to nonlinear differences in the echo path.
[0150] Specifically, the remote signal acquired at the current moment (hereinafter referred to as the remote acquisition signal for distinction) is subjected to nonlinear processing to obtain the remote reference signal. In specific implementations, the nonlinear processing can be wavelet denoising of the remote acquisition signal; alternatively, it can be performed on the remote acquisition signal using chaotic, fractal, or artificial neural network methods. The specific method can be set according to actual needs and is not limited here.
[0151] Further, in one embodiment, step S90 includes:
[0152] Step S901: Map the dynamic range of the remote acquisition signal to a preset dynamic range to obtain a remote reference signal.
[0153] In this embodiment, dynamic range control is performed on the remotely acquired signal. Specifically, the dynamic range of the remotely acquired signal is mapped to a preset dynamic range to obtain the remotely acquired signal. Here, dynamic range is the ratio of the maximum value to the minimum value of a variable signal (e.g., an audio signal).
[0154] The specific process of dynamic range control can be as follows: convert the remotely acquired signal from a linear value to a dB value; then perform gain calculation, that is, obtain the difference by passing the dB signal to the static characteristic equation; next, perform gain smoothing, that is, use attacktime (the time it takes for the gain signal to go from 10% to 90% of the final value), releasetime (the time it takes for the gain signal to go from 10% to 90% of the final value), and holdtime (the delay period before the gain is applied) as weights to smooth the signal; then, add gain compensation; convert the dB value to a linear value; and apply the calculated gain signal to the remotely acquired signal to obtain the remote reference signal.
[0155] It should be noted that by performing nonlinear processing on the remotely acquired signal before using it as the remote reference signal for echo cancellation, compared to directly using the remotely acquired signal as the reference signal for echo cancellation, this implementation method can enhance the robustness of the adaptive cancellation algorithm to nonlinear differences in the echo path.
[0156] In this embodiment, the echo cancellation filter at the initial moment is obtained by using the preset weight as the initial step size of the frequency domain adaptive filter. Compared with the adaptive filter starting to converge when the step size is zero, this embodiment can accelerate the convergence speed of the adaptive filter, making the adaptive filter stabilize quickly, thereby improving the echo cancellation effect.
[0157] Furthermore, embodiments of the present invention also propose an echo cancellation device, referring to... Figure 3 The echo cancellation device includes:
[0158] The echo simulation module 10 is used to simulate the echo path of the far-end reference signal received at the current moment through an echo cancellation filter to obtain an estimated echo signal.
[0159] The echo cancellation module 20 is used to cancel the near-end reference signal acquired at the current time using the estimated echo signal to obtain the echo-cancelled echo signal;
[0160] The determining module 30 is used to determine the optimal step size of the echo cancellation filter at the current time, and to calculate the iterative weight vector based on the optimal step size and the current weight vector of the echo cancellation filter at the current time.
[0161] The update module 40 is used to update the echo cancellation filter at the current time using the iterative weight vector to obtain the echo cancellation filter at the next time, and to perform echo cancellation on the near-end reference signal at the next time using the echo cancellation filter at the next time.
[0162] Furthermore, the echo cancellation device also includes a setting module, which is used for:
[0163] The echo cancellation filter at the initial time is obtained by using the preset weights as the initial step size of the frequency domain adaptive filter.
[0164] Furthermore, the setting module is also used for:
[0165] Acquire scene sound signals in various voice scenarios;
[0166] The frequency domain adaptive filter is trained using the sound signals of each of the aforementioned scenes to obtain the convergence step size of each of the aforementioned scene sound signals when the frequency domain adaptive filter converges.
[0167] The preset weights are determined based on the convergence step size.
[0168] Furthermore, the setting module is also used for:
[0169] Calculate the average value of each convergence step and use the average value as a preset weight.
[0170] Furthermore, the echo cancellation device also includes a processing module, which is used for:
[0171] The remote reference signal is obtained by performing nonlinear processing on the remote acquisition signal acquired at the current moment.
[0172] Furthermore, the processing module is also used for:
[0173] The dynamic range of the remotely acquired signal is mapped to a preset dynamic range to obtain a remote reference signal.
[0174] Furthermore, the determining module 30 is also used for:
[0175] Calculate the estimated echo power of the estimated echo signal at the current moment, and calculate the output signal power of the echo cancellation signal at the current moment;
[0176] The estimated echo power and the output signal power are recursively smoothed to obtain a first correlation coefficient and a second correlation coefficient, wherein the first correlation coefficient is the cross-correlation coefficient between the estimated echo signal at the current time and the echo cancellation signal at the current time, and the second correlation coefficient is the autocorrelation coefficient of the echo cancellation signal at the current time.
[0177] The estimated leakage coefficient is obtained by dividing the first correlation coefficient by the second correlation coefficient.
[0178] The variance of the estimated echo signal at the current moment is calculated to obtain the first variance, and the variance of the echo cancellation signal at the current moment is calculated to obtain the second variance;
[0179] Divide the first variance by the second variance to obtain the quotient, and multiply the obtained quotient by the estimated leakage coefficient to calculate the estimated step size;
[0180] The minimum value between the estimated step size and the preset step size parameter is determined as the optimal step size.
[0181] All embodiments of the echo cancellation device of the present invention can refer to the various embodiments of the echo cancellation method of the present invention, and will not be repeated here.
[0182] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing an echo cancellation program, which, when executed by a processor, implements the steps of the echo cancellation method described below.
[0183] The various embodiments of the echo cancellation device and computer-readable storage medium of the present invention can be referred to the various embodiments of the echo cancellation method of the present invention, and will not be repeated here.
[0184] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0185] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0186] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0187] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An echo cancellation method, characterized by, The echo cancellation method comprises the following steps: an estimated echo signal at the current time is obtained by performing echo path simulation on the remote reference signal received at the current time through the echo cancellation filter at the current time; an echo cancellation signal at the current time is obtained by canceling the near-end reference signal at the current time using the estimated echo signal at the current time; an optimal step size of the echo cancellation filter at the current time is determined, and an iteration weight vector is calculated based on the optimal step size and a current weight vector of the echo cancellation filter at the current time; the echo cancellation filter at the current time is updated using the iteration weight vector to obtain an echo cancellation filter at the next time, and the near-end reference signal at the next time is subjected to echo cancellation through the echo cancellation filter at the next time; wherein the echo cancellation method further comprises: acquiring scene sound signals in each speech scene; training the frequency domain adaptive filter using each of the scene sound signals to obtain a convergence step size corresponding to each of the scene sound signals when the frequency domain adaptive filter converges; determining a preset weight value according to each of the convergence step sizes; using the preset weight value as an initial step size of the frequency domain adaptive filter to obtain an echo cancellation filter at an initial time.
2. The echo cancellation method of claim 1, wherein, The step of determining the preset weight value according to each of the convergence step sizes comprises: calculating an average value of each of the convergence step sizes, and using the average value as the preset weight value.
3. The echo cancellation method of claim 1, wherein, Before the step of obtaining the estimated echo signal at the current time by performing echo path simulation on the remote reference signal received at the current time through the echo cancellation filter at the current time, the method further comprises: performing nonlinear processing on the remote collection signal collected at the current time to obtain the remote reference signal.
4. The echo cancellation method of claim 3, wherein, The step of performing nonlinear processing on the remote collection signal collected at the current time to obtain the remote reference signal comprises: mapping a dynamic range of the remote collection signal to a preset dynamic range to obtain the remote reference signal.
5. The echo cancellation method according to any one of claims 1 to 4, wherein, The step of determining the optimal step size of the echo cancellation filter at the current time comprises: calculating an estimated echo power of the estimated echo signal at the current time, and calculating an output signal power of the echo cancellation signal at the current time; performing recursive smoothing on the estimated echo power and the output signal power to obtain a first correlation coefficient and a second correlation coefficient, wherein the first correlation coefficient is a cross-correlation coefficient between the estimated echo signal at the current time and the echo cancellation signal at the current time, and the second correlation coefficient is an autocorrelation coefficient of the echo cancellation signal at the current time; dividing the first correlation coefficient by the second correlation coefficient to obtain an estimated leakage coefficient; calculating a first variance of the estimated echo signal at the current time to obtain a first variance, and calculating a second variance of the echo cancellation signal at the current time to obtain a second variance; dividing the first variance by the second variance to obtain a quotient, and multiplying the obtained quotient by the estimated leakage coefficient to obtain an estimated step size; determining the minimum value between the estimated step size and a preset step size parameter as the optimal step size.
6. An echo cancellation device, characterized by The device comprises: an echo simulation module, configured to simulate an echo path of a far-end reference signal received at a current time moment by an echo cancellation filter to obtain an estimated echo signal; an echo cancellation module, configured to cancel a near-end reference signal collected at the current time moment by using the estimated echo signal to obtain an echo-canceled echo cancellation signal; a determination module, configured to determine an optimal step size of the echo cancellation filter at the current time moment, and calculate an iteration weight vector based on the optimal step size and a current weight vector of the echo cancellation filter at the current time moment; an update module, configured to update the echo cancellation filter at the current time moment by using the iteration weight vector to obtain an echo cancellation filter at a next time moment, and perform echo cancellation on a near-end reference signal at the next time moment by using the echo cancellation filter at the next time moment. The echo cancellation device further includes a setting module, which is configured to: obtain scene sound signals in each speech scene; train the frequency-domain adaptive filter by using each of the scene sound signals respectively to obtain a convergence step size corresponding to each of the scene sound signals when the frequency-domain adaptive filter converges; determine a preset weight value according to each of the convergence step sizes; obtain an echo cancellation filter at an initial time moment by using the preset weight value as an initial step size of the frequency-domain adaptive filter.
7. An echo cancellation device, characterized by The device includes a memory, a processor, and an echo cancellation program stored on the memory and executable on the processor, and the echo cancellation program is configured to implement the steps of the echo cancellation method according to any one of claims 1 to 5.
8. A storage medium, characterized by The storage medium has an echo cancellation program stored thereon, and the echo cancellation program, when executed by a processor, implements the steps of the echo cancellation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Variable-step-size hearing aid adaptive echo cancellation device and echo cancellation method
CN111916099A
Function connection type adaptive nonlinear echo cancellation method
CN112037811A
Voice signal processing method and device, electronic equipment and storage medium
CN114299998A