CN110992923B - Echo cancellation method, electronic device, and storage device - Google Patents

Echo cancellation method, electronic device, and storage device Download PDF

Info

Publication number
CN110992923B
CN110992923B CN201911320924.9A CN201911320924A CN110992923B CN 110992923 B CN110992923 B CN 110992923B CN 201911320924 A CN201911320924 A CN 201911320924A CN 110992923 B CN110992923 B CN 110992923B
Authority
CN
China
Prior art keywords
previous
signal
filter
end signal
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911320924.9A
Other languages
Chinese (zh)
Other versions
CN110992923A (en
Inventor
陈烈
林聚财
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201911320924.9A priority Critical patent/CN110992923B/en
Publication of CN110992923A publication Critical patent/CN110992923A/en
Application granted granted Critical
Publication of CN110992923B publication Critical patent/CN110992923B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Processing of the speech or voice signal to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0208Noise filtering
    • G10L21/0216Noise filtering characterised by the method used for estimating noise
    • G10L21/0224Processing in the time domain
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10KSOUND-PRODUCING DEVICES; METHODS OR DEVICES FOR PROTECTING AGAINST, OR FOR DAMPING, NOISE OR OTHER ACOUSTIC WAVES IN GENERAL; ACOUSTICS NOT OTHERWISE PROVIDED FOR
    • G10K11/00Methods or devices for transmitting, conducting or directing sound in general; Methods or devices for protecting against, or for damping, noise or other acoustic waves in general
    • G10K11/16Methods or devices for protecting against, or for damping, noise or other acoustic waves in general
    • G10K11/175Methods or devices for protecting against, or for damping, noise or other acoustic waves in general using interference effects; Masking sound
    • G10K11/178Methods or devices for protecting against, or for damping, noise or other acoustic waves in general using interference effects; Masking sound by electro-acoustically regenerating the original acoustic waves in anti-phase
    • G10K11/1785Methods, e.g. algorithms; Devices
    • G10K11/17853Methods, e.g. algorithms; Devices of the filter
    • G10K11/17854Methods, e.g. algorithms; Devices of the filter the filter being an adaptive filter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M9/00Arrangements for interconnection not involving centralised switching
    • H04M9/08Two-way loud-speaking telephone systems with means for conditioning the signal, e.g. for suppressing echoes for one or both directions of traffic
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Processing of the speech or voice signal to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0208Noise filtering
    • G10L2021/02082Noise filtering the noise being echo, reverberation of the speech

Abstract

The application discloses an echo cancellation method, an electronic device and a storage device, wherein the method comprises the following steps: performing time delay alignment on a current far-end signal and a current near-end signal of the first device; filtering the current far-end signal by using a self-adaptive filter to obtain a current echo signal; subtracting the current echo signal from the current near-end signal to obtain a current output signal; the current output signal is sent to the second device. By the echo cancellation method, the call quality can be improved.

Description

Echo cancellation method, electronic device and storage device
Technical Field
The present application relates to the field of speech signal processing, and in particular, to an echo cancellation method, an electronic device, and a storage apparatus.
Background
With the rapid development and integration of Internet network technology, software technology and computer multimedia technology, the application of voice over Internet telephony has become very popular.
In the network voice chat, the voice of the far-end speaker is picked up by the microphone and then transmitted to the near-end through the network, the voice played by the near-end speaker is picked up by the microphone and then re-sent back to the far-end through the network, and the influence of various delays such as the network and data processing is added, so that the far-end speaker can hear the echo of the far-end speaker, and the quality of the conversation is influenced.
Disclosure of Invention
The application provides an echo cancellation method, an electronic device and a storage device, which are used for solving the technical problems of how to reduce echo residues and improve the communication quality.
To solve the above technical problem, a first aspect of the present application provides an echo cancellation method, including: performing time delay alignment on a current far-end signal and a current near-end signal of first equipment, wherein the current far-end signal and the current near-end signal are audio signals, and the current far-end signal is from second equipment communicating with the first equipment; filtering the current far-end signal by using an adaptive filter to obtain a current echo signal, wherein the current filter coefficient of the adaptive filter is determined by the difference between the previous echo signal and the previous near-end signal of the adaptive filter; subtracting the current echo signal from the current near-end signal to obtain a current output signal; the current output signal is sent to the second device.
In order to solve the above technical problem, a second aspect of the present application provides an electronic device, including a processor, and a memory, a microphone, a speaker, and a communication circuit, which are respectively coupled to the processor; the communication circuit is used for transmitting audio signals with other equipment; the microphone is used for receiving a near-end signal; the loudspeaker is used for playing the far-end signal received by the communication circuit; the processor is adapted to execute a computer program stored in the memory, which computer program, when executed by the processor, is adapted to carry out the method of the first aspect as described above.
In order to solve the above technical problem, a third aspect of the present application provides a storage device, which stores a computer program, and when the computer program is executed by a processor, the method of the first aspect can be implemented.
The beneficial effect of this application is: different from the situation in the prior art, in the echo cancellation method provided by the application, in the call process, the current filter coefficient of the adaptive filter is determined by the difference between the previous echo signal and the previous near-end signal of the adaptive filter, then the current far-end signal is filtered by using the adaptive filter according to the current far-end signal sent by the second device to obtain the current echo signal, and finally the current echo signal is subtracted from the current near-end signal to obtain the current output signal, so that the echo of the current far-end signal is subtracted from the current output signal, and the call quality can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings required in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor. Wherein:
FIG. 1 is a first flowchart of an embodiment of an echo cancellation method according to the present application;
FIG. 2 is a second flowchart of an embodiment of the echo cancellation method of the present application;
FIG. 3 is a first flowchart of a second embodiment of the echo cancellation method of the present application;
FIG. 4 is a second flow chart of a second embodiment of the echo cancellation method of the present application;
FIG. 5 is a first flowchart of a third embodiment of the echo cancellation method of the present application;
FIG. 6 is a second flow chart of a third embodiment of the echo cancellation method of the present application;
FIG. 7 is a third flowchart of a third embodiment of the echo cancellation method of the present application;
FIG. 8 is a fourth flowchart of a third embodiment of the echo cancellation method of the present application;
FIG. 9 is a block diagram of an embodiment of an electronic device for echo cancellation according to the present application;
FIG. 10 is a block diagram of an embodiment of a storage medium according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the following described embodiments, the two parties of the call are respectively defined as a first device and a second device. For a first device, the second device is the distal end and the first device is the proximal end. When the second device sends information to the first device, the message is defined as the original far-end signal. The first device preprocesses the original far-end signal to obtain a far-end signal. When a first device performs echo cancellation on a far-end signal, a corresponding original far-end signal is obtained after preprocessing, namely the current far-end signal is obtained, namely the current far-end signal comes from a second device which is communicated with the first device, when the first device receives and plays the original far-end signal, information received by the first device through a microphone of the first device is defined as an original near-end signal, and when the original near-end signal is preprocessed, the current near-end signal is obtained.
For the far-end signal, after the second device sends an original far-end signal, the preprocessing process of the first device includes sampling the original far-end signal for multiple times, and after the preprocessing, a plurality of far-end signals correspondingly generated by different sampling points are correspondingly obtained. Where n represents a specific signal sequence, for example, y (1) represents a first far-end signal obtained after the first sampling, that is, a first far-end signal obtained according to the first sampling point, y (2) represents a far-end signal obtained after the second sampling, that is, a second far-end signal obtained according to the second sampling point, and the same holds true for other signals. Meanwhile, the second far-end signal y (2) is used to represent the current far-end signal, i.e. the far-end signal currently being processed, that is, y (1) is the previous far-end signal, and the same is true for other signals. It should be noted that the first far-end signal y (1) and the second far-end signal y (2) are far-end signals obtained by sampling based on one far-end signal, that is, a plurality of far-end signals can be obtained from one original far-end signal. In addition, in some embodiments, after the second device sends two original far-end signals back and forth and correspondingly obtains the far-end signals, the first sampling point of the far-end signal sent back may also be the second far-end signal y (2) currently performing the echo operation, and the last sampling point of the far-end signal sent front may also be the first far-end signal y (1), that is, the previous far-end signal.
It will be appreciated that the current far-end signal and the current near-end signal may be audio signals, or may be video signals containing audio signals. The following embodiments describe specific aspects of the present application, taking only audio signals as examples.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of an echo cancellation method according to the present application. Specifically, the method may include the steps of:
step S100: and performing time delay alignment on the current far-end signal and the current near-end signal of the first device.
In the process of a call, there is a time delay situation, so when performing echo cancellation, an operation of time delay alignment on an audio signal is required. If the delay alignment operation is not performed, then, during echo cancellation, it is likely that the echo generated by the user of the second device during speaking is not the echo generated by the user of the second device during speaking, but the echo of the previous audio signal is eliminated, so that the audio signal of the echo cancellation is not correctly matched, and the purpose of eliminating the echo cannot be achieved. Therefore, the operation of time delay alignment is carried out on the audio signal in the conversation process, so that the audio signal of echo cancellation can be matched with the audio signal generating echo, and the echo cancellation effect is improved.
For the first device, after the original far-end signal is transmitted to the first device and played by the loudspeaker, part of the sound is reflected by various kinds of reflections, received by the microphone of the first device, and then becomes part of the current near-end signal after being preprocessed. Therefore, the current near-end signal must lag the current far-end signal compared to the current far-end signal, and therefore it is necessary to perform delay alignment between the current far-end signal and the current near-end signal to improve the effect of echo cancellation.
In a specific implementation scenario, when two parties are in a call, for a first device, an audio signal transmitted from a second device needs to be copied to a delay estimator before being played by the first device, and then played after being decoded, sampled, and the like, where a time delay T1 is generated. Another time delay T2 may then be introduced by the audio signal being played from the speaker of the first device through air propagation (including various straight line propagation, reflection or multiple reflections, etc.) to the microphone of the first device. In addition, after the microphone receiver of the first device receives the sound, it is further processed by a series of sampling, encoding, signal enhancement, etc., that is, a time delay T3 is generated before entering the adaptive filter for echo cancellation. It can be seen that the current near-end signal altogether produces a delay of T1+ T2+ T3, which is the sum of the three time periods, as compared to the current far-end signal. Therefore, it is necessary to perform delay alignment between the current far-end signal and the current near-end signal of the first device to eliminate such delay, thereby improving the effect of echo cancellation. Specifically, the delay alignment may be performed by a delay estimation module, a delay value is obtained by estimation, and then zero is padded in front of the current far-end signal. After the current far-end signal and the current near-end signal are aligned, the current near-end signal and the current far-end signal are in one-to-one correspondence in time, so that the effect of time delay alignment is achieved.
Step S101: and filtering the current far-end signal by using a self-adaptive filter to obtain a current echo signal.
Since the user of the second device may hear his own echo, it is necessary to perform an echo cancellation operation using the current far-end signal. Specifically, the adaptive filter may be used to filter the current far-end signal to obtain the current echo signal, so as to provide support for subsequent echo cancellation. The specific filtering process is that the adaptive filter estimates echo signals possibly formed by the current far-end signals, an echo channel is simulated, and finally the current echo signals are obtained. I.e. the current echo signal is derived from the current far-end signal, which can be used to cancel the echo. It should be noted that the current echo signal is obtained by filtering the current echo signal by a filter according to the current far-end signal. The original far-end signal is played by a loudspeaker and then collected by a microphone to generate a real echo signal. Therefore, the current echo signal is not necessarily equal to the true echo signal. In a specific implementation scenario, after the first device obtains the current far-end signal y (2) according to the original far-end signal sent by the second device after preprocessing, the adaptive filter processes the current far-end signal y (2), and specifically, the adaptive filter simulates an echo signal of the current far-end signal y (2), that is, estimates an echo signal that may be formed by the current far-end signal y (2), and then performs a corresponding echo cancellation operation in subsequent echo cancellation. By simulating the echo signal which may be generated by the current far-end signal y (2), the echo generated by the current far-end signal y (2) can be subjected to targeted cancellation in the subsequent process, so as to improve the echo cancellation effect.
Since the current filter coefficient of the adaptive filter may affect the filtering effect, the method for determining the current filter coefficient may have a great influence on the echo cancellation effect. Therefore, the present embodiment further proposes that the current filter coefficient of the adaptive filter can be determined by a difference between a previous echo signal and a previous near-end signal of the adaptive filter.
In a specific implementation scenario, in a call process, after an original far-end signal is sent by a second device, a far-end signal y (1) and a far-end signal y (2) are obtained after preprocessing (including sampling the far-end signal twice) by a first device, an adaptive filter filters the far-end signal y (1) and the far-end signal y (2) and generates echo signals d (1) and d (2), the first device also generates near-end signals z (1) and z (2) correspondingly, and when performing an echo cancellation operation on the near-end signal z (2), a filter coefficient of the adaptive filter in an echo simulation process for a current far-end signal y (2) can be determined by using an echo signal d (1) generated by a far-end signal y (1) before the current far-end signal y (2) and a corresponding generated near-end signal z (1).
In a specific implementation scenario, the specific calculation process for obtaining the echo signal may be: d (n) ═ y (n) · w (n).
The echo signal and the near-end signal generated last time are selected and used for determining the current filter coefficient of the current adaptive filter, and the current echo signal is obtained according to the current filter coefficient, so that the correlation degree of the current echo signal and the real echo signal can be improved, the filtering effect is improved, and echo residue is reduced.
Step S102: and subtracting the current echo signal from the current near-end signal to obtain a current output signal.
Since the current near-end signal is generated after being collected and processed by the microphone of the first device, an audio signal including the current far-end signal may exist in the current near-end signal, and the specific process may refer to the process of generating the time delay T2 in step S100, that is, after the original far-end signal is played by the first device, sound is reflected and propagated, a part of sound is collected by the microphone of the first device, the collected sound is an echo in the current far-end signal, that is, a real echo signal, and the real echo signal may affect the quality of a call.
In step S101, a current echo signal is obtained by simulating a current far-end signal with an adaptive filter. In step S100, the delay alignment operation has been performed on the current far-end signal and the current near-end signal, so that the current echo signal can be directly subtracted from the current near-end signal, so as to obtain the current output signal, and the current output signal has undergone the echo cancellation operation, so that the echo residue is reduced, and the quality of the call can be improved.
The specific calculation formula can be specifically expressed as:
u(n)=z(n)-d(n)。
in a specific implementation scenario, the adaptive filter obtains the current echo signal d (2) according to the current far-end signal y (2). The microphone of the first device receives and processes the audio signal to obtain a current near-end signal z (2). Now, the current echo signal d (2) can be subtracted from the current near-end signal z (2), so as to cancel the echo related to the current far-end signal y (2) in the current near-end signal z (2), and obtain the current output signal u (2). Since the echo of the current far-end signal y (2) has been subtracted from the current output signal u (2), the call quality can be improved.
Step S103: the current output signal is sent to the second device.
Because the echo of the original far-end signal sent by the second device is eliminated by the current output signal, the current output signal can be sent to the second device, and after the current output signal is played by the second device, the probability that a user of the second device hears the echo or the volume of the echo can be reduced, so that the call quality is improved.
According to the scheme, the current far-end signal is filtered by the self-adaptive filter to obtain the current echo signal, and then the current echo signal is subtracted from the current near-end signal to obtain the current output signal subjected to echo cancellation aiming at the real echo signal, so that when the second device plays the current output signal, the probability of hearing the echo or the volume of the echo can be reduced, and the quality of listening the voice can be improved.
It should be noted that the adaptive filter may be an algorithm or a device, and the filter coefficients may be automatically adjusted by adopting a specific algorithm based on the estimation of the statistical characteristics of the input and output signals, so that the adaptive filter achieves the optimal filter characteristics.
Referring to fig. 2, in the above embodiment, before performing the step S100 to perform the time delay alignment on the current far-end signal and the current near-end signal of the first device, the operations shown in fig. 2 may be performed to obtain the current far-end signal and the current near-end signal, which specifically includes:
step S080: an original far-end signal input by a loudspeaker of the first device and an original near-end signal received by a microphone of the first device are acquired.
During the conversation, the microphone of the second device collects the audio signal, sends the audio signal to the first device, and plays the audio signal through the loudspeaker of the first device. The audio signal sent by the second device to the first device is the original far-end signal. After the first device plays the original far-end signal sent by the second device, the microphone of the first device also receives the corresponding audio signal, which is the original near-end signal. The original near-end signal may include the ambient audio signal and the spoken voice of the user of the first device. The ambient audio signal may include an audio signal that is propagated to a microphone of the first device after various reflections after the original far-end signal is played out through a speaker of the first device, and may also include other audio signals.
Step S090: and respectively preprocessing the original far-end signal and the original near-end signal to obtain a current far-end signal and a current near-end signal.
Since the original far-end signal and the original near-end signal are both unprocessed audio signals, if the signals are not processed, subsequent echo cancellation work can be affected. Therefore, the original far-end signal and the original near-end signal are preprocessed in the embodiment, so that the subsequent echo cancellation operation is facilitated, the efficiency of echo cancellation is improved, echo residues are reduced, and the call quality is improved.
Specifically, the preprocessing step for the original far-end signal and the original near-end signal may include:
(1) and respectively framing the original far-end signal and the original near-end signal to obtain a multi-frame far-end signal and a multi-frame near-end signal.
Since the speech signal belongs to a quasi-stationary signal, i.e. stationary for short periods. The short time is generally 10-30ms, so that when the speech signal is processed, in order to reduce the overall unsteady and time-varying influence of the speech signal, the signal is subjected to framing, i.e. segmenting the speech signal, i.e. sampling the speech signal multiple times to analyze its characteristic parameters. After the original far-end signal and the original near-end signal are framed, the multi-frame far-end signal and the multi-frame near-end signal are correspondingly obtained. The signal obtained from the first sample point, i.e. the far-end signal of the first frame, i.e. the first far-end signal y (1), and the signal obtained for the second sample point, i.e. the far-end signal of the second frame, i.e. the second far-end signal y (2). The same is true for the near-end signal.
(2) And sequentially windowing and Fourier transforming each frame of far-end signal and each frame of near-end signal.
After the original far-end signal and the original near-end signal are framed, both ends of each frame are likely not to gradually change to 0, which is not beneficial to performing fourier transform on the multi-frame far-end signal and the multi-frame near-end signal subsequently. The far-end signal and the near-segment signal of each frame can be windowed, i.e., the amplitude of the far-end signal and the near-segment signal of each frame is gradually changed to 0 at both ends. After windowing the far-end signal and the near-segment signal of each frame, fourier transform may be performed on each frame of signal, and the far-end signal and the near-segment signal of each frame are mapped from the time domain to the frequency domain, so that the subsequent adaptive filter performs echo cancellation on the far-end signal and the near-segment signal, and the adaptive filter at this time is a frequency domain filter.
(3) And sequentially selecting a frame of far-end signals after Fourier transform as current far-end signals, and sequentially selecting a frame of near-end signals after Fourier transform as current near-end signals.
After the far-end signal and the near-end signal of each frame are subjected to Fourier transform, filtering operation can be carried out. The current far-end signal and the current near-end signal may be sequentially selected when proceeding to the next operation. When a frame of far-end signal is selected for filtering operation, the frame of far-end signal is the current far-end signal, and the near-end signal which is correspondingly generated and is subjected to Fourier transform is the current near-segment signal. For example, a first frame far-end signal is selected for filtering, the first frame far-end signal is a current far-end signal, and the first frame near-end signal is a current near-segment signal. And then selecting a second frame far-end signal to carry out filtering processing, wherein the second frame far-end signal is a current far-end signal, the second frame near-end signal is a current near-segment signal, and the rest frames are analogized in the same way.
In some embodiments, only the original far-end signal and the original near-end signal may be pre-processed for framing without windowing and fourier transformation. The far-end signal and the near-end signal, which are not subjected to windowing and fourier transform, are still time-domain signals, and the adaptive filter may also perform the filtering operation described in this embodiment on the time-domain signals, where the adaptive filter is a time-domain filter.
Referring to fig. 3, a schematic flow chart of another embodiment of the echo cancellation method of the present application is shown. Specifically, the method may include:
step S300: and performing time delay alignment on the current far-end signal and the current near-end signal of the first device.
Please refer to step S100.
In some embodiments, before performing the time delay alignment, the original far-end signal and the original near-end signal may also be preprocessed, specifically refer to steps S080-S090.
Since each parameter of the adaptive filter affects the echo cancellation effect of the adaptive filter, it is necessary to specifically define the parameter of the adaptive filter to improve the echo cancellation effect.
The process of defining the parameters of the adaptive filter in particular may comprise steps S301-S302.
Step S301: and subtracting the previous echo signal of the adaptive filter from the previous near-end signal to obtain a previous output signal, and obtaining a previous coefficient updating quantity.
When a user speaks, the spoken segment is split into a plurality of parts, namely a plurality of frames, by the device, so that the device can conveniently collect and process the spoken segment. That is, the split up upper and lower frames are actually consecutive. The previous coefficient update amount can thus be determined by subtracting the previous output signal of the previous echo signal of the adaptive filter from the previous near-end signal to improve the echo cancellation effect.
Specifically, the method for determining the previous coefficient update amount may be: and obtaining a previous output signal obtained by subtracting the previous echo signal obtained by the adaptive filter from the previous near-end signal, and taking the product of the previous output signal and the previous far-end signal as a previous coefficient updating quantity.
The previous coefficient update amount is expressed by Δ w (n-1), and the calculation formula can be specifically expressed as:
Δw(n-1)=y(n-1)*u(n-1)。
when the previous coefficient update amount Δ w (1) needs to be determined for filtering the current far-end signal y (2), the calculation formula is: Δ w (1) ═ y (1) × u (1).
Step S302: and obtaining the current filter coefficient of the adaptive filter based on the step length of the adaptive filter, the previous coefficient updating amount and the previous filter coefficient of the adaptive filter.
Generally, the smaller the step size of the adaptive filter, the slower the convergence, but at the same time, the smaller the mean square error of the filter, which means the better performance of echo cancellation. While the larger the step size of the adaptive filter, the faster the filter converges, but the residual echo will also be larger. Therefore, the filtering effect of the adaptive filter is affected by the convergence speed.
In addition, the filter coefficients of the adaptive filter may characterize the correlation with the transfer function in the near-end room, i.e. the transfer function of the sound signal from the loudspeaker to the microphone. Generally, the filter coefficients of the adaptive filter are adjusted a plurality of times to gradually approximate the room impulse response of the room in which the first device is located.
By determining the current filter coefficient of the adaptive filter by using the previous filter coefficient of the adaptive filter, the matching degree of the current filter coefficient and the impulse response of the environment where the first device is located can be improved. The above mentioned voice of the user speaking is split into multiple frames by the device, the upper and lower frames are continuous, and the correlation is very high, so that the current filter coefficient of the adaptive filter can be determined by using the previous filter coefficient to improve the echo cancellation effect.
In this embodiment, the current filter coefficient of the adaptive filter obtained by using the step length of the adaptive filter, the previous coefficient update amount, and the previous filter coefficient of the adaptive filter can improve the filtering effect of the adaptive filter, thereby improving the call quality.
Specifically, the specific calculation method of the current filter coefficient of the adaptive filter obtained by using the step size of the adaptive filter, the previous coefficient update amount, and the previous filter coefficient of the adaptive filter may be: and adding the previous filter coefficient of the adaptive filter to the product of the step size of the adaptive filter and the previous coefficient updating amount to obtain the current filter coefficient of the adaptive filter.
The current filter coefficient is represented by w (n), the step size of the adaptive filter is represented by μ, the update amount of the previous coefficient is represented by Δ w (n-1), and the calculation formula can be specifically expressed as:
w (n-1) + μ × Δ w (n-1), where w (n-1) is the previous filter coefficient.
When the current far-end signal y (2) is filtered and the current filter coefficient needs to be determined, the calculation formula is specifically as follows: w (2) ═ w (1) + μ Δ w (1).
Step S303: and filtering the current far-end signal by using a self-adaptive filter to obtain a current echo signal.
Please refer to step S101.
Step S304: and subtracting the current echo signal from the current near-end signal to obtain a current output signal.
Please refer to step S102.
Step S305: the current output signal is sent to the second device.
Please refer to step S103.
Referring to fig. 4, fig. 4 is a second flowchart of a second embodiment of the echo cancellation method of the present application, and specifically, the step S303 of obtaining the current echo signal may specifically include:
step S3031: and taking two first adaptive filters as filters to be compared, and acquiring the correlation degree between a previous echo signal of each filter to be compared and a reference signal, wherein the reference signal comprises a previous near-end signal and/or a previous output signal obtained by using the previous echo signal.
For echo cancellation, the echo in the current near-end signal can be cancelled by simultaneously filtering with a plurality of adaptive filters with different step sizes, and selecting the adaptive filter with the best filtering effect from the plurality of adaptive filters, so as to further improve the echo cancellation effect.
In the present embodiment, two adaptive filters are taken as an example, and how to further improve the echo cancellation effect by using a plurality of adaptive filters is described. That is, the adaptive filter of step S303 may include a first adaptive filter of two different step sizes. Wherein the step size of one first adaptive filter is larger than the step size of the other. The first device may simultaneously filter each far-end signal by using two first adaptive filters, and correspondingly obtain current echo signals generated by the two adaptive filters.
In a specific implementation scenario, two first adaptive filters are used as the filters to be compared. The two adaptive filters with different step lengths can filter each far-end signal simultaneously to obtain corresponding echo signals, and the obtained echo signals can be simultaneously utilized to obtain corresponding output signals. When filtering the current far-end signal y (2), the adaptive filter with a large step size filters the current far-end signal y (2) to obtain a current echo signal d1(2) After the adaptive filter with a shorter step length filters the current far-end signal y (2), the current echo signal d is obtained2(2). Further, the current echo signal d may be based on the current far-end signal y (2)1(2)、d2(2) And current near-end signal z (2) to obtain current output signals u respectively1(2) And u2(2)。
Since each far-end signal is filtered by the two first adaptive filters, in a specific implementation scenario, the filter to be compared (the two first adaptive filters) can determine the degree of correlation between the previous echo signal and the reference signal, and determine which filter has a good filtering effect according to the condition of the degree of correlation. The reference signal may be a previous near-end signal and/or a previous output signal derived using said previous echo signal. When the reference signal is the previous near-end signal, the correlation degree between the previous echo signal and the previous near-end signal is obtained. When the reference signal is a previous output signal obtained by filtering a previous echo signal obtained by using two first adaptive filters, the correlation degree between the previous echo signal and the previous output signal is obtained. When the reference signal is the previous near-end signal and the previous output signal, the degree of correlation between the previous echo signal and the two signals is obtained.
In one particular implementation scenario, when the first device is performing echo cancellation on the current far-end signal y (2)In operation, taking the first adaptive filter with a larger step size as an example, the correlation degree between the previous echo signal and the previous near-end signal is d1(1) And z (1); the degree of correlation between the previous echo signal and the previous output signal is d1(1) And u1(1) The degree of correlation between; the degree of correlation between the previous echo signal and the previous echo signal is d1(1) And z (1) and u1(1) The degree of correlation between the two. Two or more current echo signals can be obtained by simultaneously filtering the current far-end signal by using two or more adaptive filters, so that when a plurality of current echo signals are required to be selected in the following process, the obtained current echo signals can be directly used, and the efficiency is improved. And the filtering is performed by using the selected adaptive filter after the adaptive filter is selected, so that the time consumed by the whole process is further increased.
Step S3032: and selecting a first adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
After the first adaptive filters with two different step lengths are used for filtering the same far-end signal, the obtained two echo signals and the output signal can determine which adaptive filter has a better filtering effect by comparing whether the obtained correlation degree of the current echo signal with the previous near-end signal and/or the previous output signal meets the preset requirement or not, and then the current echo signal with a good effect is selected so as to improve the echo cancellation effect.
In a specific implementation scenario, when filtering the current far-end signal of the first frame, since the current far-end signal is the first frame, the previous far-end signal, the previous near-end signal, the previous echo signal, the previous output signal, and the like all of them are all absent, and therefore all of the signals related to the previous filtering can be regarded as 0. Under the condition, when the first frame is filtered, the adaptive filter with large step length is adopted for filtering, so that the effect of converging as soon as possible is achieved, and the aim of eliminating echo is fulfilled. It should be noted that, although the adaptive filter with a large step size is directly used for filtering, the adaptive filter with a small step size may also filter the current far-end signal of the first frame, and only the corresponding obtained current echo signal may not be actually used for echo cancellation.
In another specific implementation scenario, when filtering is performed on the far-end signal of the second frame and later, for example, the far-end signal of the second frame, the two filters will also filter the current far-end signal y (2) at the same time, and the current echo signal generated by the large-step-size adaptive filter is d1(2) Small is d2(2). And, the first device will also obtain z (2) corresponding to the current near-end signal. Meanwhile, the first device may also be based on the current far-end signal y (2) and the current echo signal d1(2)、d2(2) And current near-end signals z (2) respectively obtaining current output signals u1(2) And u2(2). At this time, the previous echo signal d can be obtained by the method according to the above step S30321(1)、d2(1) And the previous near-end signal z (1) and/or the previous output signal u1(1)、u2(1) Whether the correlation degree between the first adaptive filter and the second adaptive filter meets the preset requirement or not is judged to determine which adaptive filter has a better filtering effect, and then the first adaptive filter with a better filtering effect is selected.
Because the filtering effects of the two adaptive filters with different step lengths are compared, and whether the adaptive filters meet the preset requirement is judged, the adaptive filter with good filtering effect is obtained, so that the first adaptive filter meeting the preset requirement can be used for carrying out actual echo cancellation operation on the current far-end signal, and then the echo of the current near-end signal is cancelled through the obtained current echo signal, thereby improving the echo cancellation effect and the call quality.
It should be noted that, regardless of which first adaptive filter is finally selected, both first adaptive filters obtain an echo signal and a corresponding output signal according to the far-end signal. Only the output signal generated correspondingly according to the echo signal generated by the first adaptive filter with good filtering effect is selected and sent to the second device.
Referring to fig. 5, fig. 5 is a first flowchart of a third embodiment of the echo cancellation method according to the present application. Specifically, the method may include:
step S500: and performing time delay alignment on the current far-end signal and the current near-end signal of the first device.
Please refer to step S100.
Step S501: and subtracting the previous echo signal of the adaptive filter from the previous near-end signal to obtain a previous output signal, and obtaining a previous coefficient updating quantity.
Please refer to step S301 for a process of obtaining a previous coefficient update amount by the first adaptive filter.
Step S502: and obtaining the current filter coefficient of the adaptive filter based on the step length of the adaptive filter, the previous coefficient updating amount and the previous filter coefficient of the adaptive filter.
Please refer to step S302 for the process of the first adaptive filter specifically obtaining the current filter coefficient.
Step S503: and taking two first adaptive filters as filters to be compared, and acquiring the correlation degree between the previous echo signal of each filter to be compared and the reference signal.
Please refer to step S3031.
Step S504: and detecting whether the mobile phone is in a double-talk state.
In the process of conversation, the two-way speaking state is that the users of the first equipment and the second equipment speak simultaneously. In the process of communication, it is not limited that when only one of the first device or the second device can talk, the other end cannot talk, so that the double-talk state is normal in the process of communication. For example, when the second device has a person speaking, and the first device also has a person speaking at the same time, the two-way speaking state is obtained. When both the first device and the second device are not speaking, there is no possibility of generating echo, so that the case where both the first device and the second device are not speaking is not one of the cases of the technical problems to be solved by the present application, and the present embodiment does not describe this case. That is, the states in the present embodiment include two kinds, i.e., a double-talk state and a single-talk state.
In one implementation scenario, it may be detected by the first device whether in a dual talk state.
Step S505: and if so, taking the first adaptive filter and the second adaptive filter which meet the preset requirement as filters to be compared, and acquiring the correlation degree between the previous echo signal of each filter to be compared and the reference signal.
In this embodiment, the adaptive filter may further include a first adaptive filter and a second adaptive filter. Wherein the first adaptive filter comprises two adaptive filters with different step sizes, and the step size of one adaptive filter is larger than that of the other adaptive filter. In addition, the step size of the second adaptive filter is smaller than the step sizes of the two first adaptive filters. I.e. the step size of the second adaptive filter is the smallest of all filters.
In step S503, the filtering effect is compared by determining whether the correlation degree between the previous echo signal and the reference signal of the two first adaptive filters meets the preset requirement, and based on this operation, it can be determined which one of the two first adaptive filters has better filtering effect. At this time, the first adaptive filter and the second adaptive filter with good filtering effects may be used as filters to be compared, and the correlation degree between the previous echo signal and the reference signal of each filter to be compared (i.e., the first adaptive filter and the second adaptive filter) may be obtained, so as to determine which adaptive filter has the better filtering effect. In a specific implementation scenario, it is determined that the first adaptive filters with larger step sizes have better filtering effects through comparison. Based on the judgment, the first adaptive filter and the second adaptive filter with larger step length can be further used as the filters to be compared, and the correlation degree between the previous echo signal and the reference signal of the first adaptive filter and the second adaptive filter is compared with the preset requirement, so as to judge which filter has better filtering effect. It can be understood that, when the first adaptive filters with the smaller step sizes of the two first adaptive filters have better filtering effects, the first adaptive filter with the smaller step size and the second adaptive filter are used as filters to be compared, and the correlation degree between the previous echo signal and the reference signal of the first adaptive filter and the second adaptive filter is compared with the preset requirement, so as to determine which filter meets the preset requirement, and thus, which filter has better filtering effect is determined.
Step S506: and selecting a self-adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
Through step S505, according to a result of comparing the correlation degree between the previous echo signal and the reference signal of the first adaptive filter and the second adaptive filter with the preset requirement, which of the filtering effects of the first adaptive filter and the second adaptive filter is better can be determined, so as to obtain an adaptive filter with a good filtering effect. And then, the current far-end signal is filtered by using the adaptive filter with good filtering effect, and echo cancellation operation is performed by using the obtained current echo signal so as to improve the call quality.
Step S507: if not, selecting a first adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
Please refer to step S3032.
According to the above description, whether the single-talk state or the double-talk state is adopted, a current echo signal with good filtering effect is obtained. Therefore, the current echo signal can be used for the next echo cancellation operation.
With continued reference to fig. 5, step S508: and subtracting the current echo signal from the current near-end signal to obtain a current output signal.
Please refer to step S102.
Step S509: the current output signal is sent to the second device.
Please refer to step S103.
Referring to fig. 6, fig. 6 is a second flowchart illustrating a third embodiment of the echo cancellation method according to the present application, specifically, the step S503: and obtaining a correlation degree between the previous echo signal of each filter to be compared and the reference signal, wherein the specific process may include the following steps:
since the filtering effects of the two first adaptive filters with different step sizes are compared in step S503, the two first adaptive filters are the filters to be compared. In the following steps, the first adaptive filter with a larger step size is defined as a first filter to be compared, and the first adaptive filter with a smaller step size is defined as a second filter to be compared, that is, the two filters to be compared include the first adaptive filter with a larger step size and the first adaptive filter with a smaller step size. Of course, in other embodiments, the same is true for selecting the first adaptive filter with the smaller step size as the first to-be-compared filter, and details are not repeated in this embodiment.
Step S5031: and acquiring a third correlation coefficient between a first previous echo signal obtained by filtering the previous far-end signal by the first filter to be compared and the previous near-end signal, and acquiring a fourth correlation coefficient between the first previous echo signal and a previous output signal obtained by using the first previous echo signal.
The comparison of the filtering effects of the two filters to be compared needs to obtain the signals related to the filters to be compared and calculate the relationship between the two filters to be compared so as to compare the filtering effects. For the two filters to be compared, a first previous echo signal obtained by filtering a previous far-end signal by the first filter to be compared is obtained, the first previous echo signal at this time is the previous echo signal corresponding to the first filter to be compared, and then a third correlation coefficient is obtained according to the first previous echo signal and the previous near-end signal. The first filter to be compared is the first adaptive filter with larger step length.
In a specific implementation scenario, for the first filter to be compared (the first adaptive filter with a larger step size), the comparison result of the first filter to be compared to the previous far-end signal can be obtainedy (1) filtering the resulting first previous echo signal d1(1) The previous near-end signal z (1), then d is calculated1(1) And z (1) to obtain a third phase relation number alpha 3. Continuing to acquire and utilize the first previous echo signal d1(1) The resulting previous output signal u1(1) Then d can be calculated1(1) And u1(1) The fourth correlation coefficient α 4 is obtained from the previous correlation coefficients.
Step S5032: and acquiring a fifth correlation coefficient between a second previous echo signal and a previous near-end signal, which are obtained by filtering the previous far-end signal by the second filter to be compared, and acquiring a sixth correlation coefficient between the second previous echo signal and a previous output signal obtained by using the second previous echo signal.
The second filter to be compared is the first adaptive filter with smaller step length. For the second filter to be compared (the first adaptive filter with smaller step size), the second previous echo signal d obtained by filtering the previous far-end signal y (1) by the second filter to be compared can be obtained2(1) The second previous echo signal is the previous echo signal corresponding to the second filter to be compared, and then the second previous echo signal d is obtained2(1) And the previous near-end signal z (1), and the correlation coefficient between them is calculated to obtain a fifth correlation coefficient α 5. Continuing to acquire and utilize the second previous echo signal d2(1) The resulting previous output signal u2(1) Then, a second previous echo signal d can be calculated2(1) And the previous output signal u2(1) The sixth correlation coefficient α 6 is obtained.
Step S5033: comparing the third correlation coefficient with the fifth correlation coefficient and comparing the fourth correlation coefficient with the sixth correlation coefficient; if the third phase relation number is smaller than the fifth correlation coefficient and the fourth phase relation number is larger than the sixth phase relation number, determining that the correlation degree of the second filter to be compared meets the preset requirement; otherwise, determining that the correlation degree of the first filter to be compared meets the preset requirement.
In a specific implementation scenario, the third phase relation number is α 3, the fifth correlation coefficient is α 5, the fourth phase relation number is α 4, and the sixth phase relation number is α 6. The conditions for comparing the two filters are specifically: when alpha 3< alpha 5 and alpha 4> alpha 6, the correlation degree of the second filter to be compared is determined to meet the preset requirement, namely the filtering effect of the second filter to be compared is better than that of the first filter to be compared. Otherwise, if the above condition is not met, it is determined that the correlation degree of the first filter to be compared meets the preset requirement, that is, the filtering effect of the first filter to be compared is better than that of the second filter to be compared.
Referring to fig. 7, fig. 7 is a third flowchart illustrating a third embodiment of the echo cancellation method according to the present application, specifically, the step S504: detecting whether the mobile phone is in a double-talk state, and specifically comprising the following steps:
step S5041: a first correlation coefficient between a previous far-end signal and a previous near-end signal is obtained, and a second correlation coefficient between the previous near-end signal and a previous output signal sent to the second device is obtained.
When detecting whether the mobile phone is in the dual-talk state, the related audio signal and the filter coefficient can be used as a judgment condition to detect whether the mobile phone is in the dual-talk state.
In this embodiment, the first correlation coefficients between and among the previous far-end signal, the previous near-end signal, and the previous near-end signal, the previous output signal transmitted to the second device, and the second correlation coefficients therebetween are used as the determination conditions. It will be appreciated that other audio signals may be used as the determination condition.
In a specific implementation scenario, a filtering operation needs to be performed on the current far-end signal y (2), and at this time, it needs to first determine whether the far-end signal y (2) is in the double-talk state. At this time, the double talk state can be judged by acquiring the previous far-end signal y (1), the previous near-end signal z (1), the previous output signal u (1) actually transmitted to the second device, and calculating the correlation coefficient between them.
Specifically, the previous far-end signal y (1) and the previous near-end signal z (1) may be acquired, and the first correlation coefficient α 1 between the previous far-end signal y (1) and the previous near-end signal z (1) may be calculated. The previous near-end signal z (1) and the previous output signal u (1) actually sent to the second device are acquired and the second number of correlations α 2 between them is calculated.
It should be noted that, when there are two first adaptive filters, both of the first adaptive filters perform filtering processing on the far-end signal, and obtain an echo signal and a corresponding output signal. After comparison, the echo signal obtained by the first adaptive filter with good filtering effect is selected to perform echo cancellation, and the obtained echo signal is actually sent to the second device. For example, the first adaptive filter with larger step size and the first adaptive filter with smaller step size both filter the far-end signal y (1) and obtain the current echo signal d1(1)、d2(1) And a corresponding output signal u1(1)、u2(1). After comparison, if d1(1) The correlation degree between the reference signal and the reference signal meets the preset requirement, that is, it can be judged that the filtering effect of the first adaptive filter with the larger step size is better than that of the first adaptive filter with the smaller step size, the first adaptive filter with the larger step size is selected to perform the actual echo cancellation operation, and the obtained current output signal u is correspondingly obtained1(1) To a second device, u at that time1(1) I.e. the output signal u (1). Similarly, if the step size is smaller, the obtained d is obtained by the first adaptive filter2(1) The correlation degree between the reference signal and the reference signal meets the preset requirement, namely, the first adaptive filter with smaller step length can be judged to have good filtering effect, and the u generated correspondingly2(1) To a second device, u at that time2(1) I.e. the output signal u (1). At this time, for the filtering operation being performed on the current far-end signal y (2), the output signal u (1) is the previous output signal. Similarly, if the second adaptive filter is selected for filtering, the final output signal u is obtained3(1) To a second device, u at that time3(1) I.e. output signal u (1), which output signal u (1) is the previous output signal.
Step S5042: and judging whether the first correlation coefficient is smaller than a first threshold value or not and whether the second correlation coefficient is larger than a second threshold value or not.
After the first correlation coefficient and the second correlation coefficient are obtained through calculation, whether the mobile phone is in the double-talk state or not can be judged by using the correlation coefficient. The first device presets a correlation threshold value to judge the magnitude of the correlation coefficient, and when a preset condition is met, the first correlation coefficient is smaller than the first threshold value, and the second correlation coefficient is larger than the second threshold value, the first device judges that the first device is in a double-talk state. If the preset condition is not met, the single-talk state is judged.
In one implementation scenario, the first threshold is 0.1 and the second threshold is 0.9. The specific judgment conditions are that the first correlation coefficient alpha 1 is less than 0.1, and the second correlation coefficient alpha 2 is more than 0.9, and when the conditions are met, the double-talk state is judged; if the condition is not met, the single-talk state is judged.
If the dual-talk state is determined, the above step S505 is executed. If it is determined to be in the single talk state, the above step S507 is executed.
Referring to fig. 8, fig. 8 is a fourth flowchart illustrating a third embodiment of an echo cancellation method according to the present application.
In step S504, the first device detects that the first device is in the dual-talk state, and adds a second adaptive filter to further enhance the echo cancellation effect and improve the quality of the call.
In this embodiment, the second adaptive filter is not enabled when in the single talk state because the second adaptive filter is used only when the dual talk state is detected. That is, when the second adaptive filter is not enabled, the second adaptive filter does not generate the echo signal d for the far-end signal y (n)3(n) without using the echo signal d3(n) obtaining an output signal u3(n) in the formula (I). Thus, when the first device detects a change from the single talk state to the double talk state, meaning that the second adaptive filter has just been enabled, the previous far-end signal is not filtered since it was not previously used for echo cancellation operations, i.e. for the second adaptive filter at this time, there is no previous echo signal, previous output signal.
In another embodiment, the second adaptive filter may perform the filtering process on each far-end signal as the first adaptive filter. Therefore, for the second adaptive filter, the method for specifically calculating the third, fourth, fifth and sixth correlation coefficients can be referred to steps 5031-5033.
For the case that the second adaptive filter is enabled only in the dual-talk state, since the second adaptive filter is used for filtering, the related data related to the second adaptive filter is needed, and the absence of the related data may cause the echo cancellation operation to be disabled, the present embodiment provides a related calculation method, so that the second adaptive filter can perform the filtering operation normally. See in particular the following steps:
step S5051: and acquiring the first two coefficient updating quantity and the first two filter coefficients of the first filter to be compared.
In this step, the first adaptive filter with good filtering effect is compared with the second adaptive filter with good filtering effect. In the embodiment, the first filter to be compared has been defined as the filter with the larger step size, and the filter with the shorter step size is the second filter to be compared. Since the step length of the second adaptive filter is smaller than that of the two first adaptive filters, the second adaptive filter is the second filter to be compared, and the first adaptive filter with good filtering effect is the first filter to be compared.
In a specific implementation scenario, when detecting that the mobile terminal is in the dual-talk state, the first device needs to perform filtering processing on the current far-end signal y (n), and first device first obtains the first two coefficient update amounts Δ w (n-2) and the first two filter coefficients w (n-2) of the first filter to be compared. When the first filter to be compared is the first adaptive filter with larger step size, Δ w (n-2) is Δ w1(n-2), w (n-2) is w1(n-2). When the first filter to be compared is the first adaptive filter with smaller step size, Δ w (n-2) is Δ w2(n-2), w (n-2) is w2(n-2)。
Step S5052: and obtaining a previous filter coefficient of the second filter to be compared based on the step length of the second filter to be compared, the obtained previous two coefficient updating amount and the previous two filter coefficients.
After obtaining the correlation data needed for filtering with the second adaptive filter, the correlation calculation can be performed. Specifically, the step size of the second filter to be compared, the previous second coefficient update amount and the previous second filter coefficient of the first filter to be compared obtained in step S5051 are used to obtain the previous filter coefficient of the second filter to be compared.
In a specific implementation scenario, when the first filter to be compared is the first adaptive filter with a larger step size, the previous filter coefficient w of the second filter to be compared is3(n-1) the specific calculation formula is: w is a3(n-1)=w1(n-2)+μ3*Δw1(n-2). When the first filter to be compared is the first adaptive filter with smaller step length, the previous filter coefficient w of the second filter to be compared3(n-1) the specific calculation formula is: w is a3(n-1)=w2(n-2)+μ3*Δw2(n-2)。
Step S5053: and taking the obtained previous filter coefficient as the filter coefficient of a second filter to be compared so as to filter the previous far-end signal and obtain a second previous echo signal.
In a specific implementation scenario, the second previous echo signal may obtain an echo signal according to the previous far-end signal and the previous filter coefficient of the second adaptive filter, and since the previous filter coefficient obtained in step S5052 is already used as the previous filter coefficient of the second filter to be compared, the method for calculating the second previous echo signal may specifically be: d3(n-1)=y(n-1)*w3(n-1)。
Step S5054: a fifth correlation coefficient between the second previous echo signal and the previous near-end signal is obtained.
In a specific implementation scenario, a correlation coefficient between the second previous echo signal and the previous near-end signal may be calculated, so as to provide support for a subsequent echo cancellation operation. The correlation coefficient calculated by using the second previous echo signal and the previous near-end signal is the fifth correlation coefficient α 5. Of course, the sixth correlation coefficient α 6 may also be calculated from the second previous echo signal and the previous output signal obtained using the second previous echo signal.
Referring to fig. 9, fig. 9 is a block diagram of an embodiment of an electronic device for echo cancellation according to the present application. Specifically, the electronic device 90 may include a processor 91, a memory 92, a microphone 93, a speaker 94, a communication circuit 95, and a camera assembly 96.
The communication circuit 95 is used for transmission of audio signals with other devices. The microphone 93 is used to receive near-end signals. The speaker 94 is used to play the far-end signals received through the communication circuit. The memory 92 is used to store a computer program for executing the method described in the above embodiments. The camera assembly 96 is used to collect video signals. The processor 91 is used to run the computer program stored in the memory to perform the method described in the above embodiments.
Referring to fig. 10, fig. 10 is a schematic diagram of a frame of an embodiment of a storage medium of the present application. The computer-readable storage medium 101 stores a computer program 100, and the computer program 100, when executed by a processor, may implement the steps of the echo cancellation method in any of the embodiments described above.
The computer-readable storage medium 101 may be a medium that can store the computer program 100, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, or may be a server that stores the computer program 100, and the server can send the stored computer program 100 to another device for running, or can run the stored computer program 100 by itself.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (13)

1. An echo cancellation method, comprising:
performing time delay alignment on a current far-end signal and a current near-end signal of first equipment, wherein the current far-end signal and the current near-end signal are audio signals, and the current far-end signal is from second equipment which is in conversation with the first equipment;
the adaptive filter filters the current far-end signal according to a current filter coefficient to obtain a current echo signal, wherein the current filter coefficient of the adaptive filter is determined by the difference between a previous echo signal and a previous near-end signal of the adaptive filter, and the adaptive filter comprises a plurality of adaptive filters with different step lengths;
subtracting the current echo signal from the current near-end signal to obtain a current output signal;
sending the current output signal to the second device;
wherein, the adaptive filter filters the current far-end signal according to the current filter coefficient to obtain the current echo signal, including:
and selecting a self-adaptive filter meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
2. The method of claim 1, wherein before the adaptive filter filters the current far-end signal according to the current filter coefficient to obtain the current echo signal, the method further comprises:
subtracting a previous output signal obtained by subtracting a previous echo signal of the adaptive filter from the previous near-end signal to obtain a previous coefficient updating quantity;
and obtaining the current filter coefficient of the adaptive filter based on the step length of the adaptive filter, the previous coefficient updating amount and the previous filter coefficient of the adaptive filter.
3. The method of claim 2, wherein the subtracting a previous echo signal of the adaptive filter from the previous near-end signal to obtain a previous coefficient update amount using a previous output signal comprises:
obtaining a previous output signal obtained by subtracting a previous echo signal of the adaptive filter from the previous near-end signal, and taking the product of the previous output signal and the previous far-end signal as a previous coefficient updating quantity;
the obtaining a current filter coefficient of the adaptive filter based on the step size of the adaptive filter, the previous coefficient update amount, and the previous filter coefficient of the adaptive filter includes:
and adding the previous filter coefficient of the adaptive filter to the product of the step length of the adaptive filter and the previous coefficient updating amount to obtain the current filter coefficient of the adaptive filter.
4. The method of claim 2, wherein the adaptive filter comprises a first adaptive filter of two different step sizes;
the selecting a self-adaptive filter meeting preset requirements to filter the current far-end signal to obtain the current echo signal includes:
taking the two first adaptive filters as filters to be compared, and acquiring the correlation degree between a previous echo signal of each filter to be compared and a reference signal, wherein the reference signal comprises a previous near-end signal and/or a previous output signal obtained by using the previous echo signal;
and selecting the first adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
5. The method of claim 4, wherein the adaptive filter further comprises a second adaptive filter, wherein the step size of the second adaptive filter is smaller than the step sizes of the two first adaptive filters;
the selecting the first adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal includes:
detecting whether the mobile phone is in a double-talk state;
if so, taking the first adaptive filter and the second adaptive filter which meet the preset requirement as filters to be compared, and acquiring the correlation degree between the previous echo signal of each filter to be compared and the reference signal;
and selecting the self-adaptive filter with the correlation degree meeting the preset requirement to filter the current far-end signal to obtain the current echo signal.
6. The method of claim 5, wherein the detecting whether the mobile device is in a dual talk state comprises:
obtaining a first correlation coefficient between a previous far-end signal and a previous near-end signal, and obtaining a second correlation coefficient between the previous near-end signal and a previous output signal sent to the second device;
and judging whether the first correlation coefficient is smaller than a first threshold value or not and whether the second correlation coefficient is larger than a second threshold value or not, and if so, determining that the mobile phone is in a double-talk state.
7. The method according to claim 5, wherein the two filters to be compared comprise a first filter to be compared with a larger step size and a second filter to be compared with a smaller step size;
the obtaining the correlation degree between the previous echo signal of each filter to be compared and the reference signal comprises:
acquiring a third correlation coefficient between a first previous echo signal and a previous near-end signal, which are obtained by filtering a previous far-end signal by the first filter to be compared, and acquiring a fourth correlation coefficient between the first previous echo signal and a previous output signal obtained by using the first previous echo signal;
acquiring a fifth correlation coefficient between a second previous echo signal and a previous near-end signal, which are obtained by filtering a previous far-end signal by the second filter to be compared, and acquiring a sixth correlation coefficient between the second previous echo signal and a previous output signal obtained by using the second previous echo signal;
comparing the third correlation coefficient to a fifth correlation coefficient and comparing the fourth correlation coefficient to a sixth correlation coefficient; if the third phase relation number is smaller than the fifth correlation coefficient and the fourth phase relation number is larger than the sixth correlation coefficient, determining that the correlation degree of the second filter to be compared meets a preset requirement; otherwise, determining that the correlation degree of the first filter to be compared meets the preset requirement.
8. The method according to claim 7, wherein when the second filter to be compared is a second adaptive filter, the obtaining a fifth correlation coefficient between a second previous echo signal obtained by filtering the previous far-end signal by the second filter to be compared and the previous near-end signal comprises:
acquiring a first two coefficient updating quantity and a first two filter coefficients of the first filter to be compared;
obtaining a previous filter coefficient of the second filter to be compared based on the step length of the second filter to be compared, the obtained previous second coefficient updating amount and the previous second filter coefficient;
taking the obtained previous filter coefficient as a filter coefficient of a second filter to be compared so as to filter the previous far-end signal to obtain a second previous echo signal;
obtaining a fifth correlation coefficient between the second previous echo signal and the previous near-end signal.
9. The method of claim 1, wherein prior to said time delay aligning a current far-end signal and a current near-end signal of the first device, the method further comprises:
acquiring an original far-end signal input by a loudspeaker of the first device and an original near-end signal received by a microphone of the first device;
and respectively preprocessing the original far-end signal and the original near-end signal to obtain the current far-end signal and the current near-end signal.
10. The method of claim 9, wherein the adaptive filter is a frequency domain adaptive filter;
the preprocessing the original far-end signal and the original near-end signal respectively to obtain the current far-end signal and the current near-end signal includes:
framing the original far-end signal and the original near-end signal respectively to obtain a multi-frame far-end signal and a multi-frame near-end signal;
windowing and Fourier transformation are sequentially carried out on each frame of far-end signal and each frame of near-end signal;
and sequentially selecting a frame of far-end signals after Fourier transform as current far-end signals, and sequentially selecting a frame of near-end signals after Fourier transform as current near-end signals.
11. An electronic device comprising a processor and a memory, a microphone, a speaker, and a communication circuit, each coupled to the processor;
the communication circuit is used for transmitting audio signals with other equipment;
the microphone is used for receiving a near-end signal;
the loudspeaker is used for playing the far-end signal received by the communication circuit;
the processor is configured to execute the computer program stored in the memory to perform the method of any of claims 1-10.
12. The electronic device of claim 11, further comprising a camera assembly.
13. A storage device, characterized in that the storage device stores a computer program which, when executed by a processor, implements the method of any one of claims 1-10.
CN201911320924.9A 2019-12-19 2019-12-19 Echo cancellation method, electronic device, and storage device Active CN110992923B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911320924.9A CN110992923B (en) 2019-12-19 2019-12-19 Echo cancellation method, electronic device, and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911320924.9A CN110992923B (en) 2019-12-19 2019-12-19 Echo cancellation method, electronic device, and storage device

Publications (2)

Publication Number Publication Date
CN110992923A CN110992923A (en) 2020-04-10
CN110992923B true CN110992923B (en) 2022-06-07

Family

ID=70065604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911320924.9A Active CN110992923B (en) 2019-12-19 2019-12-19 Echo cancellation method, electronic device, and storage device

Country Status (1)

Country Link
CN (1) CN110992923B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111683184B (en) * 2020-05-21 2021-09-10 浙江大华技术股份有限公司 Echo signal processing method, echo signal processing device and computer storage medium
CN111933166B (en) * 2020-07-31 2024-01-26 广州视源电子科技股份有限公司 Echo suppression method, device, storage medium and electronic equipment
CN113362844B (en) * 2021-07-26 2022-05-10 西南交通大学 Low-complexity decorrelation self-adaptive acoustic echo cancellation method and device
CN115602184A (en) * 2022-09-23 2023-01-13 北京沃东天骏信息技术有限公司(Cn) Echo cancellation method, echo cancellation device, electronic equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101461257A (en) * 2006-05-30 2009-06-17 微软公司 Adaptive acoustic echo cancellation
CN102592605A (en) * 2003-09-02 2012-07-18 日本电气株式会社 Signal processing method and apparatus
CN106533500A (en) * 2016-11-25 2017-03-22 上海伟世通汽车电子系统有限公司 Method for optimizing convergence characteristic of acoustic echo canceller
CN107123430A (en) * 2017-04-12 2017-09-01 广州视源电子科技股份有限公司 Echo cancel method, device, meeting flat board and computer-readable storage medium
CN107134281A (en) * 2017-05-04 2017-09-05 重庆第二师范学院 Adaptive filter coefficient update method during a kind of adaptive echo is eliminated
CN109451195A (en) * 2018-09-18 2019-03-08 北京佳讯飞鸿电气股份有限公司 A kind of echo cancel method and system of adaptive double-end monitor
CN109559756A (en) * 2018-10-26 2019-04-02 北京佳讯飞鸿电气股份有限公司 Filter factor determines method, echo cancel method, related device and equipment
CN109754813A (en) * 2019-03-26 2019-05-14 南京时保联信息科技有限公司 Variable step echo cancel method based on fast convergence characteristic
CN109785853A (en) * 2019-03-11 2019-05-21 出门问问信息科技有限公司 A kind of echo cancel method, device, system and storage medium
CN110138990A (en) * 2019-05-14 2019-08-16 浙江工业大学 A method of eliminating mobile device voip phone echo

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7778408B2 (en) * 2004-12-30 2010-08-17 Texas Instruments Incorporated Method and apparatus for acoustic echo cancellation utilizing dual filters
US9805734B2 (en) * 2010-10-08 2017-10-31 Nec Corporation Signal processing device, signal processing method and signal processing program for noise cancellation

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102592605A (en) * 2003-09-02 2012-07-18 日本电气株式会社 Signal processing method and apparatus
CN101461257A (en) * 2006-05-30 2009-06-17 微软公司 Adaptive acoustic echo cancellation
CN106533500A (en) * 2016-11-25 2017-03-22 上海伟世通汽车电子系统有限公司 Method for optimizing convergence characteristic of acoustic echo canceller
CN107123430A (en) * 2017-04-12 2017-09-01 广州视源电子科技股份有限公司 Echo cancel method, device, meeting flat board and computer-readable storage medium
CN107134281A (en) * 2017-05-04 2017-09-05 重庆第二师范学院 Adaptive filter coefficient update method during a kind of adaptive echo is eliminated
CN109451195A (en) * 2018-09-18 2019-03-08 北京佳讯飞鸿电气股份有限公司 A kind of echo cancel method and system of adaptive double-end monitor
CN109559756A (en) * 2018-10-26 2019-04-02 北京佳讯飞鸿电气股份有限公司 Filter factor determines method, echo cancel method, related device and equipment
CN109785853A (en) * 2019-03-11 2019-05-21 出门问问信息科技有限公司 A kind of echo cancel method, device, system and storage medium
CN109754813A (en) * 2019-03-26 2019-05-14 南京时保联信息科技有限公司 Variable step echo cancel method based on fast convergence characteristic
CN110138990A (en) * 2019-05-14 2019-08-16 浙江工业大学 A method of eliminating mobile device voip phone echo

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Novel variable step size NLMS algorithms for echo cancellation";MA Iqbal等;《ICASSP 2008》;20081231;全文 *
"自适应噪声抵消技术中一种变步长的最小均方(LMS)算法研究";高慧 等;《航天医学与医学工程》;20021031;第15卷(第5期);全文 *

Also Published As

Publication number Publication date
CN110992923A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110992923B (en) Echo cancellation method, electronic device, and storage device
US11297178B2 (en) Method, apparatus, and computer-readable media utilizing residual echo estimate information to derive secondary echo reduction parameters
JP4377952B1 (en) Adaptive filter and echo canceller having the same
JP2003234679A (en) Gain control method for executing acoustic echo cancellation and suppression
CN111031448B (en) Echo cancellation method, echo cancellation device, electronic equipment and storage medium
CN110956975B (en) Echo cancellation method and device
CN106657507A (en) Acoustic echo cancellation method and device
CN109559756B (en) Filter coefficient determining method, echo eliminating method, corresponding device and equipment
JP2013509774A (en) Method and apparatus for canceling acoustic echo by audio watermark
CN111556210B (en) Call voice processing method and device, terminal equipment and storage medium
JP4155774B2 (en) Echo suppression system and method
CN109215672B (en) Method, device and equipment for processing sound information
US8582754B2 (en) Method and system for echo cancellation in presence of streamed audio
CN103370741B (en) Process audio signal
CN112489679B (en) Evaluation method and device of acoustic echo cancellation algorithm and terminal equipment
JP2003309493A (en) Method, device and program for reducing echo
CN115620737A (en) Voice signal processing device, method, electronic equipment and sound amplification system
CN112489680B (en) Evaluation method and device of acoustic echo cancellation algorithm and terminal equipment
CN113241084B (en) Echo cancellation method, device and equipment
Fukui et al. Acoustic echo and noise canceller for personal hands-free video IP phone
KR102172608B1 (en) Apparatus and method for removing acoustic echo based on deep learning standing up to double talks
KR20220157475A (en) Echo Residual Suppression
JP4903843B2 (en) Adaptive filter and echo canceller having the same
JP4964267B2 (en) Adaptive filter and echo canceller having the same
Kotte Performance Analysis of Adaptive Algorithms based on different parameters Implemented for Acoustic Echo Cancellation in Speech Signals

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant