SPEECH ENHANCEMENT WITH GAIN LIMITATIONS BASED ON SPEECH ACTIVITY

Abstract: An apparatus and method for data processing that improves estimation of spectral parameters of speech data and reduces algorithmic delay in a data coding operation. Estimation of spectral parameters is improved by adaptively adjusting a gain function used to enhance data based on whether the data contains information speech and noise or noise only. Delay is reduced by extracting coding parameters using incompletely processed data.

Description: SPEECH ENHANCEMENT WITH GAIN LIMITATIONS BASED ON SPEECH ACTIVITY Cross-Reference to Related Applications This application claims the benefit of the filing date of U.S. Provisional Application No. 60/119,279, filed February 9, 1999, and is incorporated herein by reference. Field of the Invention This invention relates to enhancement processing for speech coding (i.e., speech compression) systems, including low bit-rate speech coding systems such as MELP. Background of the Invention Low bit-rate speech coders, such as parametric speech coders, have improved significantly in recent years. However, low-bit rate coders still suffer from a lack of robustness in harsh acoustic environments. For example, artifacts introduced by low bit-rate parametric coders in medium and low signal-to-noise ratio (SNR) conditions can affect intelligibility of coded speech. Tests show that significant improvements in coded speech can be made when a low bit-rate speech coder is combined with a speech enhancement preprocessor. Such enhancement preprocessors typically have three main components: a spectral analysis/synthesis system (usually realized by a windowed fast Fourier transform/inverse fast Fourier transform (FFT/IFFT), a noise estimation process, and a spectral gain computation. The noise estimation process typically involves some type of voice activity detection or spectral minimum tracking technique. The computed spectral gain is applied only to the Fourier magnitudes of each data frame (i.e., segment) of a speech signal. An example of a speech enhancement preprocessor is provided in Y. Ephraim et al., "Speech Enhancement Using a Minimum Mean-Square Error Log-Spectral Amplitude Estimator," IEEE Trans. Acoustics, Speech and Signal Processing, Vol. 33, pp. 443-445, April 1985, which is hereby incorporated by reference in its entirety. As is conventional, the spectral gain comprises individual gain values to be applied to the individual subbands output by the FFT process. A speech signal may be viewed as representing periods of articulated speech (that is, periods of "speech activity") and speech pauses. A pause in articulated speech results in the speech signal representing background noise only, while a period of speech activity results in the speech signal representing both articulated speech and background noise. Enhancement preprocessors function to apply a relatively low gain during periods of speech pauses (since it is desirable to attenuate noise) and a higher gain during periods of speech (to lessen the attenuation of what has been articulated). However, switching from a low to a high gain value to reflect, for example, the onset of speech activity after a pause, and vice-versa, can result in structured "musical" (or "tonal") noise artifacts which are displeasing to the listener. In addition, enhancement preprocessors themselves can introduce degradations in speech intelligibility as can speech coders used with such preprocessors. To address the problem of structured musical noise, some enhancement preprocessors uniformly limit the gain values applied to all data frames of the speech signal. Typically, this is done by limiting an "a priori' signal to noise ratio (SNR) which is a functional input to the computation of the gain. This limitation on gain prevents the gain applied in certain data frames (such as data frames corresponding to speech pauses) from dropping too low and contributing to significant changes in gain between data frames (and thus, structured musical noise). However, this limitation on gain does not adequately ameliorate the intelligibility problem introduced by the enhancement preprocessor or the speech coder. Summary of the Invention The present invention overcomes the problems of the prior art to both limit structured musical noise and increase speech intelligibility. In the context of an enhancement preprocessor, an illustrative embodiment of the invention makes a determination of whether the speech signal to be processed represents articulated speech or a speech pause and forms a unique gain to be applied to the speech signal. The gain is unique in this context because the lowest value the gain may assume (i.e., its lower limit) is determined based on whether the speech signal is known to represent articulated speech or not. In accordance with this embodiment, the lower limit of the gain during periods of speech pause is constrained to be higher than the lower limit of the gain during periods of speech activity. In the context of this embodiment, the gain that is applied to a data frame of the speech signal is adaptively limited based on limited a priori SNR values. These a priori SNR values are limited based on (a) whether articulated speech is detected in the frame and (b) a long term SNR for frames representing speech. A voice activity detector can be used to distinguish between frames containing articulated speech and frames that contain speech pauses. Thus, the lower limit of a priori SNR values may be computed to be a first value for a frame representing articulated speech and a different second value, greater than the first value, for a frame representing a speech pause. Smoothing of the lower limit of the a priori SNR values is performed using a first order recursive system to provide smooth transitions between active speech and speech pause segments of the signal. An embodiment of the invention may also provide for reduced delay of coded speech data that can be caused by the enhancement preprocessor in combination with a speech coder. Delay of the enhancement preprocessor and coder can be reduced by having the coder operate, at least partially, on incomplete data samples to extract at least some coder parameters. The total delay imposed by the preprocessor and coder is usually equal to the sum of the delay of the coder and the length of overlapping portions of frames in the enhancement preprocessor. However, the invention takes advantage of the fact that some coders store "look-ahead" data samples in an input buffer and use these samples to extract coder parameters. The look-ahead samples typically have less influence on the quality of coded speech than other samples in the input buffer. Thus, in some cases, the coder does not need to wait for a fully processed, i.e., complete, data frame from the preprocessor, but instead can extract coder parameters from incomplete data samples in the input buffer. By operating on incomplete data samples, delay of the enhancement preprocessor and coder can be reduced without significantly affecting the quality of the coded data. For example, delay in a speech preprocessor and speech coder combination can be reduced by multiplying an input frame by an analysis window and enhancing the frame in the enhancement preprocessor. After the frame is enhanced, the left half of the frame is multiplied by a synthesis window and the right half is multiplied by an inverse analysis window. The synthesis window can be different from the analysis window, but preferably is the same as the analysis window. The frame is then added to the speech coder input buffer, and coder parameters are extracted using the frame. After coder parameters are extracted, the right half of the frame in the speech coder input buffer is multiplied by the analysis and the synthesis window, and the frame is shifted in the input buffer before the next frame is input. The analysis windows, and synthesis window used to process the frame in the coder input buffer can be the same as the analysis and synthesis windows used in the enhancement preprocessor, or can be slightly different, e.g., the square root of the analysis window used in the preprocessor. Thus, the delay imposed by the preprocessor can be reduced to a very small level, e.g., 1-2 milliseconds. These and other aspects of the invention will be appreciated and/or obvious in view of the following description of the invention. Brief Description of the Drawings The invention is described in connection with the following drawings where reference numerals indicate like elements and wherein: Figure 1 is a schematic block diagram of an illustrative embodiment of the invention. Figure 2 is a flowchart of steps for a method of processing speech and other signals in accordance with the embodiment of Figure 1. Figure 3 is a flowchart of steps for a method for enhancing speech signals in accordance with the embodiment of Figure 1. Figure 4 is a flowchart of steps for a method of adaptively adjusting an a priori SNR value in accordance with the embodiment of Figure 1. Figure 5 is a flowchart of the steps for a method of applying a limit to the a priori signal to noise ratio for use in a gain computation. Detailed Description A. Introduction to Illustrative Embodiments As is conventional in the speech coding art, the illustrative embodiment of the present invention is presented as comprising individual functional blocks (or "modules"). The functions these blocks represent may be provided through the use of either shared or dedicated hardware, including, but not limited to, hardware capable of executing software. For example, the functions of blocks 1- 5 presented in Figure 1 may be provided by a single shared processor. (Use of the term "processor" should not be construed to refer exclusively to hardware capable of executing software.) Illustrative embodiments may be realized with digital signal processor (DSP) or general purpose personal computer (PC) hardware, available from any of a number of manufacturers, read-only memory (ROM) for storing software performing the operations discussed below, and random access memory (RAM) for storing DSP/PC results. Very large scale integration (VLSI) hardware embodiments, as well as custom VLSI circuitry in combination with a general purpose DSP/PC circuit, may also be provided. Illustrative software for performing the functions presented in Figure 1 is provided in the Software Appendix hereto. B. The Illustrative Embodiment Figure 1 presents a schematic block diagram of an illustrative embodiment 8 of the invention. As shown in Figure 1 , the illustrative embodiment processes various signals representing speech information. These signals include a speech signal (which includes a pure speech component, s(k), and a background noise component, n(k)), data frames thereof, spectral magnitudes, spectral phases, and coded speech. In this example, the speech signal is enhanced by a speech enhancement preprocessor 8 and then coded by a coder 7. The coder 7 in this illustrative embodiment is a 2400 bps MIL Standard MELP coder, such as that described in A. McCree et al., "A 2.4 KBIT/S MELP Coder Candidate for the New U.S. Federal Standard," Proc, IEEE Intl. Conf. Acoustics, Speech, Signal Processing (ICASSP), pp. 200-203, 1996, which is hereby incorporated by reference in its entirety. Figures 2, 3, 4, and 5 present flow diagrams of the processes carried out by the modules presented in Figure 1. 1. The Segmentation Module The speech signal, s(k) + n(k), is input into a segmentation module 1. The segmentation module 1 segments the speech signal into frames of 256 samples of speech and noise data (see step 100 of Figure 2; the size of the data frame can be any desired size, such as the illustrative 256 samples), and applies an analysis window to the frames prior to transforming the frames into the frequency domain (see step 200 of Figure 2). As is well known, applying the analysis window to the frame affects the spectral representation of the speech signal. The analysis window is tapered at both ends to reduce cross talk between subbands in the frame. Providing a long taper for the analysis window significantly reduces cross talk, but can result in increased delay of the preprocessor and coder combination 10. The delay inherent in the preprocessing and coding operations can be minimized when the frame advance (or a multiple thereof) of the enhancement preprocessor 8 matches the frame advance of the coder 7. However, as the shift between later synthesized frames in the enhancement preprocessor 8 increases from the typical half-overlap (e.g., 128 samples) to the typical frame shift of the coder 7 (e.g., 180 samples), transitions between adjacent frames of the enhanced speech signal s(k) become less smooth. These discontinuities arise because the analysis window attenuates the input signal most at the edges of each frame and the estimation errors within each frame tend to spread out evenly over the entire frame. This leads to larger relative errors at the frame boundaries, and the resulting discontinuities, which are most notable for low SNR conditions, can lead to pitch estimation errors, for example. Discontinuities may be greatly reduced if both an analysis and synthesis windows are used in the enhancement preprocessor 8. For example, the square root of the Tukey window ^05(\ - cos(m / M Q )) for 1 < i < M w(i) = -/0.5(1 - cos(;r(M - i) / M 0 )) for M - M 0 < i < M 1 otherwise ( ' ) gives good performance when used as both an analysis and a synthesis window. M is the frame size in samples and M 0 is the length of overlapping sections of adjacent synthesis frames. Windowed frames of speech data are next enhanced. This enhancement step is referenced generally as step 300 of Figure 2 and more particularly as the sequence of steps in Figures 3, 4, and 5. 2. The Transform Module The windowed frames of the speech signal are output to a transform module 2, which applies a conventional fast Fourier transform (FFT) to the frame (see step 310 of Figure 3). Spectral magnitudes output by the transform module 2 are used by a noise estimation module 3 to estimate the level of noise in the frame. 3. The Noise Estimation Module The noise estimation module 3 receives as input the spectral magnitudes output by the transform module 2 and generates a noise estimate for output to the gain function module 4 (see step 320 of Figure 3). The noise estimate includes conventionally computed a priori and a posteriori SNRs. The noise estimation module 3 can be realized with any conventional noise estimation technique, and may be realized in accordance with the noise estimation technique presented in the above-referenced U.S. Provisional Application No. 60/119,279, filed February 9, 1999. 4. The Gain Function Module To prevent musical distortions and avoid distorting the overall spectral shape of speech sounds (and thus avoid disturbing the estimation of spectral parameters), the lower limit of the gain, G, must be set to a first value for frames which represent background noise only (a speech pause) and to a second lower value for frames which represent active speech. These limits and the gain are determined illustratively as follows. 4.1 Limiting the a priori SNR The gain function, G, determined by module 4 is a function of an a priori SNR value ξ k and an a posteriori SNR value γ k (referenced above). The a priori SNR value ξ k is adaptively limited by the gain function module 4 based on whether the current frame contains speech and noise or noise only, and based on an estimated long term SNR for the speech data. If the current frame contains noise only (see step 331 of Figure 4), a preliminary lower limit ξmim(λ) = 0.12 is preferably set for the a priori SNR value ξ* (see step 332 of Figure 4). If the current frame contains speech and noise (i.e., active speech), the preliminary lower limit ξmini(λ) is set to mιn ι ( .)= 0.12 exp(-5)(0.5 + SNR LT (λ)) 065 (3) where SNR L τ is the long term SNR for the speech data, and λ is the frame index for the current frame (see step 333 of Figure 4). However, ξmj n . is limited to be no greater than 0.25 (see steps 334 and 335 of Figure 4). The long term SNR L τ is determined by generating the ratio of the average power of the speech signal to the average power of the noise over multiple frames and subtracting 1 from the generated ratio. Preferably, the speech signal and the noise are averaged over a number of frames that represent 1-2 seconds of the signal. If the SNR τ is less than 0, the SNR τ is set equal to 0. The actual lower limit for the a priori SNR is determined by a first order recursive filter: mι „(λ) = 0.9ξ min (λ-1 ) + 0.1ξmini(λ) (4) This filter provides for a smooth transition between the preliminary values for speech frames and noise only frames (see step 336 of Figure 4). The smoothed lower limit ς mιn (λ) is then used as the lower limit for the a priori SNR value ς k (λ) in the gain computation discussed below. 4.2 Determining the Gain with a Limited a priori SNR As is known in the art, gain, G, used in speech enhancement preprocessors is a function of the a priori signal to noise ratio, , and the a posteriori SNR value, γ. That is, G k = f(ξk(λ),γ (λ)), where λ is the frame index and k is the subband index. In accordance with an embodiment of this invention, the lower limit of the a priori SNR, ς m i n (λ), is applied to the a priori SNR (which is determined by noise estimation module 3) the as follows: ξ k (λ) = ς k (λ) if k (λ) > ς min (λ) ξ k (λ) = ξmin(λ) if ς k (λ) < ςmjn( ) (see steps 510 and 520 of Figure 5). Based on the a posteriori SNR estimation generated by the noise estimation module 3 and the limited a priori SNR discussed above, the gain function module 4 determines a gain function, G (see step 530 Figure 5). A suitable gain function for use in realizing this embodiment is a conventional Minimum Mean Square Error Log Spectral Amplitude estimator (MMSE LSA), such as the one described in Y. Ephraim et al., "Speech Enhancement Using a Minimum Mean-Square Error Log-Spectral Amplitude Estimator," IEEE Trans. Acoustics, Speech and Signal Processing, Vol. 33, pp. 443-445, April 1985, which is hereby incorporated by reference as if set forth fully herein. Further improvement can be obtained by using a multiplicatively modified MMSE LSA estimator, such as that described in D. Malah, et al., "Tracking Speech Presence Uncertainty to Improve Speech Enhancement in Non-Stationary Noise Environments," Proc. ICASSP, 1999, to account for the probability of speech presence. This reference is incorporated by reference as if set forth fully herein. 5. Applying the Gain Function The gain, G, is applied to the noisy spectral magnitudes of the data frame output by the transform module 2. This is done in conventional fashion by multiplying the noisy spectral magnitudes by the gain, as shown in Figure 1 (see step 340 of Figure 3). 6. The Inverse Transform Module A conventional inverse FFT is applied to the enhanced spectral amplitudes by the inverse transform module 5, which outputs a frame of enhanced speech to an overlap/add module 6 (see step 350 of Figure 3). 7. Overlap Add Module; Delay Reduction The overlap/add module 6 synthesizes the output of the inverse transform module 5 and outputs the enhanced speech signal s(k) to the coder 7. Preferably, the overlap/add module 6 reduces the delay imposed by the enhancement preprocessor 8 by multiplying the left "half (e.g., the less current 180 samples) in the frame by a synthesis window and the right half (e.g., the more current 76 samples) in the frame by an inverse analysis window (see step 400 of Figure 2). The synthesis window can be different from the analysis window, but preferably is the same as the analysis window (in addition, these windows are preferably the same as the analysis window referenced in step 200 of Figure 2). The sample sizes of the left and right "halves" of the frame will vary based on the amount of data shift that occurs in the coder 7 input buffer as discussed below (see the discussion relating to step 800, below). In this case, the data in the coder 7 input buffer is shifted by 180 samples. Thus, the left half of the frame includes 180 samples. Since the analysis/synthesis windows have a high attenuation at the frame edges, multiplying the frame by the inverse analysis filter will greatly amplify estimation errors at the frame boundaries. Thus, a small delay of 2-3 ms is preferably provided so that the inverse analysis filter is not multiplied by the last 16-24 samples of the frame. Once the frame is adjusted by the synthesis and inverse analysis windows, the frame is then provided to the input buffer (not shown) of the coder 7 (see step 500 of Figure 2). The left portion of the current frame is overlapped with the right half of the previous frame that is already loaded into the input buffer. The right portion of the current frame, however, is not overlapped with any frame or portion of a frame in the input buffer. The coder 7 then uses the data in the input buffer, including the newly input frame and the incomplete right half data, to extract coding parameters (see step 600 of Figure 2). For example, a conventional MELP coder extracts 10 linear prediction coefficients, 2 gain factors, 1 pitch value, 5 bandpass voicing strength values, 10 Fourier magnitudes, and an aperiodic flag from data in its input buffer. However, any desired information can be extracted from the frame. Since the MELP coder 7 does not use the latest 60 samples in the input buffer for the Linear Predictive Coefficient (LPC) analysis or computation of the first gain factor, any enhancement errors in these samples have a low impact on the overall performance of the coder 7. After the coder 7 extracts coding parameters, the right half of the last input frame (e.g., the more current 76 samples) are multiplied by the analysis and synthesis windows (see step 700 of Figure 2). These analysis and synthesis windows are preferably the same as those referenced in step 200, above (however, they could be different, such as the square-root of the analysis window of step 200). Next, the data in the input buffer is shifted in preparation for input of the next frame, e.g., the data is shifted by 180 samples (see step 800 of Figure 2). As discussed above, the analysis and synthesis windows can be the same as the analysis window used in the enhancement preprocessor 8, or can be different from the analysis window, e.g., the square root of the analysis window. By shifting the final part of overlap/add operations into the coder 7 input buffer, the delay of the enhancement preprocessor 8/coder 7 combination can be reduced to 2-3 milliseconds without sacrificing spectral resolution or cross talk reduction in the enhancement preprocessor 8. C. Discussion While the invention has been described in conjunction with specific embodiments thereof, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art. Accordingly, the preferred embodiments of the invention as set forth herein are intended to be illustrative, not limiting. Various changes may be made without departing from the spirit and scope of the invention. For example, while the illustrative embodiment of the present invention is presented as operating in conjunction with a conventional MELP speech coder, other speech coders can be used in conjunction with the invention. The illustrative embodiment of the present invention employs an FFT and IFFT, however, other transforms may be used in realizing the present invention, such as a discrete Fourier transform (DFT) and inverse DFT. While the noise estimation technique in the referenced provisional patent application is suitable for the noise estimation module 3, other algorithms may also be used such as those based on voice activity detection or a spectral minimum tracking approach, such as described in D. Malah et al., "Tracking Speech Presence Uncertainty to Improve Speech Enhancement in Non- Stationary Noise Environments," Proc. IEEE Intl. Conf. Acoustics, Speech, Signal Processing (ICASSP), 1999; or R. Martin, "Spectral Subtraction Based on Minimum Statistics, " Proc. European Signal Processing Conference, vol. 1 , 1994, which are hereby incorporated by reference in their entirety. Although the preliminary lower limit ς m in.(λ) = 0.12 is preferably set for the a priori SNR value ς k when a frame represents a speech pause (background noise only), this preliminary lower limit ξm .n . could be set to other values as well. The process of limiting the a priori SNR is but one possible mechanism for limiting the gain values applied to the noisy spectral magnitudes. However, other methods of limiting the gain values could be employed. It is advantageous that the lower limit of the gain values for frames representing speech activity be less than the lower limit of the gain values for frames representing background noise only. However, this advantage could be achieved other ways, such as, for example, the direct limitation of gain values (rather than the limitation of a functional antecedent of the gain, like a priori SNR). Although frames output from the inverse transform module 5 of the enhancement preprocessor 8 are preferably processed as described above to reduce the delay imposed by the enhancement preprocessor 8, this delay reduction processing is not required to accomplish enhancement. Thus, the enhancement preprocessor 8 could operate to enhance the speech signal through gain limitation as illustratively discussed above (for example, by adaptively limiting the a priori SNR value ς k ). Likewise, delay reduction as illustratively discussed above does not require use of the gain limitation process. Delay in other types of data processing operations can be reduced by applying a first process on a first portion of a data frame, i.e., any group of data, and applying a second process to a second portion of the data frame. The first and second processes could involve any desired processing, including enhancement processing. Next, the frame is combined with other data so that the first portion of the frame is combined with other data. Information, such as coding parameters, are extracted from the frame including the combined data. After the information is extracted, a third process is applied to the second portion of the frame in preparation for combination with data in another frame. o t the Float input poa Float l « double e*lp_pβr bpvc|4)| If Imelpmode I- MIRLTSISI « melp_per uv.fleg « melp_dec_lnltllι << double melp_per geln|0|l *t< double melρ_per.geinll) ) /' Run HtLP coder on Input signal '/ « double "■•IP-Jper litter) from* a Oi « double to-»lp_p«r ls(fl)) eof.raeched ■ Oi « double •** * P_par lat|2|) while leof.reached •■ 01 I << double •oelp-per lafllll « double »elp_per let(4|) /• Perform HELf analysis '/ « double "•lp_P*r letlSU It Imelpmode !• SnmtESIS) I « double melp_par lat(4|) « double «>elp_per lef|7|| /* reed Input speech */ « double atlp Mr lafI4|l if Itloetmode -- 01 ( « double melp_per lat(9|> length • s>elp_readbllspeech_ln. f _in. infrasasl i //RM.07/20/ « double melp__par laf 110) > « melp_per.eιavq_indexfOJ If llpcmode •- 1) « melp__par mevq_lndex|l| « melp_reedbltβpeech_in_lpc.fp_ln.lpc.lnfrβaas) i << melp_per mevq_lndex (2) < If Ipltchmode ■■ 1) << nelp_per nevq__index(3l melp_reedbl lβpeech_in_pltch, fp_ln_pltch. lnframe) i ) elee If (reeiteode -- 1 1 writamod double dduamtyr length > me lp_readbl_tloat lβpeech_ln. fp_ln. lnrraatel i //RM. Int idumavj if llpcmode •• 11 lnpere.ee > ddueaw i pit melp_reedbl_floetlapeech_la_lpc,fp_ln_lpc. inrremei ι inpere-ne > Idjtotov, plt If Ipltchmode •• II inperame > dmsm'i bpv melp_readbl_float lspeech_ln_pltch, fp_ln_pltch. inrreme) i inparemo > ddu-me i new_ρer bpv inperame > ddueai f new_per bpv o Inperame > upm new_pβr bpv if (autocorrmode ■> 1) Inperame » uMm j bpv malp_readbl_floa Irl. fp.eutocorrln. LfC_0-U>»1 ) i Inpereme > Id ewtyi uv_ inpereme > ddu-miy f it llength < Inrrama) I inperame > d umMy t new_per ga melp_v_sβp(4βpeech_l l lengthi . lnframe- length) i Inperame > d ummyf new_jar Ji , If llpcmode •• 11 Inpereme > ddumeiyi new_pβ«' la Bte!p_v_ιβpt4speech_ln_lpcllength| . inrreme- length) ι Inperame > d flMy t new_pβr la If Ipltchmode •• 11 inperame > ddum* j nrw_par la mβlp_v_rβp(4βpeech_ln_pltchI lengthi . inrreme-length) ι inpere-ne > ueMyi new_per la eof-reached > li Inpereme > ddueaiy f new_per I Inpe eM > dumy new_ρ r inpereme > new_pβr it (writamode •• 1) ( inpereme > ddumeyj new_per If lllpcmoda •• 01 44 Ipltchmode ■• 0)1 inperame > dduesayi new_par me)p_enc(apeech_ln. apeech_ln. speech_in, chan.blt. Lxtelp inperame > ddu-wtyi inparema > to y, // new__par s If Hlpcmode -• 11 44 Ipltchmode ■• 011 inpereme > lduessyj // new_par melp_.nc (βpeech_ln. speach_ln_lpc, speech_ln, chan_blt, 4 inperame i imeij i // new_per a lp_par) i inpereme >'■ Iduawyi // new_par if Hlpcmode •• 01 44 Ipltchmode •- 11) melp_enc(speech_in, βpeech.ln melp_anc(spaaeh_ln. speech.ln. βpaech_ln_pltch, chan_blt. ar. 4naw_perlι else It Iwrltemode -• 0) I If Hlpcmode -- 1) 44 Ipltchmode •• HI if lllpcmoda •• 0) 44 Ipltchmod melp_enc!epeech_ln. βpeech_in_lpc, epeech_ln_pltch. chen_ melp_enctepeech_ln. ap*ach_ln. -. 4s-elp_perlr tr.ckl <* doubl. Imelp_par pltchl -•< it lllpcmoda •• 11 44 Ipltchmod «. malp_per pltch_lndax <« ' melp_enclapeech_in. s eech_ln .« double |melp_per bpvclOII as <« double lmelp_per bpvcltll *a «« double lmelp_per bρvcl2|t « if lllpcxtode -• 01 44 Ipltchmod << double tatolp_per hpvcllll «« melp_enclspaach_ln. βp*βch_ln 07705 99 I5:58;36 enhance.c. _>'. " . i ' for ( i « Of I < P nolee_fraa»e a r.wln_*hift«r wln.ahlftt !•• I | D.tnltlal_noiae(l) - (Float) noieeβli), I faeekl fp.ln, 0, SEEK.SET li enh_inl (tD,4PI r /* Initialise enhancement routine "/ /* Reed in overlap.len of speech dete "/ freadltvold "I speech_.ahort, slteof (abort) , P overlap.let*. fp_ln)ι for (1 <• 0ι 1 < P overlap_lenι !••) speech_in_floe 111 » (Floet) speech_short 11| i /• main processing loop */ whlle((lread - freadltvold *|ap*βch_βhort . si teof (short ) . P ln_.*hltt. fp.ln)) * 0) I short *epeech_βhort , 'nolaeei /• Oet input parameters from cumiend line and overwrite defeult peremeters if neceaa edd overlapping buffer eection, and write e-twal lng section in output buffer */ ιy/ vec_copy(apeβch_overlep_floet . epeech__overlep_floet*P win.ehitt. P overl--.D_.len) ι parae_.coemιend.l Ine large argvlt vec_eccu tepeech..ove lap,floa . apeech..out.float , P overlep.len) i lnlt_parameliP.veralon_,naa4el i /* initialise pe aete ere with defeult values*/ vec_copy (apeech_ovarlap_float*P ove lep_len, apeech„out_floe * p overlap_len. P win a hift)ι speech.short • CRLLOC.SHORTIF wln.ahlftli apeech_.ln__floet • CΛLLOC_FLOAT(P wln_len| t /* for ( 1 ■ 0ι 1 < P win_lem !•♦ ) reme "/ tprlntf letdout. * %d \t %14 l*f \t %14 lit \n*, 1*1. epeech_ln_tloa I i I . apeec h_oveκlap_float(l))ι •/ /• shift Input buffer for next frame */ v«e__copy(epeβch_in_f loa , apeech_in_( loat »P wln_shl(t.P over lap_l n) ι •ifdef WRITEFLOAT / • write to file */ fwritel (void *) speech_overlap_tloat, alxeof (Float) , P wln_ahlft, fp.out )ι false /* conversion to short with erithmetik rounding (inatead of truncation) •/ f loat_lo__βhort l*peech_overlap_floet . speech_short . p win_shif ) t /' write to (He */ exit ( I I I » / • d ee memory * / enh_tenninate (t>υ, 4Pi . f ree in inl I la l .not*r| ι w σ. 12/05/99 I 15:59:28 i cnh.fun.c. ■ lude 'globe 1* h* 12 &a lude *enh_fun h* Short* teeι lude 'enhance h" tap ■ calloc(nuat_sanρleB,alιaof lahortDf lude • v*ct_fun if (tap — MULL) lude -window* h* I lude < st ring h> prlntf ("\nERROR- CALLOC.SHORT raqueat cannot ba satiafledl \n\n a lι lude < float h» terminated) ι Subroutine terminateι terminate enhancement program in c Speech Rnhenrew-fnl Fum t lone void terminated.it error__no) ( Λ.m.ori Reiner Martin ATfcT 1-Λlιa Reneartli pr Int f ( 'Program exit with'error code %d\n\n* rπot noli exitd), i • *. U date fld>$ ) tlfdef MALAH / , , /* Subroutine li-it_noiae__paraats_a«alah Initialise parameters of noise */ /* eetlmatlon procedure */ Subroutine CALLOC_FLOΛTt meetory allocation for Float vector* / * / void in lt_ > nolae_perama_.mal eh (Enhance. Far ems* p) • t* CALLOC_PLOΛT(lnt nuιa_.aamplesl I p >NP >wtr_front__lβn • J2j loat* tmpt "> ' celloc tnum_s**plee.siteo( (Float) ) » p >NP >hear_thr_me - 6 Of /• hearing thld RMS */ I Iteφ •• NULL) p >MP >env_rate • 1 • 0 02 * p >wln_ratloj /* lower envelope riae In da •/ I p >MP >alρhe_env • 1 le 4 * p >wln_ratlo * p >wtn_βhi I t_rat loi /* lower envelope p lntf CXnERR Rt C ALLOC_F LOAT r«qu«at cannot be satisfied! \n\n* parameter */ terminated) i p >MP >beta_env - 1 p >MP >alpha_envj 41fdef USEDOUBLES p »NP >rean_thr - 20 * log10 (p >NP >hβer_thr_π*s» , /* deaired realdual abe nolee le lelae p >MP >rean_thr - 20 • loglOf (p >NP >hear_thr_rma> . desired residual aba nolae 1 evel */ lendlf Subroutine CALLOC.FLOATPi memory allocation for polnterβ to Float vectors p >NP >GH_H1H * 0 12; max value for Win Cain Hixllf Factor CM_mln */ at" CALLOC_FLOATP(int num_semplea) p >NP >(_n_min • 0 01 * p >wln„ratio * p >wln_.ahl It _rat ioj * Hln Nolae update (act r Noise only */ p >NP >(_n_Mi ■> 0 1 * p >wiπ_ratlθ * p >vin_»hl ft_rβt ioi Hex Holee update facto Nolae only */ I lt«p ■■ NULL) p >NP >f_β__nln - 0 02 * p >wln_ratio * p >wln_ahltt_rat ioi /• Hln Moiae update fact ( r Signal prββent*/ prlntf CVnERROR CALLOC_FLOATP request cannot be aatisfledl \n\n*lι p >NP >f__a_jRex ■ 0 20 • p >wln_ratlo * p >win_βhif _ra iot /* Max Noise-update tact terminated)! r Signal present */ If p >NP >nsmth_h)aa • 1 • ( 1 - p >wln_ratio 1 / 3 0/ bieβ factor for Initial nol • turn tPφi ae estleiate */ p >NP >noise_b__by__namth u b • p >nolae_bles * p >NP >nsmth_blaaj IIfdef USEDOUBLES - 2 ' log ( 2 \ι /" Upper thld on ga _av for nolee on Subroutine CALtOC.SHORT. memory allocation for short vector* ly cond */ felee rt* CALLOC.SHORT(int nua^semplea) p->NP »CAMAV_TH - 2 - logf ( 2 ll -- • -- o 02/05/99 15:59;28 en h_ fun.c. r.-.--..'J /* computation of lowar_βnv*lope and aattlng anv flag* ♦ / /• If (P->β«LP_FLO| track_enveloρe(YV_ev, D, P) f */ It (n.flag •• 01 I /* SICMAL PRESEHT '/ tdef MINSTAT /* computation of tha long term SNR */ If tgaama.ev > r .NP-.gaammv.thrI /* coaφute amoothed abort tie* periodogrem •/ I amoothe<JLperlodogremlD. YY.av. Fit D->YY_LT - D->YT_LT*P-»alphs_LT • P-»bets_LT*YT_avι O-.SM.LT - IO-»YY_LT/0->H_pwr) - li / • Long-term S/H /' compute Inverse biaa and multiply short time perlodogran with invar** blaa •/ biaa_.conpenaation(D.911 if ID->SN_LT < 0) D->SM_LT . D-»SH_LT0ι /* detemlne unbiaaed noise pβd eatimate by minimus* search */ min_*earch(D.Pt t D->SM_LT0 - D->SM.LTι lae vec.f i ll ID->laa*xiaD. 1000.0, P >vec_lenf ) ι / • 1 I I I 11 1111 11111 I 111 11 */ /* prlntft'td Vt 110.10(Vn'.D->I. O-.SH.LTI, '/ ■td /* Estimating qk'a using Nsrd-daclaion Approach 17/141 */ coms>ute.qk.new(D->qk,D->qla. D->gamaR, P-.gasmtaq.thr. P-.alpheq, P->beteq, f- / • compute 'gammaa* */ .vβc.lent11 vec_dlv(D->gemeX,D->YY,D->lamtodaD. P->vac_len() i vβc_llmlt_toplD->qk.D-»qk.P-»qk.msx,r->vβc_lentlι gasmιa_maB • vec_max (D >gam*K, p->vec_lenf ) j vβc_Hmlt_bottomtO->qk,D->qk.f->qk_mln.f->vβc_lenf|ι aum • D- »gamaR|0| ♦ D->gamaK | P-»vec_lent - 11 « 2 * vec_auM(tD->gaMKl 1| , P->vac_lβnf ll /' If (n_fleg •- 01 • / sum>D-»qk|0| * D->qk|f->vec_lenf-Hi /* determine algnal preaence tor llalιl<P->vec.lenf-lι I*. I (aum . sum<2* D-.qklll,) n.flag • Ot default flag - algnal preeent /* prlntll'td Vt 410. lOfVn',D->I. sum) i vβc.flHID->qk,β-m/P->win_lβn,P->vβc_lent) , •/ -- S It f (gaaata_-a«x < F >NP >gam x.thr) (6 (gam _av < P->NP-»g* geln.log. ιglD->Oeln.D-»vk.D->qk.D->kal .D-.gaiaaR. P-»vec.lenf1 1 /* o-k. R n.flag • li /* nolae only •/ 21/1/11 •/ I f (YY.av » 0 - >N.pwr * P »NP- >ge-maav_thr * 2. ) vβc_llmlt_top(D->Oβin.D->Cain.1.0. P-.vec.lenf I /* limit gain to 1 */ n.flag - 0; /• overidlng If frame SNR > IdB (9/94) */ galn_mod(D->GH,D >qk,D- >ksl ,D->vk. p->vec_lenfI i /• o k . R.M. 21/1/11 •/ vec.llmlt.bottomlD >GM.D->CM,D-*CM_min. P- .v.c.lenfI i l imit lowest CM ve . D->! -- I l l lue • / /* Initial estimation of aprlori SNR and Cain */ n_flag « 1; vec. ult (D->GalnD.D->Gain.D->CM. p-.vec.lenf ) i / ' modif ied gain * tor ( 1 - 0; 1 < P >vec_ienf; I*. ) ( D >ksi|l) • D->kBl win; vec_mult(D >Agat , D- .CβlnD. D- >Ymβg, P- .vec.lenf I i D >qk| 11 ■ F >qk_κux; D->Cain|i| * D->CH_mlnι li /• D >l > I '/ 0--CHIU ■ D »GM_mln; D »CalnD|ll - D >CM_mln; /' enhanced algnel In frequency domain */ D >Agal|i| • D >Ymeg|U * 0 >CM_mint /* (laxjlement ygal ■ CalnD . * Y) •/ ) elae ( /* D >I > 1 • / fp . D- >yg. I ; (p2 • D->Yι /* eat 1mat ion of aprlori SNR */ (or I 1 • Oi i < P->win_len/2.1 ι 1* * . fp •• 2. fp2 •• 2 I ( tor I 1 Ot 1 < P->vec_Ien(f (•• I ( IplOI ■ (p2 IO| • D ►CslnDI I I , D->k*iIl| • P->elphek • D >Agal|l| * 0 >Agal|l| * P- >vln..len_lnv / 0->la-*bda Ipl l ) . (p2 | l | ' D-.CalnDl ll i I • P->betak * | (D >gamaK|l| > P >gNI 7 D->gamaK|l| P >gN i 0 )t ) /" transformat ion to time do sln '/ I f ftr I outapeech. D->ygal , 4D-»fcsche ) ι D- »Kal_min_ver - 0 9*U >Ka l_.mtn_.var . 0. I *kβi_min_ad*ιρt (n_ I lag.lo >Kel_mln. D > i f lr-»sottwera.ver >. 7| vec_Hmlt_bottom(D >kal . O »kal , D »Ksl_mln_var. P-»v*c v lenf ) ι vec.mult (out speech, out speech, P-»ens I ysls.w I ndow. P-.wln_lenl i /* es imation of k th c'--*ι-onent 'signet absence' prob end gain */ /* upttata.nolaa.aitact tgasmta.sv, n.flag. υ. PI i */ ver. f l l l (l) >qk . P >ιjk I* lenf ) ; / * default value (or qk * a * (9/98) 0205/99 I 15:59:40 J enh fun.li. (ndef , enh fun, •fine _--.anh_fun_ enh.fun h - Speech Enhancement Functlona Authori Ralner Martin, AT&T Labe Reseerch Last Updatet |Id $ nclude 'globela h" oclude 'enhance h* tl tnl t__p rajns (E hance.Para e* const char* verslon_na id track, envelope (Float YY.av. Enhance.Dete "D. Enhance. Parame *F); i <t update.nolse.epect IP loet ge*ww_ v. int n.f lag, Enhance_Data *D, Enhance. Pa raata *P •at* amoothed ^ perlodogramlEnhance.Data *D, Float YY.av, Enhance. Fa ra a 'Pit id minatat.l it (Enhance.Dete *D, Enhancβ.Paramβ *P) i ■ ■I mtnstAt.terninatelEnhence-.Oete *d. Enhance.Paraate *p)t »t' min_eeerch(Enhance_Deta *0. Enhence.Peramβ *F)ι ι>at ninacallnglFloat nlnwln.lenlt oat nol*e.*lope(Enhance_Data *D. Enhence_Paramβ *F)ι ■at* biae„cαnpenaatlon(Enhance_Data *D, Enhance. Fa raae « P|ι fidif ■ rt* CALLOC.SHORTIint nun_Baa leβ» i '>>at* CALLOC_FL0AT(int num_aBSφleβl t •nf CALLOC.FLOATPdnt num.SBf*pl s) i • J termlnatellnt error.num) i > *l *galn_ρ*-od(Floet * CM. Float* qk . float* kal. Floet* vk, Int m) ; < • o pute.q (Float *qk, Float *gamβK, Float *kβl.int ml; 't>*t *cceaputa.qk_new(Float *qk. Float *qla. Float *gaamK. Float OeasM( .TH. Float alphaq oat beteq, int ) ι i -At *gain_log_--aa*e (Float *Cein Floet 'vk.Ploat "qk. Float *kβl. Float *gameK.int } ; kai.mln.edapt tint n.flag. Float Kal.mln. Float an.ltlt id enh.lnl (Enhance.Deta "d. Enhance_Perema *pl ; • id enh_terninate(Enhence_Oete *d. Enhance.Paraiaa "pit • •J proceβB.frane (Float lnapeechd. Float outβpeechl) , Enhance.Dete *d. Enhance.Pere • pi i 02/0599 j.V-.< e). 16:00:03 vectj fun.c. • ,*-ι-to'* ι. -. ^ M ' int li Moat t • nt 11 teg> ■ veclOlt for li • li 1 < a; I.* I if (vecl i I > tstpl for II • Oi 1 a a i*. I tap a vecllli tmp *• vecllli return (tmpl i Subroutine vee.eumi computee the minimum ot vector componente. * • / loet vec_m!nlMoet 'vac. int ml * .. / Moat tmpi ee.mult.conot trloet 'vecl.Moat *vec2.Moat c. Int m) int li int li tap > vec 101 i lorli'Oi I « mi !•') for II • li 1 « at I*. I vecllil * vec2|l| ' c; If (veclll < t-χι> tsip . vecllli returnlvecll I rvliirnltmpl I Subroutine vsc.llmlt.bot torn, compare vec2|l| with a constant c end take '/ mexlmum. */ loet *vec_llmlt.bottom|Moat 'vecl. Moat 'vac2. Moat c. Int m| int ii (or 11 • Oi 1 < mi It. I vecllil • (vec-lll < cl 7 c : vec 11 I , returnlvecll i Subroutine vec.Hmlt.topi compare veclll with a conatsnt c snd tske 'vec.sqrt (Moat 'vecl. Moet 'vec2. Int ml minimum. int ll loat •vec.limlt.toplrloat 'vecl. rloat *vec2. Moat c. Int m) Int li tor 11 • Oi l < mι lt* l vecl 111 • Ivec-IU Subroutine vec.stsai computes the mealsaaa ot ■ vector components, •t vec.moslrloet 'vec, Int ml I loat tmpi 02/05799 ; Λ6iw '£(-* •■ H imated ar- wovt n -. n >oooooo< 38833323-.38888888.888838388838888333 S 33 - S 33333 SIS.8-3... S333S3333 % g 83333333333

Claims: WHAT IS CLAIMED IS: 1. A method for enhancing a speech signal for use in speech coding, the speech signal representing background noise and periods of articulated speech, the speech signal being divided into a plurality of data frames, the method comprising the steps of: applying a transform to the speech signal of a data frame to generate a plurality of sub-band speech signals; making a determination whether the speech signal corresponding to the data frame represents articulated speech; applying individual gain values to individual sub-band speech signals, wherein the lowest permissible gain value for a frame determined to represent articulated speech is lower than the lowest permissible gain value for a frame determined to represent background noise only; and applying an inverse transform to the plurality of sub-band speech signals. 2. The method of claim 1 further comprising the step of determining the individual gain values and wherein the lowest permissible gain value is a function of a lowest permissible a priori signal to noise ratio. 3. A method for enhancing a signal for use in speech coding, the signal being divided into data frames and representing background noise information and periods of articulated speech information, the method comprising the steps of: making a determination whether the signal of a data frame represents articulated speech information; and applying a gain value to the signal, wherein the lowest permissible gain value for a frame determined to represent articulated speech is lower than the lowest permissible gain value for a frame determined to represent background noise only. 4. The method of claim 3 further comprising the step of determining the gain value and wherein the lowest permissible gain value is a function of a lowest permissible a priori signal to noise ratio.

Inventors: COX RICHARD VANDERVOORT, MARTIN RANIER, COX, RICHARD, VANDERVOORT, MARTIN, RANIER
Applicants: AT & T CORP, AT & T CORP.
Application year: 2000
Main classification: G10L21
IPC codes: G10L13, G10L19, G10L21, H03M7