A voice signal processing method and related equipment
By using the diffusion model to perform noise reduction and high-frequency component repair processing of speech signals in long-distance or far-field environments, the problem of low quality of far-field speech signals is solved, achieving a clearer and fuller speech signal effect, and reducing the cost of equipment. power consumption and computing power requirements.
Patent Information
- Application Number
- CN202410350758.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-03-26
AI Technical Summary
When collecting voice signals in a long-distance or far-field environment, the signal-to-noise ratio is low, resulting in unclear and incomplete voice signals. It is difficult for existing technologies to effectively improve the quality of voice signals.
Adopting a diffusion model-based denoising and repair processing method, two diffusion models are used to perform noise reduction and high-frequency component repair respectively, reducing algorithm complexity and saving computing power. Gradient and Gaussian noise are used for sampling processing to improve the clarity of the speech signal. degree and fullness.
It significantly improves the hearing clarity and fullness of far-field speech signals. It repairs high-frequency components more effectively than simple noise reduction processing, reduces noise interference, and reduces the power consumption and computing power requirements of terminal equipment.
Smart Images

Figure CN118098260B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a voice signal processing method and related equipment. Background Art
[0002] It is very challenging to collect voice signals at a long distance using terminal devices (or, collecting voice signals at a long distance, which can also be called collecting or picking up far-field voice signals). Long distance or far field can be understood as the distance between the microphone used to collect or pick up the sound and the sound source is far. Generally speaking, in the field of acoustics, a distance of more than 10m between the microphone and the sound source can be called long distance, and a distance of 20m or 30m between the microphone and the sound source can be called ultra-long distance.
[0003] At present, far-field speech signals are mainly picked up based on microphone arrays, and the picked up far-field speech signals are enhanced according to acoustic models to pick up speech signals in the target direction. Summary of the invention
[0004] The present application provides a speech signal processing method and related equipment, which can make the collected speech signals (especially far-field speech signals) sound clearer and fuller.
[0005] In a first aspect, a speech signal processing method is provided, which is applied to an electronic device, and the method includes: obtaining a first speech signal to be processed; performing noise reduction processing on the first speech signal based on a first diffusion model to obtain a second speech signal; performing repair processing on the first speech signal and the second speech signal based on a second diffusion model to obtain a target speech signal, wherein the second diffusion model is a conditional diffusion model, and the repair processing includes: using the first speech signal as a condition for the second diffusion model to repair the high-frequency components of the second speech signal.
[0006] The above solution can reduce noise on the one hand, making the target voice signal clearer to listen to, and repair high-frequency components on the other hand, making the target voice signal fuller to listen to. Moreover, compared with the solution that only reduces noise on far-field voice signals, the target voice signal can be made fuller to listen to.
[0007] Furthermore, since the attenuated high-frequency components may be submerged in the noise, the noise reduction process may interfere with the attenuated high-frequency component noise of the first speech signal, which may affect the restoration effect. When performing the restoration process, the speech signal before the noise reduction is also used as a condition of the conditional diffusion model for restoration processing, as reference information for restoring the high-frequency components, so as to reduce the interference that the noise reduction process may cause to the restoration process and improve the restoration effect.
[0008] In addition, the processing of the first voice signal is decomposed into two major steps, and two diffusion models are used for processing respectively. Compared with using one model to process the far-field voice signal, it can reduce the complexity of the algorithm and save computing power while achieving the same effect. In other words, using one model to process the first voice signal requires a more complex algorithm to achieve the effect that these two models can achieve, and has higher requirements on the power consumption and computing power of the terminal device.
[0009] In a possible embodiment, the first voice signal is a far-field voice signal, or the distance between a microphone of the electronic device and a sound source of the first voice signal is greater than or equal to a preset distance threshold.
[0010] The embodiments of the present application are particularly effective in picking up far-field voice signals and performing voice processing.
[0011] In a possible embodiment, a first speech signal is subjected to noise reduction processing based on a first diffusion model to obtain a second speech signal, including: calculating a gradient of the first speech signal, the gradient being used to characterize a probability distribution of the second speech signal, the probability distribution of the second speech signal corresponding to the distribution of time-frequency points in a spectrogram of the second speech signal; and sampling the gradient of the first speech signal to obtain the second speech signal.
[0012] It can be understood that the above consideration of the probability distribution of the second speech signal is to consider the integrity of the distribution of the time-frequency points of the second speech signal, and the integrity includes the relationship between the time-frequency points.
[0013] It can also be understood that, for the case where the overall integrity is not taken into consideration and each time-frequency point is analyzed one by one, even if the total error (for example, the first error value) between the time-frequency points of the signal after noise reduction processing and the time-frequency points corresponding to the ideal clean signal (the signal after all noise is removed from the first speech signal in an ideal situation) is very small, it is very likely that a small number of time-frequency points will have a large error with the corresponding time-frequency points of the ideal clean signal, while the errors of most time-frequency points will be very small. Therefore, the small number of time-frequency points with large errors will, in principle, cause a certain degree of damage to the noise-reduced speech, poor spectrum continuity, and poor listening experience.
[0014] Compared with the solution that does not consider the overall distribution of time-frequency points, the present application, on the basis of considering the overall distribution of time-frequency points, if the total error is controlled to the same small value (such as the first error value), the errors of almost all points will be more balanced and smaller, thereby reducing the damage of noise reduction processing to the speech signal in principle.
[0015] In a possible embodiment, calculating the gradient of a first speech signal includes: inputting the first speech signal into a first neural network to obtain a denoised gradient to be sampled of the first speech signal, wherein the denoised gradient to be sampled is used to characterize the probability distribution of a second speech signal; sampling the gradient of the first speech signal includes: predicting a denoised sampled signal based on the denoised gradient to be sampled; calculating the gradient of the first speech signal also includes: inputting the denoised sampled signal into the first neural network to obtain a denoised gradient to be corrected of the denoised sampled signal, wherein the denoised gradient to be corrected is used to characterize the probability distribution of the second speech signal; sampling the gradient of the first speech signal also includes: correcting the denoised sampled signal based on the denoised gradient to be corrected to obtain a denoised corrected signal; and generating a second speech signal based on the denoised corrected signal.
[0016] The above scheme further calculates the denoised gradient to be corrected for the denoised sampled signal obtained based on the prediction of the denoised gradient to be sampled, and corrects the denoised sampled signal based on the denoised gradient to be corrected. Compared with the diffusion model that only calculates the gradient once, or compared with the diffusion model that only predicts but does not correct, the denoising effect is better.
[0017] That is to say, sampling is performed according to the gradient, including two sub-steps of prediction and correction. Exemplarily, the prediction step adopts ancestral sampling; the correction step adopts Langevin kinetic sampling or annealed Langevin kinetic sampling, and the correction step is used to correct the prediction result of the prediction step. The prediction and sampling steps in this application can refer to the examples here, and are uniformly explained here, and will not be repeated below.
[0018] In a possible embodiment, a denoised sampling signal is predicted according to a denoised gradient to be sampled, including: calculating a denoised drift coefficient according to a first speech signal based on a stochastic differential equation of a first diffusion model; calculating a denoised inverse drift coefficient according to the denoised drift coefficient and the denoised gradient to be sampled; and predicting a denoised sampling signal according to the denoised inverse drift coefficient, the first speech signal and a fourth Gaussian noise value, wherein the fourth Gaussian noise value is generated based on a third random seed.
[0019] It can be understood that the inverse drift coefficient can be used to describe the path of the noisy speech signal tending towards the clean speech signal during the sampling process. Sampling based on the inverse drift coefficient to obtain the gradient can achieve noise reduction.
[0020] In a possible embodiment, the first neural network is obtained based on first input data and first target data, wherein the first input data includes a sample noisy speech signal and a sample noise reduction sampling signal, the sample noisy speech signal is generated by a first sample noise signal and a first sample speech signal, the sample noise reduction sampling signal is generated based on the sample noisy speech signal, and the first target data is used to characterize the probability distribution of the first sample speech signal.
[0021] The above scheme trains the neural network model by characterizing the probability distribution of the sample speech signal contained in the sample noisy speech signal through target data, so that the gradient output by the trained neural network model can characterize the probability distribution of the second speech signal.
[0022] In a possible embodiment, the sample denoising sampling signal is a fifth Gaussian noise value, which is generated based on a sample noisy speech signal, a sample speech signal and a sixth Gaussian noise value that obeys a standard normal distribution, and the first target data is generated based on the standard deviation of the fifth Gaussian noise value and the sixth Gaussian noise value, and the sixth Gaussian noise value is generated based on a fourth random seed.
[0023] It can be understood that since the random numbers generated by the random seed at different times are different, the speech signal processing method provided in the present application performs noise reduction processing on the same segment of speech signal to be processed at different times, and the second speech signals output respectively are different or not completely the same, so that the target speech signals output finally are different or not completely the same.
[0024] In a possible embodiment, the first speech signal and the second speech signal are repaired based on a second diffusion model to obtain a target speech signal, including: calculating the gradient of the second speech signal based on the first speech signal and the second speech signal, the gradient is used to characterize the probability distribution of the target speech signal, the probability distribution of the target speech signal corresponds to the distribution of time-frequency points in the spectrogram of the target speech signal; sampling the gradient of the second speech signal based on a first Gaussian noise value to obtain the target speech signal, the first Gaussian noise value is generated based on a first random seed.
[0025] In the above scheme, since Gaussian noise is superimposed according to the gradient in the sampling step, if the Gaussian noise conforms to the gradient or the probability distribution of the target speech signal, the attenuated high-frequency components will be enhanced, thereby repairing the high-frequency components.
[0026] It is understandable that traditional discriminative neural networks cannot repair high-frequency components by superimposing Gaussian noise based on probability distribution like generative neural networks.
[0027] In a possible embodiment, the gradient of the second voice signal is calculated according to the first voice signal and the second voice signal, including: inputting the first voice signal and the second voice signal into the second neural network to obtain the repaired gradient to be sampled of the second voice signal, and the repaired gradient to be sampled is used to characterize the probability distribution of the target voice signal; sampling the gradient of the second voice signal based on the first Gaussian noise value, including: predicting the repaired sampled signal according to the repaired gradient to be sampled and the first Gaussian noise value; calculating the gradient of the second voice signal according to the first voice signal and the second voice signal, and also including: inputting the repaired sampled signal into the second neural network to obtain the repaired gradient to be corrected of the repaired sampled signal, and the repaired gradient to be corrected is used to characterize the probability distribution of the target voice signal; sampling the gradient of the second voice signal, and also including: correcting the repaired sampled signal according to the repaired gradient to be corrected to obtain a repaired corrected signal; generating the target voice signal according to the repaired corrected signal.
[0028] The above scheme further calculates the repaired gradient to be corrected for the repaired sampled signal obtained based on the repaired gradient to be sampled prediction, and corrects the repaired sampled signal based on the repaired gradient to be corrected. Compared with the diffusion model that only calculates the gradient once, or compared with the diffusion model that only predicts without correction, the effect of repairing high-frequency components is better.
[0029] In a possible embodiment, a repaired sampling signal is predicted based on the repaired gradient to be sampled and the first Gaussian noise value, including: calculating a repair drift coefficient based on the second speech signal based on a stochastic differential equation of a second diffusion model; calculating a repair inverse drift coefficient based on the repair drift coefficient and the repaired gradient to be sampled; and predicting a repaired sampling signal based on the repair inverse drift coefficient, the second speech signal and the first Gaussian noise value.
[0030] It can be understood that the inverse drift coefficient can be used to describe the path of the noisy speech signal tending to the clean speech signal during the sampling process. That is, the time-frequency points that do not obey the probability distribution of the target speech signal are reduced, and the path of the time-frequency points that obey the probability distribution of the target speech signal is generated by means of the first Gaussian noise.
[0031] In a possible embodiment, the second neural network is trained based on second input data and second target data, wherein the second input data includes a sample noisy speech signal, a sample attenuated speech signal and a sample repaired sampling signal, the sample noisy speech signal is generated by the second sample noise signal and the second sample speech signal, the sample attenuated speech signal is obtained by convolving the sample noisy speech signal with a preset distance room impulse response, the sample repaired sampling signal is generated based on the sample attenuated speech signal and the second sample speech signal, the second target data is used to characterize the probability distribution of the second sample speech signal, and the preset distance room impulse response is used to simulate the process of sound being emitted by the sound source and propagating to the microphone when the distance between the sound source and the microphone of the electronic device is greater than or equal to a preset distance threshold.
[0032] The above scheme trains the neural network model by using the target data to characterize the probability distribution of the sample speech signal used to generate the sample attenuated speech signal, so that the gradient output by the trained neural network model can characterize the probability distribution of the target speech signal.
[0033] In a possible embodiment, the sample repair sampling signal is a second Gaussian noise value, which is generated based on the sample attenuated speech signal, the second sample speech signal and a third Gaussian noise value that obeys a standard normal distribution, and the second target data is generated based on the standard deviation of the second Gaussian noise value and the third Gaussian noise value, and the third Gaussian noise value is generated based on a second random seed.
[0034] It is understandable that, since the random numbers generated by the random seed at different times are different, the speech signal processing method provided in the present application performs repair processing on the same speech signal to be processed at different times, and the target speech signals outputted respectively are different or not completely the same.
[0035] In a possible embodiment, a first speech signal is input into a first neural network to obtain a denoised gradient to be sampled of the first speech signal, including: inputting the first speech signal into the first neural network to obtain a first denoised gradient to be sampled of the first speech signal; calculating a denoised drift coefficient according to the first speech signal based on a stochastic differential equation of a first diffusion model, including: calculating a first denoised drift coefficient according to the first speech signal based on a stochastic differential equation of the first diffusion model; calculating a denoised inverse drift coefficient according to the denoised drift coefficient and the denoised gradient to be sampled, including: calculating a first denoised inverse drift coefficient according to the first denoised drift coefficient and the first denoised gradient to be sampled; calculating a denoised inverse drift coefficient according to the denoised inverse drift coefficient. The method comprises: predicting a first denoised sampling signal according to a first denoised inverse drift coefficient, a first speech signal and a first fourth Gaussian noise value; inputting the denoised sampling signal into a first neural network to obtain a denoised gradient to be corrected of the denoised sampling signal, comprising: inputting the first denoised sampling signal into the first neural network to obtain a first denoised gradient to be corrected of the first denoised sampling signal; correcting the denoised sampling signal according to the denoised gradient to be corrected to obtain a denoised corrected signal, comprising: correcting the first denoised sampling signal according to the first denoised gradient to be corrected to obtain a first denoised corrected signal.
[0036] Alternatively, the first speech signal is input into the first neural network to obtain the denoising gradient to be sampled of the first speech signal, including: inputting the n-1th denoising correction signal and the first speech signal into the first neural network to obtain the nth denoising gradient to be sampled of the first speech signal; calculating the denoising drift coefficient according to the first speech signal based on the stochastic differential equation of the first diffusion model, including: calculating the nth denoising drift coefficient according to the n-1th denoising correction signal and the first speech signal based on the stochastic differential equation of the first diffusion model; calculating the denoising inverse drift coefficient according to the denoising drift coefficient and the denoising gradient to be sampled, including: calculating the nth denoising inverse drift coefficient according to the nth denoising drift coefficient and the nth denoising gradient to be sampled; predicting according to the denoising inverse drift coefficient, the first speech signal and the fourth Gaussian noise value. to a denoised sampling signal, including: predicting the nth denoised sampling signal according to the nth denoising inverse drift coefficient, the n-1th denoising correction signal and the nth fourth Gaussian noise value; inputting the denoised sampling signal into the first neural network to obtain the denoising gradient to be corrected of the denoised sampling signal, including: inputting the nth denoised sampling signal and the first speech signal into the first neural network to obtain the nth denoising gradient to be corrected of the nth denoised sampling signal; correcting the denoised sampling signal according to the denoising gradient to be corrected to obtain a denoising correction signal, including: correcting the nth denoised sampling signal according to the nth denoising gradient to be corrected to obtain the nth denoising correction signal, 2≤n≤N, n and N are both positive integers, wherein, when n=N, the Nth denoising correction signal is used as the second speech signal.
[0037] In the above scheme, the steps of calculating gradient, prediction and correction are iterated N times to achieve better noise reduction effect.
[0038] In a possible embodiment, the first speech signal and the second speech signal are input into the second neural network to obtain the repaired gradient to be sampled of the second speech signal, including: inputting the first speech signal and the second speech signal into the second neural network to obtain the first repaired gradient to be sampled of the second speech signal; calculating the repair drift coefficient according to the second speech signal based on the stochastic differential equation of the second diffusion model, including: calculating the first repair drift coefficient according to the second speech signal based on the stochastic differential equation of the second diffusion model; calculating the repair inverse drift coefficient according to the repair drift coefficient and the repaired gradient to be sampled, including: calculating the first repair inverse drift coefficient according to the first repair drift coefficient and the first repaired gradient to be sampled; A repaired sampling signal is predicted based on the repaired inverse drift coefficient, the second speech signal and the first Gaussian noise value, including: a first repaired sampling signal is predicted based on the first repaired inverse drift coefficient, the second speech signal and the first Gaussian noise value; the repaired sampling signal is input into the second neural network to obtain a repaired gradient to be corrected of the repaired sampling signal, including: the first repaired sampling signal is input into the second neural network to obtain a first repaired gradient to be corrected of the first repaired sampling signal; according to the repaired gradient to be corrected, the repaired sampling signal is corrected to obtain a repaired correction signal, including: according to the first repaired gradient to be corrected, the first repaired sampling signal is corrected to obtain a first repaired correction signal.
[0039] Alternatively, the first speech signal and the second speech signal are input into a second neural network to obtain a repaired gradient to be sampled of the second speech signal, including: inputting the first speech signal, the second speech signal and the m-1th repair correction signal into the second neural network to obtain the mth repaired gradient to be sampled of the second speech signal; calculating the repair drift coefficient according to the second speech signal based on the stochastic differential equation of the second diffusion model, including: calculating the mth repair drift coefficient according to the second speech signal and the m-1th repair correction signal based on the stochastic differential equation of the second diffusion model; calculating the repair inverse drift coefficient according to the repair drift coefficient and the repair gradient to be sampled, including: calculating the mth repair inverse drift coefficient according to the mth repair drift coefficient and the mth repair gradient to be sampled; calculating the repair inverse drift coefficient according to the repair inverse drift coefficient, the second speech signal and the first Gaussian noise. value, predicting a repaired sampling signal, including: predicting the mth repaired sampling signal according to the mth repaired inverse drift coefficient, the m-1th repaired correction signal and the first Gaussian noise value; inputting the repaired sampling signal into the second neural network to obtain a repaired gradient to be corrected of the repaired sampling signal, including: inputting the first speech signal, the second speech signal and the mth repaired sampling signal into the second neural network to obtain the mth repaired gradient to be corrected of the mth repaired sampling signal; correcting the repaired sampling signal according to the repaired gradient to be corrected to obtain a repaired correction signal, including: correcting the mth repaired sampling signal according to the mth repaired gradient to be corrected to obtain the mth repaired correction signal, 2≤m≤M, m and M are both positive integers, wherein, when m=M, the Mth repaired correction signal is used as the target speech signal.
[0040] In the above scheme, the steps of calculating gradient, predicting and correcting are iterated M times to achieve a better effect of repairing high-frequency components.
[0041] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0042] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, causes the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0044] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0045] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of an example of a scenario to which the embodiments of the present application are applicable;
[0047] Figure 2A for Figure 1 In the scenario shown, the time domain diagram and time-frequency diagram of the speech signal 1 collected at 5m;
[0048] Figure 2B for Figure 1 In the scenario shown, the time domain diagram and time-frequency diagram of the speech signal 2 collected at 30m;
[0049] Figure 3 A schematic diagram of a speech signal processing method 100 provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of a speech conversion method 200 provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a voice conversion method 300 provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of a training process 400 of a deep neural network model provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of a training process 500 of a deep neural network model provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of the hardware structure of an electronic device 1000 provided in an embodiment of the present application;
[0055] Fig. 9A block diagram of a software system of an electronic device 1000 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0057] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are first introduced.
[0058] 1. Long distance or far field can be understood as the distance between the microphone used to collect or pick up sound and the sound source is far. Generally speaking, in the field of acoustics, a distance of more than 10m between the microphone and the sound source can be called long distance, and a distance of 20m or 30m between the microphone and the sound source can be called ultra-long distance. In the embodiment of the present application, long distance can be understood as the situation where the distance between the microphone and the sound source is greater than or equal to the preset distance threshold.
[0059] A long-distance voice signal or a far-field voice signal is a voice signal collected or picked up in a long-distance or far-field scenario. A far-field voice signal can be understood as a voice signal recorded when the distance between the microphone of an electronic device and the sound source is greater than or equal to a preset distance threshold.
[0060] 2. Room impulse response (RIR), in this application, includes the process of simulating the propagation of sound from the sound source to the microphones. In this process, there may be noise, and the sound from the noise source may also propagate together; in this process, the distance between the sound source and the microphone affects the attenuation of the high-frequency components; in this process, reverberation may also be caused by reasons such as wall reflection.
[0061] In some embodiments, the embodiments of the present application are applicable to scenarios where sound signals are collected at a long distance. The RIR data set used in the present application in the process of training the second neural network is mainly a long-distance RIR data set, for example, it may include a long-distance RIR recorded in an extra-large room, and also include a long-distance RIR in an extra-large room simulated by a simulation algorithm, or may also include a long-distance RIR generated by other means, which is not limited in the present application. Exemplarily, the extra-large room here is generally a room in which there is a straight-line distance greater than or equal to a preset distance threshold (such as 20m or 30m or 10m or 15m or 25m, etc.).
[0062] The long-distance RIR in this application may also be referred to as a preset distance RIR, which is equal to the preset distance threshold. The preset distance RIR is used to simulate the process of sound being transmitted from the sound source to the microphone of the electronic device when the distance between the sound source and the microphone is greater than or equal to the preset distance threshold.
[0063] It should be noted that although the RIR data sets of this application are all related to very large rooms, the long distance or far field involved in this application is not coupled with large rooms or very large rooms. In other words, the speech signal processing method provided by this application is not only applicable to closed spaces such as very large rooms, large lecture halls, and banquet halls, but also to non-enclosed spaces such as playgrounds and open-air venues surrounded on all sides. Moreover, these closed spaces or non-enclosed spaces all contain a straight-line distance of more than 20m or more than 30m.
[0064] It is understandable that, since the training process of the second neural network does not focus on data sets such as noise data sets or RIR data sets that interfere with the sample clean speech signal (or may be called sample speech signal), but focuses on the probability distribution of the sample speech signal, the second neural network is not affected by the noise type and has better generalization performance. Then, during the training process, even if the interference data set related to the closed space is used, the trained second neural network can obtain the target speech signal for the speech signal to be processed in the non-closed space.
[0065] 3. Time domain diagram, spectrogram and high-frequency components.
[0066] The horizontal axis of the time domain graph is time, and the vertical axis is amplitude. By performing feature transformation on the time domain graph, the corresponding spectrogram can be obtained.
[0067] The spectrogram (also called time-frequency graph) has time as the horizontal axis and frequency as the vertical axis. The spectrogram is composed of multiple time-frequency points. The brightness or depth of the time-frequency points indicates the size of the energy. For example, the brighter or lighter the time-frequency point, the greater the energy; otherwise, the smaller the energy.
[0068] For example, the frequency range of the spectrogram is 0~8000KHz, 5000KHz~8000KHz is high frequency, and 0~5000KHz is medium and low frequency.
[0069] High-frequency components are components with higher frequencies in speech signals, which can be specifically expressed as time-frequency points with higher frequencies in the spectrogram. For example, the frequency range of the spectrogram of a speech signal is 0~8000KHz, and the time-frequency points of 5000KHz~8000KHz are high-frequency components.
[0070] 4. Diffusion model: A type of generative model based on random processes, which can be used to generate various types of data such as images, text, audio, etc. Unlike traditional generative models, diffusion models do not rely on known labels or target data, but instead process random noise to gradually generate high-quality data from the noise. Therefore, the diffusion model can be regarded as an unsupervised generative model.
[0071] Among diffusion models, the most common is the unconditional diffusion model, whose main task is to generate random samples of original data. However, for some specific applications, such as image restoration, image synthesis, text-to-image generation, etc., we may need more precise control over the generated samples, which requires the introduction of conditional diffusion models.
[0072] An important feature of the conditional diffusion model is that the generated samples can be controlled by adding additional conditional information, such as specific parts of the image, text descriptions, etc. For example, in the task of text-to-image generation, we can control what elements the generated image should contain or what style it should present by adding text descriptions.
[0073] In terms of specific implementation, the conditional diffusion model usually encodes additional conditional information as part of the model during the training phase of the diffusion model, and then controls the generated results by decoding this conditional information during the generation phase. An important advantage of this approach is that it can provide more refined control over the generated results while maintaining the generation capability of the diffusion model.
[0074] The diffusion model involved in this application is a conditional diffusion model.
[0075] 5. Drift coefficient and reverse drift coefficient.
[0076] The clean signal (for example, the speech signal in this application) is denoised by sampling. The drift coefficient and the diffusion coefficient are used together to characterize the difference between the random signal being denoised and the audio signal to be processed in the process of denoising the clean signal.
[0077] The drift coefficient is the mean of the random signal sampled at the nth time in the N sampling process; and the diffusion coefficient is the variance of the random signal sampled at the nth time in the N sampling process.
[0078] The audio signal to be processed is denoised by sampling. The inverse drift coefficient and the inverse diffusion coefficient are used together to characterize the difference between the denoised random signal and the clean signal in the process of denoising the audio signal to be processed.
[0079] The inverse drift coefficient is the mean of the random signal sampled at the nth time in the N sampling process; and the inverse diffusion coefficient is the variance of the random signal sampled at the nth time in the N sampling process.
[0080] Here 1≤n≤N and n and N are both integers.
[0081] 6. Gaussian noise: It is a common random noise with the characteristics of Gaussian distribution, that is, the intensity and frequency of the noise are uniformly distributed. In signal processing and image processing, Gaussian noise is often used as a tool to simulate various noises. The frequency response of Gaussian noise can be calculated by Gaussian function. In the frequency domain, the spectral density function of Gaussian noise presents a Gaussian curve.
[0082] 7. Random seed is a computer professional term, a random number with a true random number (seed) as the initial condition. Generally, the random numbers of computers are pseudo-random numbers, which use a true random number (seed) as the initial condition, and then use a certain algorithm to iterate and generate random numbers.
[0083] It is understandable that in the present application, the random numbers (eg, Gaussian noise values) generated based on the same random seed at different times are different.
[0084] At present, the main method is to pick up far-field speech signals based on microphone arrays, enhance the picked-up far-field speech signals according to the acoustic model, and thus pick up speech signals at the target location. This type of method is driven by a linear model and has limited performance; if there is an error in the positioning module, the target speech signal will be distorted, and this type of method requires multiple microphone devices, which is costly.
[0085] Figure 1 A schematic diagram of an example of a scenario to which an embodiment of the present application is applicable.
[0086] like Figure 1 As shown, the dotted box can represent the closed space or non-closed space mentioned above. The sound source is making a sound. For example, microphone A (for example, included in terminal device 1) and microphone B (for example, included in terminal device 2) are used to collect voice signals at 5m and 30m away from the sound source, respectively. The voice signals of the same sound emitted by the same sound source at the same time are collected at normal distance and long distance.
[0087] It should be noted that only 5m and 30m are used as examples here to illustrate the problems that need to be solved in long-distance recording compared to normal-distance recording, and it is not limited to specific values.
[0088] For example, students are taking classes in a large lecture hall (or other enclosed space), the teacher is giving a lecture at the podium, student 1 sitting in the second row (about 5m from the podium) is recording using terminal device 1, and student 2 sitting in the last row (about 30m from the podium) is recording using terminal device 2. Generally speaking, the audio recorded by student 1 is easy to hear the teacher's voice; while in the audio recorded by student 2, the teacher's voice is very small and the signal-to-noise ratio is very low. Even if the volume is increased to amplify the teacher's voice, the noise will also be amplified, and the teacher's voice will still be drowned out by the noise. Moreover, even if some sentences can be barely heard, the sound is not full enough in terms of hearing.
[0089] For another example, students are listening to a speech on the playground (or other non-enclosed space). Student 1, who is about 5 meters away from the speaker, uses terminal device 1 to record, and student 2, who is about 30 meters away from the speaker, uses terminal device 2 to record. Generally speaking, the speaker's voice can be easily heard in the audio recorded by student 1; while in the audio recorded by student 2, the speaker's voice is very small and the signal-to-noise ratio is very low. Even if the volume is increased to amplify the speaker's voice, the noise will also be amplified, and the speaker's voice will still be drowned out by the noise. Moreover, even if some sentences can be barely heard, the sound is not full enough in terms of hearing.
[0090] Figure 2A for Figure 1 In the scenario shown, the time domain diagram and time-frequency diagram of the speech signal 1 collected at 5m.
[0091] Figure 2B for Figure 1 In the scenario shown, the time domain diagram and time-frequency diagram of the speech signal 2 collected at 30m.
[0092] It should be noted that since the volume of the voice signal 2 collected at 30m is very small, it is necessary to amplify the volume to barely hear the sound from the sound source. Figure 2B It has been processed with increased volume.
[0093] like Figure 2A As shown, the upper part is the time domain Figure 1 , the lower part is based on the time domain Figure 1 Spectrum obtained by feature conversion Figure 1 . Such as the lexical notation Figure 1 As shown in the figure, the harmonic structure of the mid-low frequency region of speech signal 1 is more obvious, and the time-frequency point distribution in the high frequency region is also more obvious; overall, a small number of irregularly distributed time-frequency points are noise, but the energy of the time-frequency points of the mid-low frequency harmonic components and high frequency components is significantly greater than the time-frequency points of the noise, that is, the time-frequency points of the noise do not overwhelm the time-frequency points of the speech signal. From the listening experience, the sound is very full and clear, and the noise can be ignored.
[0094] like Figure 2B As shown in the figure, the upper part is the time domain graph 2, and the lower part is the spectrogram 2 obtained by feature conversion based on the time domain graph 2. It can be seen from the time domain graph 2 that the signal-to-noise ratio is very small. As shown in the spectrogram 2, overall, in the speech signal 2, the energy of the time-frequency points of the noise is not significantly different from the energy of the time-frequency points of the non-noise, which also shows that the signal-to-noise ratio is very low. The harmonic structure of the medium and low frequencies is vaguely visible in the first half of the time. Compared with the first half of the time, the harmonic structure of the medium and low frequencies is relatively obvious in the second half of the time. The high-frequency components are almost completely submerged by the time-frequency points of the noise. In terms of listening experience, the noise is much larger than the non-noise. In the first half of the time, you can't hear what is being said even if you listen carefully. In the second half of the time, you can roughly hear what is being said, but the sound is obviously not natural enough.
[0095] It is understandable that for the collection of far-field speech or long-distance speech, as the distance increases, on the one hand, the signal-to-noise ratio of the speech signal collected by the microphone gradually becomes lower, which will make the speech signal less and less clear in hearing; on the other hand, the high-frequency components of the speech signal will attenuate more, which will make the speech signal less and less full in hearing.
[0096] Therefore, how to improve the voice quality of the collected far-field voice signals has become an urgent problem to be solved.
[0097] In view of this, the present application provides a speech signal processing method, which first reduces the noise of the speech signal to be processed based on a diffusion model, and then repairs the high-frequency components based on the diffusion model, so as to finally obtain a target speech signal.
[0098] The above solution can reduce noise on the one hand, making the target voice signal clearer to listen to, and repair high-frequency components on the other hand, making the target voice signal fuller to listen to. Moreover, compared with the solution that only reduces noise on far-field voice signals, the target voice signal can be made fuller to listen to.
[0099] Furthermore, since the attenuated high-frequency components may be submerged in the noise, the noise reduction process may interfere with the attenuated high-frequency component noise of the first speech signal, which may affect the restoration effect. When performing the restoration process, the speech signal before the noise reduction is also used as a condition of the conditional diffusion model for restoration processing, as reference information for restoring the high-frequency components, so as to reduce the interference that the noise reduction process may cause to the restoration process and improve the restoration effect.
[0100] In addition, the processing of far-field voice signals is decomposed into two major steps, and two diffusion models are used for processing respectively. Compared with using one model to process far-field voice signals, it can reduce the complexity of the algorithm and save computing power while achieving the same effect. In other words, using one model to process far-field voice signals requires a more complex algorithm to achieve the effect that these two models can achieve, and has higher requirements on the power consumption and computing power of the terminal device.
[0101] In some embodiments, the restoration process includes the steps of calculating the gradient of the denoised speech signal and sampling the gradient based on Gaussian noise. Since Gaussian noise is superimposed on the gradient in the sampling step, if the Gaussian noise conforms to the gradient or conforms to the probability distribution of the target speech signal, the attenuated high-frequency components will be enhanced, thereby restoring the high-frequency components.
[0102] Traditional discriminative neural networks cannot repair high-frequency components by superimposing Gaussian noise based on probability distribution like generative neural networks.
[0103] Figure 3 A schematic diagram of a speech signal processing method 100 provided in an embodiment of the present application.
[0104] S101: Acquire a first speech signal to be processed.
[0105] For example, the microphone module 110 of the electronic device is used to collect the voice signal to be processed from a distance. s(k) The speech signal to be processed recorded by the microphone of the electronic device is a speech signal in the time domain. The feature transformation module 120 can transform the speech signal in the time domain into s(k) The first speech signal converted into the time-frequency domain x(f,t) , then based on the first speech signal x(f,t) For subsequent processing. f Indicates frequency, t Indicates the time frame.
[0106] S102, using the noise reduction module 130 based on the first diffusion model to perform noise reduction processing on the first speech signal to obtain a second speech signal y(f,t) .
[0107] As a possible example of S102, example 1 includes:
[0108] Step A-1, calculating the gradient of the first speech signal.
[0109] The gradient is used to characterize the probability distribution of the second speech signal, and the probability distribution of the second speech signal corresponds to the distribution of time-frequency points in the spectrogram of the second speech signal.
[0110] Step A-2: Sampling the gradient of the first speech signal to obtain a second speech signal.
[0111] It can be understood that the above consideration of the probability distribution of the second speech signal is to consider the integrity of the distribution of the time-frequency points of the second speech signal, and the integrity includes the relationship between the time-frequency points.
[0112] It can also be understood that the method of analyzing each time-frequency point without considering the overall performance, even if the total error (e.g., the first error value) between the time-frequency points of the signal after speech enhancement processing and the time-frequency points corresponding to the ideal clean signal (the signal after all noise is removed from the first speech signal in an ideal situation) is very small, it is very likely that the following situation will occur: the error of a small number of time-frequency points relative to the corresponding time-frequency points of the ideal clean signal is large (e.g., significantly larger than the first error value), and the error of most time-frequency points is very small (e.g., significantly smaller than the first error value). Therefore, the small number of time-frequency points with large errors will, in principle, cause a certain degree of damage to the denoised speech, poor spectrum continuity, and poor listening experience.
[0113] Compared with the solution that does not consider the overall distribution of time-frequency points, the present application, on the basis of considering the overall distribution of time-frequency points, if the total error is controlled to the same small value (such as the first error value), the errors of almost all time-frequency points will be more balanced and smaller, thereby reducing the damage of noise reduction processing to the speech signal in principle.
[0114] The total error in the present application can be understood as the loss function value used by the neural network used to calculate the denoised gradient to be sampled or the denoised gradient to be corrected during the training process.
[0115] As a possible specific implementation of Example 1, two gradient calculations are performed, and a correction process is performed after the sampling process. Example 1-1 includes:
[0116] Step C-1, input the first speech signal into the first neural network to obtain the denoised sampled gradient of the first speech signal. The denoised sampled gradient is used to characterize the probability distribution of the second speech signal.
[0117] Step C-2: predicting the denoised sampled signal according to the denoised sampled gradient.
[0118] Step C-3, inputting the denoised sampled signal into the first neural network to obtain the denoised gradient to be corrected of the denoised sampled signal, where the denoised gradient to be corrected is used to characterize the probability distribution of the second speech signal.
[0119] Step C-4, correcting the noise reduction sampling signal according to the noise reduction gradient to be corrected to obtain a noise reduction correction signal, and the noise reduction correction signal is used to generate a second speech signal.
[0120] Among them, step C-1 and step C-3 are a specific example of step A-1; step C-2 and step C-3 are a specific example of step A-2.
[0121] The above scheme further calculates the denoised gradient to be corrected for the denoised sampled signal obtained based on the prediction of the denoised gradient to be sampled, and corrects the denoised sampled signal based on the denoised gradient to be corrected. Compared with the diffusion model that only calculates the gradient once, or compared with the diffusion model that only predicts but does not correct, the denoising effect is better.
[0122] As a possible specific implementation of step C-2, the noise reduction sampling signal is predicted by the drift coefficient and the inverse drift coefficient. Example 1-2 includes:
[0123] Step E-1, based on the stochastic differential equation of the first diffusion model, calculate the noise reduction drift coefficient according to the first speech signal.
[0124] Step E-2, calculating the denoising inverse drift coefficient according to the denoising drift coefficient and the denoising gradient to be sampled.
[0125] Step E-3: predicting a noise reduction sampling signal according to the noise reduction inverse drift coefficient, the first speech signal and the fourth Gaussian noise value.
[0126] The fourth Gaussian noise value is generated based on the third random seed.
[0127] It can be understood that the inverse drift coefficient can be used to describe the path of the noisy speech signal tending towards the clean speech signal during the sampling process. Sampling based on the inverse drift coefficient to obtain the gradient can achieve noise reduction.
[0128] Specifically, the following will combine Example 1-1 and Example 1-2, based on Figure 4 Introduce more specific implementation methods.
[0129] Specifically, for the first neural network in Example 1-1, the following will be based on Figure 6 Introduce the training process.
[0130] S103: Perform restoration processing on the first speech signal and the second speech signal based on the second diffusion model to obtain a target speech signal.
[0131] The second diffusion model is a conditional diffusion model, and the restoration process includes: using the first speech signal as a condition of the second diffusion model to restore the high-frequency components of the second speech signal.
[0132] For example, the first speech signal is restored by using the restoration module 140 based on the second diffusion model. x(f,t) and the second speech signal y(f,t) Perform repair processing to obtain the repaired speech signal r(f,t) The repaired speech signal r(f,t) Input feature inverse transformation module 150 to obtain the target speech signal .
[0133] As a possible example of S102, Example 2 includes:
[0134] Step B-1, based on the first speech signal and the second speech signal, calculate the gradient of the second speech signal, the gradient is used to characterize the probability distribution of the target speech signal, the probability distribution of the target speech signal corresponds to the distribution of time-frequency points in the spectrogram of the target speech signal.
[0135] Step B-2: sampling the gradient of the second speech signal based on the first Gaussian noise value to obtain a target speech signal, wherein the first Gaussian noise value is generated based on the first random seed.
[0136] In the above scheme, since Gaussian noise is superimposed according to the gradient in the sampling step, if the Gaussian noise conforms to the gradient or the probability distribution of the target speech signal, the attenuated high-frequency components will be enhanced, thereby repairing the high-frequency components.
[0137] It is understandable that traditional discriminative neural networks cannot repair high-frequency components by superimposing Gaussian noise based on probability distribution like generative neural networks.
[0138] As a possible specific implementation of Example 2, two gradient calculations are performed, and a correction process is performed after the sampling process. Example 2-1 includes:
[0139] Step D-1, input the first speech signal and the second speech signal into the second neural network to obtain the repaired gradient to be sampled of the second speech signal, and the repaired gradient to be sampled is used to characterize the probability distribution of the target speech signal.
[0140] Step D-2: predicting the repaired sampling signal according to the repaired sampled gradient and the first Gaussian noise value.
[0141] Step D-3, inputting the repaired sampled signal into the second neural network to obtain the repaired gradient to be corrected of the repaired sampled signal, where the repaired gradient to be corrected is used to characterize the probability distribution of the target speech signal.
[0142] Step D-4, sampling the gradient of the second speech signal, also includes: correcting the repaired sampled signal according to the repaired gradient to be corrected to obtain a repaired corrected signal, and the repaired corrected signal is used to generate the target speech signal.
[0143] Among them, step D-1 and step D-3 are used as a specific example of step B-1. Step D-2 and step D-3 are used as a specific example of step B-2.
[0144] The above scheme further calculates the repaired gradient to be corrected for the repaired sampled signal obtained based on the repaired gradient to be sampled prediction, and corrects the repaired sampled signal based on the repaired gradient to be corrected. Compared with the diffusion model that only calculates the gradient once, or compared with the diffusion model that only predicts without correction, the effect of repairing high-frequency components is better.
[0145] As a possible specific implementation of step D-2, the sampled signal is repaired by predicting the drift coefficient and the inverse drift coefficient. Example 2-2 includes:
[0146] Step F-1, based on the stochastic differential equation of the second diffusion model, calculate the restoration drift coefficient according to the second speech signal.
[0147] Step F-2, calculating the repaired inverse drift coefficient according to the repaired drift coefficient and the repaired gradient to be sampled.
[0148] Step F-3, predicting and obtaining a repaired sampling signal according to the repaired inverse drift coefficient, the second speech signal and the first Gaussian noise value.
[0149] It can be understood that the inverse drift coefficient can be used to describe the path of the noisy speech signal tending to the clean speech signal during the sampling process. That is, the time-frequency points that do not obey the probability distribution of the target speech signal are reduced, and the path of the time-frequency points that obey the probability distribution of the target speech signal is generated by means of the first Gaussian noise.
[0150] Specifically, in combination with Example 2-1 and Example 2-2, based on Figure 5 Introduce a more specific implementation method.
[0151] Specifically, for the second neural network in Example 2-1, the following will be based on Figure 7 Introduce the training process.
[0152] The embodiment of the present application performs noise reduction on the one hand, which can make the target voice signal more clear in hearing, and repairs the high-frequency components on the other hand, which can make the target voice signal more full in hearing. Moreover, compared with the solution of only performing noise reduction processing on the far-field voice signal, the target voice signal can be made to sound fuller.
[0153] As a possible further example of Example 1-1 and Example 1-2, Example 3, the steps of Example 1-1 and Example 1-2 need to be iterated N times to achieve a better noise reduction effect, Example 3 includes:
[0154] When the sampling number n=1, in step G-1, the first speech signal is input into the first neural network to obtain the first denoised sampled gradient of the first speech signal.
[0155] Step G-2: Calculate the first noise reduction drift coefficient according to the first speech signal based on the stochastic differential equation of the first diffusion model.
[0156] Step G-3, calculating the first denoising inverse drift coefficient according to the first denoising drift coefficient and the first denoising gradient to be sampled.
[0157] Step G-4, predicting the first denoised sampling signal according to the first denoised inverse drift coefficient, the first speech signal and the first fourth Gaussian noise value.
[0158] Step G-5, inputting the first denoised sampling signal into the first neural network to obtain the first denoised gradient to be corrected of the first denoised sampling signal.
[0159] Step G-6, correcting the first denoised sampled signal according to the first denoised gradient to be corrected to obtain the first denoised corrected signal.
[0160] Alternatively, when the number of sampling times is n, and 2≤n≤N, and n and N are both positive integers, in step H-1, the n-1th noise reduction correction signal and the first speech signal are input into the first neural network to obtain the nth noise reduction gradient to be sampled of the first speech signal.
[0161] Step H-2: Calculate the nth noise reduction drift coefficient based on the stochastic differential equation of the first diffusion model and the n-1th noise reduction correction signal and the first speech signal.
[0162] Step H-3, calculating the nth denoising inverse drift coefficient according to the nth denoising drift coefficient and the nth denoising gradient to be sampled.
[0163] Step H-4, predicting and obtaining the nth noise reduction sampling signal according to the nth noise reduction inverse drift coefficient, the n-1th noise reduction correction signal and the nth fourth Gaussian noise value.
[0164] Step H-5, inputting the nth denoised sampling signal and the first speech signal into the first neural network to obtain the nth denoised gradient to be corrected of the nth denoised sampling signal.
[0165] Step H-6, correcting the nth denoised sampled signal according to the nth denoised gradient to be corrected to obtain the nth denoised corrected signal.
[0166] Figure 4 A schematic diagram of a speech conversion method 200 provided in an embodiment of the present application. Figure 4 This can be used as a possible further example of Example 3. For example, the noise reduction module 130 based on the first diffusion model includes: Figure 4 The initialization module 201 to the judgment module 207 are shown.
[0167] Initialization module 201, initialize sampling times n = 1 (indicates that the current sampling is the first time), initialize sampling time s = 0.999, initialize sampling signal , and outputs the initialized parameters to the drift coefficient calculation module 202.
[0168] in, is the first speech signal mentioned above.
[0169] in, Represents the noise-reduced sampled signal.
[0170] Wherein, when the sampling number n satisfies 2≤n≤N, when the steps from the drift coefficient calculation module 202 to the judgment module 207 are executed for the nth time, is the n-1th noise reduction correction signal, which can be understood as the noise reduction correction signal obtained by the n-1th sampling.
[0171] Drift coefficient calculation module 202, the input of which is , s , The function of this module is to calculate the drift coefficient according to the stochastic differential equation of the diffusion model fc ,for example The drift coefficient calculated by this module is output to the inverse drift coefficient calculation module 204 to calculate the inverse drift coefficient.
[0172] Here the stochastic differential equation may be a forward stochastic differential equation of a diffusion model.
[0173] The step performed by the drift coefficient calculation module 202 may be understood as a possible example of step G-2 or step H-2.
[0174] Gradient calculation module 203, the input of this module is , s , The function of this module is to use the trained first neural network model to calculate the denoised sampled gradient. .
[0175] The step performed by the gradient calculation module 203 may be understood as a possible example of step G-1 or step H-1.
[0176] Specifically, the training process of the first neural network model will be described below in conjunction with Figure 6 Provide a detailed introduction.
[0177] The gradient calculated by this module is output to the inverse drift coefficient calculation module 204 to calculate the inverse drift coefficient.
[0178] Inverse drift coefficient calculation module 204, the input of this module is the drift coefficient fc and gradient grad , using the formula To calculate the inverse drift coefficient fcr , output to the prediction module 205 for prediction. is a predefined diffusion coefficient, in this application, It can be a constant selected based on experience, such as 1.2.
[0179] The step performed by the inverse drift coefficient calculation module 204 may be understood as a possible example of step G-3 or step H-3.
[0180] The prediction module 205, which may also be referred to as the sampling prediction module 205, uses the formula To predict the new sampled signal, z1 is a Gaussian noise with a mean of zero and a variance of 1 (i.e., the fourth Gaussian noise mentioned above). It should be noted that the generation of Gaussian noise requires setting a random seed. For evidence collection, the random seed is set when the terminal device is reset.
[0181] Among them, the formula Indicates that Updated to , a new sampling signal is obtained, that is, the noise-reduced sampling signal obtained by the n-th sampling, also called the n-th noise-reduced sampling signal.
[0182] Exemplarily, the sampling methods include but are not limited to ancestral sampling, Langevin kinetic sampling and annealing Langevin kinetic sampling (a combination of one or two), but no matter which sampling method is used, it is necessary to generate random numbers based on random seeds (that is, Gaussian noise with a mean of 0 and a variance of 1 in this application), and then sample based on the random numbers.
[0183] The step performed by the prediction module 205 may be understood as a possible example of step G-4 or step H-4.
[0184] After predicting the denoised sampled signal, the prediction module 205 outputs the prediction result to the gradient calculation module 203 .
[0185] Gradient calculation module 203, the input of this module is , s , Among them, is the nth sample signal updated in the prediction module 205 The function of this module is to use the trained neural network model to calculate the gradient to be corrected for noise reduction. The gradient calculated by this module is output to the correction module 206 for correction.
[0186] The step performed by the gradient calculation module 203 may be understood as a possible example of step G-5 or step H-5.
[0187] Correction module 206 uses the annealing Langevin dynamic sampling method to predict the new sampling signal according to the denoised gradient to be corrected Perform correction and obtain the nth correction signal , wherein the annealing Langevin kinetic sampling method can refer to the description in the related art. Alternatively, the Langevin kinetic sampling method can also be used, and the Langevin kinetic sampling method can refer to the description in the related art.
[0188] When 1≤n<N, it is used as the n+1th input of the drift coefficient calculation module 202, and when n=N, it is used as the final output of this method.
[0189] The step performed by the correction module 206 may be understood as a possible example of step G-6 or step H-6.
[0190] The judgment module 207 judges whether n is equal to N (the preset total number of sampling steps, for example, assuming it is 10). If n=N, the correction signal As the second speech signal output, otherwise update the sampling number and sampling time, (i.e. update n with n+1), , and execute the drift coefficient calculation module 202 cyclically.
[0191] The beneficial effects of method 200 can refer to the beneficial effects of the corresponding solution in method 100.
[0192] As a possible further example of Example 2-1 and Example 2-2, Example 4, the steps of Example 2-1 and Example 2-2 need to be iterated M times to achieve a better effect of repairing high-frequency components, and Example 4 includes:
[0193] When the sampling number m=1, in step I-1, the first speech signal and the second speech signal are input into the second neural network to obtain the first repaired to-be-sampled gradient of the second speech signal.
[0194] Step I-2: Calculate a first repair drift coefficient according to the second speech signal based on the stochastic differential equation of the second diffusion model.
[0195] Step I-3, calculating the first repaired inverse drift coefficient according to the first repaired drift coefficient and the first repaired gradient to be sampled.
[0196] Step I-4: predicting a first repaired sampling signal based on the first repaired inverse drift coefficient, the second speech signal and the first Gaussian noise value.
[0197] Step I-5, inputting the first repaired sampling signal into the second neural network to obtain the first repaired gradient to be corrected of the first repaired sampling signal.
[0198] Step I-6, correcting the first repaired sampling signal according to the first repaired gradient to be corrected to obtain the first repaired correction signal.
[0199] Alternatively, when the number of times is m and 2≤m≤M, and m and M are both positive integers, in step J-1, the first speech signal, the second speech signal and the m-1th repaired and corrected signal are input into the second neural network to obtain the mth repaired gradient to be sampled of the second speech signal.
[0200] Step J-2: Calculate the mth restoration drift coefficient according to the second speech signal and the m-1th restoration correction signal based on the stochastic differential equation of the second diffusion model.
[0201] Step J-3, calculating the mth repaired inverse drift coefficient according to the mth repaired drift coefficient and the mth repaired gradient to be sampled.
[0202] Step J-4, predicting and obtaining the mth repaired sampling signal according to the mth repaired inverse drift coefficient, the m-1th repaired correction signal and the first Gaussian noise value.
[0203] Step J-5, inputting the first speech signal, the second speech signal and the mth repaired sampling signal into the second neural network to obtain the mth repaired gradient to be corrected of the mth repaired sampling signal.
[0204] Step J-6, correcting the mth repaired sampling signal according to the mth repaired gradient to be corrected, to obtain the mth repaired corrected signal.
[0205] Figure 5 A schematic diagram of a speech conversion method 300 provided in an embodiment of the present application. Figure 5 This can be used as a possible further example of Example 4. For example, the repair module 140 based on the second diffusion model includes: Figure 5 The initialization module 301 to the judgment module 307 are shown.
[0206] Initialization module 301, initialize sampling times m = 1 (indicates that the current sampling is the first time), initialize sampling time s = 0.999, initialize sampling signal , and outputs the initialized parameters to the drift coefficient calculation module 302.
[0207] in, is the second speech signal mentioned above.
[0208] in, Represents the repaired sampled signal.
[0209] Wherein, when the sampling number m satisfies 2≤m≤M, when the steps from the drift coefficient calculation module 302 to the judgment module 307 are executed for the mth time, is the m-1th repair and correction signal, which can be understood as the repair and correction signal obtained by the m-1th sampling.
[0210] Drift coefficient calculation module 302, the input of which is , s and The function of this module is to calculate the drift coefficient according to the stochastic differential equation of the diffusion model fc ,for example The drift coefficient calculated by this module is output to the inverse drift coefficient calculation module 304 to calculate the inverse drift coefficient.
[0211] Here the stochastic differential equation may be a forward stochastic differential equation of a diffusion model.
[0212] The step performed by the drift coefficient calculation module 302 may be understood as a possible example of step I-2 or step J-2.
[0213] Gradient calculation module 303, the input of this module is , s , and The function of this module is to use the trained first neural network model to calculate and repair the gradient to be sampled. .
[0214] The step performed by the gradient calculation module 303 may be understood as a possible example of step I-1 or step J-1.
[0215] Specifically, the training process of the first neural network model will be described below in conjunction with Figure 6 Provide a detailed introduction.
[0216] The gradient calculated by this module is output to the inverse drift coefficient calculation module 304 to calculate the inverse drift coefficient.
[0217] Inverse drift coefficient calculation module 304, the input of this module is the drift coefficient fc and gradient grad , using the formula To calculate the inverse drift coefficient fcr , output to the prediction module 305 for prediction.
[0218] The step performed by the inverse drift coefficient calculation module 304 may be understood as a possible example of step I-3 or step J-3.
[0219] The prediction module 305, which may also be referred to as the sampling prediction module 305, uses the formula To predict the new sampled signal, z2 is a Gaussian noise with a mean of zero and a variance of 1 (i.e., the first Gaussian noise mentioned above). It should be noted that the generation of Gaussian noise requires setting a random seed. For evidence collection, the random seed is set when the terminal device is reset.
[0220] Among them, the formula Indicates that Updated to , a new sampling signal is obtained, that is, the repaired sampling signal obtained by the nth sampling, also called the mth repaired sampling signal.
[0221] Exemplarily, the sampling methods include but are not limited to ancestral sampling, Langevin kinetic sampling and annealing Langevin kinetic sampling (a combination of one or two), but no matter which sampling method is used, it is necessary to generate random numbers based on random seeds (that is, Gaussian noise with a mean of 0 and a variance of 1 in this application), and then sample based on the random numbers.
[0222] The step performed by the prediction module 305 may be understood as a possible example of step I-4 or step J-4.
[0223] After predicting and repairing the sampled signal, the prediction module 305 outputs the prediction result to the gradient calculation module 303 .
[0224] Gradient calculation module 303, the input of this module is , s , and Among them, is the mth sampling signal after update in the prediction module 305 The function of this module is to use the trained neural network model to calculate and repair the gradient to be corrected. The gradient calculated by this module is output to the correction module 306 for correction.
[0225] The step performed by the gradient calculation module 303 may be understood as a possible example of step I-5 or step J-5.
[0226] Correction module 306 uses the annealing Langevin kinetic sampling method to repair the predicted new sampling signal according to the gradient to be corrected Perform correction and obtain the mth correction signal , wherein the annealing Langevin kinetic sampling method can refer to the description in the related art. Alternatively, the Langevin kinetic sampling method can also be used, and the Langevin kinetic sampling method can refer to the description in the related art.
[0227] When 1≤m<M, it is used as the m+1th input of the drift coefficient calculation module 302, and when m=M, it is used as the final output of this method.
[0228] The step performed by the correction module 306 may be understood as a possible example of step I-6 or step J-6.
[0229] The judgment module 307 judges whether m is equal to M (the preset total number of sampling steps, for example, assuming it is 10). If m=M, the correction signal As the restored speech signal r(f,t) Output, otherwise update the sampling times and sampling time, (i.e. update m with m+1), , and execute the drift coefficient calculation module 302 cyclically.
[0230] The beneficial effects of method 300 can refer to the beneficial effects of the corresponding solution in method 100.
[0231] As a further example of Example 1-1, Example 5, the first neural network is trained based on first input data and first target data, wherein the first input data includes a sample noisy speech signal and a sample noise reduction sampling signal, the sample noisy speech signal is generated by a first sample noise signal and a first sample speech signal, the sample noise reduction sampling signal is generated based on the sample noisy speech signal, and the first target data is used to characterize the probability distribution of the first sample speech signal.
[0232] The above scheme trains the neural network model by characterizing the probability distribution of the sample speech signal contained in the sample noisy speech signal through target data, so that the gradient output by the trained neural network model can characterize the probability distribution of the second speech signal.
[0233] Among them, the sample denoising sampling signal is the fifth Gaussian noise value, the fifth Gaussian noise value is generated based on the sample noisy speech signal, the sample speech signal and the sixth Gaussian noise value that obeys the standard normal distribution, the first target data is generated based on the standard deviation of the fifth Gaussian noise value and the sixth Gaussian noise value, and the sixth Gaussian noise value is generated based on the fourth random seed.
[0234] It can be understood that since the random numbers generated by the random seed at different times are different, the speech signal processing method provided in the present application performs noise reduction processing on the same segment of speech signal to be processed at different times, and the second speech signals output respectively are different or not completely the same, so that the target speech signals output finally are different or not completely the same.
[0235] Figure 6A schematic diagram of a training process 400 of a deep neural network model provided in an embodiment of the present application is shown. Figure 6 The training process shown can be understood as a specific example of the training process of the first neural network in method 100, that is, a specific example of Example 5.
[0236] The training process diagram of the deep neural network model includes the following modules.
[0237] Adding module 401, used to add sample noise and sample clean speech signal Ya(k) According to a certain signal-to-noise ratio, linear addition is performed to obtain the sample noisy speech signal. Ys(k) , the signal is a time domain signal.
[0238] The sample noise comes from a sample noise set, and the sample clean speech signal comes from a clean speech signal set. The sample noise set can be generated by simulation or actually recorded. The sample clean speech data set can be recorded in advance.
[0239] Feature transformation module 402, for the sample noisy speech signal Ys(k) Perform feature transformation to obtain the sample noisy speech signal in the time-frequency domain after feature transformation Yx(f,t) ; Also for the sample clean speech signal Ya(k) Perform feature transformation to obtain the sample clean speech signal in the time-frequency domain after feature transformation YA(f,t).
[0240] For example, the feature transformation is short-time Fourier transform, amplitude transform, etc.
[0241] Sampling time generation module 403, this module does not need input information. The function of this module is to randomly generate a l min arrive l max The decimal between is taken as the sampling time, where l min is the minimum value, such as 0.003, l max The sampling time generated by this module is output to the sample generation module 405.
[0242] The Gaussian noise generating module 404 is used to generate a Gaussian noise value z3 (ie, the sixth Gaussian noise value mentioned above) with a mean of zero and a variance of 1.
[0243] The sample generation module 405 is used to generate a sample according to Generate sample denoised signal ,in, is the mean, is the standard deviation.
[0244] in, , .
[0245] The first neural network 406. Sample noisy speech signal Yx(f,t) , Sample sampling time l And the sample noise reduction sampling signal Input the first neural network 406 and output the denoised sample gradient, i.e. .
[0246] The first neural network here can be composed of a variety of deep neural network models, such as noise conditional scoring network (NCSN)++ network, convolutional neural networks (CNN), convolutional recurrent neural network (CRNN), U-net and other network models.
[0247] Loss function calculation module 407. The calculation formula of the loss function is: ,Will As the target data, the loss function is calculated with the output prediction gradient.
[0248] The beneficial effects of the training process 400 can refer to the beneficial effects of the corresponding solution in the method 100.
[0249] As a further example of Example 2-1, Example 6, the second neural network is trained based on second input data and second target data, wherein the second input data includes a sample noisy speech signal, a sample attenuated speech signal and a sample repaired sampling signal, the sample noisy speech signal is generated by the second sample noise signal and the second sample speech signal, the sample attenuated speech signal is obtained by convolving the sample noisy speech signal with a preset distance room impulse response, the sample repaired sampling signal is generated based on the sample attenuated speech signal and the second sample speech signal, the second target data is used to characterize the probability distribution of the second sample speech signal, the first distance room impulse response is used to simulate the process of the sound source being emitted by the sound source and propagating to the microphone when the distance between the sound source and the microphone of the electronic device is a preset distance, and the preset distance is a preset distance threshold.
[0250] The above scheme trains the neural network model by using the target data to characterize the probability distribution of the sample speech signal used to generate the sample attenuated speech signal, so that the gradient output by the trained neural network model can characterize the probability distribution of the target speech signal.
[0251] Among them, the sample repair sampling signal is the second Gaussian noise value, the second Gaussian noise value is generated based on the sample attenuated speech signal, the sample speech signal and the third Gaussian noise value that obeys the standard normal distribution, the second target data is generated based on the standard deviation of the second Gaussian noise value and the third Gaussian noise value, and the third Gaussian noise value is generated based on the second random seed.
[0252] It is understandable that, since the random numbers generated by the random seed at different times are different, the speech signal processing method provided in the present application performs repair processing on the same speech signal to be processed at different times, and the target speech signals outputted respectively are different or not completely the same.
[0253] Figure 7 A schematic diagram of a training process 500 of a deep neural network model provided in an embodiment of the present application is shown. Figure 7 The training process shown can be understood as a specific example of the training process of the second neural network in method 100, that is, a specific example of Example 6.
[0254] The training process diagram of the deep neural network model includes the following modules.
[0255] Adding module 501, used to add sample noise and sample clean speech signal Ya(k) According to a certain signal-to-noise ratio, linear addition is performed to obtain the sample noisy speech signal. Ys(k) , the signal is a time domain signal.
[0256] The sample noise comes from a sample noise set, and the sample clean speech signal comes from a clean speech signal set. The sample noise set can be generated by simulation or actually recorded. The sample clean speech data set can be recorded in advance.
[0257] Convolution module 502 is used to convolve the sample noisy speech signal Ys(k) Convolution calculation is performed with the distant room impulse response (i.e., distant RIR) to obtain a sample attenuated speech signal with attenuated high-frequency components. Yd(k) .
[0258] The long-distance RIR comes from the long-distance RIR dataset, which includes the long-distance RIR recorded in a very large room and the long-distance RIR in a very large room simulated by a simulation algorithm.
[0259] Feature transformation module 503, used to attenuate the sample speech signal Yd(k) Perform feature transformation to obtain the sample attenuated speech signal in the time-frequency domain after feature transformation Yx(f,t) ; Also for the sample clean speech signal Ya(k) Perform feature transformation to obtain the sample clean speech signal in the time-frequency domain after feature transformation YA(f,t).
[0260] The noise reduction module 504 based on the first diffusion model is used to reduce the noise of the sample speech signal. Yx(f,t) Perform noise reduction processing and output sample noise-reduced speech signal Yy(f,t) .
[0261] Sampling time generation module 505, this module does not need input information. The function of this module is to randomly generate a l min arrive l max The decimal between is taken as the sampling time, where l min is the minimum value, such as 0.003, l max The sampling time generated by this module is output to the sample generation module 507.
[0262] The Gaussian noise generating module 506 is used to generate a Gaussian noise value z4 (ie, the third Gaussian noise value mentioned above) with a mean of zero and a variance of 1.
[0263] The sample generation module 507 is used to generate a sample according to Generate sample repair sample signal ,in, is the mean, is the standard deviation.
[0264] in, , .
[0265] The second neural network 508 attenuates the sample speech signal Yx(f,t) , Sample sampling time l And the sample repair sampling signal Input the second neural network 508 and output the repair sample gradient, that is, .
[0266] The second neural network here can be composed of a variety of deep neural network models, such as NCSN++ network, CNN, CRNN, U-Net and other network models.
[0267] Loss function calculation module 509. The calculation formula of the loss function is: ,Will As the target data, the loss function is calculated with the output prediction gradient.
[0268] The beneficial effects of the training process 500 can refer to the beneficial effects of the corresponding solution in the method 100.
[0269] Please refer to Figure 8 , Figure 8 A schematic diagram of the hardware structure of an electronic device 1000 provided in an embodiment of the present application is shown.
[0270] The electronic device 1000 can be a headset, a mobile phone, a smart screen, a tablet computer, a wearable electronic device, an in-vehicle electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc. The embodiment of the present application does not impose any limitation on the specific type of the electronic device 1000.
[0271] See also Figure 8 The electronic device 1000 may include a processor 1010, an audio module 1020, a microphone 1020A, and optionally, a speaker 1020B.
[0272] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0273] The processor 1010 may include one or more processing units. For example, the processor 1010 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU).
[0274] The controller may be the nerve center and command center of the electronic device 1000. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0275] The processor 1010 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1010 is a cache memory. The memory may store instructions or data that the processor 1010 has just used or cyclically used. If the processor 1010 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1010, and thus improves the efficiency of the system.
[0276] In the present application, the processor 1010 is used to first perform noise reduction on the voice signal to be processed based on the diffusion model, and then repair the high-frequency components based on the diffusion model, and finally obtain the target voice signal. On the one hand, noise reduction can make the target voice signal clearer in hearing, and on the other hand, repairing the high-frequency components can make the target voice signal fuller in hearing. Moreover, compared with the solution of only performing noise reduction processing on the far-field voice signal, the target voice signal can be made fuller in hearing.
[0277] In some embodiments, the processor 1010 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0278] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0279] The electronic device 1000 can implement audio functions, such as music playback, recording, voice calls, etc., through the audio module 1020, the speaker 1020B, the microphone 1020A, and the application processor (not shown in the figure).
[0280] In a voice call or recording scenario, microphone 1020A is used to record far-field voice signals.
[0281] Optionally, during a voice call, the speaker 1020B is used to play the voice of the party talking to the user; in a recording scenario, if the user wants to listen to the recording content, the speaker 1020B plays the recording content.
[0282] Next, the software system of the electronic device 1000 will be described.
[0283] Exemplarily, the electronic device 1000 may be a mobile phone. The software system of the electronic device 1000 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device 1000.
[0284] Fig. 9 1 shows a block diagram of a software system of an electronic device 1000 provided in an embodiment of the present application. Fig. 9 , the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer (application layer), the application framework layer (framework layer), the hardware abstraction layer (HAL), the driver layer, and the hardware layer.
[0285] The application layer may include a series of application packages, such as dialing applications, gallery applications, etc. (not shown in the figure). In the embodiment of the present application, the application package may include applications such as recording and voice calls, and these applications all require the use of a microphone to record audio. The terminal device may perform the voice signal processing of the present application on the audio recorded by the microphone, including noise reduction processing and high-frequency component repair processing.
[0286] Alternatively, the application layer may also include other applications that require the voice signal recorded by the microphone to be processed by the voice signal of this application, which is not limited in this application.
[0287] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. In an embodiment of the present application, the framework layer includes a microphone service interface and a noise reduction and high-frequency component repair service interface. Among them, the noise reduction and high-frequency component repair service interface can provide an API and a programming framework for applications that obtain noise reduction and high-frequency component repair services. The microphone service can be used to provide an API and a programming framework for applications that call the microphone.
[0288] The hardware abstraction layer (HAL) is an interface layer between the operating system kernel and the upper software, providing a virtual hardware platform for the operating system. In the embodiment of the present application, the hardware abstraction layer may include a microphone hardware abstraction layer and a noise reduction and high-frequency component repair algorithm. The microphone hardware abstraction layer may provide virtual hardware for microphone 1, microphone 2 or more microphone devices. The noise reduction and high-frequency component repair algorithm may include operating code and data for implementing the voice signal processing method provided in the embodiment of the present application.
[0289] The driver layer is a layer between hardware and software. The driver layer includes drivers for various hardware. The driver layer may include microphone device drivers, digital signal processor drivers, etc. The microphone device driver is used to drive the microphone sensor to collect sound signals, and drive the audio signal processor to pre-process the sound signals to obtain audio digital signals. The digital signal processor driver is used to drive the digital signal processor to process audio digital signals.
[0290] The hardware layer includes sensors and audio signal processors. The sensors include microphones 1 and 2. The microphones included in the sensors correspond one-to-one to the virtual microphones included in the microphone hardware abstraction layer. The audio signal processor can be used to convert the sound signals collected by the microphones into audio digital signals. The digital signal processor can be used to process audio digital signals. It should be noted that the application provides Fig. 9 The software structure diagram of the electronic device shown is only an example and does not limit the specific module division in different layers of the Android operating system. For details, please refer to the introduction of the Android operating system software structure in conventional technology.
[0291] The following is a detailed description of the method in the embodiment of the present application in combination with the above hardware structure and system structure:
[0292] In response to enabling recording or voice call applications, such applications may call the noise reduction and high-frequency component repair service interface to obtain the noise reduction and high-frequency component repair service application programming interface and programming framework.
[0293] On the one hand, the noise reduction and high-frequency component repair service can call the microphone service of the framework layer to collect sound signals in the environment through the microphone service. Among them, the microphone service can send an instruction to collect sound signals to the microphone 1 sensor of the hardware layer by calling the microphone 1 in the microphone hardware abstraction layer. The microphone hardware abstraction layer sends the instruction to the microphone device driver of the driver layer. The microphone device driver can start microphone 1 according to the above instruction, thereby obtaining the sound signal in the environment and generating a digital audio signal through the audio signal processor.
[0294] On the other hand, the noise reduction and high frequency component repair service can initialize the noise reduction and high frequency component repair algorithm. The noise reduction and high frequency component repair algorithm can obtain the digital audio signal generated by the audio signal processor through the microphone hardware abstraction layer. Then, according to the voice signal processing method stored in the noise reduction and high frequency component repair algorithm, the noise reduction and high frequency component repair algorithm can use the digital signal processor to process the acquired digital audio signal to obtain a digital audio signal after noise reduction and high frequency component repair.
[0295] Specifically, how to process the digital audio signal to obtain the digital audio signal after noise reduction and repair of high-frequency components can be seen in the previous section. Figures 3 to 7 The method flow chart is shown.
[0296] Finally, the noise reduction and high frequency component restoration algorithm can transmit the digital audio signal after noise reduction and high frequency component restoration back to the noise reduction and high frequency component restoration service, and then back to the application layer.
[0297] The embodiment of the present application provides a chip system, which includes one or more processors for calling and running instructions stored in the memory from the memory, so that the method of the embodiment of the present application is executed. The chip system can be composed of chips, or it can include chips and other discrete devices.
[0298] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.
[0299] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.
[0300] The computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.
[0301] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0302] The computer-readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM).
[0303] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.
[0304] In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
[0305] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0306] It should be understood that the "plurality" mentioned in this application refers to two or more than two. The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0307] The terms (or numbers) "first", "second", ..., etc. that appear in the embodiments of the present application are used for descriptive purposes only, that is, only to distinguish different objects, such as different "coordinates", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", ..., etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" means one or more. "Multiple" means two or more. "At least one of the following (items)" or similar expressions refers to any combination of these items, including any combination of a single (item) or multiple (items).
[0308] In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.
Claims
1. A speech signal processing method, applied to electronic equipment, characterized in that: The method comprises: Acquire a first speech signal to be processed; Performing noise reduction processing on the first speech signal based on a first diffusion model to obtain a second speech signal; The first speech signal and the second speech signal are repaired based on a second diffusion model to obtain a target speech signal, wherein the second diffusion model is a conditional diffusion model, and the repair processing includes: using the first speech signal as a condition for the second diffusion model to repair the high-frequency components of the second speech signal.
2. The method according to claim 1, characterized in that The first voice signal is a far-field voice signal, or the distance between the microphone of the electronic device and the sound source of the first voice signal is greater than or equal to a preset distance threshold.
3. The method according to claim 1, characterized in that The performing restoration processing on the first speech signal and the second speech signal based on the second diffusion model to obtain a target speech signal includes: Calculating a gradient of the second speech signal according to the first speech signal and the second speech signal, wherein the gradient is used to characterize a probability distribution of the target speech signal, and the probability distribution of the target speech signal corresponds to a distribution of time-frequency points in a spectrogram of the target speech signal; The target speech signal is obtained by sampling the gradient of the second speech signal based on a first Gaussian noise value, wherein the first Gaussian noise value is generated based on a first random seed.
4. The method according to claim 3, characterized in that The step of calculating the gradient of the second speech signal according to the first speech signal and the second speech signal comprises: inputting the first speech signal and the second speech signal into a second neural network to obtain a repaired gradient to be sampled of the second speech signal, wherein the repaired gradient to be sampled is used to characterize the probability distribution of the target speech signal; The sampling process of the gradient of the second speech signal based on the first Gaussian noise value includes: predicting and repairing the sampled signal according to the repaired gradient to be sampled and the first Gaussian noise value; The step of calculating the gradient of the second speech signal according to the first speech signal and the second speech signal further includes: inputting the repaired sampled signal into the second neural network to obtain a repaired gradient to be corrected of the repaired sampled signal, wherein the repaired gradient to be corrected is used to characterize the probability distribution of the target speech signal; The sampling process of the gradient of the second speech signal further includes: correcting the repaired sampled signal according to the repaired gradient to be corrected to obtain a repaired corrected signal, wherein the repaired corrected signal is used to generate the target speech signal.
5. The method according to claim 4, characterized in that The predicting and repairing the sampled signal according to the repaired to-be-sampled gradient and the first Gaussian noise value comprises: Calculating a repair drift coefficient according to the second speech signal based on a stochastic differential equation of the second diffusion model; Calculating a repair inverse drift coefficient according to the repair drift coefficient and the repaired gradient to be sampled; The repaired sampling signal is predicted based on the repaired inverse drift coefficient, the second speech signal and the first Gaussian noise value.
6. The method according to claim 4, characterized in that The second neural network is trained based on second input data and second target data, wherein the second input data includes a sample noisy speech signal, a sample attenuated speech signal and a sample repaired sampling signal, the sample noisy speech signal is generated by a second sample noise signal and a second sample speech signal, the sample attenuated speech signal is obtained by convolving the sample noisy speech signal with a preset distance room impulse response, the sample repaired sampling signal is generated based on the sample attenuated speech signal and the second sample speech signal, the second target data is used to characterize the probability distribution of the second sample speech signal, and the preset distance room impulse response is used to simulate the process of sound being emitted by a sound source and propagating to the microphone of the electronic device when the distance between the sound source and the microphone is greater than or equal to a preset distance threshold.
7. The method according to claim 6, characterized in that The sample repair sampling signal is a second Gaussian noise value, which is generated based on the sample attenuated speech signal, the second sample speech signal and a third Gaussian noise value that obeys a standard normal distribution, and the second target data is generated based on the standard deviation of the second Gaussian noise value and the third Gaussian noise value, and the third Gaussian noise value is generated based on a second random seed.
8. The method according to claim 1, characterized in that The performing noise reduction processing on the first speech signal based on the first diffusion model to obtain a second speech signal includes: Calculating a gradient of the first speech signal, where the gradient is used to characterize a probability distribution of the second speech signal, where the probability distribution of the second speech signal corresponds to a distribution of time-frequency points in a spectrogram of the second speech signal; The gradient of the first speech signal is sampled to obtain the second speech signal.
9. The method according to claim 8, characterized in that The calculating the gradient of the first speech signal includes: inputting the first speech signal into a first neural network to obtain a denoised gradient to be sampled of the first speech signal, wherein the denoised gradient to be sampled is used to characterize a probability distribution of the second speech signal; The sampling process of the gradient of the first speech signal includes: predicting a noise reduction sampling signal according to the noise reduction gradient to be sampled; The step of calculating the gradient of the first speech signal further includes: inputting the denoised sampled signal into the first neural network to obtain a denoised gradient to be corrected of the denoised sampled signal, wherein the denoised gradient to be corrected is used to characterize the probability distribution of the second speech signal; The sampling process of the gradient of the first speech signal also includes: correcting the noise reduction sampled signal according to the noise reduction gradient to be corrected to obtain a noise reduction correction signal, and the noise reduction correction signal is used to generate the second speech signal.
10. The method according to claim 9, characterized in that The step of predicting the denoised sampled signal according to the denoised sampled gradient comprises: Calculating a noise reduction drift coefficient according to the first speech signal based on a stochastic differential equation of the first diffusion model; Calculating a noise reduction inverse drift coefficient according to the noise reduction drift coefficient and the noise reduction to-be-sampled gradient; The denoised sampling signal is predicted based on the denoising inverse drift coefficient, the first speech signal and a fourth Gaussian noise value, wherein the fourth Gaussian noise value is generated based on a third random seed.
11. The method according to claim 9, characterized in that The first neural network is trained based on first input data and first target data, wherein the first input data includes a sample noisy speech signal and a sample noise reduction sampling signal, the sample noisy speech signal is generated by a first sample noise signal and a first sample speech signal, the sample noise reduction sampling signal is generated based on the sample noisy speech signal, and the first target data is used to characterize the probability distribution of the first sample speech signal.
12. The method according to claim 11, characterized in that The sample denoising sampling signal is a fifth Gaussian noise value, and the fifth Gaussian noise value is generated based on the sample noisy speech signal, the sample speech signal and a sixth Gaussian noise value that obeys a standard normal distribution. The first target data is generated based on the standard deviation of the fifth Gaussian noise value and the sixth Gaussian noise value, and the sixth Gaussian noise value is generated based on a fourth random seed.
13. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method according to any one of claims 1 to 12.
14. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, cause the electronic device to perform the method as claimed in any one of claims 1 to 12.
