Improved speech enhancement and noise reduction method
Through the improved speech enhancement and noise reduction method, short-time Fourier transform and various algorithms are used to optimize noise spectrum estimation and gain calculation, which solves the difficulty of noise spectrum tracking and weak speech estimation in strong noise environments, and improves speech quality and noise reduction. inhibitory effect.
Patent Information
- Application Number
- CN202410494683.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-04-24
AI Technical Summary
Existing speech enhancement technology has problems such as difficulty in tracking the noise spectrum in a strong noise environment and the inability to polarize weak speech estimation, resulting in reduced speech quality.
Using an improved speech enhancement and noise reduction method, through short-time Fourier transform, DD decision method, MCRA algorithm, OMLSA algorithm and smoothing processing technology, the prior signal-to-noise ratio, posterior signal-to-noise ratio and speech existence probability are calculated and optimized. Noise spectrum estimation and gain calculation protect weak speech and prevent noise overestimation.
The parameter estimation performance is improved, the speech quality is improved, the speech enhancement effect is ensured in a strong noise environment, and the total error rate of noise suppression is reduced.
Smart Images

Figure CN118398022B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of speech signal processing, and in particular to an improved speech enhancement and noise reduction method. Background Art
[0002] During the collection and transmission of speech signals, they are interfered by noise, resulting in a low audio signal-to-noise ratio, and the signal will be attenuated during transmission. Therefore, it is necessary to enhance and reduce noise on the collected audio. Speech enhancement algorithms usually involve the estimation of noise spectrum and prior signal-to-noise ratio. The accuracy of the two parameter estimates directly affects the quality of the enhanced speech. Existing speech enhancement technologies are mainly divided into traditional methods and deep learning methods. Among them, traditional methods are characterized by low complexity and easy real-time application, so they are widely used in the field of speech enhancement. Traditional speech enhancement technologies are divided into three categories: spectral subtraction, algorithms based on statistical models, and subspace algorithms. The NS module of WebRTC is common in the field of algorithms based on statistical models. Its main steps include: frame windowing fft; speech feature calculation, including LRT mean feature, spectrum flatness, and spectrum template difference; then use these features to calculate the probability of speech existence and update the noise spectrum; calculate the prior and posterior signal-to-noise ratio and gain factor.
[0003] The algorithm based on the statistical model can continuously update the noise of each frame, but it cannot track well when the noise level changes complexly. In a strong noise environment, the estimation of the probability of speech existence cannot be polarized, and there may be misjudgment. In addition, traditional enhancement algorithms often filter out weak speech components as noise, which reduces the quality of the enhanced speech. Summary of the invention
[0004] Based on this, it is necessary to provide an improved speech enhancement and denoising method to address the problems of difficulty in noise spectrum tracking in strong noise environments and inability to polarize weak speech estimation.
[0005] An improved speech enhancement and noise reduction method, the method comprising: S1, obtaining a noisy speech signal y(n) to be processed; S2, performing short-time Fourier transform on the noisy speech signal y(n) to obtain the spectrum of the noisy speech signal; S3, calculating a priori signal-to-noise ratio ξ(k,l) using a DD decision method; S4, calculating a posteriori signal-to-noise ratio γ(k,l) using an MCRA algorithm; S5, calculating a speech existence probability p(k,l) according to the priori signal-to-noise ratio ξ(k,l) and the posteriori signal-to-noise ratio γ(k,l); S6, estimating a noise spectrum λ according to the speech existence probability p(k,l) d (k, l); S7, according to the prior signal-to-noise ratio ξ(k, l), the speech existence probability p(k, l) and the noise spectrum λ d(k, l) uses the OMLSA algorithm to calculate the gain G(k, l); S8, multiplying the gain G(k, l) by the amplitude spectrum of the noisy speech signal to obtain the amplitude spectrum of the clean signal; S9, synthesizing the amplitude spectrum of the clean signal with the phase spectrum of the noisy speech signal, and performing an inverse short-time Fourier transform to obtain a clean speech signal.
[0006] Preferably, step S7 comprises: assuming that the estimation of the amplitude spectrum of the clean speech signal |X′(k,l)|=G(k,l)|Y(k,l)| is solved by using a Wiener filter, wherein |X(k,l)| is the amplitude spectrum of the clean speech signal, |X′(k,l)| is the estimation of |X(k,l)|, and Y(k,l) is the amplitude spectrum of the noisy speech signal;
[0007] According to the log spectrum amplitude estimator: Δ = E(|log|X(k,l)|-log|X′(k,l)|| 2 ), the estimation of the amplitude spectrum of the clean speech signal is approximately log|X′(k,l)|=E{log|X(k,l)|||Y(k,l)};
[0008] Exponentially process log|X′(k,l)|=E{log|X(k,l)|||Y(k,l)} to obtain |X′(k,l)|=exp{E[log|X(k,l)||Y(k,l)]}=G(k,l)|Y(k,l)|;
[0009] A binary hypothesis model is established based on the presence or absence of speech, with event H1(k,l) representing the presence of speech and event H0(k,l) representing the absence of speech. This gives an estimate of |X(k,l)|:
[0010] |X′(k,l)|=(exp{E[log|X(k,l)||Y(k,l),H1(k,l)]}) p(k,l)
[0011] ×(exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}) (1-p(k,l))
[0012] Where p(k,l)=P(H1(k,l)|Y(k,l)) is the probability of speech existence;
[0013] When there is no speech, the gain is set to a minimum threshold G min , we have exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}=G min |Y(k,l)|;
[0014] When speech is present, set the gain to have At this time, according to the Wiener filter have:
[0015]
[0016] Assume the prior signal-to-noise ratio A posteriori signal-to-noise ratio Among them, λ x (k,l) is the pure speech signal λ x (k,l)=E[|X(k,l)| 2 ] standard deviation, λ d (k,l)=E[|D(k,l)| 2 ] is the standard deviation of the noisy speech signal, and can be approximately considered as λ in calculation x (k,l)=|X(k,l)| 2 ,λ d (k,l)=|D(k,l)| 2 ;
[0017] according to Arranged
[0018] Due to G min and Constitute a binary hypothesis model, then the total gain
[0019] Preferably, the calculation steps of the priori signal-to-noise ratio ξ(k,l) are:
[0020] S31, by definition Use the power spectrum of the clean speech signal of the previous frame to estimate λ x ′(k,l-1) and the noise power spectrum estimate λ of the noise signal of the previous frame d ′(k,l-1), calculate the prior signal-to-noise ratio estimate of the previous frame
[0021] S32, calculating an estimate ξ′(k, l) of the priori signal-to-noise ratio of the noisy speech signal of the current frame according to the posterior signal-to-noise ratio estimate γ′(k, l) of the noisy speech signal of the current frame;
[0022] Among them, the calculation of the prior signal-to-noise ratio estimate of the current frame is:
[0023] Assuming speech exists, by definition we have where λ x (k,l)=|X(k,l)| 2 ,λ d (k,l)=|D(k,l)| 2 , |Y(k,l)| 2=|X(k,l)| 2 +|D(k,l)| 2 ,get:
[0024]
[0025] S33, smoothing the priori signal-to-noise ratio estimate ξ′(k,l-1) of the previous frame and the priori signal-to-noise ratio estimate ξ′(k,l) of the current frame obtained in steps S31 and S32 to obtain the priori signal-to-noise ratio ξ(k,l) of the current frame.
[0026] Preferably, smoothing the priori signal-to-noise ratio estimate ξ′(k, l-1) of the previous frame and the priori signal-to-noise ratio estimate ξ′(k, l) of the current frame comprises:
[0027] Use the speech power spectrum of the previous frame to estimate λ x ′(k,l-1) and noise power spectrum estimate λ d ′(k-1,l), calculate the prior signal-to-noise ratio estimate of the previous frame
[0028] Using the a posteriori SNR estimate γ′(k,l) of the current frame, calculate the a priori SNR estimate ξ′(k,l)=γ′(k,l)-1 of the current frame;
[0029] Calculate the priori SNR estimate ξ using the DD decision method DD (k, l), that is, the smooth update of the priori SNR estimate ξ′(k, l-1) of the previous frame and the priori SNR estimate ξ′(k, l) of the current frame. The DD decision method formula is:
[0030]
[0031] According to |X′(k,l)|=G(k,l)|Y(k,l)|, we get:
[0032]
[0033] Since the premise of DD judgment method is to assume the existence of speech, when speech exists, get:
[0034]
[0035] in, is the priori SNR estimate of the previous frame; max{γ(k,l)-1,0} is the maximum likelihood estimate of the priori SNR of the current frame; α=0.98.
[0036] Preferably, step S4 includes: performing frequency domain smoothing and time domain smoothing on the noisy speech power spectrum:
[0037] The frequency domain smoothing formula is: Among them, S f (k,l) is the power spectrum of noisy speech |Y(k,l)| 2 The smoothing value within the range of ±ω on both sides of its frequency domain subband k, the sliding window b(i) is a standardized window function;
[0038] The time domain smoothing formula is:
[0039]
[0040] Among them, S(k,l) is the power spectrum of the noisy speech after time domain smoothing, a p is the smoothing factor;
[0041] A binary hypothesis model is established based on whether weak speech appears or not, and p w (k, l) is the probability of occurrence of weak speech, and S(k, l) is written in smooth form: S(k, l) = p w (k,l)a p S(k,l-1)+(1-a p p w (k,l))S f (k,l);
[0042] The probability of weak speech occurrence p w The calculation formula for (k,l) is:
[0043]
[0044] Among them, δ is the preset weak speech threshold, S min (k,l) is the global minimum value of the noisy speech power spectrum S(k,l) after time domain smoothing;
[0045]
[0046]
[0047] Among them, S tmp (k,l) is the local minimum value of the noisy speech power spectrum S(k,l) after time domain smoothing;
[0048] The posterior signal-to-noise ratio is calculated using the noisy speech power spectrum S(k,l) after frequency domain smoothing and time domain smoothing. The calculation formula is:
[0049] Preferably, the noise spectrum λ is estimated d The steps include: d The estimation is converted into smoothing of the noise signal without speech segment, including:
[0050] When speech does not exist, λd ′(k,l)=α d λ d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 , when speech exists, λ d ′(k,l)=λ d ′(k,l-1), where α d Between 0 and 1, it is the smoothing coefficient;
[0051] Integration based on the binary hypothesis model:
[0052] λ d ′(k,l)=p(k,l-1)×λ d ′(k,l-1)+(1-p(k,l-1))×[α d λ d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 ]
[0053] =α d ′λ d ′(k,l-1)+[1-α d ′]|Y(k,l-1)| 2
[0054] where α d ′=α d +(1-α d )p(k,l),α d =0.85.
[0055] Preferably, step S5 includes: a posteriori speech existence probability Where q(k,l)=P(H0(k,l)) is the probability of the absence of prior speech;
[0056] After substitution, we get:
[0057]
[0058] In a strong noise environment, it is deduced that p(k,l) is close to 0.5, and it is difficult to determine whether speech exists or not;
[0059] In order to determine whether speech exists or not, the prior signal-to-noise ratio ξ(k,l) is set to a fixed value ξ fix , when p(k,l)=0.5, we have When the posterior signal-to-noise ratio γ(k,l)>γ b (k,l), p(k,l)>0.5, it is judged that speech exists; when γ(k,l<γ b(k,l), p(k,l)<0.5, it is judged that the speech does not exist;
[0060] Assume that at a certain moment there is P(H0(k,l)), that is, the speech does not exist; and when γ(k,l)>γ b (k,l), p(k,l)>0.5, it is judged that speech exists. In this case, it is a false alarm. The false alarm rate is:
[0061]
[0062] Assume that at some time P(H1(k,l)) exists, that is, speech exists; and when γ(k,l)<γ b (k,l), p(k,l)<0.5, it is judged that the speech does not exist. In this case, it is missed detection, and the missed detection rate is:
[0063]
[0064] This gives the total error rate:
[0065] P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l)
[0066] =(1-q)P m (k,l)+qP f (k,l)
[0067] Should choose fix The value of P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l) obtains the minimum value, and the probability of speech existence is calculated only based on the value of the posterior signal-to-noise ratio γ(k,l);
[0068] ξ fix Take a fixed value as ξ fix =8dB; then
[0069] Compared with the prior art, the present invention has the following advantages:
[0070] By optimizing the noise spectrum estimation and prior signal-to-noise ratio estimation modules, the parameter estimation performance is improved; specifically, a series of measures are taken, including: setting thresholds, such as the gain threshold G when speech is not present min ; Smoothing update, such as smoothing of the prior signal-to-noise ratio ξ(k,l) and the noisy speech power spectrum S(k,l) based on the DD decision method; and using a fixed prior signal-to-noise ratio ξ fix,These measures jointly protect weak speech and prevent over-estimation of noise while still having good noise suppression ,effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 The present invention is a schematic flowchart of an improved speech enhancement and noise reduction method according to an embodiment. DETAILED DESCRIPTION
[0072] Figure 1 FIG. 1 is a schematic flow chart of an improved speech enhancement and noise reduction method according to an embodiment. Figure 1 As shown, an improved speech enhancement and noise reduction method includes:
[0073] S1, obtain the noisy speech signal y(n) to be processed; assuming that the speech signal is x(n) and the additive noise is d(n), and the two are independent of each other, then the total input signal (the noisy speech signal to be processed) is y(n)=x(n)+d(n).
[0074] Specifically, for d(n), the following assumptions are made:
[0075] 1. The noise is additive noise independent of speech;
[0076] 2. The statistical distribution of noise in each frame is steady-state;
[0077] 3. The Fourier series of noise is a zero-mean complex Gaussian distribution.
[0078] S2, perform short-time Fourier transform on the noisy speech signal y(n) to obtain the spectrum Y(k,l) of the noisy speech signal, where k represents the subband index and l represents the number of frames; similarly, perform short-time Fourier transform on the clean speech signal x(n) and the noise signal d(n) to obtain the corresponding spectra X(k,l) and D(k,l). According to the previous assumption, the STFT of the speech signal and the noise signal are also independent of each other and both obey the zero-mean complex Gaussian distribution, so |Y(k,l)| 2 =|X(k,l)| 2 +|D(k,l)| 2 .
[0079] In this embodiment, event H1(k,l) represents the presence of speech, and event H0(k,l) represents the absence of speech. When speech does not exist, |(Y(k,l)|H0(k,l))| 2 =|D(k,l)| 2 ; When speech exists, |(Y(k,l)|H0(k,l))| 2 =|X(k,l)| 2 +|D(k,l)| 2 .
[0080] S3, calculate the prior signal-to-noise ratio ξ(k,l) using the DD decision method;
[0081] In this embodiment, step S3 includes:
[0082] According to the a priori definition of signal-to-noise ratio: Among them, λ x (k,l) is the amplitude of the pure speech signal. x (k,l) is a posteriori value and cannot be used to calculate the priori SNR of the current frame. Therefore, this formula is used to calculate the priori SNR estimate of the previous frame:
[0083] Again, assuming that speech exists, by definition we have where λ x (k,l)=|X(k,l)| 2 ,λ d (k,l)=|D(k,l)| 2 , |Y(k,l)| 2 =|X(k,l)| 2 +|D(k,l)| 2 ,get:
[0084]
[0085] In ξ(k,l)=γ(k,l)-1, γ′(k,l) is the posterior signal-to-noise ratio estimate of the current frame, and thus can be used to calculate the prior signal-to-noise ratio estimate of the current frame: ξ′(k,l)=γ′(k,l)-1.
[0086] In this embodiment, the DD decision method is used to smooth the priori signal-to-noise ratio estimate ξ′(k, l-1) of the previous frame and the priori signal-to-noise ratio estimate ξ′(k, l) of the current frame. The specific steps of smoothing include: dividing the priori signal-to-noise ratio estimate ξ′(k, l) of the current frame into two parts, respectively using the formula and ξ(k,l)=γ(k,l)-1, where λ is estimated using the previous frame x ′(k,l-1) and λ d ′(k,l-1) pairs Update, use the current frame estimate γ′(k,l) to update ξ′(k,l)=γ′(k,l)-1;
[0087] Multiply the above two parts by the smoothing coefficients respectively, and the sum of the coefficients is 1, and the smoothing formula is obtained to achieve smooth update of the priori SNR estimate ξ′(k,l-1) of the previous frame and the priori SNR estimate ξ′(k,l) of the current frame; let the coefficients be α and (1-α) respectively, and the smoothing formula is:
[0088]
[0089] According to |X′(k,l)|=G(k,l)|Y(k,l)|, we can deduce that:
[0090]
[0091] Since the premise of DD judgment method is to assume the existence of speech, when speech exists, get:
[0092]
[0093] in: is the prior signal-to-noise ratio estimate of the previous frame; max{γ(k,l)-1,0} is the maximum likelihood estimate of the prior signal-to-noise ratio of the current frame, and α is an artificially set weight, which can be set to 0.98.
[0094] S4, use the MCRA algorithm to calculate the posterior signal-to-noise ratio γ(k,l);
[0095] In this embodiment, step S4 includes:
[0096] Compute the posterior signal-to-noise ratio according to the definition: Among them, λ d (k,l) uses the estimated value λ from the previous frame d ′(k,l-1).
[0097] In order to protect the weak speech after the strong speech and prevent the over-estimation of noise caused by misjudging the weak speech as noise, the MCRA algorithm is used to calculate the power spectrum of the noisy speech |Y(k,l)| 2 Specifically, the power spectrum of the noisy speech is smoothed in the frequency domain and time domain:
[0098] The frequency domain smoothing formula is: Among them, S f (k,l) is the power spectrum of noisy speech |Y(k,l)| 2 The smoothing value within the range of ±ω on both sides of the frequency domain subband k, the sliding window b(i) is a standardized window function, and a common window function can be selected, such as the Hamming window, whose window length is 2ω+1, and the value is not specifically limited, as long as the smoothing effect is achieved, and 9 can be selected;
[0099] The time domain smoothing formula is:
[0100]
[0101] Among them, S(k,l) is the power spectrum of the noisy speech after time domain smoothing, α p (0<α p<1) is the smoothing factor, which can be 0.8. When weak speech does not exist, S(k,l)=S f (k,l); when weak speech exists, S(k,l) is composed of S f (k,l) is replaced by smoothing in the time domain.
[0102] The purpose of two-step smoothing is to protect weak speech after strong speech:
[0103] When weak speech appears after strong speech, the spectrum energy drops rapidly, and the weak speech is easily misjudged as noise. Through two-step smoothing, the spectrum energy will not drop rapidly, providing a buffer period for the weak speech that may exist after the strong speech, avoiding over-estimation of noise.
[0104] It should be noted that weak speech includes the comb harmonics of strong voiced segments and the consonants of unvoiced segments, especially fricatives (such as the s in the initial consonant in Chinese). Since the algorithm is based on the estimation of the signal-to-noise ratio, this type of sound is easily regarded as noise, resulting in over-estimation of the noise. Since weak speech cannot be completely separated from noise, one of the challenges of various speech enhancement methods is the trade-off between reducing the energy distortion of weak speech and participating in noise.
[0105] A binary hypothesis model is established based on whether weak speech appears or not, and p w (k, l) is the probability of occurrence of weak speech, and S(k, l) is written in smooth form: S(k, l) = p w (k,l)a p S(k,l-1)+(1-a p p w (k,l))S f (k,l).
[0106] The probability of weak speech occurrence p w The calculation formula for (k,l) is:
[0107]
[0108] Among them, δ is the preset voice presence threshold, S min (k,l) is the global minimum value of the noisy speech power spectrum S(k,l) after time domain smoothing;
[0109]
[0110]
[0111] Among them, S tmp (k,l) is the local minimum of the noisy speech power spectrum S(k,l) after time domain smoothing.
[0112] That is, by setting a frame length L, S min(k,l) and S tmp (k, l) is updated. The length of L affects the speed of noise tracking. It is usually selected between 0.5s and 1.5s according to experience. The specific number of frames is related to the STFT window length. tmp (k,l), within the range of the current L frame, its value is min{S tmp (k,l-1), S(k,l)}, which is the local minimum value in the interval; when the interval ends, the value is reinitialized to S(k,l). tmp (k,l) is the local minimum value in the current L frame interval. min (k,l), at the end of the interval, the value is min{S tmp (k,l-1), S(k,l)}, we know that S min (k, l) At this time, the local minimum value of the previous L frame interval is saved; within the interval range, the value is min{S min (k,l-1), S(k,l)}, which is the minimum value of the previous interval and the current interval. Therefore, S min (k, l) is the minimum value between the previous L-frame interval and the current L-frame interval, and can be regarded as a global minimum value updated in real time.
[0113] The posterior signal-to-noise ratio is calculated using the noisy speech power spectrum S(k,l) after two-step smoothing. The calculation formula is:
[0114] It should be noted that step S4 is derived from Cohen's MCRA algorithm. In the existing algorithm, the purpose of MCRA is to control the probability of speech existence by using the local and global minimum values of the power spectrum of noisy speech. Specifically, the MCRA of the existing algorithm includes two purposes: 1. Estimating the probability of speech existence, 2. Estimating noise by recursive averaging. In the existing algorithm, p is directly w (k, l) is used as the speech existence probability p(k, l). Since the noise estimation needs to use the speech existence probability p(k, l), and the speech existence probability of the present application is innovated in step S5, it does not include 2.
[0115] S5, calculating the speech existence probability p(k,l) according to the priori signal-to-noise ratio ξ(k,l) and the posteriori signal-to-noise ratio γ(k,l);
[0116] In this embodiment, step S5 includes: calculating the formula of the priori signal-to-noise ratio ξ(k, l) according to the DD decision method:
[0117]
[0118] Since the premise of the DD decision method is to assume the existence of speech, it can be expected that when speech does not exist, or when speech exists but is weak, the prior signal-to-noise ratio estimate ξ′(k,l) obtained by the DD decision method will deviate from the actual prior signal-to-noise ratio ξ(k,l). A specific analysis shows that the prior signal-to-noise ratio estimate ξ′(k,l) obtained by the DD decision method is jointly determined by the prior signal-to-noise ratios of the previous frame and the current frame. From α=0.98, it can be seen that the prior signal-to-noise ratio of the previous frame is dominant. If the previous frame is strong noise, the prior signal-to-noise ratio is relatively small. If the next frame is weak speech, it is obvious that ξ′(k,l) cannot be updated immediately, and the estimated value remains at a small state, that is,
[0119] Since it is assumed that the STFTs of speech and noise signals are uncorrelated and both obey a zero-mean complex Gaussian distribution, when speech does not exist, i.e., under the condition H0(k,l), |Y(k,l)| 2 =|X(k,l)| 2 ; When speech exists, that is, H1(k,l), |Y(k,l)| 2 =|X(k,l)| 2 +|D(k,l)| 2 .
[0120] Therefore, according to the probability density function of the complex Gaussian distribution, we can get
[0121]
[0122]
[0123] Among them, P(Y(k,l)|H0(k,l)) represents the noisy signal under the premise that speech does not exist, and P(Y(k,l)|H1(k,l)) represents the noisy signal under the premise that speech exists.
[0124] Will Substituting in, we get
[0125]
[0126]
[0127] It can be seen that in this case, P(Y(k,l)|H0(k,l)) and P(Y(k,l)|H1(k,l)) are basically the same.
[0128] Since H0(k,l) and H1(k,l) are complementary and mutually exclusive, they form a complete event group, whose sum is Y(k,l). Therefore, the sum of P(Y(k,l)|H0(k,l)) and P(Y(k,l)|H1(k,l)) is 1. It can be seen that P(Y(k,l)|H0(k,l))=P(Y(k,l)|H1(k,l))=0.5, and P(H0(k,l))=P(H1(k,l))=0.5, that is, the probability of the presence and absence of speech is the same, and both are 0.5, that is, the speech signal at this time is at the critical value of presence and absence.
[0129] According to the Bayesian formula, the probability of the existence of posterior speech can be calculated
[0130]
[0131] Substituting P(Y(k,l)|H0(k,l))=P(Y(k,l)|H1(k,l))=0.5, we get This shows that the posterior probability of speech existence p(k,l) completely depends on the prior probability of speech non-existence q(k,l), that is, the posterior probability of speech existence is the same as the prior probability of speech existence; and q(k,l)=P(H0(k,l))=0.5, then p(k,l)→0.5, which means that the posterior probability of speech existence is independent of the observed value Y(k,l), and it is difficult to judge whether speech exists or not.
[0132] The present application hopes that the speech existence probability can clearly determine whether speech exists, that is, it is close to 1 when speech exists and close to 0 when speech does not exist. The presence or absence of speech is approximately a binomial distribution of 0 and 1.
[0133] Assuming that the prior probability of speech presence / absence P(H1(k,l))=P(H0(k,l))=0.5, the posterior probability of speech presence is:
[0134]
[0135] When P(Y(k,l)|H0(k,l)) is very large, p(k,l)→0, and speech does not exist; when P(Y(k,l)|H0(k,l)) is very small, p(k,l)→1, and speech exists. Therefore, the value of p(k,l) is greatly affected by P(Y(k,l)|H0(k,l)). When ξ(k,l)→0, we have That is, at this time P(Y(k,l)|H0(k,l)) is only related to γ(k,l), so that the probability of speech existence depends only on the posterior signal-to-noise ratio estimate γ′(k,l).
[0136] According to the above inference, when ξ(k,l) is close to 0, the probability of speech existence is close to 0.5, which is not a binomial distribution. When ξ(k,l) is greater than 0 but much less than 0.5, the probability of speech existence is also near 0.5, which cannot be approximated as a binomial distribution. Since this problem cannot be avoided, the present application hopes to find a method to make the probability of speech existence independent of the specific estimated value of ξ(k,l), and its distribution is closer to the binomial distribution of 0 and 1.
[0137] In order to ensure that the probability of speech existence is greater than or less than 0.5, we first need to find the intersection point where p(k,l)=0.5.
[0138] again Right now
[0139] q(k,l)P(Y(k,l)|H0(k,l))=(1-q(k,l))P(Y(k,l)|H1(k,l))
[0140] There are also:
[0141]
[0142]
[0143] Substituting the solution into
[0144] Since the present application hopes to make the probability of speech existence independent of the specific estimated value of ξ(k,l), and its distribution is closer to the binomial distribution of 0 and 1. Therefore, the present application uses a fixed priori signal-to-noise ratio ξ fix To calculate the speech probability. Therefore, the above formula is converted to Among them, γ b (k,l) represents the value of the posterior signal-to-noise ratio when p(k,l) = 0.5. b (k,l), p(k,l)>0.5, it is judged that speech exists; when γ(k,l<γ b (k,l), p(k,l)<0.5, and it is judged that the speech does not exist.
[0145] Assume that at a certain moment there is P(H0(k,l)), that is, speech does not exist. Also when γ(k,l)>γ b (k,l), p(k,l)>0.5, it is judged that speech exists. In this case, it is a false alarm, and the false alarm rate is:
[0146]
[0147] Assume that at a certain moment there is P(H1(k,l)), that is, speech exists. And when γ(k,l)<γ b(k,l), p(k,l)<0.5, it is judged that the speech does not exist. In this case, it is missed detection, and the missed detection rate is:
[0148]
[0149] This gives the total error rate:
[0150] P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l)
[0151] =(1-q)P m (k,l)+qP f (k,l)
[0152] When fix When it is too high, the missed detection rate increases, resulting in the inability to recognize weak speech. fix When ξ is too low, the false alarm rate increases, causing random fluctuations in p(k,l). Therefore, ξ should be carefully selected. fix The value of P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l) obtains the minimum value, and the probability of speech existence is calculated only based on the value of the posterior signal-to-noise ratio γ(k,l).
[0153] This application requires the selection of an appropriate fix , so that when γ(k,l) is within the range of the signal-to-noise ratio of common speech signals, the image of p(k,l) about γ(k,l) is close to the binomial distribution, and the total error rate P ε (k,l) is the smallest.
[0154] Therefore, this application selects ξ in the range of [0dB, 32dB] fix , and calculate ∫P by ξ(k,l) in the common signal-to-noise ratio range [-10dB, 15dB] ε (k,l)dξ(k,l), select the smallest possible ξ when the result is as close to 0 as possible fix , we get ξ fix ≥8dB. ;ξ fix Take a fixed value of ξ fix =8dB, then
[0155]
[0156] S6, estimating the noise spectrum λ according to the speech existence probability p(k,l) d (k,l);
[0157] In this embodiment, the estimated noise spectrum λ d The steps include: d The estimation is converted into smoothing of the noise signal without speech segment, including:
[0158] When speech does not exist, λ d ′(k,l)=α d λ d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 , when speech exists, λ d ′(k,l)=λ d ′(k,l-1), where α d Between 0 and 1, it is the smoothing coefficient.
[0159] Integration based on the binary hypothesis model:
[0160] λ d ′(k,l)=p(k,l-1)×λ d ′(k,l-1)+(1-p(k,l-1))×[α d λ d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 ]
[0161] =α d ′λ d ′(k,l-1)+[1-α d ′]|Y(k,l-1)| 2
[0162] where α d ′=α d +(1-α d )p(k,l),α d =0.85.
[0163] S7, according to the prior signal-to-noise ratio ξ(k,l), the speech existence probability p(k,l) and the noise spectrum λ d (k,l) Calculate the gain G(k,l) using the OMLSA algorithm;
[0164] Step S7 includes: assuming that an estimate of the amplitude spectrum of a clean speech signal |X′(k,l)|=G(k,l)|Y(k,l)| is solved, wherein |X(k,l)| is the amplitude spectrum of the clean speech signal, |X′(k,l)| is an estimate of |X(k,l)|, and Y(k,l) is the amplitude spectrum of the noisy speech signal;
[0165] The OMLSA algorithm is used to solve the gain G(k,l). The specific process is as follows:
[0166] The log spectral amplitude (LSA) estimator is used to evaluate the deviation between the speech signal spectrum estimate X′(k,l) and the actual speech signal spectrum X(k,l): Δ=E(|log|X(k,l)|-log|X′(k,l)|| 2 ). To achieve accurate estimation, it is necessary to minimize the difference between the actual clean speech X(k,l) and the estimated clean speech X′(k,l), that is, Δ→0. Therefore, the theoretical estimate of the speech signal amplitude spectrum is approximately log|X′(k,l)|=E{log|X(k,l)||Y(k,l)}.
[0167] Performing exponential processing on log|X′(k,l)|=E{log|X(k,l)||Y(k,l)}, and from |X′(k,l)|=G(k,l)|Y(k,l)|, we can obtain |X′(k,l)|=exp{E[log|X(k,l)||Y(k,l)]}=G(k,l)|Y(k,l)|.
[0168] Among them, E[log|X(k,l)||Y(k,l)] means: the posterior expectation of log|X(k,l)| when Y(k,l) is observed. Whether X(k,l) exists when Y(k,l) is observed needs to be determined based on the cause of the observed signal. This is assumed.
[0169] Given a hypothesis: event H1(k,l) represents the presence of speech, and event H0(k,l) represents the absence of speech. The presence or absence of speech in the observed data Y(k,l) constitutes a binary hypothesis model.
[0170] Known total probability formula:
[0171] If events B1,B2,...,B i constitutes a complete set of events whose sum is the whole set; and P(B i )>0, then for any event A
[0172]
[0173] Applying the total probability formula to the model, the probability of event A is E[log|X(k,l)||Y(k,l)], condition B iThat is, H0(k,l), H1(k,l). Let p(k,l) = P(H1(k,l) | Y(k,l)) be the prior probability of speech existence. Since H0(k,l) and H1(k,l) are complementary and mutually exclusive, they form a complete event group, whose sum is Y(k,l). We have P(H0(k,l)) + P(H1(k,l)) = 1, so P(H0(k,l)) = 1-P(H1(k,l)) = 1-p(k,l). Then we have
[0174] E[log|X(k,l)||Y(k,l)]
[0175] =E[log|X(k,l)||Y(k,l),H1(k,l)]p(k,l)
[0176] +E[log|X(k,l)||Y(k,l),H0(k,l)](1-p(k,l))
[0177] According to the formula |X′(k,l)|=exp{E[log|X(k,l)||Y(k,l)]}=G(k,l)|Y(k,l)|, and based on the binary hypothesis model, we can get the estimate of |X(k,l)|:
[0178] |X′(k,l)|=(exp{E[log|X(k,l)||Y(k,l),H1(k,l)]}) p(k,l)
[0179] ×(exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}) (1-p(k,l))
[0180] When speech does not exist, the gain should be very small, assuming that the gain is a minimum threshold G min , we have exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}=G min |Y(k,l)|; This threshold is generally set to the minimum signal ratio of the noisy signal, which is set to 20log here 10 G min =-25dB.
[0181] When speech is present, set the gain to have
[0182] According to the optimal solution of the Wiener filter: And definition: Prior signal-to-noise ratio A posteriori signal-to-noise ratio λ x (k,l)=|X(k,l)| 2 ,λ d(k,l)=|D(k,l)| 2 .according to After finishing, we get:
[0183]
[0184] Due to G min and Constitute a binary hypothesis model, then the total gain At this point, the derivation of the OMLSA algorithm is completed.
[0185] S8, multiplying the gain G(k, l) by the amplitude spectrum of the noisy speech signal to obtain the amplitude spectrum of the pure signal;
[0186] S9, synthesizing the amplitude spectrum of the clean signal and the phase spectrum of the noisy speech signal, and performing an inverse short-time Fourier transform to obtain a clean speech signal.
[0187] In summary, the present application improves the parameter estimation performance by optimizing the noise spectrum estimation and the priori signal-to-noise ratio estimation module; specifically, a series of measures are taken, including: setting a threshold, such as the gain threshold G when speech is not present min ; Smoothing update, such as smoothing of the prior signal-to-noise ratio ξ(k,l) and the noisy speech power spectrum S(k,l) based on the DD decision method; and using a fixed prior signal-to-noise ratio ξ fix ,These measures jointly protect weak speech and prevent over-estimation of noise while still having good noise suppression ,effect.
[0188] As another possible embodiment, in the existing algorithm, the posterior speech existence probability formula obtained according to the Bayesian formula is: It can be seen that in order to calculate the posterior speech existence probability p(k,l), the required parameters are the prior signal-to-noise ratio ξ(k,l), the posterior signal-to-noise ratio γ(k,l) and the prior speech non-existence probability q(k,l), among which the prior signal-to-noise ratio ξ(k,l) has been obtained in step S3, and the posterior signal-to-noise ratio γ(k,l) has been obtained in step S4.
[0189] The common method requires calculating the probability estimate q′(k,l) of the absence of prior speech, which is calculated as follows:
[0190] Let ζ(k,l) be a recursive average of the prior signal-to-noise ratio ξ(k,l), and β be a weight coefficient: ζ(k,l) = βζ(k,l-1) + (1-β)ξ′(k,l-1).
[0191] Apply two smoothing windows of different sizes to ζ(k,l) in the frequency domain to obtain the local average ζ local (k,l) and the global average ζ global (k,l): The λ in the above equations are replaced by local and global respectively; h λ (n) is the length of 2ω λ +1 for the standard window function.
[0192] Definition P local (k,l),P global (k,l), which represent ζ local (k,l) and ζ global (k, l) is the likelihood relationship between the speech in the kth frequency band of the lth frame. The calculation formula is:
[0193]
[0194] where ζ min , max It is an empirical constant that protects weak speech while maximally attenuating noise.
[0195] definition is the average value of ζ(k,l) in the frequency band of the current frame; ζ peak (l) is the ζ of the previous speech frame frame The value of (l); ζ pmin , pmax To limit peak (l) The empirical constants of the upper and lower limits have the function of controlling the buffering degree in the following measure 2.
[0196] In order to protect weak speech, a parameter P is defined frame (l) and take the following measures:
[0197] Measure 1: When frame (l)>ζ frame (l-1), it is assumed that speech exists, so as to achieve the purpose of protecting weak speech when speech appears. frame (l) = 1, and update ζ peak (l) = min{max[ζ frame (l),ζ pmin ],ζ pmax}.
[0198] Measure 2, when frame (l)≤ζ frame (l-1), assuming that there is no speech, in order to protect the weak speech at the end of the speech, it is necessary to add a buffer in the transition process from H1(k,l) to H0(k,l).
[0199]
[0200] Finally, using P local (k,l),Pglobal (k,l),P frame (l) The probability estimate of speech absence is q′(k,l): q′(k,l)=1-P local (k,l)P global (k,l)P frame (l).
[0201] Furthermore, if the previous frame or the adjacent frequency band does not contain speech, then q′(k,l)→1. At this time, the probability of the posterior speech existence p(k,l)→0, and the gain G(k,l)=G min In this case, speech distortion may occur, so an upper limit needs to be set for q′(k,l): q max <1.
[0202] The above method uses the correlation of speech presence in adjacent frequency bands of consecutive frames to adjust the estimation method of the prior speech absence probability q(k,l). Specifically, the local and global averages of the prior signal-to-noise ratio estimate ξ(k,l) obtained by the DD method are calculated, and then the averages are mapped to between 0 and 1 and used as the prior speech absence probability estimate q′(k,l). In this case, the calculated q will be closer to the binomial distribution of 0 and 1, so it dominates the calculation of the posterior speech presence probability p(k,l).
[0203] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0204] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. An improved speech enhancement and noise reduction method, characterized in that: include: S1, obtaining a noisy speech signal y(n) to be processed; S2, performing short-time Fourier transform on the noisy speech signal y(n) to obtain a frequency spectrum of the noisy speech signal; S3, calculate the prior signal-to-noise ratio ξ(k,l) using the DD decision method; S4, use the MCRA algorithm to calculate the posterior signal-to-noise ratio γ(k,l); S5, calculating the speech existence probability p(k,l) according to the priori signal-to-noise ratio ξ(k,l) and the posteriori signal-to-noise ratio γ(k,l); S6, estimating the noise spectrum λ according to the speech existence probability p(k,l) d (k,l); S7, according to the prior signal-to-noise ratio ξ(k,l), the speech existence probability p(k,l) and the noise spectrum λ d (k,l) Use the OMLSA algorithm to calculate the gain G(k,l); S8, multiplying the gain G(k, l) by the amplitude spectrum of the noisy speech signal to obtain the amplitude spectrum of the pure signal; S9, synthesizing the amplitude spectrum of the clean signal and the phase spectrum of the noisy speech signal, and performing an inverse short-time Fourier transform to obtain a clean speech signal; Step S7 includes: Assume that the Wiener filter is used to solve the estimation of the amplitude spectrum of the clean speech signal |X′(k,l)|=G(k,l)|Y(k,l)|, where |X(k,l)| is the amplitude spectrum of the clean speech signal, |X′(k,l)| is the estimation of |X(k,l)|, and Y(k,l) is the amplitude spectrum of the noisy speech signal; According to the log spectrum amplitude estimator: Δ = E(|log|X(k,l)|-log|X′(k,l)|| 2 ), the estimation of the amplitude spectrum of the clean speech signal is approximately log|X′(k,l)|=E{log|X(k,l)||Y(k,l)}; Exponentially process log|X′(k,l)|=E{log|X(k,l)||Y(k,l)} to obtain |X′(k,l)|=exp{E[log|X(k,l)||Y(k,l)]}=G(k,l)|Y(k,l)|; A binary hypothesis model is established based on the presence or absence of speech, with event H1(k,l) representing the presence of speech and event H0(k,l) representing the absence of speech. This gives an estimate of |X(k,l)|: |X′(k,l)|=(exp{E[log|X(k,l)||Y(k,l),H1(k,l)]}) p(k,l) ×(exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}) (1-p(k,l)) Where p(k,l)=P(H1(k,l)|Y(k,l)) is the probability of speech existence; When there is no speech, the gain is set to a minimum threshold G min , we have exp{E[log|X(k,l)|Y(k,l),H0(k,l)|]}=G min |Y(k,l)|; When speech is present, set the gain to have At this time, the optimal solution according to the Wiener filter is: Assume the prior signal-to-noise ratio A posteriori signal-to-noise ratio Among them, λ x (k,l) is the pure speech signal λ x (k,l)=E[|X(k,l)| 2 ] standard deviation, λ d (k,l)=E[|D(k,l)| 2 ] is the standard deviation of the noisy speech signal, and can be approximately considered as λ in calculation x (k,l)=|X(k,l)| 2 ,λ d (k,l)=|D(k,l)| 2 ; according to Arranged Due to G min and Constitute a binary hypothesis model, then the total gain 2. The improved speech enhancement and noise reduction method according to claim 1, characterized in that: The calculation steps of the prior signal-to-noise ratio ξ(k,l) are: S31, by definition Use the power spectrum of the clean speech signal of the previous frame to estimate λ x ′(k,l-1) and the noise power spectrum estimate λ of the noise signal of the previous frame d ′(k,l-1), calculate the prior signal-to-noise ratio estimate of the previous frame S32, calculating an estimate ξ′(k, l) of the priori signal-to-noise ratio of the noisy speech signal of the current frame according to the posterior signal-to-noise ratio estimate γ′(k, l) of the noisy speech signal of the current frame; Among them, the calculation of the prior signal-to-noise ratio estimate of the current frame is: Assuming speech exists, by definition we have where λ x (k,l)=|X(k,l)| 2 ,λ d (k,l)=|D(k,l)| 2 , |Y(k,l)| 2 =|X(k,l)| 2 +|D(k,l)| 2 ,get: S33, smoothing the priori signal-to-noise ratio estimate ξ′(k,l-1) of the previous frame and the priori signal-to-noise ratio estimate ξ′(k,l) of the current frame obtained in steps S31 and S32 to obtain the priori signal-to-noise ratio ξ(k,l) of the current frame.
3. The improved speech enhancement and noise reduction method according to claim 2, characterized in that: Smoothing the priori signal-to-noise ratio estimate ξ′(k,l-1) of the previous frame and the priori signal-to-noise ratio estimate ξ′(k,l) of the current frame includes: Use the speech power spectrum of the previous frame to estimate λ x ′(k,l-1) and noise power spectrum estimate λ d ′(k-1,l), calculate the prior signal-to-noise ratio estimate of the previous frame Using the a posteriori SNR estimate γ′(k,l) of the current frame, calculate the a priori SNR estimate ξ′(k,l)=γ′(k,l)-1 of the current frame; Calculate the priori SNR estimate ξ using the DD decision method DD (k, l), that is, the smooth update of the priori SNR estimate ξ′(k, l-1) of the previous frame and the priori SNR estimate ξ′(k, l) of the current frame. The DD decision method formula is: According to |X′(k,l)|=G(k,l)|Y(k,l)|, we get: Since the premise of DD judgment method is to assume the existence of speech, when speech exists, get: in, is the priori SNR estimate of the previous frame; max{γ(k,l)-1,0} is the maximum likelihood estimate of the priori SNR of the current frame; α=0.
98.
4. The improved speech enhancement and noise reduction method according to claim 3, characterized in that: Step S4 includes: Perform frequency domain and time domain smoothing on the noisy speech power spectrum: The frequency domain smoothing formula is: Among them, S f (k,l) is the power spectrum of noisy speech |Y(k,l)| 2 The smoothing value within the range of ±ω on both sides of its frequency domain subband k, the sliding window b(i) is a standardized window function; The time domain smoothing formula is: Among them, S(k,l) is the power spectrum of the noisy speech after time domain smoothing, a p is the smoothing factor; A binary hypothesis model is established based on whether weak speech appears or not, and p w (k, l) is the probability of occurrence of weak speech, and S(k, l) is written in smooth form: S(k, l) = p w (k,l)a p S(k,l-1)+(1-a p p w (k,l))S f (k,l); The probability of weak speech occurrence p w The calculation formula for (k,l) is: Among them, δ is the preset weak speech threshold, S min (k,l) is the global minimum value of the noisy speech power spectrum S(k,l) after time domain smoothing; Among them, S tmp (k,l) is the local minimum value of the noisy speech power spectrum S(k,l) after time domain smoothing; The posterior signal-to-noise ratio is calculated using the noisy speech power spectrum S(k,l) after frequency domain smoothing and time domain smoothing. The calculation formula is:
5. The improved speech enhancement and noise reduction method according to claim 4, characterized in that: Estimated noise spectrum λ d The steps include: d The estimation is converted into smoothing of the noise signal without speech segment, including: When speech does not exist, λ d ′(k,l)=α d λ d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 , when speech exists, λ d ′(k,l)=λ d ′(k,l-1), where α d Between 0 and 1, it is the smoothing coefficient; Integration based on the binary hypothesis model: l d ′(k,l)=p(k,l-1)×λ d ′(k,l-1)+(1-p(k,l-1))×[α d l d ′(k,l-1)+(1-α d )|Y(k,l-1)| 2 ] =a d ′λ d ′(k,l-1)+[1-α d ′]|Y(k,l-1)| 2 among them d ′=a d +(1-a d )p(k,l),a d = 0.
85.
6. The improved speech enhancement and noise reduction method according to claim 5, characterized in that: Step S5 includes: posterior speech existence probability Where q(k,l)=P(H0(k,l)) is the probability of the absence of prior speech; After substitution, we get: In a strong noise environment, it is deduced that p(k,l) is close to 0.5, and it is difficult to determine whether speech exists or not; In order to determine whether speech exists or not, the prior signal-to-noise ratio ξ(k,l) is set to a fixed value ξ fix , when p(k,l)=0.5, we have When the posterior signal-to-noise ratio γ(k,l)>γ b (k,l), p(k,l)>0.5, it is judged that speech exists; when γ(k,l<γ b (k,l), p(k,l)<0.5, it is judged that the speech does not exist; Assume that at a certain moment there is P(H0(k,l)), that is, the speech does not exist; and when γ(k,l)>γ b , when p(k,l)>0.5, it is judged that speech exists. In this case, it is a false alarm. The false alarm rate is: Assume that at a certain moment there is P(H1(k,l)), that is, speech exists; and when γ(k,l)<γ b , when p(k,l)<0.5, it is judged that the speech does not exist. In this case, it is missed detection. The missed detection rate is: This gives the total error rate: P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l) =(1-q)P m (k,l)+qP f (k,l) Should choose fix The value of P ε (k,l)=P(H1(k,l))P m (k,l)+P(H0(k,l))P f (k,l) obtains the minimum value, and the probability of speech existence is calculated only based on the value of the posterior signal-to-noise ratio γ(k,l); ξ fix Take a fixed value as ξ fix =8dB; then
