Background of the Invention
1. Field of the Invention
The present invention relates generally to speech coding, and more specifically to an apparatus and method for a high quality speech coding at 4.8 kbps or less.
2. Description of the Related Art
Code excited linear predictive speech coding at low bit rates is described in a paper "Code Excited Linear Prediction (CELP): High-Quality Speech at Very Low Bit Rates", M. Schroeder and B. Atal, Proceedings ICASSP, pages 937 to 940, 1985, and in a paper "Improved Speech Quality and Efficient Vector Quantization in SELP", W. B. Kleijin et al., Proceedings ICASSP, pages 155 to 158, 1988. According to this coding technique, a speech signal is segmented into speech samples at 5-millisecond intervals. A spectral parameter that represents the spectral feature of the speech is linearly predicted from those samples that occur at 20-millisecond intervals. At 5-ms intervals, a pitch period is predicted and a residual sample is obtained from each pitch period. For each residual sample, an optimum excitation code vector is selected from excitation codebooks of predetermined random noise sequences and optimum gain is determined by the selected excitation code vector, so that the error power of the combined residual signal and a replica of the speech sample synthesized by the selected noise sequence is reduced to a minimum. Index signals representing the selected code vector and gain and spectral parameter are multiplexed for transmission or storage.
One shortcoming of the techniques described in these papers is that the quality of female speech degrades significantly due to the codebook size limited by the low coding rate. One way of solving this problem is to remove the annoying noise components from the excitation signal by the use of a comb filter. This technique is proposed in a paper "Improved Excitation for Phonetically-Segmented VXC Speech Coding Below 4 kb/s," Shihua Wang et al., Proc. GLOBECOM, pages 946 to 950, 1990. While the proposed technique improves female speech quality by preemphasizing pitch characteristics, all code vectors are comb-filtered when the adaptive codebook and excitation codebooks are searched. As a result, a large amount of computations are required. Additionally, speech quality is susceptible to bit errors that occur during the transmission or data recovering process.
Summary of the Invention
It is therefore an object of the present invention to provide a low bit rate speech coding technique that allows reduction of computations associated with a comb filtering process and provides immunity to bit errors.
According to a first aspect of the present invention, an input speech signal is segmented into speech samples at first intervals and a spectral parameter is derived from the speech samples that occur at second intervals longer than the first intervals, the spectral parameter representing the characteristic spectral feature. Each speech sample is weighted with the spectral parameter for producing weighted speech samples. The pitch period of the speech signal is determined from the weighted speech samples. A predetermined number of excitation code vectors having smaller amounts of distortion are selected from excitation codebooks as candidate code vectors. The candidate vectors are comb-filtered with a delay time set equal to the pitch period. One of the filtered code vectors having a minimum distortion is selected. The selected excitation code vector is calculated for minimum distortion and, in response thereto, a gain code vector is selected from a gain codebook.
According to a second aspect of the present invention, each of the filtered excitation code vectors is calculated for minimum distortion and, in response, a gain code vector is selected from the gain code vectors stored in the gain codebook so that the selected gain code vector minimizes distortion. One of the candidate code vectors and one of the selected gain code vectors are selected so that they further minimize the distortion.
According to a third aspect of the present invention, the candidate code vectors are comb-filtered with a delay time equal to the pitch period and with a plurality of weighting functions respectively set equal to gain code vectors stored in the gain codebook and a set of filtered excitation code vectors are produced corresponding to each of the candidate code vectors. The filtered excitation code vectors of each set are calculated and, and for each of the sets, a gain code vector is selected from the gain code vectors stored in the gain codebook so that each of the selected gain code vectors minimizes distortion. One of the selected candidate code vectors is selected and one of the selected gain code vectors is selected so that the selected candidate code vector and the selected gain code vector further minimize the distortion.
Brief Description of the Drawings
The present invention will be described in further detail with reference to the accompanying drawings, in which:
FIG. 1 is a block diagram of a speech encoder according to a first embodiment of the present invention;
FIG. 2 is a block diagram of a speech encoder according to a second embodiment of the present invention; and
FIG. 3 is a block diagram of a speech encoder according to a third embodiment of the present invention.
Detailed Description
In FIG. 1, there is shown a speech encoder according to a first embodiment of the present invention. The speech encoder includes a framing circuit 10 where a digital input speech signal is segmented into blocks or "frames" of 40-millisecond duration, for example. The output of framing circuit 10 is supplied to a subframing circuit 11 where the speech samples of each frame are subdivided into a plurality of subblocks, or "subframes" of 8-millisecond duration, for example.
Digital speech signals on each 8-ms subframe are supplied to a perceptual weighting circuit 15 and to a spectral parameter and LSP (SP/LSP) calculation circuit 12 where they are masked by a window of an approximately 24-millisecond length. Computations are performed on the signals extracted through the window to produce a spectral parameter of the speech samples. The number of computations corresponds to the order p (typically, p=10). Known techniques are available for this purpose, such as LPC (linear predictive coding) and the Burg's method. The latter is described in "Maximum Entropy spectrum Analysis", J. P. Burg, Ph.D. dissertation, Department of Geophysics, Stanford University, Stanford, Calif., 1975.
It is desirable to provide spectral calculations at short intervals as possible to reflect significant spectral variations that occur between consonants and vowels. For practical purposes, however, spectral parameter calculations are performed during first, third and fifth subframes in order to reduce the computations, and a linear interpolation technique is used for deriving spectral parameters for the second and fourth subframes. In the LSP calculation circuit 12, linear predictive coefficients .alpha..sub.i (where i corresponds to the order p and equals to 1, 2, . . . , 10) which are obtained by the Burg's method are converted to linear spectrum pairs, or LSP parameters suitable for quantization and interpolation processes,
The linear predictive coefficients .alpha..sub.ij (where j indicates subframes 1 to 5) are supplied at subframe intervals from the circuit 12 to the perceptual weighting circuit 15 so that the speech samples from the subframing circuit 11 are weighted by the linear predictive coefficients. A series of perceptually weighted digital speech samples Xw(n) are generated and supplied to a subtractor 16, in which the difference between the sample Xw(n) and a correcting signal Xz(n) from a correction signal calculator 29 is detected so that corrected speech samples X'w(n) have a minimum of error associated with the speech segmenting (blocking and sub-blocking) processes. The output of the subtractor 16 is applied to a pitch synthesizer 17 to determine its pitch period.
On the other hand, the linear spectrum pairs of the first to fifth subframes are supplied from the spectral parameter calculator 12 to an LSP quantizer 13, where the LSP parameter of the fifth subframe is vector-quantized by using an LSP codebook 14. The LSP parameters of the first to fourth subframes are recovered by interpolation between the quantized fifth-subframe LSP parameters of successive frames. Alternatively, a set of LSP vectors is selected from the LSP codebook 14 such that they minimize the quantization error, and linear interpolation is used for recovering the LSP parameters of the first to fourth subframes from the selected LSP vectors. Further, a plurality of sets of such LSP vectors may be selected from the codebook 14 as candidates which are then evaluated in terms of cumulative distortion. Selection is made on one of the candidates having a minimum distortion.
At subframe intervals, linear predictive coefficients .alpha.'.sub.ij are derived by the LSP quantizer 13 from the recovered LSP parameters of the first to fourth subframes as well as from the LSP parameter of the fifth subframe. The coefficients are supplied to an impulse response calculator 26, and an LSP index representing the LSP vector of the quantized LSP parameter of the fifth subframe is generated and presented to a multiplexer 25 for transmission or storage.
Using the linear predictive coefficients .alpha..sub.ij and .alpha.'.sub.ij, the impulse response calculator 26 calculates the impulse responses h.sub.w (n) of the weighting filter of an excitation pulse synthesizer 28. The z-transform of the weighting filter is represented by the following Equation. ##EQU1## where .gamma. is a weight constant. The output of impulse response calculator 26 is supplied to the pitch synthesizer 17 to allow it to determine the pitch period of the speech signal.
A mode classifier 27 is connected to the spectral parameter calculator 12 to evaluate the linear predictive coefficients .alpha..sub.ij. Specifically, it calculates K-parameters that represent the spectral envelope of the speech samples of every five subframes. A technique described in a paper "Quantization Properties of Transmission Parameters in Linear Predictive Systems", John Makhoul et al., IEEE Transactions ASSP, pages 309 to 321, 1983, is available for this purpose. Using the K-parameters, the mode classifier determines an accumulated predictive error power for every five subframes compares it with three threshold values and The the error power is classified into one of four distinct categories, or modes, with a mode 0 corresponding to the minimum error power and a mode 3 corresponding to the maximum. A mode index is supplied from the mode classifier to the pitch synthesizer 17 and to the multiplexer 25 for transmission or storage.
In order to determine the pitch period at subframe intervals, the pitch synthesizer 17 is provided with a known adaptive codebook. During mode 1, 2 or 3, a pitch period is derived from an output sample X'w(n) of subtractor 16 using the impulse response h.sub.w (n) from impulse response calculator 26. Pitch synthesizer 17 supplies a pitch index indicating the pitch period to an excitation vector candidate selector 18, a comb filter 21, a vector selector 22, an excitation pulse synthesizer 28 and to the multiplexer 25. When the encoder is in mode 0, the pitch synthesizer produces no pitch index.
Excitation vector candidate selector 18 is connected to excitation vector codebooks 19 and 20 to search for excitation vector candidates and to select excitation code vectors such that those having smaller amounts of distortion are selected with higher priorities. When the encoder is in mode 1, 2 or 3, it makes a search through the codebooks 19 and 20 for excitation code vectors that minimize the amount of distortion represented by the following Equation: ##EQU2## where, the symbol * denotes convolution, .beta. is the gain of the pitch synthesizer 17, g(n) is the pitch index, g.sub.1 and g.sub.2 are optimum gains of the first and second excitation vector stages, respectively, and c.sub.1 and c.sub.2 are the excitation code vectors of the first and second stages, respectively. When the encoder is in mode 0 in which the pitch synthesizer 17 is producing no outputs, the following Equation is used instead: ##EQU3## The computations are repeated a number of times corresponding to the order p to produce M (=10) candidates for each codebook. A further search is then made for M.times.M candidates to determine excitation vector candidates corresponding in number to the first to fifth subframes. Details of the codebooks 19 and 20 and the method of excitation vector search are described in Japanese Provisional Patent Publication (Tokkaihei 4) 92-36170.
The excitation vector candidates, the pitch index and the mode index are applied to the comb filter 21 in which its delay time T is set equal to the pitch period. During mode 1, 2 or 3, each of the excitation code vector candidates is passed through the comb filter so that, if the order of the filter is 1, the following excitation code vector C.sub.jz (n) is produced as a comb filter output:
where C.sub.j (n) is the excitation code vector candidate j, and .rho. is the weighting function of the comb filter. Alternatively, a different value of weighting function .rho. may be used for each mode of operation.
Preferably, comb filter 21 is of moving average type to take advantage of this filter's ability to prevent errors that occur during transmission or data recovery process from being accumulated over time. As a result, the transmitted or stored speech samples are less susceptible to bit errors.
The filtered vector candidates C.sub.jz (n), the pitch index and the output of subtractor 16 are applied to the vector selector 22. For the first and second excitation vector stages (corresponding respectively to codebooks 19 and 20), the vector selector 22 selects those of the filtered candidates which minimizes the distortion given by the following Equation: ##EQU4## and generates excitation indices I.sub.c1 and I.sub.c2, respectively indicating the selected excitation code vectors. These excitation indices are supplied to an excitation pulse synthesizer 28 as well as to the multiplexer 25.
The output of the vector selector 22, the pitch index from pitch synthesizer 17 and the output of subtractor 16 are coupled to a gain search are known in the art the gain calculator 23 searches the codebook 24 for a gain code vector that minimizes distortion represented by the following Equation: ##EQU5## where, .beta.'.sub.k is the gain of k-th adaptive code vector, and g'.sub.1k and g'.sub.2k are the gains of k-th excitation code vectors of the first and second excitation vector stages, respectively. During mode 0, the following Equation is used to search for an optimum gain code vector: ##EQU6## In each operating mode, the gain calculator generates a gain index representing the quantized optimum gain code vector for application to the excitation pulse synthesizer 28 as well as to the multiplexer 25 for transmission or storage.
Excitation pulse synthesizer 28 receives the gain index, excitation indices, mode index and pitch index and reads corresponding vectors from codebooks, not shown. During mode 1, 2 or 3, it synthesizes an excitation pulse v(n) by solving the following Equation:
or solving the following Equation during mode 0:
At subframe intervals, excitation pulse synthesizer 28 responds to the spectral parameters .alpha..sub.ij and .alpha.'.sub.ij and LSP index by calculating the following Equation to modify the excitation pulse v(n): ##EQU7## where p(n) is the output of the weighting filter of the excitation pulse synthesizer.
The excitation pulse d(n) is applied to the correction signal calculator 29, which derives the correcting signal Xz(n) at subframe intervals by solving the following Equation by setting d(n) to zero if the term (n-1) of the Equation (10) is zero or positive and using d(n) if the term (n-1) is negative: ##EQU8##
Since the excitation code vector candidates are selected in number corresponding to the subframes and filtered through the moving average type comb filter 21, and one of the candidates is selected so that speech distortion is minimized, computations involved in the gain calculation, excitation pulse syntheses and impulse response calculation on excitation pulses are reduced significantly, while retaining the required quality of speech at 4.8 kbps or lower.
A modified embodiment of the present invention is shown in FIG. 2 in which the vector selector 22 is connected between the gain calculator 23 and multiplexer 25 to receive its inputs from the outputs of gain calculator 23 and from the outputs of excitation vector candidate selector 18. The vector selector 22 receives its inputs direct from filter 21. Gain calculator 23 makes a search for a gain code vector using a three-dimensional gain codebook 24'0. During mode 1, 2 or 3, vector selector 22 searches for a gain code vector that minimizes Equation (6) with a respect to each of the filtered excitation code vectors, and during mode 0 it searches for one that minimizes Equation (7) with respect to each excitation code vector. Vector selector 22 selects one of the candidate code vectors and one of the gain code vectors that minimize the distortion given Equation (6) during mode 1, 2 or 3, or minimize the distortion given by Equation (7) during mode 0, and delivers the selected candidate excitation code vector and the selected gain code vector as excitation and gain indices to multiplexer 25 as well as to excitation pulse synthesizer 28.
A modification shown in FIG. 3 differs from the embodiment of FIG. 2 in that the weighting function .eta. of the comb filter 21 is set equal to .epsilon..times.G where .epsilon. is a constant and G represents the gain code vector. Comb filter 21 reads all gain code vectors from gain codebook 24' and substitutes each of these gain code vectors for the value G. The weighting function .eta. is therefore varied with the gain code vectors and the comb filter 21 produces, for each of its inputs, a plurality of filtered excitation code vectors corresponding in number to the number of gain code vectors stored in gain codebook 24'. For each of its inputs, gain calculator 23 selects one of gain code vectors stored in gain codebook 24' that minimizes the distortion given by Equations (6) and (7) and applies the selected gain code vectors to vector selector 22. From these gain code vectors and the candidate excitation code vectors, vector selector 22 selects a set of a gain code vector and an excitation code vector that minimize the distortion represented by Equations (6) and (7).