A network model training method, echo cancellation method and device

The recurrent neural network model is used to calculate the phase-sensitive mask and acoustically mask the microphone signal, which solves the problem that the traditional echo cancellation algorithm cannot effectively remove echo in scenes with low signal-to-return ratio and strong nonlinear distortion, and achieves better echo cancellation. Effect and voice quality protection.

CN113744748BActive Publication Date: 2024-09-03ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110904295.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-06
Publication Date
2024-09-03
Estimated Expiration
2041-08-06

AI Technical Summary

Technical Problem

Traditional echo cancellation algorithms cannot accurately estimate residual echo in scenarios with low signal-to-return ratio and strong nonlinear distortion, resulting in the video conferencing system being unable to effectively suppress echo and causing near-end voice distortion.

Method used

The training method of the recurrent neural network model is used to obtain the characteristics of the microphone signal and the reference signal, calculate the loss of the phase-sensitive mask, and adjust the model parameters to obtain the phase-sensitive mask, which is used to acoustically mask the microphone signal to suppress echoes.

Benefits of technology

The echo cancellation capability is improved, which can effectively remove residual echo in a single-talk scenario, while ensuring that the near-end voice signal is not distorted in a dual-talk scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113744748B
    Figure CN113744748B
Patent Text Reader

Abstract

The present application discloses a training method for a recurrent neural network model, an echo cancellation method, a terminal device, and a computer-readable storage medium, the method comprising: obtaining a sample signal, the sample signal comprising a microphone signal and a reference signal corresponding to the microphone signal; extracting features from the sample signal to obtain a first acoustic feature and a second acoustic feature, the first acoustic feature being the acoustic feature of the microphone signal, and the second acoustic feature being the acoustic feature of the reference signal; inputting the first acoustic feature and the second acoustic feature into an initial recurrent neural network model, and outputting a predicted value of a phase-sensitive mask, the phase-sensitive mask being the frequency spectrum proportion of the echo cancellation signal in the microphone signal, the frequency spectrum comprising an amplitude spectrum and a phase spectrum; calculating the loss of the phase-sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model. In the above manner, the present application can improve the echo cancellation capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of echo cancellation, and in particular to a training method for a recurrent neural network model, an echo cancellation method, a terminal device, and a computer-readable storage medium. Background Art

[0002] In video conferencing systems, acoustic echoes that affect voice interaction are often generated due to the coupling between microphones and speakers. In traditional echo cancellation, a finite-length linear filter is first used to estimate the acoustic path from the speaker to the microphone in the acoustic environment to eliminate the linear echo, and then a gain value is applied to remove the remaining residual echo. However, in scenarios with low signal-to-echo ratio and strong nonlinear distortion, traditional echo cancellation algorithms cannot accurately estimate the residual echo, resulting in the video conferencing system being unable to suppress the residual echo and causing near-end voice distortion. Summary of the invention

[0003] The main technical problem solved by the present application is to provide a training method for a recurrent neural network model, an echo cancellation method, a terminal device and a computer-readable storage medium, which can improve the echo cancellation capability.

[0004] To solve the above technical problems, a technical solution adopted in the present application is: to provide a training method for a recurrent neural network model, the method comprising: obtaining a sample signal, the sample signal comprising a microphone signal and a reference signal corresponding to the microphone signal; performing feature extraction on the sample signal to obtain a first acoustic feature and a second acoustic feature, the first acoustic feature being the acoustic feature of the microphone signal, and the second acoustic feature being the acoustic feature of the reference signal; inputting the first acoustic feature and the second acoustic feature into an initial recurrent neural network model, and outputting a predicted value of a phase-sensitive mask, the phase-sensitive mask being the frequency spectrum proportion of an echo cancellation signal in a microphone signal, the frequency spectrum comprising an amplitude spectrum and a phase spectrum; calculating the loss of the phase-sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model.

[0005] The calculation of the loss of the phase sensitive mask includes: obtaining a reference target value of the phase sensitive mask; calculating the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask, and using the difference as the loss of the phase sensitive mask; or calculating the loss of the phase sensitive mask using a loss function.

[0006] Among them, calculating the loss of the phase sensitive mask includes: obtaining a reference target value of the phase sensitive mask; calculating a first loss and a second loss respectively, the first loss being the loss of the phase sensitive mask calculated using a loss function, and the second loss being the difference between a predicted value of the phase sensitive mask and a reference target value of the phase sensitive mask; performing weighted fusion on the first loss and the second loss to obtain the loss of the phase sensitive mask.

[0007] Among them, the first loss and the second loss are weightedly fused, including: the loss function includes an echo return loss gain function and a signal distortion ratio function, and the first loss is a weighted fusion of the loss of the echo return loss gain function and the loss of the signal distortion ratio function; if the purpose of the phase-sensitive mask is to process the residual echo, the weight of the loss of the echo return loss gain function is greater than the weight of the loss of the signal distortion ratio function; if the purpose of the phase-sensitive mask is to reduce the distortion of the signal, the weight of the loss of the echo return loss gain function is less than the weight of the loss of the signal distortion ratio function.

[0008] Among them, the reference target value of the phase sensitive mask is: |V| is the amplitude spectrum of the near-end signal, θ V is the phase spectrum of the near-end signal, |D| is the amplitude spectrum of the microphone signal, θ D is the phase spectrum of the microphone signal.

[0009] Among them, feature extraction is performed on the sample signal to obtain the first acoustic feature and the second acoustic feature, including: framing and windowing the time domain signals of the microphone signal and the reference signal to obtain the framed and windowed microphone signal and the reference signal; Fourier transform is performed on the framed and windowed microphone signal and the reference signal to obtain frequency domain signals corresponding to the microphone signal and the reference signal; feature extraction is performed on the frequency domain signals of the microphone signal and the reference signal to obtain the first acoustic feature and the second acoustic feature.

[0010] Among them, the recurrent neural network model is at least one of a gated recurrent unit network and a long short-term memory network.

[0011] To solve the above technical problems, another technical solution adopted in the present application is: to provide an echo cancellation method, the method comprising: obtaining a microphone signal and a reference signal corresponding to the microphone signal; performing feature extraction on the microphone signal and the reference signal to obtain a first acoustic feature and a second acoustic feature, the first acoustic feature being the acoustic feature of the microphone signal, and the second acoustic feature being the acoustic feature of the reference signal; inputting the first acoustic feature and the second acoustic feature into a recurrent neural network model to obtain a phase-sensitive mask, the phase-sensitive mask being the frequency spectrum proportion of the echo cancellation signal in the microphone signal, the frequency spectrum comprising an amplitude spectrum and a phase spectrum; using the phase-sensitive mask to acoustically mask the first acoustic feature to obtain an echo cancellation signal.

[0012] The recurrent neural network model is trained using the above-mentioned recurrent neural network model training method.

[0013] To solve the above technical problems, another technical solution adopted in the present application is: to provide a terminal device, which includes a processor and a memory, the memory stores program instructions, and the processor is used to execute the program instructions to implement the above-mentioned recurrent neural network model training method or the above-mentioned echo elimination method.

[0014] In order to solve the above technical problems, another technical solution adopted in the present application is: providing a computer-readable storage medium, which stores program instructions, and the program instructions can be executed to implement the above-mentioned training method of the recurrent neural network model or the above-mentioned echo elimination method.

[0015] The beneficial effect of the present application is as follows: different from the prior art, the present application provides a training method for a recurrent neural network model, the method comprising: acquiring a sample signal, the sample signal comprising a microphone signal and a reference signal corresponding to the microphone signal; performing feature extraction on the sample signal to obtain a first acoustic feature and a second acoustic feature, the first acoustic feature being the acoustic feature of the microphone signal, and the second acoustic feature being the acoustic feature of the reference signal; using an initial recurrent neural network model to process the first acoustic feature and the second acoustic feature to obtain a phase-sensitive mask, the phase-sensitive mask being the frequency spectrum proportion of the near-end signal in the microphone signal, the frequency spectrum comprising an amplitude spectrum and a phase spectrum; calculating the loss of the phase-sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model; processing the first acoustic feature and the second acoustic feature through the initial recurrent neural network model to obtain the phase-sensitive mask, and obtaining the recurrent neural network by calculating the loss of the phase-sensitive mask. When this recurrent neural network is applied to echo cancellation, a phase-sensitive mask close to the near-end signal can be extracted. The microphone signal is acoustically masked by the phase-sensitive mask, thereby suppressing the echo in the microphone signal to obtain the near-end signal, thereby improving the echo cancellation capability.

[0016] Furthermore, since the echo return loss gain function and the signal distortion ratio function are introduced in the loss calculation of the phase sensitive mask, when the recurrent neural network model is subsequently used, the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal are processed to obtain a phase sensitive mask of the echo cancellation signal that is close to the phase sensitive mask of the near-end signal (the echo cancellation signal is close to the near-end signal, and the phase sensitive mask of the echo cancellation signal is close to the phase sensitive mask of the near-end signal). The echo return loss gain function and the signal distortion ratio function are introduced in the phase sensitive mask. Therefore, when the phase sensitive mask is used to acoustically mask the microphone signal, the echo signal in the microphone signal can be suppressed and eliminated, thereby improving the ability to remove residual echo in a single-speaking scenario, and at the same time ensuring that the near-end voice signal is not distorted in a double-speaking scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of an embodiment of a training method for a recurrent neural network model provided by the present application;

[0018] Figure 2 It is a flowchart of an embodiment of extracting acoustic features from sound signals provided by the present application;

[0019] Figure 3 It is a flowchart of an embodiment of calculating the loss of a phase sensitive mask to obtain a recurrent neural network model provided by the present application;

[0020] Figure 4 is a flowchart of another embodiment of calculating the loss of a phase sensitive mask to obtain a recurrent neural network model provided by the present application;

[0021] Figure 5 It is a flowchart of an embodiment of an echo cancellation method provided by the present application;

[0022] Figure 6 is a schematic diagram of a phase sensitive mask provided by the present application;

[0023] Figure 7 It is a structural diagram of an embodiment of a terminal device provided by the present application;

[0024] Figure 8 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail below with reference to the accompanying drawings and examples.

[0026] It should be noted that if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0027] The present application provides an echo cancellation method, which acoustically masks the acoustic features of a microphone signal through a phase-sensitive mask, thereby obtaining the acoustic features of an echo-cancelled signal, and reconstructs the echo-cancelled signal through the acoustic features of the echo-cancelled signal, thereby obtaining an echo-cancelled signal. The phase-sensitive mask is obtained by training a recurrent neural network model, and how to obtain the recurrent neural network model will be described in detail in conjunction with the following embodiments.

[0028] See also Figure 1 , Figure 1 is a flow chart of an embodiment of a training method for a recurrent neural network model provided in the present application. It should be noted that if there are substantially the same results, this embodiment does not take Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:

[0029] Step S11: Acquire a sample signal.

[0030] The sample signal includes a microphone signal and a reference signal corresponding to the microphone signal. The microphone signal is a sound signal collected by a microphone or other sound collection device, that is, a sound signal received when performing echo cancellation, and the reference signal is an echo signal in the microphone signal.

[0031] For example, during audio and video instant messaging, both communicating parties are equipped with microphones and speakers. The near-end voice is broadcast through the near-end speaker, then transmitted to the far-end through the telephone line or the Internet and broadcast through the far-end speaker. The far-end microphone picks up the broadcast sound and broadcasts it through the far-end speaker, then transmits it to the near-end through the telephone line or the Internet, and broadcasts it through the near-end speaker. At this time, the sound signal collected by the near-end microphone and transmitted back to the near-end is the echo signal. Therefore, the signal collected by the microphone includes not only the near-end voice signal sent by the user, but also the echo signal transmitted from the far-end and broadcast through the near-end speaker.

[0032] In one embodiment, the microphone signal of the current environment and the reference signal corresponding to the collected microphone signal can be collected by a sound collection device such as a microphone. It can be understood that in other embodiments, the microphone signal stored locally or in the cloud and the reference signal corresponding to the microphone signal can also be directly read, which is not specifically limited here.

[0033] Step S12: extracting features from the sample signal to obtain a first acoustic feature and a second acoustic feature.

[0034] In this embodiment, by extracting features from the sample signal, a first acoustic feature and a second acoustic feature are obtained, wherein the first acoustic feature is the acoustic feature of the microphone signal, and the second acoustic feature is the acoustic feature of the reference signal. In one embodiment, acoustic features can be extracted from the microphone signal and the reference signal by Fourier transform (FFT, Fast Fourier Transform) to obtain the first acoustic feature and the second acoustic feature. It can be understood that in other embodiments, acoustic features can also be extracted from the microphone signal and the reference signal by other means, which can be specifically set according to actual use needs and are not specifically limited here.

[0035] Among them, the acoustic features of the sound signal can characterize the data features of the sound signal. In one embodiment, the amplitude spectrum can be used as the acoustic features of the microphone signal and the reference signal, that is, the respective amplitude spectra are extracted from the microphone signal and the reference signal as their respective acoustic features, that is, the amplitude spectrum of the microphone signal is the first acoustic feature, and the amplitude spectrum of the reference signal is the second acoustic feature. It can be understood that in other embodiments, other features of the microphone signal and the reference signal can also be used as acoustic features, which can be specifically set according to actual use needs and are not specifically limited here.

[0036] Step S13: input the first acoustic feature and the second acoustic feature into the initial recurrent neural network model, and output the predicted value of the phase sensitive mask.

[0037] In this implementation, the initial recurrent neural network model can process the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal to obtain a predicted value of a phase sensitive mask (PSM, Phase Sensitive Mask).

[0038] Among them, the predicted value of the phase sensitive mask output by the initial recurrent neural network model is:

[0039] PSM e =F(|X|,|D|)

[0040] Among them, |X| is the amplitude spectrum of the reference signal, |D| is the amplitude spectrum of the microphone signal, F is the recurrent neural network model, PSM e is the predicted value of the phase sensitive mask.

[0041] Specifically, the first acoustic feature and the second acoustic feature are input into the initial recurrent neural network model to obtain a predicted value of the phase-sensitive mask. Since the initial recurrent neural network model has not been trained yet, the predicted value of the phase-sensitive mask output after processing by the initial recurrent neural network model may be different from the true value of the phase-sensitive mask corresponding to the near-end signal. Therefore, the phase-sensitive mask output by the initial recurrent neural network model cannot be used as the final value, and the parameters of the initial recurrent neural network model need to be further adjusted so that the phase-sensitive mask output by the initial recurrent neural network model is close to the phase-sensitive mask of the near-end signal.

[0042] Step S14: Calculate the loss of the phase sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model.

[0043] Since the near-end signal cannot be directly collected during the actual echo cancellation process, the phase-sensitive mask of the echo cancellation signal that is close to the phase-sensitive mask of the near-end signal can be obtained according to the recurrent neural network model, and the echo cancellation signal is reconstructed through the phase-sensitive mask of the echo cancellation signal. Therefore, the initial recurrent neural network model is trained so that the phase-sensitive mask output by it can be close to or approximate to the phase-sensitive mask of the near-end signal. Therefore, in the subsequent application of the recurrent neural network model, the phase-sensitive mask that is close to or approximate to the near-end signal can be directly obtained through the recurrent neural network model, and then the echo cancellation signal is obtained through the phase-sensitive mask to achieve echo cancellation. Based on this, the reference target value of the phase-sensitive mask of the near-end signal is pre-set according to the actual situation, and there is a difference between the predicted value of the phase-sensitive mask value output by the initial recurrent neural network model and the reference target value of the phase-sensitive mask, that is, PSM e There are differences with PSM, so in order to improve the accuracy of the phase-sensitive mask output by the initial recurrent neural network model, that is, to make the phase-sensitive mask value output by the initial recurrent neural network model close to the reference target value of the phase-sensitive mask of the near-end signal, in this embodiment, by calculating the loss of the phase-sensitive mask, the loss of the phase-sensitive mask is known, and then the parameters of the initial recurrent neural network model are adjusted according to the loss, so that the trained initial recurrent neural network model can process the first acoustic feature and the second acoustic feature to obtain a phase-sensitive mask close to the near-end signal. The trained initial recurrent neural network model is the recurrent neural network model mentioned in step S14. Among them, the calculation formula of the reference target value of the phase-sensitive mask of the near-end signal, that is, the phase-sensitive mask, is:

[0044]

[0045] Where, |V| is the amplitude spectrum of the near-end signal, θ Vis the phase spectrum of the near-end signal, |D| is the amplitude spectrum of the microphone signal, θ D is the phase spectrum of the microphone signal.

[0046] In one embodiment, the loss between the predicted value of a single phase-sensitive mask and the reference target value of the phase-sensitive mask can be calculated to adjust the parameters of the initial recurrent neural network model, thereby obtaining a recurrent neural network model. It is understandable that in other embodiments, the loss of the phase-sensitive mask can also be calculated using a loss function, or the total loss between the loss between the predicted value of the phase-sensitive mask and the reference target value of the phase-sensitive mask and the loss of the phase-sensitive mask calculated using the loss function can be calculated to adjust the parameters of the initial recurrent neural network model, thereby obtaining a recurrent neural network model. How to calculate the loss of the phase-sensitive mask can be set according to the use requirements and is not specifically limited here.

[0047] In one embodiment, the recurrent neural network model may be a gated recurrent unit network. It is understandable that in other embodiments, the recurrent neural network model may also be a long short-term memory network or other neural network, which may be specifically configured according to actual use needs and is not specifically limited here.

[0048] See also Figure 2 , Figure 2 is a flow chart of an embodiment of extracting acoustic features from a sound signal provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not use Figure 2 The process sequence shown is limited. Figure 2 As shown, in this embodiment, the amplitude spectrum is extracted from the sample signal by Fourier transform to obtain the first amplitude spectrum and the second amplitude spectrum, which specifically includes:

[0049] Step S21: performing frame division and windowing processing on the time domain signals of the microphone signal and the reference signal to obtain the frame division and windowed microphone signal and the reference signal.

[0050] Among them, the time domain signal describes the relationship between a mathematical function or a physical signal and time, and is the only domain in which the signal actually exists. Therefore, when the microphone signal and the reference signal are obtained, the time domain signal corresponding to the microphone signal and the reference signal can be obtained.

[0051] In this implementation, the time domain signals corresponding to the microphone signal and the reference signal are first framed. Since the Fourier transform requires the input signal to be stable, the time domain signal needs to be framed to ensure that the signal intercepted and input to the Fourier transform is a stable signal. The frame length of the time domain signal is not specifically limited and can be set according to actual use needs. For example, the frame length of each frame can be 20 milliseconds, 30 milliseconds, etc.

[0052] Furthermore, in this embodiment, before Fourier transform is performed on a frame of intercepted signal, windowing processing is required to be performed so that the amplitude of the frame signal gradually changes to zero at both ends. Since the amplitude at both ends of the signal is weakened, in order to compensate for the two ends, two adjacent frames can be subjected to frame shift processing so that the two adjacent frames overlap, for example, the overlap of the two adjacent frames can be 10 milliseconds, etc. In one embodiment, the window function can be a Hanning window. It can be understood that in other embodiments, other window functions can also be used to perform windowing processing on the signal, which can be specifically set according to actual use needs and is not specifically limited here.

[0053] Step S22: Perform Fourier transform on the frame-divided and windowed microphone signal and the reference signal to obtain frequency domain signals corresponding to the microphone signal and the reference signal.

[0054] In this embodiment, the time domain signal after framing and windowing is subjected to Fourier transform to obtain a frequency domain signal corresponding to the microphone signal and the reference signal, wherein the frequency component of the signal can be analyzed by the frequency domain signal and the signal can be processed in the frequency domain.

[0055] Step S23: extracting features from the frequency domain signals of the microphone signal and the reference signal to obtain a first acoustic feature and a second acoustic feature.

[0056] In this embodiment, the amplitude spectrum is used as the acoustic feature of the sound signal, and the first acoustic feature and the second acoustic feature are obtained by extracting the features of the frequency domain signals of the microphone signal and the reference signal. Since the frequency domain signal is a complex number, the feature extraction of the frequency domain signal is actually to extract the real part and the imaginary part of the frequency domain signal, and calculate the extracted real part and the imaginary part to obtain the amplitude spectrum of the frequency domain signal. The formula for calculating the amplitude spectrum of the frequency domain signal is:

[0057]

[0058] Among them, X Re is the real part of the frequency domain signal, X Im is the imaginary part of the frequency domain signal, and |X| is the amplitude spectrum of the frequency domain signal.

[0059] Taking into account that the first acoustic feature of the microphone signal, i.e., the first amplitude spectrum, and the second acoustic feature of the reference signal, i.e., the second amplitude spectrum, may have a large difference in numerical values, in one embodiment, the first amplitude spectrum of the microphone signal and the second amplitude spectrum of the reference signal are normalized, so that the first amplitude spectrum and the second amplitude spectrum are mapped to the range of 0-1 for processing, so as to facilitate subsequent rapid processing of the first amplitude spectrum and the second amplitude spectrum.

[0060] See also Figure 3 , Figure 3is a flow chart of an embodiment of calculating the loss of the phase sensitive mask to obtain a recurrent neural network model provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not use Figure 3 The process sequence shown is limited. Figure 3 As shown, in this embodiment, by calculating the loss between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask, a recurrent neural network model is obtained, which specifically includes:

[0061] Step S31: obtaining a reference target value of a phase sensitive mask.

[0062] In this implementation, the reference target value of the phase sensitive mask is specifically set by the user according to the near-end signal. The formula for the reference target value of the phase sensitive mask is:

[0063]

[0064] Where, |V| is the amplitude spectrum of the near-end signal, θ V is the phase spectrum of the near-end signal, |D| is the amplitude spectrum of the microphone signal, θ D is the phase spectrum of the microphone signal.

[0065] Step S32: Calculate the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask, and use the difference as the loss of the phase sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain the recurrent neural network model.

[0066] In this embodiment, the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal are input into the initial recurrent neural network model to obtain the predicted value of the phase sensitive mask. The loss between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask is calculated, that is, the difference between the two is calculated, and the calculated difference, that is, the loss, is back-propagated to the initial recurrent neural network model, and the parameters of the initial recurrent neural network model are adjusted. After repeated rounds of iterative training, the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask is minimized. When the difference no longer decreases, it means that the initial recurrent neural network model has completed the fitting of the extracted acoustic features, and finally the trained initial recurrent neural network model, that is, the recurrent neural network model, is output. Among them, the formula for the predicted value of the phase sensitive mask and the formula for the difference between the reference target value of the phase sensitive mask and the predicted value of the phase sensitive mask are:

[0067] PSM e =F(|X|,|D|)

[0068] L1=PSM t -PSM e

[0069] Among them, |X| is the amplitude spectrum of the reference signal, |D| is the amplitude spectrum of the microphone signal, F is the recurrent neural network model, PSM e is the predicted value of the phase sensitive mask, PSM t is the reference target value of the phase sensitive mask, and L1 is the difference value of the phase sensitive mask.

[0070] In this embodiment, the recurrent neural network model is obtained by calculating the loss between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask to adjust the parameters. Therefore, when the recurrent neural network model is specifically applied, the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal are processed to obtain a phase sensitive mask of the estimated signal that is close to the phase sensitive mask of the near-end signal (the estimated signal is close to the near-end signal, and the phase sensitive mask of the estimated signal is close to the phase sensitive mask of the near-end signal). Since the phase sensitive mask of the estimated signal is close to the phase sensitive mask of the near-end signal, the phase sensitive mask of the estimated signal is actually the phase sensitive mask of the echo cancellation signal. At this time, the echo cancellation signal is reconstructed by the phase sensitive mask of the echo cancellation signal, thereby achieving echo cancellation.

[0071] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of another embodiment of calculating the loss of the phase sensitive mask to obtain the recurrent neural network model provided by the present application. It should be noted that if there is substantially the same result, this embodiment does not use Figure 4 The process sequence shown is limited. Figure 4 As shown, in this embodiment, the total loss of the phase sensitive mask is calculated to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model, so that the phase sensitive mask generated by the recurrent neural network model can suppress the residual echo in the microphone signal without causing near-end speech distortion, specifically including:

[0072] Step S41: obtaining a reference target value of a phase sensitive mask.

[0073] Step S41 is similar to step S31 and will not be described again.

[0074] Step S42: Calculate the first loss and the second loss respectively.

[0075] In this implementation, the first loss is the loss of the phase sensitive mask calculated using the loss function, and the second loss is the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask.

[0076] In one embodiment, the loss function includes an echo return loss gain function or a signal distortion ratio function, or the loss function includes both an echo return loss gain function and a signal distortion ratio function. It is understandable that in other embodiments, the loss function may also include other functions, which may be specifically set according to actual use needs and are not specifically limited here. Among them, the reference target value of the phase-sensitive mask is the phase-sensitive mask of the near-end signal, so when the loss function is the echo return loss gain function and the signal distortion ratio function, there is no signal distortion and echo in the near-end signal, so the reference target value of the phase-sensitive mask of the near-end signal on the two loss functions is set to zero, that is, the reference target value of the near-end signal on the two loss functions. Among them, the reference target value of the echo return loss gain and the reference target value of the signal distortion ratio are respectively:

[0077] ERLE t =0

[0078] SDR t =0

[0079] Among them, ERLE t is the reference target value of the echo return loss gain function, SDR t is the reference target value of the signal distortion ratio function.

[0080] Furthermore, in order to calculate the first loss, that is, the loss of the phase-sensitive mask on the loss function, it is necessary to obtain the predicted value of the phase-sensitive mask through the recurrent neural network model, and obtain its predicted value on the loss function through the predicted value of the phase-sensitive mask, and then calculate the difference between the predicted value of the phase-sensitive mask on the loss function and the reference target value of the loss function to obtain the first loss.

[0081] Specifically, first, the microphone signal and the reference signal are input into the recurrent neural network model to obtain the predicted value of the phase-sensitive mask; secondly, the corresponding echo cancellation signal is obtained through the predicted value of the phase-sensitive mask, so calculating the predicted value of the phase-sensitive mask prediction value on the loss function is equivalent to calculating the predicted value of the echo cancellation signal on the loss function; finally, the loss on each loss function is obtained through the predicted value of the echo cancellation signal on the loss function and the reference target value of the near-end signal on the loss function. In a specific embodiment, the loss function includes an echo return loss gain function and a signal distortion ratio function, then the predicted values ​​of the estimated signal on the echo return loss gain function and the signal distortion ratio function are respectively:

[0082]

[0083]

[0084] Where E[·] represents the averaging operation, d is the microphone signal in the time domain, v is the near-end signal in the time domain, is the echo cancellation signal in the time domain, is the amplitude spectrum of the echo cancellation signal.

[0085] The predicted values ​​of the echo cancellation signal on the echo return loss gain function and the signal distortion ratio function are obtained by calculation. Then, the losses of the echo cancellation signal on the echo return loss gain function and the signal distortion ratio function are respectively:

[0086] L a =ERLE t -ERLE e

[0087] L b =SDR t -SDR e

[0088] Among them, L a ERLE is the loss of the echo cancellation signal on the echo return loss gain function. t ERLE is the reference target value of the near-end signal on the echo return loss gain function. e is the predicted value of the echo cancellation signal on the echo return loss gain function, L b is the loss of the echo cancellation signal in the signal-to-distortion ratio function, SDR t is the reference target value of the near-end signal on the signal-distortion ratio function, SDR e is the predicted value of the echo cancellation signal on the signal-distortion ratio function.

[0089] In one embodiment, the first loss may be obtained by weighted fusion of the loss of the echo cancellation signal on the echo return loss gain function and the loss of the echo cancellation signal on the signal distortion ratio function. In other embodiments, the first loss may be obtained by processing the loss of the echo cancellation signal on the echo return loss gain function and the loss of the echo cancellation signal on the signal distortion ratio function in other ways. The specific processing method may be set according to actual use needs and is not specifically limited here.

[0090] Step S43: Perform weighted fusion on the first loss and the second loss to obtain the loss of the phase sensitive mask to adjust the parameters of the initial recurrent neural network model to obtain the recurrent neural network model.

[0091] In this embodiment, the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal are input into the initial recurrent neural network model to obtain the predicted value of the phase sensitive mask. The loss of the phase sensitive mask is obtained by weighted fusion of the first loss and the second loss, that is, the loss of the phase sensitive mask is the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask and the loss of the phase sensitive mask on the loss function, that is, the loss of the phase sensitive mask is the total loss obtained by adding the above two. After obtaining the total loss of the phase sensitive mask, it is back-propagated to the initial recurrent neural network model, and the parameters of the initial recurrent neural network model are adjusted. After repeated multiple rounds of iterative training, the loss of the phase sensitive mask is minimized. When the loss value no longer decreases, it means that the initial recurrent neural network model has completed the fitting of the extracted acoustic features, and finally outputs the trained initial recurrent neural network model, that is, the recurrent neural network model. It can be understood that in other embodiments, the loss of the phase sensitive mask can also be obtained by processing the first loss and the second loss in other ways. The specific processing method can be set according to actual use needs and is not specifically limited here.

[0092] In one embodiment, the total loss of the phase sensitive mask is obtained by weighted summing the first loss and the second loss, wherein the total loss of the phase sensitive mask is expressed as follows:

[0093] L sum =α(ERLE t -ERLE e )+β(SDR t -SDR e )+γ(PSM t -PSM e )

[0094] Among them, L sum The total loss of the phase sensitive mask, α, β, and γ are the weight of the loss of the echo cancellation signal on the echo return loss gain function, the weight of the loss of the echo cancellation signal on the signal distortion ratio function, and the weight of the second loss, respectively.

[0095] Since the loss value of the echo return loss gain function, the loss value of the signal distortion ratio function, and the loss value between the predicted value of the phase sensitive mask and the reference target value are different in size range, the three need to be normalized. Based on this, α, β, and γ are introduced to unify the total loss to the same order of magnitude. In a specific embodiment, the order of magnitude of the loss value of the echo return loss gain function and the loss value of the signal distortion ratio function is 10, and the order of magnitude of the loss value between the predicted value of the phase sensitive mask and the reference target value is 0.1 or 0.01. Therefore, in order to unify the total loss to the same order of magnitude, α can be 0.1, β can be 0.1, and γ can be 10 or 100.

[0096] Since the echo return loss gain function and the signal distortion ratio function are introduced in the loss calculation of the phase-sensitive mask, when the recurrent neural network model is subsequently applied, the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal are processed to obtain a phase-sensitive mask of the echo cancellation signal that is close to the phase-sensitive mask of the near-end signal (the echo cancellation signal is close to the near-end signal, and the phase-sensitive mask of the echo cancellation signal is close to the phase-sensitive mask of the near-end signal). The echo return loss gain function and the signal distortion ratio function are introduced in the phase-sensitive mask. Therefore, when the phase-sensitive mask is subsequently used to acoustically mask the microphone signal, the echo signal in the microphone signal can be suppressed and eliminated.

[0097] If the purpose of the phase sensitive mask is to process residual echo, the weight α of the loss of the echo return loss gain function is greater than the weight β of the loss of the signal distortion ratio function, that is, α>β, which improves the ability to remove residual echo in a single-talk scenario. The weight α of the loss of the echo return loss gain function and the weight β of the loss of the signal distortion ratio function are not limited and can be set according to the actual usage scenario, for example, α=0.5, β=0.1.

[0098] If the purpose of the phase sensitive mask is to reduce the distortion of the signal, the weight α of the loss of the echo return loss gain function is less than the weight β of the loss of the signal distortion ratio function, that is, α<β, thereby ensuring that the near-end speech is not distorted in the double-talk scenario. Among them, the weight α of the loss of the echo return loss gain function and the weight β of the loss of the signal distortion ratio function are not limited, and can be specifically set according to the actual use scenario, for example, α=0.1, β=0.5.

[0099] See also Figure 5 , Figure 5 1 is a flow chart of an embodiment of the echo cancellation method provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily use Figure 5 The process sequence shown is limited. Figure 5As shown, this embodiment includes:

[0100] Step S51: Acquire a microphone signal and a reference signal corresponding to the microphone signal.

[0101] Step S51 is similar to step S11 and will not be described again here.

[0102] Step S52: extracting features from the microphone signal and the reference signal to obtain a first acoustic feature and a second acoustic feature.

[0103] Step S52 is similar to step S12 and will not be described again.

[0104] Step S53: input the first acoustic feature and the second acoustic feature into the recurrent neural network model to obtain a phase sensitive mask.

[0105] In one embodiment, the recurrent neural network model is trained by the training method of the recurrent neural network model of any of the above-mentioned embodiments. In practical applications, the trained recurrent neural network model is used to process the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal to obtain a phase-sensitive mask of the echo cancellation signal, and the phase-sensitive mask of the echo cancellation signal obtained by the recurrent neural network model is close to the phase-sensitive mask of the near-end signal in the microphone signal. It can be understood that in other embodiments, the recurrent neural network model obtained by other training methods can also be used to process the first acoustic feature of the microphone signal and the second acoustic feature of the reference signal, which can be specifically set according to actual use needs and is not specifically limited here. Among them, the formula for estimating the phase-sensitive mask of the signal is:

[0106] PSM e =F(|X|,|D|)

[0107] Where F is the recurrent neural network model, |X| is the amplitude spectrum of the reference signal, |D| is the amplitude spectrum of the microphone signal, and PSM e is the phase-sensitive mask of the echo cancellation signal.

[0108] Step S54: acoustically masking the first acoustic feature using a phase-sensitive mask to obtain an echo cancellation signal.

[0109] In this embodiment, the first acoustic feature is acoustically masked by a phase-sensitive mask to obtain an echo cancellation signal. It should be noted that if the phase-sensitive mask is Figure 3 If the recurrent neural network of the embodiment shown in the figure is used to obtain the first acoustic feature, the phase-sensitive mask is used to acoustically mask the first acoustic feature, which actually eliminates the echo signal in the microphone signal; and if the phase-sensitive mask is obtained by Figure 4If the recurrent neural network of the illustrated embodiment is obtained, the phase-sensitive mask is used here to acoustically mask the first acoustic feature, which actually suppresses and eliminates the echo in the microphone signal, thereby improving the ability to remove residual echo in a single-speaking scenario, while ensuring that the near-end voice signal in a dual-speaking scenario is not distorted.

[0110] Specifically, since the first acoustic feature is the amplitude spectrum of the microphone signal, the phase-sensitive mask of the echo cancellation signal is equivalent to the phase-sensitive mask of the near-end signal. Therefore, after acoustically masking the amplitude spectrum of the microphone signal with the phase-sensitive mask obtained by the recurrent neural network model, the masked amplitude spectrum, i.e., the amplitude spectrum of the echo cancellation signal, can be obtained. Since the echo cancellation signal is close to the near-end signal, the amplitude spectrum of the echo cancellation signal is equivalent to the amplitude spectrum of the near-end signal.

[0111] Among them, the formula of the amplitude spectrum of the echo cancellation signal is:

[0112]

[0113] in, is the amplitude spectrum of the echo cancellation signal, |D| is the amplitude spectrum of the microphone signal, PSM e is the phase-sensitive mask of the echo cancellation signal.

[0114] For example, if Figure 6 As shown, Figure 6 is a schematic diagram of the phase sensitive mask provided by the present application. In acoustic masking, the amplitude spectrum of the microphone signal is multiplied by the phase sensitive mask of the echo cancellation signal to remove the echo signal in the microphone signal, thereby obtaining the amplitude spectrum of the echo cancellation signal. Since the echo in the microphone signal is removed, the echo cancellation signal is the near-end signal in the microphone signal, and the amplitude spectrum of the echo cancellation signal is the amplitude spectrum of the near-end signal in the microphone signal. Please refer to Figure 6 The black point in the figure represents a value of 0, which is considered to correspond to the echo signal. Therefore, after multiplying the black point's value with the amplitude spectrum of the microphone signal, the echo signal is removed. Figure 6 The brighter the point, the closer its value is to 1, and it is considered that the point corresponds to the echo cancellation signal. Therefore, after multiplying the value of the bright spot with the amplitude spectrum of the microphone signal, the echo cancellation signal is retained. Based on this, by multiplying the amplitude spectrum of the microphone signal with the phase sensitive mask of the echo cancellation signal, the echo in the microphone signal is removed and the echo cancellation signal is retained.

[0115] Furthermore, after acoustically masking the first acoustic feature with a phase-sensitive mask, an amplitude spectrum of the echo-cancelled signal is obtained, so the echo-cancelled signal needs to be reconstructed based on the amplitude spectrum of the echo-cancelled signal. Specifically, the masked first acoustic feature is subjected to an inverse Fourier transform to obtain the echo-cancelled signal. Since the phase information of the signal is introduced into the phase-sensitive mask, the echo-cancelled signal can be better reconstructed based on the masked first acoustic feature.

[0116] See also Figure 7 , Figure 7 6 is a schematic diagram of a terminal device according to an embodiment of the present application. In this embodiment, the terminal device 60 includes a processor 61 and a memory 63 .

[0117] The processor 61 may also be referred to as a CPU (Central Processing Unit). The processor 61 may be an integrated circuit chip having signal processing capabilities. The processor 61 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 61 may also be any conventional processor 61, etc.

[0118] The memory 63 in the terminal device 60 is used to store program instructions required for the processor 61 to run.

[0119] The processor 61 is used to execute program instructions to implement the method provided by any embodiment of the training method of the recurrent neural network model or the echo cancellation method of the present application and any non-conflicting combination.

[0120] See also Figure 8 , Figure 8It is a structural diagram of an embodiment of a computer-readable storage medium provided by the present application. The computer-readable storage medium 70 of the embodiment of the present application stores a program instruction 71, and when the program instruction 71 is executed, the training method of the recurrent neural network model of the present application or the echo cancellation method of any embodiment and any non-conflicting combination of the method provided. Among them, the program instruction 71 can form a program file and be stored in the above-mentioned computer-readable storage medium 70 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) executes all or part of the steps of the methods of each embodiment of the present application. The aforementioned computer-readable storage medium 70 includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code, or terminal devices such as computers, servers, mobile phones, tablets, etc. The above description is only an embodiment of the present application, and does not limit the patent scope of the present application. All equivalent structures or equivalent process changes made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are similarly included in the patent protection scope of the present application.

Claims

1. A training method for a recurrent neural network model, characterized in that: The method comprises: Acquire a sample signal, wherein the sample signal includes a microphone signal and a reference signal corresponding to the microphone signal; and, acquire a reference target value of a phase sensitive mask; Performing feature extraction on the sample signal to obtain a first acoustic feature and a second acoustic feature, wherein the first acoustic feature is an acoustic feature of the microphone signal, and the second acoustic feature is an acoustic feature of the reference signal; Inputting the first acoustic feature and the second acoustic feature into an initial recurrent neural network model, and outputting a predicted value of a phase-sensitive mask, where the phase-sensitive mask is a frequency spectrum ratio of the echo cancellation signal in the microphone signal, and the frequency spectrum includes an amplitude spectrum and a phase spectrum; Based on the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask, the loss of the phase sensitive mask is determined to adjust the parameters of the initial recurrent neural network model to obtain a recurrent neural network model.

2. The training method of the recurrent neural network model according to claim 1, characterized in that: The determining the loss of the phase sensitive mask based on the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask comprises: Taking the difference as the loss of the phase sensitive mask; or The loss of the phase sensitive mask is determined based on a difference between the predicted value of the phase sensitive mask and a reference target value of the phase sensitive mask using a loss function.

3. The training method of the recurrent neural network model according to claim 1, characterized in that: The determining the loss of the phase sensitive mask based on the difference between the predicted value of the phase sensitive mask and the reference target value of the phase sensitive mask comprises: Calculating a first loss and a second loss respectively, wherein the first loss is the loss of the phase sensitive mask calculated using a loss function, and the second loss is the difference between a predicted value of the phase sensitive mask and a reference target value of the phase sensitive mask; The first loss and the second loss are weightedly fused to obtain the loss of the phase sensitive mask.

4. The training method of the recurrent neural network model according to claim 3, characterized in that: The weighted fusion of the first loss and the second loss includes: The loss function includes an echo return loss gain function and a signal distortion ratio function, and the first loss is a weighted fusion of the loss of the echo return loss gain function and the loss of the signal distortion ratio function; If the phase sensitive mask is used to process residual echo, the weight of the loss of the echo return loss gain function is greater than the weight of the loss of the signal distortion ratio function; If the purpose of the phase sensitive mask is to reduce the distortion of the signal, the weight of the loss of the echo return loss gain function is smaller than the weight of the loss of the signal distortion ratio function.

5. The training method of the recurrent neural network model according to claim 2 or 3, characterized in that: The reference target value of the phase sensitive mask is: Where, |V| is the amplitude spectrum of the near-end signal, θ V is the phase spectrum of the near-end signal, |D| is the amplitude spectrum of the microphone signal, θ D is the phase spectrum of the microphone signal.

6. The training method of the recurrent neural network model according to claim 1, characterized in that: The extracting features of the sample signal to obtain the first acoustic feature and the second acoustic feature includes: Performing frame division and windowing processing on the time domain signals of the microphone signal and the reference signal to obtain the frame division and windowed microphone signal and the reference signal; Performing Fourier transform on the frame-by-frame windowed microphone signal and the reference signal to obtain frequency domain signals corresponding to the microphone signal and the reference signal; Feature extraction is performed on frequency domain signals of the microphone signal and the reference signal to obtain the first acoustic feature and the second acoustic feature.

7. The training method of the recurrent neural network model according to claim 1, characterized in that: The recurrent neural network model is at least one of a gated recurrent unit network and a long short-term memory network.

8. An echo cancellation method, characterized in that: The method comprises: Acquire a microphone signal and a reference signal corresponding to the microphone signal; Performing feature extraction on the microphone signal and the reference signal to obtain a first acoustic feature and a second acoustic feature, wherein the first acoustic feature is an acoustic feature of the microphone signal, and the second acoustic feature is an acoustic feature of the reference signal; Inputting the first acoustic feature and the second acoustic feature into a recurrent neural network model to obtain a phase-sensitive mask, wherein the phase-sensitive mask is a frequency spectrum ratio of the echo cancellation signal in the microphone signal, and the frequency spectrum includes an amplitude spectrum and a phase spectrum; wherein the recurrent neural network model is trained using the training method for the recurrent neural network model according to any one of claims 1 to 7; The first acoustic feature is acoustically masked using the phase-sensitive mask to obtain an echo cancellation signal.

9. A terminal device, characterized in that: The terminal device includes a processor and a memory, the memory stores program instructions, and the processor is used to execute the program instructions to implement the method according to any one of claims 1-7 or 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, which can be executed to implement the method according to any one of claims 1-7 or 8.