Echo cancellation method and device, electronic device and storage medium
By calculating the mel frequency cepstral correlation coefficient of the far-end reference signal and the near-end acquisition signal, and calculating the optimal nonlinear echo filtering gain coefficient, the problem of the impact of the echo cancellation algorithm on nonlinear distortion in multi-channel acoustic echo processing is solved , achieving higher inclusiveness and robustness.
Patent Information
- Application Number
- CN202111601983.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-12-24
AI Technical Summary
In multi-channel acoustic echo processing, it is difficult for existing technologies to effectively reduce the impact of nonlinear distortion caused by playback equipment on the echo cancellation algorithm.
By calculating the reverberation spectrum of the far-end reference signal and the Mel frequency cepstral correlation coefficient of the near-end acquisition signal, it is determined whether it is a single-talk mode, and the optimal nonlinear echo is calculated based on the nonlinear gain coefficient, reverberation spectrum and power spectrum. Filter out the gain coefficient and perform echo cancellation.
It realizes that there is no need to process the reference signal in the case of multi-channel, enhances the inclusiveness and robustness of the echo cancellation algorithm, and effectively reduces the impact of non-linear distortion of the playback device.
Smart Images

Figure CN114171049B
Abstract
Description
Background Art
[0002] Current acoustic echo processing, when involving multiple channels, requires processing of the reference signal. At the same time, the strength of the nonlinear distortion caused by the playback device has a significant impact on the echo cancellation algorithm.
[0003] It can be seen that how to implement echo cancellation to be applicable to multi-channel acoustic echo processing while reducing the impact of the nonlinear distortion of the playback device on the echo cancellation algorithm is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0004] In order to overcome the defects of the above-mentioned prior art, the present application provides an echo cancellation method and device, an electronic device and a storage medium, so as to realize echo cancellation, which is suitable for multi-channel acoustic echo processing and reduces the influence of the nonlinear distortion strength of the playback device on the echo cancellation algorithm.
[0005] According to one aspect of the present application, there is provided an echo cancellation method, comprising:
[0006] Calculate the reverberation spectrum of the far-end reference signal;
[0007] Calculate the Mel frequency cepstrum correlation coefficient according to the far-end reference signal and the near-end acquisition signal;
[0008] According to the comparison between the Mel frequency cepstrum correlation coefficient and the preset single-speaking threshold, whether it is the single-speaking mode is determined;
[0009] If yes, then the nonlinear gain coefficient is calculated based on the power spectrum of the near-end acquisition signal and the reverberation spectrum of the far-end reference signal;
[0010] The estimated echo is calculated based on the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal;
[0011] According to the comparison result of the power spectrum of the estimated echo and the near-end acquisition signal, the value of the binary mask is calculated;
[0012] When the number of 1s in the binary mask value is greater than or equal to the set threshold, the echo cancellation amplitude gain is calculated according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal, and the power spectrum of the near-end acquisition signal;
[0013] Calculate the existence probability of near-end speech according to the prior speech echo ratio and the posterior speech echo ratio;
[0014] Calculate the optimal nonlinear echo filtering gain coefficient according to the echo amplitude gain and the existence probability of the near-end speech;
[0015] The optimal nonlinear echo filtering gain coefficient is multiplied by the near-end acquisition signal to perform echo cancellation.
[0016] In some embodiments of the present application, calculating the reverberation spectrum of the remote reference signal includes:
[0017] Calculate the smoothing factor based on the reverberation time;
[0018] After performing frame division and windowing operations on the remote reference signal, Fourier transform is performed to obtain the power spectrum of the remote signal;
[0019] The power spectrum of the far-end reference signal is smoothed by using the smoothing factor to obtain the reverberation spectrum of the far-end reference signal.
[0020] In some embodiments of the present application, calculating the Mel-frequency cepstrum correlation coefficient according to the far-end reference signal and the near-end acquisition signal includes:
[0021] The remote reference signal is used as a signal to be processed, and a Mel-frequency cepstral coefficient feature vector acquisition step is performed on the signal to be processed to acquire a Mel-frequency cepstral coefficient feature vector of the remote reference signal;
[0022] The near-end reference signal is used as a signal to be processed, and a Mel-frequency cepstral coefficient feature vector acquisition step is performed on the signal to be processed to acquire a Mel-frequency cepstral coefficient feature vector of the near-end reference signal;
[0023] The mel-frequency cepstrum correlation coefficient is calculated according to the mel-frequency cepstrum coefficient feature vector of the far-end reference signal and the mel-frequency cepstrum coefficient feature vector of the near-end reference signal.
[0024] In some embodiments of the present application, the step of obtaining a Mel-frequency cepstral coefficient feature vector includes:
[0025] Perform pre-emphasis, frame division and windowing processing on the signal to be processed, and obtain the frequency spectrum of the signal to be processed distributed in different time windows on the time axis through Fourier transform;
[0026] The spectrum is filtered through Mel filter to obtain Mel spectrum;
[0027] Perform cepstrum analysis on the Mel frequency spectrum to obtain the Mel frequency cepstrum coefficient feature vector of the signal to be processed.
[0028] In some embodiments of the present application, calculating the value of the binary mask according to the comparison result of the power spectrum of the estimated echo and the near-end acquisition signal includes:
[0029] When the power spectrum of the near-end acquisition signal is greater than the estimated echo, the value of the binary mask is 1;
[0030] When the power spectrum of the near-end collected signal is not greater than the estimated echo, the value of the binary mask is 0.
[0031] In some embodiments of the present application, the a priori speech echo ratio is the ratio of the power spectrum of the near-end acquisition signal to the power spectrum of the echo, and the a posteriori speech echo ratio is the ratio of the power spectrum of the near-end speech signal to the power spectrum of the echo.
[0032] In some embodiments of the present application, the near-end speech existence probability is calculated based on at least a priori near-end speech existence probability, and the prior near-end speech existence probability is tracked frame by frame at each frequency point in each frame signal.
[0033] According to another aspect of the present application, an echo cancellation device is also provided, comprising:
[0034] A first calculation module, configured to calculate a reverberation spectrum of a remote reference signal;
[0035] A second calculation module is configured to calculate a Mel frequency cepstrum correlation coefficient according to a far-end reference signal and a near-end acquisition signal;
[0036] A judgment module, configured to judge whether it is a single-speaker mode according to a comparison between a Mel frequency cepstrum correlation coefficient and a preset single-speaker threshold;
[0037] A third calculation module is configured to calculate a nonlinear gain coefficient according to a power spectrum of a near-end acquisition signal and a reverberation spectrum of a far-end reference signal when the judgment module judges that the nonlinear gain coefficient is yes;
[0038] a fourth calculation module, configured to calculate an estimated echo according to the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal;
[0039] a fifth calculation module, configured to calculate a value of a binary mask according to a comparison result of a power spectrum of the estimated echo and a near-end collected signal;
[0040] a sixth calculation module, configured to calculate the echo cancellation amplitude gain according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal, and the power spectrum of the near-end collected signal when the number of 1s in the value of the binary mask is greater than or equal to a set threshold;
[0041] a seventh calculation module, configured to calculate the existence probability of the near-end speech according to the prior speech echo ratio and the posterior speech echo ratio;
[0042] An eighth calculation module, configured to calculate an optimal nonlinear echo filtering gain coefficient according to the echo cancellation amplitude gain and the existence probability of the near-end speech;
[0043] The echo cancellation module is configured to multiply the optimal nonlinear echo filtering gain coefficient with the near-end acquisition signal to perform echo cancellation.
[0044] According to another aspect of the present application, an electronic device is provided, the electronic device comprising: a processor; a storage medium on which a computer program is stored, and the computer program executes the above steps when executed by the processor.
[0045] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above steps are executed.
[0046] It can be seen that the solution provided by this application has the following advantages compared with the prior art:
[0047] The present application adopts Mel-frequency cepstrum correlation coefficient for acoustic echo processing, which is applicable to both mono and multi-channel situations. Since the echo cancellation algorithm of the present application is a nonlinear processing process, it is more inclusive and robust than other filtering processes (such as normalized least mean square adaptive filtering), so that in multi-channel, there is no need to perform any processing on the reference signal; at the same time, it can effectively reduce the influence of the nonlinear distortion (such as clipping distortion, harmonic distortion, intermodulation distortion, transient distortion, AC interface distortion, etc.) caused by the playback device on the echo cancellation algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above and other features and advantages of the present application will become more apparent by describing in detail example embodiments thereof with reference to the attached drawings.
[0049] Figure 1 A flow chart of an echo cancellation method according to an embodiment of the present application is shown.
[0050] Figure 2 A flowchart of the steps of obtaining a Mel-frequency cepstral coefficient feature vector according to an embodiment of the present application is shown.
[0051] Figure 3 A module diagram of an echo cancellation device according to an embodiment of the present application is shown.
[0052] Figure 4 A schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure is schematically shown.
[0053] Figure 5 A schematic diagram of an electronic device in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0054] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0055] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0056] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined. Therefore, the actual execution order may be changed according to the actual situation.
[0057] In order to overcome the defects of the above-mentioned prior art, the present application provides an echo cancellation method and device, an electronic device and a storage medium, so as to realize echo cancellation, which is suitable for multi-channel acoustic echo processing, and at the same time reduces the influence of the nonlinear distortion strength of the playback device on the echo cancellation algorithm.
[0058] See first Figure 1 , Figure 1 A flow chart of an echo cancellation method according to an embodiment of the present application is shown. The echo cancellation method provided by the present application includes:
[0059] Step S100: Calculate the reverberation spectrum of the far-end reference signal;
[0060] Specifically, the present application is applied to near-end and far-end interaction. Generally speaking, the near-end system includes a playback device and a collection device. The playback device can simultaneously play the audio signal transmitted by the far-end and the audio signal collected by the near-end. At the same time, the audio signal collected by the near-end will include the audio signal played by the playback device. As a result, voice echo will be generated during the audio playback, transmission and collection process.
[0061] Specifically, the far-end reference signal is a signal sent from the far end to the near end to be played.
[0062] Specifically, the reverberation spectrum of the remote reference signal can be calculated through the following steps: calculating a smoothing factor according to the reverberation time; performing a framing and windowing operation on the remote reference signal, and then performing a Fourier transform to obtain a power spectrum of the remote signal; and using the smoothing factor to smooth the power spectrum of the remote reference signal to obtain the reverberation spectrum of the remote reference signal.
[0063] Among them, T 60 is the reverberation time. 60 Specifically, it is the time (in milliseconds) required for the voice to attenuate by 60 dB after the voice stops speaking. The echo cancellation algorithm takes α milliseconds to process one frame, so a total of T60 / α frames are required to achieve a 60 dB attenuation. 60, according to this formula, the smoothing factor can be calculated The far-end reference signal is framed, windowed, and then fast Fourier transformed to obtain the power spectrum of the far-end reference signal |RefFft(w,j)|| 2 Therefore, the reverberation spectrum of the remote reference signal can be calculated according to the following formula:
[0064]
[0065] Among them, Reverb(w,j) is the reverberation spectrum at the current moment, and Reverb(w,j-1) is the reverberation spectrum at the previous frame moment. is the smoothing factor, |RefFft(w,j)| 2 is the power spectrum of the remote reference signal after fast Fourier transformation.
[0066] Step S110: Calculate the Mel-frequency cepstrum correlation coefficient according to the far-end reference signal and the near-end acquisition signal.
[0067] Specifically, step S110 can be implemented by the following steps: taking the far-end reference signal as the signal to be processed, executing the Mel-frequency cepstral coefficient feature vector acquisition step for the signal to be processed, and obtaining the Mel-frequency cepstral coefficient feature vector of the far-end reference signal; taking the near-end reference signal as the signal to be processed, executing the Mel-frequency cepstral coefficient feature vector acquisition step for the signal to be processed, and obtaining the Mel-frequency cepstral coefficient feature vector of the near-end reference signal; calculating the Mel-frequency cepstral correlation coefficient based on the Mel-frequency cepstral coefficient feature vector of the far-end reference signal and the Mel-frequency cepstral coefficient feature vector of the near-end reference signal.
[0068] Furthermore, the Mel frequency cepstral coefficient feature vector acquisition steps are as follows: Figure 2 As shown, including:
[0069] Step S111: performing pre-emphasis, frame division and windowing processing on the signal to be processed, and obtaining the frequency spectra of the signal to be processed distributed in different time windows on the time axis through Fourier transform.
[0070] Specifically, pre-emphasis refers to emphasizing the high-frequency part of the speech signal, removing the influence of lip radiation, and increasing high-frequency resolution. Framing is to divide a long speech signal into sections. Since the speech signal has short-term stability, framing can facilitate the processing of the speech signal. Windowing is to make the framed speech signal more stable and enable the time domain signal of the speech signal to better meet the periodicity requirements of the fast Fourier transform.
[0071] Specifically, step S111 can obtain the corresponding spectrum for each short-time analysis window through fast Fourier transform, so as to obtain the spectrum of the signal to be processed distributed in different time windows on the time axis.
[0072] Step S112: The spectrum is filtered through Mel filtering to obtain a Mel spectrum.
[0073] Specifically, step S112 can process the spectrum through a Mel filter bank, thereby converting the linear natural spectrum into a Mel spectrum that reflects the special effects of human hearing.
[0074] Step S113: performing cepstrum analysis on the Mel-frequency spectrum to obtain a Mel-frequency cepstrum coefficient feature vector of the signal to be processed.
[0075] Specifically, the cepstrum analysis of the Mel spectrum may include taking the logarithm of the spectrum and then performing an inverse transform. The inverse transform can generally be achieved by discrete cosine transform (DCT). Furthermore, after the Mel spectrum is inversely transformed, the 2nd to 13th coefficients are taken as vector data for calculating the correlation coefficient in the Mel-frequency cepstrum coefficient feature vector of the signal to be processed. The present application is not limited to this. Other inverse transform methods and feature acquisition methods are also within the scope of protection of the present application.
[0076] Specifically, the Mel frequency cepstrum correlation coefficient is calculated according to the following formula:
[0077]
[0078] Where cohn is the Mel-frequency cepstral correlation coefficient, farMFCC(i) is the Mel-frequency cepstral coefficient eigenvector of the far-end reference signal, MicMFCC(i) is the Mel-frequency cepstral coefficient eigenvector of the near-end acquisition signal, and sqrt() is the square root function of a non-negative real number.
[0079] Step S120: Determine whether the mode is single-speaker mode based on the comparison between the Mel-frequency cepstrum correlation coefficient and the preset single-speaker threshold.
[0080] Specifically, the single-talk mode is a situation where only the far end speaks. Since only the far end speaks, the voice signal collected from the near end collection device only contains the far end echo, but not the near end voice.
[0081] Specifically, the preset single-talk threshold can be set as needed. In some embodiments, the preset single-talk threshold can also be obtained based on experimental measurement. This application is not limited to this.
[0082] If the judgment in step S120 is yes, then step S130 is executed: a nonlinear gain coefficient is calculated according to the power spectrum of the near-end collected signal and the reverberation spectrum of the far-end reference signal.
[0083] Specifically, the nonlinear gain coefficient can be calculated according to the following formula:
[0084] specgain(w)=|MicFft(w)| 2 / Reverb(w)
[0085] Where, specgain(w) is the nonlinear gain coefficient, |MicFft(w)| 2 is the power spectrum of the near-end acquisition signal, and Reverb(w) is the reverberation spectrum of the far-end reference signal. Specifically, the calculation method of the power spectrum of the near-end acquisition signal can be consistent with the calculation method of the power spectrum of the far-end reference signal, and the present application is not limited thereto.
[0086] Step S140: Calculate the estimated echo according to the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal.
[0087] Specifically, the estimated echo is used to estimate the echo that may be collected by the near-end collection device. The estimated echo can be calculated according to specgain(w)*Reverb(w)*gate. Among them, specgain(w) is the nonlinear gain coefficient, Reverb(w) is the reverberation spectrum of the far-end reference signal, and gate is the adjustment gain value, which can be any constant between 1 and 2. The adjustment gain value can be set as needed, and this application is not limited to this.
[0088] Step S150: Calculate the value of the binary mask according to the comparison result of the power spectrum of the estimated echo and the near-end collected signal.
[0089] Specifically, when the power spectrum of the near-end collected signal is greater than the estimated echo, the value of the binary mask is 1; when the power spectrum of the near-end collected signal is not greater than the estimated echo, the value of the binary mask is 0.
[0090] Step S160: when the number of 1s in the binary mask value is greater than or equal to the set threshold, the echo cancellation amplitude gain is calculated according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal and the power spectrum of the near-end acquisition signal.
[0091] Specifically, the threshold value can be set as needed or according to experimental measurement, and the present application is not limited to this. If the number of 1s in the value of the binary masking film is less than the set threshold, the floating value mask of each frequency point can be made 0 (to indicate that the current mode is single-speaking), so as to adjust the voice signal through the floating value mask. In the technology using the floating value mask, the time domain voice signal is first transformed into a two-dimensional time-frequency expression, and the energy ratio between the voice signal and the noise is calculated for each time-frequency unit, and then the weight is determined according to the calculated energy ratio to change the energy size of the time-frequency unit, and the degree of noise suppression on each time-frequency unit is adjusted, thereby improving the voice quality. Each element of the floating value mask can take a constant value of 0 to 1.
[0092] Specifically, the echo cancellation amplitude gain can be calculated according to the following formula:
[0093]
[0094] Among them, FltBask(w) is the amplitude gain for canceling echo, specgain(w) is the nonlinear gain coefficient, Reverb(w) is the reverberation spectrum of the far-end reference signal, |MicFft(w)| 2 Acquire the power spectrum of the signal for the near end.
[0095] Step S170: Calculate the existence probability of the near-end speech according to the priori speech echo ratio and the posterior speech echo ratio.
[0096] Specifically, the prior speech echo ratio is the ratio of the power spectrum of the near-end collected signal to the power spectrum of the echo. It can be expressed as follows: γ(w) = |MicFft(w)| 2 / λ d (w), where γ(w) is the prior speech echo ratio, |MicFft(w)| 2 is the power spectrum of the near-end acquisition signal, λ d (w) is the echo power spectrum.
[0097] Specifically, the posterior speech echo ratio is the ratio of the power spectrum of the near-end speech signal to the power spectrum of the echo. It can be expressed as follows: ξ(w) = λ s (w) / λ d (w), where ξ(w) is the posterior speech echo ratio, λ s (w) is the power spectrum of the near-end speech signal (the speech signal emitted by the near-end), λ d (w) is the echo power spectrum.
[0098] Specifically, let H0 represent the absence of near-end speech signal and H1 represent the presence of near-end speech signal, then:
[0099] P(MicFft(w)|H0)=1 / (π*λ d (w))*exp(-|MicFft(w)| 2 / λ d (w));
[0100] P(MicFft(w)|H1)
[0101] =1 / (π*(λ d (w)+λ s (w))*exp(-|MicFft(w)| 2 / (λ d (w)
[0102] +λ s (w)))
[0103] Where P(MicFft(w)|H0) is the probability that the near-end collected signal is MicFft(w) when the near-end speech signal does not exist, λ d (w) is the echo power spectrum, exp() is an exponential function with the natural constant e as the base, |MicFft(w)| 2 is the power spectrum of the near-end collected signal; P(MicFft(w)|H1) is the probability that the near-end collected signal is MicFft(w) when the near-end speech signal exists, λ s (w) is the near-end speech signal.
[0104] According to the above formula, the probability of the presence of the near-end speech signal P(H1|MicFft(w)) is:
[0105] P(H1|MicFft(w))=P(MicFft(w)||H1)*P(H1) / (P(MicFft(w)||H0)*P(H0)+
[0106] P(MicFft(w)|H1)*P(H1))
[0107] =μ(w)*Λ(MicFft(w)) / (1+μ(w)*Λ(MicFft(w)))
[0108] Where, μ(w)=P(H1) / P(H0);
[0109]
[0110] Among them, ξ(w) is the a posteriori signal echo ratio, and γ(w) is the a priori signal echo ratio.
[0111] Furthermore, P(H1) is the prior probability of near-end speech presence, and P(H0) is the prior probability of near-end speech absence. P(H1) can be expressed as Indicates that it can track each frequency point of each frame signal frame by frame:
[0112]
[0113] in,
[0114] in, is the prior near-end speech existence probability of the current frame, is the prior near-end speech existence probability of the previous frame, θ is the probability smoothing factor (can be set as needed, for example, it can be set to 0.8), I(w,j) is the binary mask value obtained by the prior signal echo ratio, γ(w,j) is the prior signal echo ratio, γ th is the threshold (can be set as needed).
[0115] Step S180: Calculate the optimal nonlinear echo filtering gain coefficient according to the echo cancellation amplitude gain and the existence probability of the near-end speech.
[0116] Specifically, the optimal nonlinear echo filtering gain coefficient can be calculated according to the following formula:
[0117] G(w)=P(H1|MicFft(w))*FltBask(w)
[0118] Wherein, G(w) is the optimal nonlinear echo filtering gain coefficient, P(H1|MicFft(w)) is the probability of the presence of the near-end speech signal, and FltBask(w) is the echo amplitude gain for offsetting.
[0119] Step S190: multiplying the optimal nonlinear echo filtering gain coefficient by the near-end acquisition signal to perform echo cancellation.
[0120] Therefore, in the echo cancellation method provided by the present application, the present application adopts Mel-frequency cepstrum correlation coefficient to perform acoustic echo processing, so as to be applicable to mono and multi-channel situations. Since the echo cancellation algorithm of the present application is a nonlinear processing process, it is more inclusive and robust than other filtering processes (such as normalized least mean square adaptive filtering), so that in multi-channel, there is no need to perform any processing on the reference signal; at the same time, it can effectively reduce the influence of the nonlinear distortion (such as clipping distortion, harmonic distortion, intermodulation distortion, transient distortion, AC interface distortion, etc.) caused by the playback device on the echo cancellation algorithm.
[0121] The above examples illustrate multiple implementations of the present application, but the present application is not limited thereto. In each implementation, the addition, omission, and sequence change of steps are all within the protection scope of the present application; each implementation can be implemented individually or in combination.
[0122] Combine the following Figure 3 The echo cancellation device 200 provided by the present application is described. The echo cancellation device 200 includes a first calculation module 201, a second calculation module 202, a judgment module 203, a third calculation module 204, a fourth calculation module 205, a fifth calculation module 206, a sixth calculation module 207, a seventh calculation module 208, an eighth calculation module 209 and an echo cancellation module 210.
[0123] The first calculation module 201 is configured to calculate the reverberation spectrum of the far-end reference signal;
[0124] The second calculation module 202 is configured to calculate the Mel-frequency cepstrum correlation coefficient according to the far-end reference signal and the near-end acquisition signal;
[0125] The judgment module 203 is configured to judge whether it is a single-speaking mode according to the comparison between the Mel-frequency cepstrum correlation coefficient and the preset single-speaking threshold;
[0126] The third calculation module 204 is configured to calculate the nonlinear gain coefficient according to the power spectrum of the near-end acquisition signal and the reverberation spectrum of the far-end reference signal when the judgment module judges that it is yes;
[0127] The fourth calculation module 205 is configured to calculate the estimated echo according to the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal;
[0128] The fifth calculation module 206 is configured to calculate the value of the binary masking film according to the comparison result of the power spectrum of the estimated echo and the near-end collected signal;
[0129] The sixth calculation module 207 is configured to calculate the echo cancellation amplitude gain according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal and the power spectrum of the near-end acquisition signal when the number of 1s in the binary mask value is greater than or equal to the set threshold;
[0130] The seventh calculation module 208 is configured to calculate the existence probability of the near-end speech according to the priori speech echo ratio and the posterior speech echo ratio;
[0131] The eighth calculation module 209 is configured to calculate the optimal nonlinear echo filtering gain coefficient according to the echo cancellation amplitude gain and the existence probability of the near-end speech;
[0132] The echo cancellation module 210 is configured to multiply the optimal nonlinear echo filtering gain coefficient with the near-end acquisition signal to perform echo cancellation.
[0133] In the echo cancellation device provided by the present application, the present application adopts Mel-frequency cepstrum correlation coefficient to perform acoustic echo processing, which is applicable to mono and multi-channel situations. Since the echo cancellation algorithm of the present application is a nonlinear processing process, it is more inclusive and robust than other filtering processes (such as normalized least mean square adaptive filtering), so that in multi-channel, there is no need to perform any processing on the reference signal; at the same time, it can effectively reduce the influence of the nonlinear distortion (such as clipping distortion, harmonic distortion, intermodulation distortion, transient distortion, AC interface distortion, etc.) caused by the playback device on the echo cancellation algorithm.
[0134] The present application can implement the echo cancellation device 200 and the video image enhancement device through software, hardware, firmware, or any combination thereof. Figure 3 The echo cancellation device 200 provided by the present application is merely schematically shown. Without violating the concept of the present application, the splitting, merging, and adding of modules are all within the protection scope of the present application.
[0135] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is executed by, for example, a processor, the steps of the echo cancellation method in any of the above embodiments can be implemented. In some possible implementations, various aspects of the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary implementations of the present application described in the above echo cancellation method section of this specification.
[0136] refer to Figure 4 As shown, a program product 800 for implementing the above method according to an embodiment of the present application is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0137] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0138] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0139] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the tenant computing device, partially on the tenant device, as a separate software package, partially on the tenant computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device may be connected to the tenant computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0140] In an exemplary embodiment of the present disclosure, an electronic device is further provided, which may include a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the steps of the echo cancellation method in any of the above embodiments by executing the executable instructions.
[0141] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0142] Refer to the following Figure 5 The electronic device 600 according to this embodiment of the present application is described. Figure 5 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0143] like Figure 5 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0144] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps of various exemplary embodiments of the present application described in the echo cancellation method section of the present specification. For example, the processing unit 610 can perform the following steps: Figure 2 or the steps shown in 3.
[0145] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and / or a cache storage unit 6202 , and may further include a read-only storage unit (ROM) 6203 .
[0146] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0147] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0148] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable tenants to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 650. In addition, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 through a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0149] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above-mentioned echo cancellation method according to the embodiment of the present disclosure.
[0150] It can be seen that the solution provided by this application has the following advantages compared with the prior art:
[0151] The present application adopts Mel-frequency cepstrum correlation coefficient for acoustic echo processing, which is applicable to both mono and multi-channel situations. Since the echo cancellation algorithm of the present application is a nonlinear processing process, it is more inclusive and robust than other filtering processes (such as normalized least mean square adaptive filtering), so that in multi-channel, there is no need to perform any processing on the reference signal; at the same time, it can effectively reduce the influence of the nonlinear distortion (such as clipping distortion, harmonic distortion, intermodulation distortion, transient distortion, AC interface distortion, etc.) caused by the playback device on the echo cancellation algorithm.
[0152] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. An echo cancellation method, characterized in that: include: Calculate the reverberation spectrum of the far-end reference signal; Calculate the Mel frequency cepstrum correlation coefficient according to the far-end reference signal and the near-end acquisition signal; According to the comparison between the Mel frequency cepstrum correlation coefficient and the preset single-speaking threshold, whether it is the single-speaking mode is determined; If yes, then the nonlinear gain coefficient is calculated based on the power spectrum of the near-end acquisition signal and the reverberation spectrum of the far-end reference signal; The estimated echo is calculated based on the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal; According to the comparison result of the power spectrum of the estimated echo and the near-end acquisition signal, the value of the binary mask is calculated; When the number of 1s in the binary mask value is greater than or equal to the set threshold, the echo cancellation amplitude gain is calculated according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal, and the power spectrum of the near-end acquisition signal; Calculate the existence probability of near-end speech according to the prior speech echo ratio and the posterior speech echo ratio; Calculate the optimal nonlinear echo filtering gain coefficient according to the echo amplitude gain and the existence probability of the near-end speech; The optimal nonlinear echo filtering gain coefficient is multiplied by the near-end acquisition signal to perform echo cancellation.
2. The echo cancellation method according to claim 1, characterized in that: Calculating the reverberation spectrum of the far-end reference signal includes: Calculate the smoothing factor based on the reverberation time; After performing frame division and windowing operations on the remote reference signal, Fourier transform is performed to obtain the power spectrum of the remote signal; The power spectrum of the far-end reference signal is smoothed by using the smoothing factor to obtain the reverberation spectrum of the far-end reference signal.
3. The echo cancellation method according to claim 1, characterized in that: According to the far-end reference signal and the near-end acquisition signal, the Mel frequency cepstrum correlation coefficient is calculated including: The remote reference signal is used as a signal to be processed, and a Mel-frequency cepstral coefficient feature vector acquisition step is performed on the signal to be processed to acquire a Mel-frequency cepstral coefficient feature vector of the remote reference signal; The near-end reference signal is used as a signal to be processed, and a Mel-frequency cepstral coefficient feature vector acquisition step is performed on the signal to be processed to acquire a Mel-frequency cepstral coefficient feature vector of the near-end reference signal; The mel-frequency cepstrum correlation coefficient is calculated according to the mel-frequency cepstrum coefficient feature vector of the far-end reference signal and the mel-frequency cepstrum coefficient feature vector of the near-end reference signal.
4. The echo cancellation method according to claim 3, characterized in that: The steps for obtaining the Mel frequency cepstral coefficient feature vector include: Perform pre-emphasis, frame division and windowing processing on the signal to be processed, and obtain the frequency spectrum of the signal to be processed distributed in different time windows on the time axis through Fourier transform; The spectrum is filtered through Mel filter to obtain Mel spectrum; Perform cepstrum analysis on the Mel frequency spectrum to obtain the Mel frequency cepstrum coefficient feature vector of the signal to be processed.
5. The echo cancellation method according to claim 1, characterized in that: According to the comparison result of the power spectrum of the estimated echo and the near-end acquisition signal, the value of the binary mask is calculated including: When the power spectrum of the near-end acquisition signal is greater than the estimated echo, the value of the binary mask is 1; When the power spectrum of the near-end collected signal is not greater than the estimated echo, the value of the binary mask is 0.
6. The echo cancellation method according to claim 1, characterized in that: The a priori speech echo ratio is the ratio of the power spectrum of the near-end collected signal to the power spectrum of the echo, and the a posteriori speech echo ratio is the ratio of the power spectrum of the near-end speech signal to the power spectrum of the echo.
7. The echo cancellation method according to claim 1, characterized in that: The near-end speech existence probability is calculated based on at least a priori near-end speech existence probability, and the priori near-end speech existence probability is tracked frame by frame at each frequency point in each frame signal.
8. An echo cancellation device, characterized in that: include: A first calculation module, configured to calculate a reverberation spectrum of a remote reference signal; A second calculation module is configured to calculate a Mel frequency cepstrum correlation coefficient according to a far-end reference signal and a near-end acquisition signal; A judgment module, configured to judge whether it is a single-speaker mode according to a comparison between a Mel frequency cepstrum correlation coefficient and a preset single-speaker threshold; A third calculation module is configured to calculate a nonlinear gain coefficient according to a power spectrum of a near-end acquisition signal and a reverberation spectrum of a far-end reference signal when the judgment module judges that the nonlinear gain coefficient is yes; a fourth calculation module, configured to calculate an estimated echo according to the nonlinear gain coefficient and the reverberation spectrum of the far-end reference signal; a fifth calculation module, configured to calculate a value of a binary mask according to a comparison result of a power spectrum of the estimated echo and a near-end collected signal; a sixth calculation module, configured to calculate the echo cancellation amplitude gain according to the nonlinear gain coefficient, the reverberation spectrum of the far-end reference signal, and the power spectrum of the near-end collected signal when the number of 1s in the value of the binary mask is greater than or equal to a set threshold; a seventh calculation module, configured to calculate the existence probability of the near-end speech according to the prior speech echo ratio and the posterior speech echo ratio; An eighth calculation module, configured to calculate an optimal nonlinear echo filtering gain coefficient according to the echo cancellation amplitude gain and the existence probability of the near-end speech; The echo cancellation module is configured to multiply the optimal nonlinear echo filtering gain coefficient with the near-end acquisition signal to perform echo cancellation.
9. An electronic device, characterized in that: Electronic equipment includes: processor; A memory on which a computer program is stored, which is executed by a processor when it is run: An echo cancellation method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which is executed by the processor when it is run: An echo cancellation method according to any one of claims 1 to 7.
