Echo cancellation method and device, electronic equipment and storage medium

By acquiring the input signal and reference signal in the audio communication system, amplitude compensation and echo cancellation, the problem of echo interference in audio communication is solved and the quality of audio communication is improved.

CN120071949APending Publication Date: 2025-05-30BESTECHNIC SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510268241.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In audio communication systems, echo interference is inevitable, resulting in reduced audio clarity and impact on communication quality.

Method used

By acquiring the input signal collected by the sound acquisition device and the reference signal played by the sound play device, amplitude compensation is performed, so that the amplitude of the input signal and the reference signal are both preset amplitude, and the echo in the input signal is cancelled based on the compensated reference signal to obtain the target signal.

Benefits of technology

Through amplitude compensation and subsequent signal processing, echoes during audio communication can be reduced more efficiently and the quality of audio communication can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071949A_ABST
    Figure CN120071949A_ABST
Patent Text Reader

Abstract

The invention relates to the field of audio communication, and discloses an echo cancellation method and device, electronic equipment and a storage medium. The echo cancellation method comprises the following steps: acquiring an input signal acquired by a sound acquisition device and a reference signal played by a sound playing device in the same time period; compensating the amplitude of the input signal and the amplitude of the reference signal to preset amplitudes respectively; and eliminating the echo in the compensated input signal based on the compensated reference signal to obtain a target signal. Compared with the prior art, the echo cancellation method and device, the electronic equipment and the storage medium provided by the embodiment of the invention have the advantage that the echo in the audio communication process can be reduced with higher efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio communication. Specifically, it relates to an echo cancellation method and apparatus, an electronic device, and a storage medium. Background Art

[0002] In an audio communication system, due to the existence of signal reflection paths, echo interference is inevitable. Echoes in audio communication include electrical echoes and acoustic echoes. Electrical echoes are caused by the reflection of signal energy generated by impedance mismatch; acoustic echoes refer to the sound broadcast by the speaker at the receiving end being picked up by the microphone and sent back to the speaking end, which includes direct echoes and indirect echoes. A direct echo is the sound that directly enters the microphone after being broadcast by the speaker, and an indirect echo refers to the sound broadcast by the speaker that enters the microphone after being reflected one or more times through different paths (such as a house or any object inside the house). The echo is transmitted back to the speaking end after being delayed by the channel and is heard by the speaker, thereby interfering with the audio at the speaking end, reducing audio clarity, and affecting the quality of audio communication. Summary of the Invention

[0003] The purpose of this application is to provide an echo cancellation method and apparatus, an electronic device, and a storage medium, which can reduce echoes in the audio communication process with higher efficiency.

[0004] In a first aspect, an embodiment of this application provides an echo cancellation method, including: obtaining an input signal collected by a sound collection device and a reference signal played by a sound playback device in the same time period; compensating the amplitude of the input signal and the amplitude of the reference signal to a preset amplitude respectively; eliminating the echo in the compensated input signal based on the compensated reference signal to obtain a target signal.

[0005] Compared with the related art, in the echo cancellation method provided by the embodiments of the present application, after obtaining the input signal collected by the sound collection device and the reference signal played by the sound playback device, since the sound played by the sound playback device has undergone a large change in amplitude after propagating a certain distance and being reflected by the environment, there is a large difference between the amplitude of the input signal and the amplitude of the reference signal. By amplitude compensation, the amplitudes of the input signal and the reference signal are respectively compensated to a preset amplitude. On the one hand, the amplitudes of the compensated input signal and the reference signal can be made equal, and the reference signal equal to the amplitude of the input signal can better remove the noise in the input signal. On the other hand, the amplitudes of the input signal and the reference signal are respectively compensated to the preset amplitude, that is, during the entire operation cycle of the audio system, the amplitudes of the input signal and the reference signal after amplitude compensation are both the preset amplitude, which can reduce the influence of the amplitude changes of the input signal and the reference signal on the subsequent signal processing process, simplify the calculation process of the subsequent signal processing, and improve the efficiency of removing the echo in the compensated input signal based on the compensated reference signal to obtain the target signal, thereby reducing the echo in the audio communication process with higher efficiency.

[0006] In an alternative embodiment, the step of respectively compensating the amplitudes of the input signal and the reference signal to a preset amplitude includes: converting the input signal into decibel form, calculating the input decibel difference between the decibel-form input signal and a preset decibel value, and obtaining the amplitude-compensated input signal based on the input decibel difference and the input signal; converting the reference signal into decibel form, calculating the reference decibel difference between the decibel-form reference signal and the preset decibel value, and obtaining the amplitude-compensated reference signal based on the reference decibel difference and the reference signal; the preset decibel value is the decibel value corresponding to the preset amplitude. After converting the reference signal and the input signal into decibel form for operation, the decibel differences between the decibel-form reference signal and the input signal and the preset decibel value corresponding to the preset amplitude can be directly calculated, simplifying the operation process of amplitude compensation for the reference signal and the input signal, and further improving the operation efficiency of the entire echo cancellation process.

[0007] In an alternative embodiment, the preset decibel value is less than or equal to zero.

[0008] In an alternative embodiment, before performing amplitude compensation on the input signal and the reference signal, the echo cancellation method further includes: performing low-pass filtering on the input signal to remove the noise in the input signal that is higher than the threshold frequency. Since there is environmental noise with extremely high frequency in the input signal collected by the sound collection device, before performing echo cancellation on the input signal, low-pass filtering the input signal through a low-pass filter can remove the echo in the input signal that is higher than the threshold frequency, eliminate the influence of this part of the echo on the subsequent echo cancellation process, and improve the echo cancellation effect.

[0009] In an alternative embodiment, eliminating the echo in the compensated input signal based on the compensated reference signal to obtain a target signal includes: respectively performing Fourier transform on the compensated input signal and the reference signal to obtain the frequency-domain characteristics of the input signal and the reference signal; performing linear filtering on the input signal according to the frequency-domain characteristics of the input signal and the reference signal, and obtaining the target signal from the linear filtering result based on inverse Fourier transform. Dividing the echo in the input signal into a linear part and a non-linear part, performing Fourier transform on the input signal and the reference signal to obtain frequency-domain characteristics and then performing linear filtering can specifically eliminate the linear part in the echo and improve the elimination effect on the linear part in the echo.

[0010] In an alternative embodiment, obtaining the target signal from the linear filtering result based on inverse Fourier transform includes: performing non-linear filtering on the linear filtering result; performing inverse Fourier transform on the non-linear filtering result to obtain the target signal. Performing non-linear filtering on the linear filtering result again can specifically eliminate the non-linear part in the echo and improve the elimination effect on the non-linear part in the echo.

[0011] In an alternative embodiment, before respectively performing Fourier transform on the compensated input signal and the reference signal, the echo cancellation method further includes: aligning the compensated input signal and the reference signal in the time domain. Aligning the compensated input signal and the reference signal in the time domain before performing echo cancellation on the input signal can align the compensated input signal and the reference signal in the time domain, reduce the influence of time-domain differences on the subsequent echo cancellation process, and improve the subsequent echo cancellation effect.

[0012] In a second aspect, an embodiment of the present application provides an echo cancellation device, including: a signal acquisition module, the signal acquisition module is used to connect a sound acquisition device and a sound playback device, and acquire an input signal collected by the sound acquisition device and a reference signal played by the sound playback device in the same time period; an amplitude compensation module, the amplitude compensation module is used to perform amplitude compensation on the input signal and the reference signal so that the compensated input signal and the reference signal are both equal to a preset amplitude; a filtering module, the filtering module is used to eliminate the echo in the compensated input signal based on the compensated reference signal to obtain a target signal.

[0013] Compared with the related art, in the echo cancellation device provided by the embodiments of the present application, after the signal acquisition module is connected to the sound collection device and the sound playback device, it can acquire the input signal collected by the sound collection device and the reference signal played by the sound playback device. Since the sound played by the sound playback device has undergone a large change in amplitude after being propagated over a certain distance and reflected by the environment, there is a large difference between the amplitude of the input signal and the amplitude of the reference signal. By compensating the amplitudes of the input signal and the reference signal to a preset amplitude respectively through the amplitude compensation module, on the one hand, the amplitudes of the compensated input signal and the reference signal can be made equal, and the reference signal with the same amplitude as the input signal can better remove the noise in the input signal. On the other hand, by compensating the amplitudes of the input signal and the reference signal to the preset amplitude respectively, that is, during the entire operation cycle of the audio system, the amplitudes of the input signal and the reference signal after amplitude compensation are both the preset amplitude, which can reduce the influence of the amplitude changes of the input signal and the reference signal on the signal processing process of the subsequent filtering module, simplify the calculation process of the subsequent filtering module for signal processing, improve the efficiency of removing the echo in the compensated input signal based on the compensated reference signal to obtain the target signal, and thus reduce the echo in the audio communication process with higher efficiency.

[0014] In a third aspect, embodiments of the present application provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the echo cancellation method as described above.

[0015] In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, characterized in that the computer program is executed by a processor to implement the echo cancellation method as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings.

[0017] Figure 1 It is a schematic flowchart of the echo cancellation method provided by Embodiment 1 of the present application;

[0018] Figure 2 It is a schematic flowchart of echo cancellation in the echo cancellation method provided by Embodiment 1 of the present application;

[0019] Figure 3 It is a schematic flowchart of the echo cancellation method provided in the second embodiment of this application;

[0020] Figure 4 It is a schematic structural diagram of the echo cancellation device provided in the third embodiment of this application;

[0021] Figure 5 It is a schematic structural diagram of the filtering module in the echo cancellation device provided in the third embodiment of this application;

[0022] Figure 6 It is a schematic structural diagram of the echo cancellation device provided in the fourth embodiment of this application;

[0023] Figure 7 It is a schematic structural diagram of the electronic device provided in the fifth embodiment of this application. Detailed implementation manners

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some but not all of the embodiments of this application. Usually, the components of the embodiments of this application described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0025] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of this application that is required to be protected, but merely represents the selected embodiments of this application.

[0026] It should be noted that similar reference numerals and letters denote similar items in the following accompanying drawings. Therefore, once an item is defined in one accompanying drawing, it does not need to be further defined and explained in subsequent accompanying drawings.

[0027] In addition, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0028] It should be noted that, without conflict, the features in the embodiments of this application can be combined with each other.

[0029] Embodiment 1

[0030] Please refer to Figure 1 , Embodiment 1 of this application provides an echo cancellation method for canceling the echo formed after the audio played by the sound playback device is fed back to the sound collection device and re-collected by the sound collection device, which specifically includes the following steps.

[0031] Step S101: Obtain the input signal collected by the sound collection device and the reference signal played by the sound playback device in the same time period.

[0032] It can be understood that although it takes a certain period of time for the reference signal to be propagated after being played by the sound playback device before it is collected by the sound collection device to form the echo in the input signal, in the actual application process, the distance between the sound collection device and the sound playback device that generates echo interference is usually relatively short. For example, in electronic devices such as mobile phones and computers that include both a sound collection device and a sound playback device, the distance between the sound collection device and the sound playback device is only less than 1 meter or even less than 10 centimeters, and the propagation duration of sound in this short distance is extremely short. At the same time, based on the intermittent collection working mode of the sound collection device, that is, the sound signals in a period of time are collected to form an input signal and transmitted backward, and time errors will also occur during the collection and transmission processes of the input signal. In the embodiments of the present application, the input signal collected by the sound collection device and the reference signal played by the sound playback device in the same period of time can be the input signal collected by the sound collection device and the reference signal played by the sound playback device within a very short duration difference. The specific duration difference can be set according to the sampling duration of the sound collection device and the distance between the sound collection device and the sound playback device in the specific application scenario.

[0033] Step S102: Compensate the amplitudes of the input signal and the reference signal to a preset amplitude respectively.

[0034] In this step, the preset amplitude is a constant threshold amplitude set in advance, which can be set in advance according to the relevant sound parameters of the sound collection device and the sound playback device and the actual needs of the actual application scenario. Compensating the amplitudes of the input signal and the reference signal to the preset amplitude respectively means reducing the amplitudes of the input signal and / or the reference signal whose amplitudes are greater than the preset amplitude to the preset amplitude, and increasing the amplitudes of the input signal and / or the reference signal whose amplitudes are less than the preset amplitude to the preset amplitude. The amplitude of the compensated input signal, the amplitude of the compensated reference signal, and the preset amplitude are equal to each other.

[0035] It can be understood that in the embodiments of the present application, due to possible errors in the operation process, it is actually impossible for the amplitudes of the compensated input signal, the compensated reference signal, and the preset amplitude to be exactly equal to each other. Therefore, in the embodiments of the present application, compensating the amplitudes of the input signal and the reference signal to the preset amplitude can actually be to make the differences between the amplitudes of the compensated input signal, the compensated reference signal, and the preset amplitude not exceed a preset error threshold. As long as the difference between the three is less than or equal to the preset error threshold, it is considered that the amplitudes of the input signal and the reference signal have been compensated to the preset amplitude respectively.

[0036] In some embodiments of the present application, amplitude compensation can be performed on the input signal and the reference signal by means of difference calculation. For the input signal, specifically, the input signal can first be converted into a decibel form for representation. Specifically, for example, it can be expressed by the formula: d_dB = 10 * log10((d_lpf / 2^15)^2), where d_dB is the decibel representation of the input signal, and d_lpf is the input signal. Then, calculate the input decibel difference between the decibel form of the input signal and the preset decibel value. Specifically, for example, it can be expressed by the formula: d_diff = threshold - d_dB, where d_diff is the input decibel difference, and threshold is the preset decibel value. The preset decibel value is the decibel value corresponding to the preset amplitude. Finally, based on the input decibel difference and the input signal, obtain the input signal after amplitude compensation. Specifically, for example, it can be expressed by the formula: d_comp = d_lpf * (10^(d_diff / 20)), where d_comp is the input signal after amplitude compensation. For the reference signal, similarly, the reference signal can first be converted into a decibel form for representation. Specifically, for example, it can be expressed by the formula: x_dB = 10 * log10((x / 2^15)^2), where x_dB is the decibel representation of the reference signal, and x is the reference signal. Then, calculate the reference decibel difference between the decibel form of the reference signal and the preset decibel value. Specifically, for example, it can be expressed by the formula: x_diff = threshold - x_dB, where x_diff is the reference decibel difference, and threshold is the preset decibel value. The preset decibel value is the decibel value corresponding to the preset amplitude. Finally, based on the reference decibel difference and the reference signal, obtain the reference signal after amplitude compensation. Specifically, for example, it can be expressed by the formula: x_comp = x * (10^(x_diff / 20)), where x_comp is the reference signal after amplitude compensation. After converting the reference signal and the input signal into decibel form for calculation, the decibel difference between the decibel form of the reference signal and the input signal and the preset decibel value corresponding to the preset amplitude can be directly calculated, simplifying the operation process of amplitude compensation for the reference signal and the input signal, and further improving the operation efficiency of the entire echo cancellation process.

[0037] It can be understood that the above is only an example of the calculation method for amplitude compensation of the input signal and the reference signal in one embodiment of the present application, compensating the amplitudes of the input signal and the reference signal to the preset amplitude respectively. In some other embodiments of the present application, it can also be, for example, directly performing amplitude compensation on the input signal and the reference signal based on the amplitude difference between the input signal and the reference signal and the preset amplitude, without performing methods such as decibel form conversion.

[0038] Further, in the embodiments of the present application, the preset decibel value is less than or equal to zero, and the specific value can be set according to actual needs. For example, in some embodiments of the present application, the preset decibel value can be, for example, -3 dB, -4 dB, -5 dB, etc.

[0039] Step S103: Eliminate the echo in the compensated input signal based on the compensated reference signal to obtain the target signal.

[0040] Specifically, in this step, eliminating the echo in the compensated input signal based on the compensated reference signal to obtain the target signal can specifically be filtering the input signal using the compensated reference signal to remove the echo generated by the audio playback device in the input signal.

[0041] Further, in the embodiments of the present application, during the process of filtering the input signal using the compensated reference signal, the echo can specifically be split into a linear part and a non-linear part, and the echo of the linear part and the non-linear part are filtered separately. Among them, as Figure 2 shown, filtering the echo of the linear part can specifically include:

[0042] Step S201: Perform Fourier transforms on the compensated input signal and the reference signal respectively to obtain the frequency-domain characteristics of the input signal and the reference signal.

[0043] In this step, during the process of performing Fourier transforms on the input signal and the reference signal respectively, the same number of fast Fourier transform points can be used for the Fourier transforms. Taking the number of fast Fourier transform points as fft_size, the input signal as d_align, and the reference signal as x_align as an example, the formula representation of this process of performing Fourier transforms on the input signal and the reference signal can be:

[0044] D_align = fft(d_align, fft_size);

[0045] X_align = fft(x_align, fft_size);

[0046] Among them, D_align is the Fourier transform result of the input signal, that is, the frequency-domain characteristic of the input signal; X_align is the Fourier transform result of the reference signal, that is, the frequency-domain characteristic of the reference signal.

[0047] Step S202: Perform linear filtering on the input signal according to the frequency-domain characteristics of the input signal and the reference signal.

[0048] Specifically, linear filtering is a filtering method based on a linear relationship that can be specifically performed by a linear filter. In linear filtering, the operation of the linear filter on the input signal satisfies a linear relationship. In this step, specifically, the filtering coefficient h_linear of linear filtering can be preset according to actual needs. During the process of inputting the frequency domain characteristics of the input signal and the reference signal into the linear filter for linear filtering, the linear filter can specifically calculate the difference between the result of the product operation and the frequency domain characteristics of the input signal after performing the product operation based on the preset filtering coefficient h_linear and the frequency domain characteristics of the reference signal, thereby realizing the linear filtering process. It can be specifically expressed by the formula: E = D_align - h_linear * X_align, where E is the output signal of the linear filter after linear filtering.

[0049] Step S203: Obtain the target signal from the linear filtering result based on the inverse Fourier transform.

[0050] In this step, specifically, the inverse Fourier transform can be directly performed on the linear filtering result E, and the result of the inverse Fourier transform can be output as the target signal for echo cancellation. Or in some other embodiments of the present application, before performing the inverse Fourier transform on the linear filtering result E, the linear filtering result E can also be nonlinearly filtered again, and then the inverse Fourier transform is performed on the nonlinear filtering result to obtain the target signal.

[0051] Among them, nonlinear filtering is a filtering method based on a nonlinear relationship that can be specifically performed by a nonlinear filter. The nonlinear filter processes the input signal based on a nonlinear function or algorithm, and there is no linear relationship between the output and the input, and it does not satisfy superposition and homogeneity. In this step, specifically, the filtering coefficient h_nonlinear of nonlinear filtering can be preset according to actual needs. During the process of inputting the linear filtering result into the nonlinear filter for nonlinear filtering, the nonlinear filter can specifically perform a quadratic nonlinear filtering on the linear filtering result E based on the preset filtering coefficient h_linear. It can be specifically expressed by the formula: Y = E * h_nonlinear, where Y is the output signal of the nonlinear filter after nonlinear filtering.

[0052] Then, based on the Fourier transform parameter fft_size of the Fourier transform in step S201, the inverse Fourier transform is performed on the nonlinear filtering result Y to obtain the target signal after echo removal. It can be specifically expressed by the formula: y = ifft(Y, fft_size), where y is the target signal after echo removal.

[0053] It can be understood that the foregoing linear filtering first and then nonlinear filtering are only illustrative examples in some embodiments of the present application. In some other embodiments of the present application, it may also be nonlinear filtering first and then linear filtering, or only linear filtering or only nonlinear filtering, which can be specifically set according to actual needs.

[0054] The echo in the input signal is divided into a linear part and a nonlinear part. After performing Fourier transform on the input signal and the reference signal to obtain frequency-domain features and then performing linear filtering, the linear part in the echo can be eliminated specifically, improving the elimination effect on the linear part in the echo; then, performing nonlinear filtering on the result of the linear filtering again can specifically eliminate the nonlinear part in the echo, improving the elimination effect on the nonlinear part in the echo. Filtering the linear part and the nonlinear part of the echo separately can filter and eliminate different parts of the echo more specifically, improving the overall filtering effect on the echo.

[0055] Furthermore, in some embodiments of the present application, before step S201, that is, before performing Fourier transform on the compensated input signal and the reference signal respectively, the compensated input signal and the reference signal can also be input into a time-domain alignment module, and the time-domain alignment module aligns the compensated input signal and the reference signal in the time domain. Among them, time-domain alignment refers to adjusting different signals in the time dimension so that these signals are synchronized in time or have a consistent time reference. Corresponding to the embodiments of the present application, that is, aligning the input signal and the reference signal in the time domain so that the input signal and the reference signal are synchronized in time or have a consistent time reference. Specifically, in this step, the reference signal and the input signal can be aligned in the time domain by using a feature-point alignment method. Feature-point alignment means finding the feature points in the reference signal and the input signal, such as the rising edge, falling edge, peak value, etc. of the reference signal and the input signal. By comparing the time positions of the feature points in the reference signal and the input signal, calculating the time difference between them, and then performing corresponding time translation on the reference signal and / or the input signal, the time-domain alignment of the reference signal and the input signal is achieved. Or, in some embodiments of the present application, the reference signal and the input signal can also be aligned in the time domain by using a correlation matching alignment method. Correlation matching alignment means calculating the correlation between the reference signal and the input signal, finding the position with the maximum correlation, and the time difference corresponding to this position is the time offset between the reference signal and the input signal. Then, performing corresponding time translation on the reference signal and / or the input signal to achieve the time-domain alignment of the reference signal and the input signal.

[0056] It can be understood that the above-mentioned alignment based on feature points and correlation matching alignment are only examples of the specific implementation methods of time-domain alignment in the embodiments of the present application. In some other embodiments of the present application, other time-domain alignment methods such as clock synchronization can also be used to perform time-domain alignment on the reference signal and the input signal, etc.

[0057] Before performing echo cancellation on the input signal, compensating the input signal and the reference signal in time domain can align the compensated input signal and the reference signal in time domain, reduce the influence of time-domain differences on the subsequent echo cancellation process, and improve the subsequent echo cancellation effect.

[0058] Compared with the related technology, in the echo cancellation method provided in the first embodiment of the present application, after obtaining the input signal collected by the sound collection device and the reference signal played by the sound playback device, since the sound played by the sound playback device has undergone a large change in amplitude after propagating a certain distance and being reflected by the environment, there is a large difference between the amplitude of the input signal and the amplitude of the reference signal. By compensating the amplitudes of the input signal and the reference signal to a preset amplitude respectively, on the one hand, the amplitudes of the compensated input signal and the reference signal can be made equal, and the reference signal with the same amplitude as the input signal can better remove the noise in the input signal. On the other hand, compensating the amplitudes of the input signal and the reference signal to the preset amplitude respectively, that is, during the entire operation cycle of the audio system, the amplitudes of the input signal and the reference signal after amplitude compensation are both the preset amplitude, which can reduce the influence of the amplitude changes of the input signal and the reference signal on the subsequent signal processing process, simplify the calculation process of the subsequent signal processing, improve the efficiency of removing the echo in the compensated input signal based on the compensated reference signal to obtain the target signal, and thus reduce the echo in the audio communication process with higher efficiency.

[0059] Embodiment Two

[0060] The second embodiment of the present application provides an echo cancellation method. The echo cancellation method provided in the second embodiment of the present application includes the aforementioned steps S101 to step S103. As Figure 3 shown, before step S102 in the echo cancellation method provided in this second embodiment, it further includes:

[0061] Step S104: Perform low-pass filtering on the input signal to remove the noise in the input signal that is higher than the threshold frequency.

[0062] Among them, low-pass filtering refers to a filtering method that allows signal components below a certain specific frequency (cutoff frequency) to pass through, while attenuating signal components above this cutoff frequency. In this step, that is, allowing the part of the input signal that is lower than or equal to the threshold frequency to pass through, while blocking the part of the input signal that is higher than the threshold frequency, thereby removing the noise in the input signal that is higher than the threshold frequency.

[0063] Compared with the related art, in the echo cancellation method provided in the second embodiment of the present application, since there is extremely high-frequency environmental noise in the input signal collected by the sound collection device, before performing amplitude compensation on the input signal and the reference signal in step S102, low-pass filtering is performed on the input signal through a low-pass filter, which can remove the echo in the input signal that is higher than the threshold frequency, eliminate the influence of this part of the echo on the subsequent echo cancellation process, and improve the echo cancellation effect.

[0064] Embodiment Three

[0065] Please refer to Figure 4 , the echo cancellation device 100 provided in the third embodiment of the present application includes: a signal acquisition module 101, an amplitude compensation module 102, and a filtering module 103. Among them, the signal acquisition module 101 can be used to connect to the sound collection device 200 and the sound playback device 300, so as to acquire the input signal collected by the sound collection device 200 and the reference signal played by the sound playback device 300 in the same time period. Then, the input signal and the reference signal are input into the amplitude compensation module 102 for amplitude compensation, so that the compensated input signal and reference signal are both equal to the preset amplitude. The input signal and the reference signal after amplitude compensation can then be further calculated in the filtering module 103, and the echo in the compensated input signal is eliminated based on the compensated reference signal to obtain the target signal.

[0066] Compared with the related art, in the echo cancellation device provided in the fourth embodiment of the present application, after the signal acquisition module 101 is connected to the sound acquisition device 200 and the sound playback device 300, it can acquire the input signal collected by the sound acquisition device 200 and the reference signal played by the sound playback device 300. Since the sound played by the sound playback device 300 has a large change in amplitude after propagating a certain distance and being reflected by the environment, there is a large difference between the amplitude of the input signal and the amplitude of the reference signal. By compensating the amplitudes of the input signal and the reference signal to a preset amplitude through the amplitude compensation module 102, on the one hand, the amplitudes of the compensated input signal and the reference signal can be made equal, and the reference signal with the same amplitude as the input signal can better remove the noise in the input signal. On the other hand, compensating the amplitudes of the input signal and the reference signal to the preset amplitude respectively, that is, during the entire operation cycle of the audio system, the amplitudes of the amplitude-compensated input signal and the reference signal are both the preset amplitude, which can reduce the influence of the amplitude changes of the input signal and the reference signal on the signal processing process of the subsequent filtering module 103, simplify the calculation process of the subsequent filtering module 103 for signal processing, and improve the efficiency of removing the echo in the compensated input signal based on the compensated reference signal to obtain the target signal, thereby reducing the echo in the audio communication process with higher efficiency.

[0067] Further, please refer to Figure 5 , in the embodiment of the present application, the filtering module 103 may specifically include: a linear filtering module 104, a non-linear filtering module 105, and a time-domain alignment module 106. Among them, the linear filtering module 104 is used to perform Fourier transforms on the compensated input signal and the reference signal respectively to obtain the frequency-domain characteristics of the input signal and the reference signal; and perform linear filtering on the input signal according to the frequency-domain characteristics of the input signal and the reference signal. The non-linear filtering module 105 is specifically used to perform non-linear filtering on the linear filtering result. The time-domain alignment module 106 is specifically used to align the compensated input signal and the reference signal in the time domain.

[0068] Embodiment 4

[0069] Please refer to Figure 6 , the fourth embodiment of the present application provides an echo cancellation device 100, which also includes: a signal acquisition module 101, an amplitude compensation module 102, and a filtering module 103. The difference is that the echo cancellation device 100 provided in the fourth embodiment further includes a low-pass filtering module 107, and the low-pass filtering module 107 is arranged between the signal acquisition module 101 and the amplitude compensation module 102. The low-pass filtering 107 is used to perform low-pass filtering on the input signal, remove the noise above the threshold frequency in the input signal, and then transmit the low-pass filtered input signal to the amplitude compensation module 102.

[0070] Compared with the related art, in the echo cancellation device provided in the fourth embodiment of the present application, since there is extremely high-frequency environmental noise in the input signal collected by the sound collection device, before performing echo cancellation on the input signal, the input signal is subjected to low-pass filtering through the low-pass filter 107, so that the echo with a frequency higher than the threshold frequency in the input signal can be removed, the influence of this part of the echo on the subsequent echo cancellation process can be eliminated, and the echo cancellation effect can be improved.

[0071] Embodiment Five

[0072] Embodiment Five of the present application relates to an electronic device, as Figure 7 shown, including: at least one processor 701; and a memory 702 communicatively connected to the at least one processor 701; wherein, the memory 702 stores instructions executable by the at least one processor 701, and the instructions are executed by the at least one processor 701, so that the at least one processor 701 can execute the methods in the above embodiments.

[0073] Among them, the memory and the processor are connected by a bus. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, so they will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be an element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted over the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor.

[0074] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory can be used to store the data used by the processor when performing operations.

[0075] Embodiment Six

[0076] Embodiment Six of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method embodiments described above are implemented.

[0077] That is, those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps in the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0078] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An echo cancellation method, characterized in that: include: Acquire an input signal collected by a sound collection device and a reference signal played by a sound playing device in the same time period; Compensating the amplitude of the input signal and the amplitude of the reference signal to preset amplitudes respectively; The echo in the compensated input signal is eliminated based on the compensated reference signal to obtain a target signal.

2. The echo cancellation method according to claim 1, characterized in that: The compensating the amplitude of the input signal and the amplitude of the reference signal to preset amplitudes respectively includes: Converting the input signal into a decibel form, calculating an input decibel difference between the input signal in decibel form and an input decibel value of a preset decibel value, and obtaining the input signal after amplitude compensation based on the input decibel difference and the input signal; Converting the reference signal into a decibel form, calculating a reference decibel difference between the reference signal in decibel form and the preset decibel value, and obtaining the reference signal after amplitude compensation based on the reference decibel difference and the reference signal; The preset decibel value is the decibel value corresponding to the preset amplitude.

3. The echo cancellation method according to claim 2, characterized in that: The preset decibel value is less than or equal to zero.

4. The echo cancellation method according to claim 1, characterized in that: Before performing amplitude compensation on the input signal and the reference signal, the echo cancellation method further includes: The input signal is low-pass filtered to remove noise in the input signal with a frequency higher than a threshold.

5. The echo cancellation method according to claim 1, characterized in that: The step of eliminating the echo in the compensated input signal based on the compensated reference signal to obtain a target signal comprises: Performing Fourier transform on the compensated input signal and the reference signal respectively to obtain frequency domain features of the input signal and the reference signal; The input signal is linearly filtered according to frequency domain characteristics of the input signal and the reference signal, and the target signal is obtained from the linear filtering result based on inverse Fourier transform.

6. The echo cancellation method according to claim 1, characterized in that: The step of obtaining the target signal from the linear filtering result based on inverse Fourier transform includes: Performing nonlinear filtering on the linear filtering result; Perform inverse Fourier transform on the nonlinear filtering result to obtain the target signal.

7. The echo cancellation method according to claim 5 or 6, characterized in that: Before performing Fourier transform on the compensated input signal and the reference signal respectively, the echo cancellation method further includes: The compensated input signal and the reference signal are aligned in time domain.

8. An echo cancellation device, characterized in that: include: A signal acquisition module, the signal acquisition module is used to connect the sound collection device and the sound playback device, and obtain the input signal collected by the sound collection device and the reference signal played by the sound playback device in the same time period; An amplitude compensation module, the amplitude compensation module is used to perform amplitude compensation on the input signal and the reference signal so that the compensated input signal and the reference signal are both equal to a preset amplitude; A filtering module is used to eliminate the echo in the compensated input signal based on the compensated reference signal to obtain a target signal.

9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the echo cancellation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the echo cancellation method according to any one of claims 1 to 7.