An echo cancellation method, system, and related devices
By calculating and correcting the initial step size factor to obtain the target filter coefficients, the problem of slow convergence speed of adaptive filtering is solved, and the efficiency and effect of echo cancellation are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN XUNFEI SUPER BRAIN INFORMATION TECH CO LTD
- Filing Date
- 2022-12-06
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, adaptive filtering has a slow convergence speed, resulting in low echo cancellation efficiency.
The initial step size factor is calculated based on the historical sound signal and filter coefficients from the previous moment, and then corrected using correction coefficients to obtain the target step size factor. The target filter coefficients are then calculated in conjunction with the current microphone and speaker signals to eliminate echo.
It improves the efficiency of adaptive filtering, optimizes echo cancellation, and achieves faster convergence speed and higher cancellation efficiency.
Smart Images

Figure CN116092463B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of filtering technology, and in particular to an echo cancellation method, system and related apparatus. Background Technology
[0002] In real-life situations, during phone calls, the sound emitted by the speaker can be captured by the microphone, causing the speaker to hear their own voice and negatively impacting the user experience. Therefore, echo cancellation is necessary to optimize the user experience during calls. Current echo cancellation technology works by coupling the microphone and speaker in a system, removing the sound emitted by the speaker from the microphone. However, current adaptive filtering technologies have slow convergence speeds, resulting in low efficiency in echo cancellation. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide an echo cancellation method, system, and related apparatus that can improve the working efficiency of adaptive filtering and optimize the echo cancellation effect.
[0004] To solve the above-mentioned technical problems, one technical solution adopted in this application is: providing an echo cancellation method, comprising: determining an initial step size factor of the filter at the previous moment based on the historical sound signal and historical filter coefficients at the previous moment; correcting the initial step size factor at the previous moment using a correction coefficient to obtain a target step size factor, and obtaining the target filter coefficient at the current moment based on the target step size factor and the historical filter coefficients; wherein the absolute value of the correction coefficient at the current moment is less than the absolute value of the correction coefficient at the previous moment; and obtaining the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients at the current moment.
[0005] The step of determining the initial step size factor of the filter at the previous moment based on the historical audio signal and historical filter coefficients at the previous moment includes: obtaining the scaling factor, historical microphone signal, historical speaker signal, and historical filter coefficients at the previous moment; wherein the historical audio signal includes the historical microphone signal and the historical speaker signal; obtaining the updated historical filter coefficients at the previous moment based on the scaling factor and the historical filter coefficients; and obtaining the initial step size factor at the previous moment based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal.
[0006] The step of obtaining the updated historical filter coefficients based on the scaling factor and the historical filter coefficients includes: quantizing the historical filter coefficients at the previous moment to obtain quantized values corresponding to the historical filter coefficients; and multiplying the quantized values by the scaling factor at the previous moment to obtain the updated historical filter coefficients.
[0007] The proportionality coefficient is negatively correlated with the correction coefficient.
[0008] The step of obtaining the initial step size factor of the previous moment based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal further includes: obtaining the initial filter coefficients of the current moment based on the initial step size factor of the previous moment, the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal; obtaining the rate of change between the historical filter coefficients and the initial filter coefficients; and using the product of the rate of change and the initial step size factor as the updated initial step size factor.
[0009] The step of correcting the initial step size factor at the previous time step using a correction coefficient to obtain a target step size factor, and obtaining the target filter coefficient at the current time based on the target step size factor and the historical filter coefficients, includes: multiplying the correction coefficient at the previous time step step step, the initial step size factor at the previous time step, and the reciprocal of the scaling factor at the previous time step to obtain the target step size factor; and obtaining the target filter coefficient at the current time based on the target step size factor and the historical filter coefficients.
[0010] The step of obtaining the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients at the current moment includes: obtaining an error signal at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients; and using the difference between the current microphone signal and the error signal as the target sound signal at the current moment.
[0011] To solve the above-mentioned technical problems, another technical solution adopted in this application is: providing an echo cancellation system, comprising: a first obtaining module, used to determine the initial step size factor of the filter at the previous moment based on the historical sound signal at the previous moment; a correction module, used to correct the initial step size factor at the previous moment using a correction coefficient to obtain a target step size factor, and obtain the target filter coefficient at the current moment based on the target step size factor; wherein, the absolute value of the correction coefficient at the current moment is less than the absolute value of the correction coefficient at the previous moment; and a second obtaining module, used to obtain the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficient at the current moment.
[0012] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the echo cancellation method in the above-mentioned technical solution.
[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium storing program instructions that can be executed by a processor, wherein the program instructions are used to implement the echo cancellation method in the above-mentioned technical solution.
[0014] The beneficial effects of this application are as follows: Unlike the prior art, the echo cancellation method proposed in this application calculates the initial step size factor of the filter at the previous moment based on the historical sound signal at the previous moment, and corrects the initial step size factor using the corresponding correction coefficient, so that the convergence speed of the target filter coefficients at the current moment obtained based on the corrected initial step size factor is faster, thereby improving the working efficiency of adaptive filtering and optimizing the echo cancellation effect. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0016] Figure 1 This is a flowchart illustrating one embodiment of the echo cancellation method of this application;
[0017] Figure 2 This is a schematic diagram of one implementation method for the filter coefficients;
[0018] Figure 3 This is a flowchart illustrating another embodiment of the echo cancellation method of this application;
[0019] Figure 4 This is a flowchart illustrating another implementation method following step S202.
[0020] Figure 5 This is a schematic diagram of one embodiment of the echo cancellation system of this application.
[0021] Figure 6 This is a schematic diagram of the structure of one embodiment of the electronic device of this application;
[0022] Figure 7 This is a schematic diagram of one embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the echo cancellation method of this application, which includes the following steps. The algorithm for the filter coefficients mentioned in the echo cancellation method proposed in this application can be the Least Mean Square (LMS) algorithm or the Normalized Least Mean Square (NLMS) algorithm, etc. For ease of description, the following description uses the NLMS algorithm as an example to describe the filter coefficient update process. It should be noted that the step numbers are for simplification only and are not intended to limit the execution order of the steps. The execution order of the steps in this embodiment can be arbitrarily changed without departing from the technical concept of this application.
[0025] S101: Determine the initial step size factor of the filter in the previous moment based on the historical sound signal and historical filter coefficients of the previous moment.
[0026] In this embodiment, step S101 includes obtaining the historical audio signal from the previous moment and the historical filter coefficients from the previous moment. The historical audio signal includes the historical microphone signal and the historical speaker signal.
[0027] Furthermore, based on the obtained historical microphone signals, historical speaker signals, and historical filter coefficients, the historical error signal for the previous moment is calculated. The specific calculation formula is as follows:
[0028]
[0029] Where e1(n) represents the historical error signal from the previous moment, y(n) represents the historical microphone signal, and x(n) represents the historical speaker signal. This represents the historical filter coefficients from the previous moment.
[0030] Furthermore, in response to obtaining the historical error signal, historical filter coefficients, and historical sound signal, the initial step size factor for the previous moment is determined using the NLMS algorithm. The specific calculation formula is as follows:
[0031]
[0032] Where 1(n) represents the initial step size factor at the previous time step, and ||x(n)|| 2 This represents the square of the Euclidean norm of the historical loudspeaker signal. The initial step size factor from the previous time step is calculated to aid in the calculation of the filter coefficients for the current time step, thus achieving echo cancellation.
[0033] Alternatively, in another implementation, the initial step size factor of the previous time step can also be calculated using the following formula.
[0034]
[0035] Where C is an infinite decimal to prevent the denominator of the initial step size factor from being 0; μ′ is a positive parameter, which is set to prevent the rate of change between the filter coefficients at different times from being too large during the calculation of the filter coefficients.
[0036] It should be noted that in practical applications, the initial step size factor of the previous moment is obtained by combining historical error signals, historical filter coefficients and historical sound signals. For detailed calculation process, please refer to the NLMS algorithm. This application will not elaborate on this in detail.
[0037] S102: Correct the initial step size factor from the previous time step using correction coefficients to obtain the target step size factor, and obtain the target filter coefficients for the current time step based on the target step size factor and historical filter coefficients. The absolute value of the correction coefficients at the current time step is less than the absolute value of the correction coefficients from the previous time step.
[0038] In this embodiment, step S102 includes: obtaining the correction coefficient from the previous time step, and multiplying the correction coefficient from the previous time step by the initial step size factor from the previous time step to obtain the target step size factor from the previous time step. The specific calculation formula for the target step size factor is as follows:
[0039]
[0040] Where μ2(n) represents the target step size factor of the previous time step, and E(n) represents the correction coefficient of the previous time step.
[0041] Furthermore, for the correction coefficients at different times, the absolute value of the correction coefficient at the current time is less than the absolute value of the correction coefficient at the previous time, i.e., |E(n+1)| < |E(n)|. And, in this embodiment, the formula for calculating the correction coefficient is as follows:
[0042] E(n)=γ n
[0043] Where α and γ are preset parameters, and 0 < γ < 1.
[0044] In this embodiment, α and γ can be obtained by back-calculation based on the results of multiple experiments. By setting the correction coefficients to increase or decrease exponentially over time, the initial step size factor at different times is multiplied by the corresponding correction coefficient, thereby accelerating the convergence speed and improving the efficiency of the filter.
[0045] Furthermore, based on the target step size factor and historical filter coefficients, the target filter coefficients at the current time are obtained. The formula for calculating the target filter coefficients is as follows:
[0046]
[0047] in, The * denotes the target filter coefficients, and the asterisk (*) indicates the complex conjugate.
[0048] In one specific implementation, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating one implementation of filter coefficient mapping. In practical applications, factors such as the movement of people or objects within a space, or changes in temperature, can easily cause filter coefficients to vary over time. Therefore, to enable the filter to adapt to environmental changes, a faster convergence speed is needed. Figure 2 The filter shown multiplies the filter coefficients at different times with their corresponding correction coefficients. For example, for a first filter coefficient that is greater than 0 and continuously decreasing, it is multiplied by the first correction coefficient at the corresponding time to accelerate the convergence of the first filter coefficient; wherein the first correction coefficient is greater than 0, and the first correction coefficient at the previous time is greater than the first correction coefficient at the current time. Alternatively, for a second filter coefficient that is less than 0 and continuously increasing, it is multiplied by the second correction coefficient at the corresponding time; wherein the second correction coefficient is less than 0, and the second correction coefficient at the previous time is less than the second correction coefficient at the current time.
[0049] S103: Based on the current microphone signal, the current speaker signal, and the target filter coefficients at the current moment, obtain the target sound signal after echo cancellation at the current moment.
[0050] In this embodiment, step S103 includes: acquiring the current microphone signal and the current speaker signal at the current moment, and combining them with the target filter coefficients obtained in step S102 above to obtain the current error signal at the current moment. The specific calculation formula is as follows:
[0051]
[0052] Where e2(n+1) represents the current error signal, y(n+1) represents the current microphone signal, and x(n+1) represents the current speaker signal.
[0053] Furthermore, the difference between the current microphone signal and the current error signal is used as the target sound signal at the current moment, and the target sound signal is output through the corresponding speaker to improve the efficiency of echo cancellation.
[0054] The echo cancellation method proposed in this application calculates the initial step size factor of the filter based on the historical sound signal of the previous moment, and then corrects the initial step size factor using the corresponding correction coefficient. This makes the convergence speed of the target filter coefficients obtained at the current moment based on the corrected initial step size factor faster, thereby improving the working efficiency of adaptive filtering and optimizing the echo cancellation effect.
[0055] In another implementation, please refer to Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the echo cancellation method proposed in this application. In response to step S102 of the above embodiment, where the initial step size of the filter is corrected using correction coefficients to accelerate filter convergence, this method can effectively speed up the filter's convergence. However, since the tail coefficients of the filter are small, accelerating convergence can easily lead to the updated amount of the corrected tail filter coefficients being significantly affected by quantization errors. Therefore, to ensure the filter's efficiency, while accelerating the convergence of the initial filter coefficients, it is necessary to appropriately amplify the tail filter coefficients to reduce the impact of quantization errors on the filter. To further improve the efficiency of echo cancellation, the echo cancellation method proposed in this embodiment includes:
[0056] S201: Obtain the scaling factor, historical microphone signal, historical speaker signal, and historical filter coefficients from the previous moment. The historical audio signal includes the historical microphone signal and the historical speaker signal.
[0057] In this embodiment, the scaling factor decays exponentially over time, meaning the scaling factor at the current moment is less than the scaling factor at the previous moment. The specific calculation formula is as follows:
[0058] S(n) = 2 -n
[0059] Where S(n) represents the scaling factor of the previous time step.
[0060] S202: Based on the scaling factor and historical filter coefficients, obtain the updated historical filter coefficients from the previous time step.
[0061] In one embodiment, in response to obtaining the scaling factor and historical filter coefficients from the previous time step, the historical filter coefficients are multiplied by their corresponding scaling factors to obtain the updated historical filter coefficients from the previous time step. Multiplying the scaling factor from the previous time step by its corresponding scaling factor reduces the impact of errors on the filter coefficients, thereby improving the stability of the filter and contributing to improved echo cancellation efficiency. The specific formula for updating the historical filter coefficients is as follows:
[0062]
[0063] in, This represents the updated historical filter coefficients.
[0064] In another embodiment, the implementation process of step S202 further includes: quantizing the historical filter coefficients of the previous moment to obtain the quantized values corresponding to the historical filter coefficients of the previous moment.
[0065] Furthermore, the obtained quantized value is multiplied by the scaling factor from the previous time step to obtain the updated historical filter coefficients. By obtaining the quantized values corresponding to the historical filter coefficients, the influence of errors is reduced, thereby improving the accuracy of obtaining the filter coefficients at the current time step.
[0066] S203: Based on the updated historical filter coefficients, historical microphone signals, and historical speaker signals, obtain the initial step size factor for the previous moment.
[0067] In this embodiment, step S203 includes: firstly, calculating the historical error signal of the previous moment based on the updated historical filter coefficients, historical microphone signal, and historical speaker signal. The specific calculation formula is as follows.
[0068]
[0069] Among them, e s (n) Historical error signal obtained based on the updated historical filter coefficients.
[0070] Furthermore, the initial step size factor for the previous moment is calculated based on the obtained historical error signal, the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal. The process of calculating the initial step size factor can be referred to step S101 in the above embodiment, and will not be described in detail here.
[0071] In one embodiment, after step S203, the method further includes: correcting the initial step size factor of the previous time step using correction coefficients to obtain the target step size factor, and obtaining the target filter coefficients of the current time step step based on the target step size factor.
[0072] Specifically, the updated target step size factor is obtained by multiplying the correction coefficient from the previous time step, the initial step size factor from the previous time step, and the reciprocal of the scaling factor from the previous time step. The process of obtaining the initial step size factor and the correction coefficient from the previous time step can be referred to the above implementation method and will not be elaborated here. The specific calculation formula for the target step size factor is as follows:
[0073]
[0074] Where, S(n) -1 It represents the reciprocal of the proportionality coefficient at the previous moment.
[0075] In this embodiment, in response to the exponential decay of the scaling factor, the initial step size factor is updated using the reciprocal of the scaling factor. This allows for the appropriate amplification of the filter coefficients at the tail of the filter, thereby reducing the impact of quantization error on the filter and improving the filter's stability.
[0076] Furthermore, based on the target step size factor and historical filter coefficients, the target filter coefficients at the current moment are obtained. The specific calculation formula is as follows.
[0077]
[0078] Furthermore, after obtaining the target filter coefficients at the current moment, the target sound signal after echo cancellation at the current moment is obtained based on the target filter coefficients. The specific process can be referred to step S103 in the above embodiment.
[0079] Optionally, in other embodiments, to reduce the impact of quantization error on the filter, after correcting the initial step size of the filter at the previous time step using a correction coefficient, the step size factor corresponding to the filter coefficients after a preset time step is multiplied by a preset parameter. The preset parameter is a constant value greater than 1, used to appropriately amplify the filter tail coefficients to improve the filter's stability.
[0080] In another implementation, please refer to Figure 4 , Figure 4 This is a flowchart illustrating another implementation method following step S202. Specifically, after step S202, the method further includes:
[0081] S301: Based on the initial step size factor of the previous moment, the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal, obtain the initial filter coefficients of the current moment.
[0082] In this embodiment, step S301 includes: acquiring the initial step size factor, updated historical filter coefficients, historical microphone signal, and historical speaker signal from the previous moment, and determining the initial step size factor from the previous moment using the NLMS algorithm. The process of calculating the initial step size factor and obtaining the updated historical filter coefficients can be referred to steps S201 to S202 in the above embodiment, and will not be described in detail here.
[0083] Furthermore, using the initial step size factor and the obtained updated historical filter coefficients, historical microphone signals, and historical speaker signals, the initial filter coefficients for the current moment are calculated. These initial filter coefficients are theoretical values calculated using the NLMS algorithm and have not been corrected by corresponding correction coefficients. By calculating these initial filter coefficients, the magnitude of the filter coefficient change between the previous and current moments is estimated. This magnitude of change is then used to correct the filter coefficients for the current moment, further improving the filter's efficiency. The specific calculation formula is as follows.
[0084]
[0085] in, This represents the initial filter coefficients at the current time.
[0086] S302: Obtain the rate of change between the historical filter coefficients and the initial filter coefficients, and use the product of the rate of change and the initial step size factor as the updated initial step size factor.
[0087] In this embodiment, the implementation process of step S302 includes: calculating the historical filter coefficients. and initial filter coefficients The rate of change between [the two values]. Multiply the rate of change by the initial step size factor obtained in step S301, and use the resulting product as the updated initial step size factor. The rate of change can be calculated by taking the derivative. After obtaining the rate of change, the formula for calculating the initial step size factor is as follows.
[0088]
[0089] Where μ1′(n) represents the updated initial step size factor, and m represents the rate of change.
[0090] Optionally, in other embodiments, after obtaining the initial filter coefficients at the current time, the ratio of the historical filter coefficients to the initial filter coefficients is obtained, and the ratio is multiplied by the initial step size factor obtained in step S301 to obtain the updated initial step size factor.
[0091] S303: Correct the initial step size factor of the previous time step using the correction coefficient to obtain the target step size factor, and obtain the target filter coefficient of the current time step step based on the target step size factor.
[0092] In this embodiment, step S303 includes obtaining the target step size factor based on the reciprocal of the scaling factor, the correction factor from the previous time step, and the updated initial step size factor obtained in step S302. The specific calculation formula is as follows:
[0093]
[0094] Furthermore, based on the obtained target step size factor, the target filter coefficients at the current time are calculated. The specific calculation formula is as follows:
[0095]
[0096] In one embodiment, after step S303, the method further includes: obtaining the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients at the current moment. The specific process can be referred to step S103 in the above embodiment.
[0097] Please see Figure 5 , Figure 5 This is a schematic diagram of one embodiment of the echo cancellation system proposed in this application. The echo cancellation system includes an acquisition module 10, a correction module 20, and a processing module 30 that are coupled to each other.
[0098] Specifically, module 10 is used to determine the initial step size factor of the filter in the previous moment based on the historical sound signal and historical filter coefficients of the previous moment.
[0099] In one implementation scenario, the obtaining module 10 is further used to obtain the scaling factor, historical microphone signal, historical speaker signal, and historical filter coefficients from the previous time step. The historical audio signal includes the historical microphone signal and the historical speaker signal. Based on the scaling factor and the historical filter coefficients, the updated historical filter coefficients from the previous time step are obtained. Based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal, the initial step size factor from the previous time step is obtained.
[0100] In one implementation scenario, module 10 quantizes the historical filter coefficients of the previous moment to obtain the quantized values corresponding to the historical filter coefficients; the quantized values are multiplied by the scaling factor of the previous moment to obtain the updated historical filter coefficients.
[0101] In one implementation scenario, after obtaining the initial filter coefficients at the current moment based on the updated historical filter coefficients, historical microphone signals, and historical speaker signals, the module 10 includes: obtaining the initial filter coefficients at the current moment based on the initial step size factor of the previous moment, the updated historical filter coefficients, historical microphone signals, and historical speaker signals; obtaining the rate of change between the historical filter coefficients and the initial filter coefficients; and using the product of the rate of change and the initial step size factor as the updated initial step size factor.
[0102] The correction module 20 is used to correct the initial step size factor of the previous time step using the correction coefficient to obtain the target step size factor, and to obtain the target filter coefficient of the current time step based on the target step size factor and the historical filter coefficients; wherein the absolute value of the correction coefficient of the current time step ...
[0103] In one implementation scenario, the scaling factor at the current moment is less than the scaling factor at the previous moment.
[0104] In one implementation scenario, the correction module 20 uses a correction coefficient to correct the initial step size factor of the previous moment to obtain the target step size factor, and obtains the target filter coefficient of the current moment based on the target step size factor and the historical filter coefficients. This includes: multiplying the correction coefficient of the previous moment, the initial step size factor of the previous moment, and the reciprocal of the scaling factor of the previous moment to obtain the target step size factor; and obtaining the target filter coefficient of the current moment based on the target step size factor and the historical filter coefficients.
[0105] The processing module 30 is used to obtain the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal and the target filter coefficients at the current moment.
[0106] In one implementation scenario, the processing module 30 obtains the error signal at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients; and uses the difference between the current microphone signal and the error signal as the target sound signal at the current moment.
[0107] Please see Figure 6 , Figure 6This is a schematic diagram of the structure of an embodiment of the electronic device of this application. The electronic device includes a memory 40 and a processor 50 coupled to each other. The memory 40 stores program instructions, and the processor 50 is used to execute the program instructions to implement the steps of the echo cancellation method in the above embodiment. Specifically, the electronic device includes, but is not limited to, desktop computers, laptops, tablets, servers, etc., and is not limited thereto. In addition, the processor 50 may also be called a CPU (Center Processing Unit). The processor 50 may be an integrated circuit chip with signal processing capabilities. The processor 50 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. In addition, the processor 50 may be implemented by integrated circuit chips.
[0108] Please see Figure 7 , Figure 7 This is a schematic diagram of one embodiment of the computer-readable storage medium proposed in this application. The computer-readable storage medium 60 stores program instructions 70 that can be executed by a processor. The program instructions 70 are used to implement the echo cancellation method in any of the above embodiments.
[0109] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0112] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An echo cancellation method, characterized in that, include: Based on the historical sound signal and historical filter coefficients of the previous moment, determine the initial step size factor of the filter at the previous moment. The initial step size factor at the previous time step is corrected using a correction coefficient to obtain a target step size factor, and the target filter coefficient at the current time step is obtained based on the target step size factor and the historical filter coefficients; wherein the absolute value of the correction coefficient at the current time step is less than the absolute value of the correction coefficient at the previous time step. Based on the current microphone signal, the current speaker signal, and the target filter coefficients at the current moment, obtain the target sound signal after echo cancellation at the current moment; The step of determining the initial step size factor of the filter at the previous moment based on the historical audio signal and historical filter coefficients at the previous moment includes: obtaining the scaling factor, historical microphone signal, historical speaker signal, and historical filter coefficients at the previous moment; wherein the historical audio signal includes the historical microphone signal and the historical speaker signal, and the scaling factor decays exponentially over time; obtaining the updated historical filter coefficients at the previous moment based on the scaling factor and the historical filter coefficients; and obtaining the initial step size factor at the previous moment based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal.
2. The method according to claim 1, characterized in that, The step of obtaining the updated historical filter coefficients based on the scaling factor and the historical filter coefficients includes: The historical filter coefficients at the previous moment are quantized to obtain the quantized values corresponding to the historical filter coefficients. The quantized value is multiplied by the scaling factor of the previous time step to obtain the updated historical filter coefficients.
3. The method according to claim 1, characterized in that, The scaling factor at the current moment is less than the scaling factor at the previous moment.
4. The method according to claim 1, characterized in that, After obtaining the initial step size factor of the previous moment based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal, the method further includes: Based on the initial step size factor of the previous moment, the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal, the initial filter coefficients of the current moment are obtained. Obtain the rate of change between the historical filter coefficients and the initial filter coefficients, and use the product of the rate of change and the initial step size factor as the updated initial step size factor.
5. The method according to claim 1 or 4, characterized in that, The step of correcting the initial step size factor at the previous time step using a correction coefficient to obtain the target step size factor, and obtaining the target filter coefficient at the current time based on the target step size factor and the historical filter coefficients, includes: The target step size factor is obtained by multiplying the correction coefficient of the previous time step, the initial step size factor of the previous time step, and the reciprocal of the scaling factor of the previous time step. Based on the target step size factor and the historical filter coefficients, the target filter coefficients at the current moment are obtained.
6. The method according to claim 1, characterized in that, The process of obtaining the echo-free target sound signal at the current moment based on the current microphone signal, the current speaker signal, and the target filter coefficients includes: Based on the current microphone signal, the current speaker signal, and the target filter coefficients, the current error signal at the current moment is obtained; The difference between the current microphone signal and the current error signal is taken as the target sound signal at the current moment.
7. An echo cancellation system, characterized in that, include: The first acquisition module is used to determine the initial step size factor of the filter at the previous moment based on the historical sound signal and historical filter coefficients at the previous moment. The correction module is used to correct the initial step size factor at the previous time step using a correction coefficient to obtain a target step size factor, and to obtain the target filter coefficient at the current time step based on the target step size factor and the historical filter coefficients; wherein the absolute value of the correction coefficient at the current time step is less than the absolute value of the correction coefficient at the previous time step. The second obtaining module is used to obtain the target sound signal after echo cancellation at the current moment based on the current microphone signal, the current speaker signal and the target filter coefficients at the current moment; The step of determining the initial step size factor of the filter at the previous moment based on the historical audio signal and historical filter coefficients at the previous moment includes: obtaining the scaling factor, historical microphone signal, historical speaker signal, and historical filter coefficients at the previous moment; wherein the historical audio signal includes the historical microphone signal and the historical speaker signal, and the scaling factor decays exponentially over time; obtaining the updated historical filter coefficients at the previous moment based on the scaling factor and the historical filter coefficients; and obtaining the initial step size factor at the previous moment based on the updated historical filter coefficients, the historical microphone signal, and the historical speaker signal.
8. An electronic device, characterized in that, The method includes a memory and a processor coupled to each other, wherein the memory stores program instructions and the processor executes the program instructions to implement the echo cancellation method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The system stores program instructions that can be executed by a processor, the program instructions being used to implement the echo cancellation method according to any one of claims 1-6.