Patent Description:
In a coder of a codec structure, for example a CELP (Code-Excited Linear Prediction) codec structure such as ACELP (Algebraic Code-Excited Linear Prediction), an input speech or audio signal (sound signal) is processed in short segments, called frames. In order to capture rapidly varying properties of an input sound signal, each frame is further divided into sub-frames. A CELP codec structure also produces adaptive codebook and fixed codebook contributions of an excitation that are added together to form a total excitation. Gains related to the adaptive and fixed codebook contributions of the excitation are quantized and transmitted to a decoder along with other encoding parameters. The adaptive codebook contribution and the fixed codebook contribution of the excitation will be referred to as "the adaptive contribution" and "the fixed contribution" of the excitation throughout the document. <CIT> discloses a speech compression system and method.

There is a need for a technique for quantizing the gains of the adaptive and fixed excitation contributions that improve the robustness of the codec against frame erasures or packet losses that can occur during transmission of the encoding parameters from the coder to the decoder.

According to the invention, there are provided a device as set forth in claim <NUM>, a device as set forth in claim <NUM>, a method as set forth in claim <NUM> and a method as set forth in claim <NUM>.

The foregoing and other features will become more apparent upon reading of the following non-restrictive description of illustrative embodiments, given by way of example only with reference to the accompanying drawings.

In the following, there is described quantization of a gain of a fixed contribution of an excitation in a coded sound signal, as well as joint quantization of gains of adaptive and fixed contributions of the excitation. The quantization can be applied to any number of sub-frames and deployed with any input speech or audio signal (input sound signal) sampled at any arbitrary sampling frequency. Also, the gains of the adaptive and fixed contributions of the excitation are quantized without the need of inter-frame prediction. The absence of inter-frame prediction results in improvement of the robustness against frame erasures or packet losses that can occur during transmission of encoded parameters.

The gain of the adaptive contribution of the excitation is quantized directly whereas the gain of the fixed contribution of the excitation is quantized through an estimated gain. The estimation of the gain of the fixed contribution of the excitation is based on parameters that exist both at the coder and the decoder. These parameters are calculated during processing of the current frame. Thus, no information from a previous frame is required in the course of quantization or decoding which, as mentioned hereinabove, improves the robustness of the codec against frame erasures.

Although the following description will refer to a CELP (Code-Excited Linear Prediction) codec structure, for example ACELP (Algebraic Code-Excited Linear Prediction), it should be kept in mind that the subject matter of the present disclosure may be applied to other types of codec structures.

In the art of CELP coding, the excitation is composed of two contributions: the adaptive contribution (adaptive codebook excitation) and the fixed contribution (fixed codebook excitation). The adaptive codebook is based on long-term prediction and is therefore related to the past excitation. The adaptive contribution of the excitation is found by means of a closed-loop search around an estimated value of a pitch lag. The estimated pitch lag is found by means of a correlation analysis. The closed-loop search consists of minimizing the mean square weighted error (MSWE) between a target signal (in CELP coding, a perceptually filtered version of the input speech or audio signal (input sound signal)) and the filtered adaptive contribution of the excitation scaled by an adaptive codebook gain. The filter in the closed-loop search corresponds to the weighted synthesis filter known in the art of CELP coding. A fixed codebook search is also carried out by minimizing the mean squared error (MSE) between an updated target signal (after removing the adaptive contribution of the excitation) and the filtered fixed contribution of the excitation scaled by a fixed codebook gain. The construction of the total filtered excitation is shown in <FIG>. For further reference, an implementation of CELP coding is described in the following document: <NPL>".

<FIG> is a schematic diagram describing the construction of the filtered total excitation in a CELP coder. The input signal <NUM>, formed by the above mentioned target signal, is denoted as x(i) and is used as a reference during the search of gains for the adaptive and fixed contributions of the excitation. The filtered adaptive contribution of the excitation is denoted as y(i) and the filtered fixed contribution of the excitation (innovation) is denoted as z(i). The corresponding gains are denoted as gp for the adaptive contribution and gc for the fixed contribution of the excitation. As illustrated in <FIG>, an amplifier <NUM> applies the gain gp to the filtered adaptive contribution y(j) of the excitation and an amplifier <NUM> applies the gain gc to the filtered fixed contribution z(i) of the excitation. The optimal quantized gains are found by means of minimization of the mean square of the error signal e(i) calculated through a first subtractor <NUM> subtracting the signal gpy(i) at the output of the amplifier <NUM> from the target signal xi and a second subtractor <NUM> subtracting the signal gcz(i) at the output of the amplifier <NUM> from the result of the subtraction from the subtractor <NUM>. For all signals in <FIG>, the index i denotes the different signal samples and runs from <NUM> to L-<NUM>, where L is the length of each sub-frame. As well known to people skilled in the art, the filtered adaptive codebook contribution is usually computed as the convolution between the adaptive codebook excitation vector v(n) and the impulse response of the weighted synthesis filter h(n), that is y(n) = v(n)*h(n). Similarly, the filtered fixed codebook excitation z(n) is given by z(n) = c(n)*h(n), where c(n) is the fixed codebook excitation.

Assuming the knowledge of the target signal x(i), the filtered adaptive contribution of the excitation y(i) and the filtered fixed contribution of the excitation z(i), the optimal set of unquantized gains gp and gc is found by minimizing the energy of the error signal e(i) given by the following relation: <MAT>.

Equation (<NUM>) can be given in vector form as <MAT> and minimizing the energy of the error signal, <MAT>, where t denotes vector transpose, results in optimum unquantized gains <MAT> where the constants or correlations c<NUM>, c<NUM>, c<NUM>, c<NUM>, c<NUM> and c<NUM> are calculated as <MAT>.

The optimum gains in Equation (<NUM>) are not quantized directly, but they are used in training a gain codebook as will be described later. The gains are quantized jointly, after applying prediction to the gain of the fixed contribution of the excitation. The prediction is performed by computing an estimated value of the gain gc<NUM> of the fixed contribution of the excitation. The gain of the fixed contribution of the excitation is given by gc = gc<NUM>. γ where γ is a correction factor. Therefore, each codebook entry contains two values. The first value corresponds to the quantized gain gp of the adaptive contribution of the excitation. The second value corresponds to the correction factor γ which is used to multiply the estimated gain gc<NUM> of the fixed contribution of the excitation. The optimum index in the gain codebook (gp and γ) is found by minimizing the mean squared error between the target signal and filtered total excitation. Estimation of the gain of the fixed contribution of the excitation is described in detail below.

Each frame contains a certain number of sub-frames. Let us denote the number of sub-frames in a frame as K and the index of the current sub-frame as k. The estimation gc<NUM> of the gain of the fixed contribution of the excitation is performed differently in each sub-frame.

<FIG> is a schematic block diagram describing an estimator <NUM> of the gain of the fixed contribution of the excitation (hereinafter fixed codebook gain) in a first sub-frame of each frame.

The estimator <NUM> first calculates an estimation of the fixed codebook gain in response to a parameter t representative of the classification of the current frame. The energy of the innovation codevector from the fixed codebook is then subtracted from the estimated fixed codebook gain to take into consideration this energy of the filtered innovation codevector. The resulting, estimated fixed codebook gain is multiplied by a correction factor selected from a gain codebook to produce the quantized fixed codebook gain gc.

In one embodiment, the estimator <NUM> comprises a calculator <NUM> of a linear estimation of the fixed codebook gain in logarithmic domain. The fixed codebook gain is estimated assuming unity-energy of the innovation codevector <NUM> from the fixed codebook. Only one estimation parameter is used by the calculator <NUM>, the parameter t representative of the classification of the current frame. A subtractor <NUM> then subtracts the energy of the filtered innovation codevector <NUM> from the fixed codebook in logarithmic domain from the linear estimated fixed codebook gain in logarithmic domain at the output of the calculator <NUM>. A converter <NUM> converts the estimated fixed codebook gain in logarithmic domain from the subtractor <NUM> to linear domain. The output in linear domain from the converter <NUM> is the estimated fixed codebook gain gc<NUM>. A multiplier <NUM> multiplies the estimated gain gc<NUM> by the correction factor <NUM> selected from the gain codebook. As described in the preceding paragraph, the output of the multiplier <NUM> constitutes the quantized fixed codebook gain gc.

The quantized gain gp of the adaptive contribution of the excitation (hereinafter the adaptive codebook gain) is selected directly from the gain codebook. A multiplier <NUM> multiplies the filtered adaptive excitation <NUM> from the adaptive codebook by the quantized adaptive codebook gain gp to produce the filtered adaptive contribution <NUM> of the filtered excitation. Another multiplier <NUM> multiplies the filtered innovation codevector <NUM> from the fixed codebook by the quantized fixed codebook gain gc to produce the filtered fixed contribution <NUM> of the filtered excitation. Finally, an adder <NUM> sums the filtered adaptive <NUM> and fixed <NUM> contributions of the excitation to form the total filtered excitation <NUM>.

In the first sub-frame of the current frame, the estimated fixed codebook gain in logarithmic domain at the output of the subtractor <NUM> is given by <MAT> where <MAT>.

The inner term inside the logarithm of Equation (<NUM>) corresponds to the square root of the energy of the filtered innovation vector <NUM> (Ei is the energy of the filtered innovation vector in the first sub-frame of frame n). This inner term (square root of the energy Ei) is determined by a first calculator <NUM> of the energy Ei of the filtered innovation vector <NUM> and a calculator <NUM> of the square root of that energy Ei. A calculator <NUM> then computes the logarithm of the square root of the energy Ei for application to the negative input of the subtractor <NUM>. The inner term (square root of the energy Ei) has non-zero energy; the energy is incremented by a small amount in case of all-zero frames to avoid log(<NUM>).

The estimation of the fixed codebook gain in calculator <NUM> is linear in logarithmic domain with estimation coefficients a<NUM> and a<NUM> which are found for each sub-frame by means of a mean square minimization on a large signal database (training) as will be explained in the following description. The only estimation parameter <NUM> in the equation, t, denotes the classification parameter for frame n (in one embodiment, this value is constant for all sub-frames in frame n). Details about classification of the frames are given below. Finally, the estimated value of the gain in logarithmic domain is converted back to the linear domain <MAT> by the calculator <NUM> and used in the search process for the best index of the gain codebook as will be explained in the following description.

The superscript (<NUM>) denotes the first sub-frame of the current frame n.

As explained in the foregoing description, the parameter t representative of the classification of the current frame is used in the calculation of the estimated fixed codebook gain gc<NUM>. Different codebooks can be designed for different classes of voice signals. However, this will increase memory requirements. Also, estimation of the fixed codebook gain in the frames following the first frame can be based on the frame classification parameter t and the available adaptive and fixed codebook gains from previous sub-frames in the current frame. The estimation is confined to the frame boundary to increase robustness against frame erasures.

For example, frames can be classified as unvoiced, voiced, generic, or transition frames. Different alternatives can be used for classification. An example is given later below as a non-limitative illustrative embodiment. Further, the number of voice classes can be different from the one used hereinabove. For example the classification can be only voiced or unvoiced in one embodiment. In another embodiment more classes can be added such as strongly voiced and strongly unvoiced.

The values for the classification estimation parameter t can be chosen arbitrarily. For example, for narrowband signals, the values of parameter t are set to: <NUM>, <NUM>, <NUM>, and <NUM>, for unvoiced, voiced, generic, and transition frames, respectively, and for wideband signals, they are set to <NUM>, <NUM>, <NUM>, and <NUM>, respectively. However, other values for the estimation parameter t can be used for each class. Including this estimation, classification parameter t in the design and training for determining estimation parameters will result in better estimation gc<NUM> of the fixed codebook gain.

The sub-frames following the first sub-frame in a frame use slightly different estimation scheme. The difference is in fact that in these sub-frames, both the quantized adaptive codebook gain and the quantized fixed codebook gain from the previous sub-frame(s) in the current frame are used as auxiliary estimation parameters to increase the efficiency.

<FIG> is a schematic block diagram of an estimator <NUM> for estimating the fixed codebook gain in the sub-frames following the first sub-frame in a current frame. The estimation parameters include the classification parameter t and the quantized values (parameters <NUM>) of both the adaptive and fixed codebook gains from previous sub-frames of the current frame. These parameters <NUM> are denoted as gp(<NUM>), gc(<NUM>), gp(<NUM>), gc(<NUM>), etc. where the superscript refers to first, second and other previous sub-frames. An estimation of the fixed codebook gain is calculated and is multiplied by a correction factor selected from the gain codebook to produce a quantized fixed codebook gain gc, forming the gain of the fixed contribution of the excitation (this estimated fixed codebook gain is different from that of the first sub-frame).

In one embodiment, a calculator <NUM> computes a linear estimation of the fixed codebook gain again in logarithmic domain and a converter <NUM> converts the gain estimation back to linear domain. The quantized adaptive codebook gains gp(<NUM>), gp(<NUM>), etc. from the previous sub-frames are supplied to the calculator <NUM> directly while the quantized fixed codebook gains gc(<NUM>), gc(<NUM>), etc. from the previous sub-frames are supplied to the calculator <NUM> in logarithmic domain through a logarithm calculator <NUM>. A multiplier <NUM> then multiplies the estimated fixed codebook gain gc<NUM> (which is different from that of the first sub-frame) from the converter <NUM> by the correction factor <NUM>, selected from the gain codebook. As described in the preceding paragraph, the multiplier <NUM> then outputs a quantized fixed codebook gain gc, forming the gain of the fixed contribution of the excitation.

A first multiplier <NUM> multiplies the filtered adaptive excitation <NUM> from the adaptive codebook by the quantized adaptive codebook gain gp selected directly from the gain codebook to produce the adaptive contribution <NUM> of the excitation. A second multiplier <NUM> multiplies the filtered innovation codevector <NUM> from the fixed codebook by the quantized fixed codebook gain gc to produce the fixed contribution <NUM> of the excitation. An adder <NUM> sums the filtered adaptive <NUM> and filtered fixed <NUM> contributions of the excitation together so as to form the total filtered excitation <NUM> for the current frame.

The estimated fixed codebook gain from the calculator <NUM> in the kth sub-frame of the current frame in logarithmic domain is given by <MAT> where <MAT> is the quantized fixed codebook gain in logarithmic domain in sub-frame k, and <MAT> is the quantized adaptive codebook gain in sub-frame k.

For example, in one embodiment, four (<NUM>) sub-frames are used (K=<NUM>) so the estimated fixed codebook gains, in logarithmic domain, in the second, third, and fourth sub-frames from the calculator <NUM> are given by the following relations: <MAT> <MAT> and <MAT>.

The above estimation of the fixed codebook gain is based on both the quantized adaptive and fixed codebook gains of all previous sub-frames of the current frame. There is also another difference between this estimation scheme and the one used in the first sub-frame. The energy of the filtered innovation vector from the fixed codebook is not subtracted from the linear estimation of the fixed codebook gain in the logarithmic domain from the calculator <NUM>. The reason comes from the use of the quantized adaptive codebook and fixed codebook gains from the previous sub-frames in the estimation equation. In the first sub-frame, the linear estimation is performed by the calculator <NUM> assuming unit energy of the innovation vector. Subsequently, this energy is subtracted to bring the estimated fixed codebook gain to the same energetic level as its optimal value (or at least close to it). In the second and subsequent sub-frames, the previous quantized values of the fixed codebook gain are already at this level so there is no need to take the energy of the filtered innovation vector into consideration. The estimation coefficients ai and bi are different for each sub-frame and they are determined offline using a large training database as will be described later below.

An optimal set of estimation coefficients is found on a large database containing clean, noisy and mixed speech signals in various languages and levels and with male and female talkers.

The estimation coefficients are calculated by running the codec with optimal unquantized values of adaptive and fixed codebook gains on the large database. It is reminded that the optimal unquantized adaptive and fixed codebook gains are found according to Equations (<NUM>) and (<NUM>).

In the following description it is assumed that the database comprises N+<NUM> frames, and the frame index is n = <NUM>,. The frame index n is added to the parameters used in the training which vary on a frame basis (classification, first sub-frame innovation energy, and optimum adaptive and fixed codebook gains).

The estimation coefficients are found by minimizing the mean square error between the estimated fixed codebook gain and the optimum gain in the logarithmic domain over all frames in the database.

For the first sub-frame, the mean square error energy is given by <MAT>.

From Equation (<NUM>), the estimated fixed codebook gain in the first sub-frame of frame n is given by <MAT> then the mean square error energy is given by <MAT>.

In above equation above (<NUM>), Eest is the total energy (on the whole database) of the error between the estimated and optimal fixed codebook gains, both in logarithmic domain. The optimal, fixed codebook gain in the first sub-frame is denoted g(<NUM>)c,opt. As mentioned in the foregoing description, Ei(n) is the energy of the filtered innovation vector from the fixed codebook and t(n) is the classification parameter of frame n. The upper index (<NUM>) is used to denote the first sub-frame and n is the frame index.

The minimization problem may be simplified by defining a normalized gain of the innovation vector in logarithmic domain. That is <MAT>.

The total error energy then becomes <MAT>.

The solution of the above defined MSE (Mean Square Error) problem is found by the following pair of partial derivatives <MAT>.

The optimal values of estimation coefficients resulting from the above equations are given by <MAT>.

Estimation of the fixed codebook gain in the first sub-frame is performed in logarithmic domain and the estimated fixed codebook gain should be as close as possible to the normalized gain of the innovation vector in logarithmic domain, Gi(<NUM>)(n).

For the second and other subsequent sub-frames, the estimation scheme is slightly different. The error energy is given by <MAT> where <MAT>. Substituting Equation (<NUM>) into Equation (<NUM>) the following is obtained <MAT>.

For the calculation of the estimation coefficients in the second and subsequent sub-frames of each frame, the quantized values of both the fixed and adaptive codebook gains of previous sub-frames are used in the above Equation (<NUM>). Although it is possible to use the optimal unquantized gains in their place, the usage of quantized values leads to the maximum estimation efficiency in all sub-frames and consequently to better overall performance of the gain quantizer.

Thus, the number of estimation coefficients increases as the index of the current sub-frame is advanced. The gain quantization itself is described in the following description. The estimation coefficients ai and bi are different for each sub-frame, but the same symbols were used for the sake of simplicity. Normally, they would either have the superscript (k) associated therewith or they would be denoted differently for each sub-frame, wherein k is the sub-frame index.

The minimization of the error function in Equation (<NUM>) leads to the following system of linear equations <MAT>.

The solution of this system, i.e. the optimal set of estimation coefficients a<NUM>, a<NUM>, b<NUM>,. ,b<NUM>k-<NUM>, is not provided here as it leads to complicated formulas. It is usually solved by mathematical software equipped with a linear equation solver, for example MATLAB. This is advantageously done offline and not during the encoding process.

For the second sub-frame, Equation (<NUM>) reduces to <MAT>.

As mentioned hereinabove, calculation of the estimation coefficients is alternated with gain quantization as depicted in <FIG>. More specifically, <FIG> is a schematic block diagram describing a state machine <NUM> in which the estimation coefficients are calculated (<NUM>) for each sub-frame. The gain codebook is then designed (<NUM>) for each sub-frame using the calculated estimation coefficients. Gain quantization (<NUM>) for the sub-frame is then conducted on the basis of the calculated estimation coefficients and the gain codebook design. Estimation of the fixed codebook gain itself is slightly different in each sub-frame, the estimation coefficients are found by means of minimum mean square error, and the gain codebook may be designed by using the KMEANS algorithm as described, for example, in<NPL>.

<FIG> is a schematic block diagram describing a gain quantizer <NUM>.

Before gain quantization it is assumed that both the filtered adaptive excitation <NUM> from the adaptive codebook and the filtered innovation codevector <NUM> from the fixed codebook are already known. The gain quantization at the coder is performed by searching the designed gain codebook <NUM> in the MMSE (Minimum Mean Square Error) sense. As described in the foregoing description, each entry in the gain codebook <NUM> includes two values: the quantized adaptive codebook gain gp and the correction factor γ for the fixed contribution of the excitation. The estimation of the fixed codebook gain is performed beforehand and the estimated fixed codebook gain gc<NUM> is used to multiply the correction factor γ selected from the gain codebook <NUM>. In each sub-frame, the gain codebook <NUM> is searched completely, i.e. for indices q=<NUM>,. ,Q-<NUM>, Q being the number of indices of the gain codebook. It is possible to limit the search range in case the quantized adaptive codebook gain gp is mandated to be below a certain threshold. To allow reducing the search range, the codebook entries may be sorted in ascending order according to the value of the adaptive codebook gain gp.

Referring to <FIG>, the two-entry gain codebook <NUM> is searched and each index provides two values - the adaptive codebook gain gp and the correction factor γ. A multiplier <NUM> multiplies the correction factor γ by the estimated fixed codebook gain gc<NUM> and the resulting value is used as the quantized gain <NUM> of the fixed contribution of the excitation (quantized fixed codebook gain). Another multiplier <NUM> multiplies the filtered adaptive excitation <NUM> from the adaptive codebook by the quantized adaptive codebook gain gp from the gain codebook <NUM> to produce the adaptive contribution <NUM> of the excitation. A multiplier <NUM> multiplies the filtered innovation codevector <NUM> by the quantized fixed codebook gain <NUM> to produce the fixed contribution <NUM> of the excitation. An adder <NUM> sums both the adaptive <NUM> and fixed <NUM> contributions of the excitation together so as to form the filtered total excitation <NUM>. A subtractor <NUM> subtracts the filtered total excitation <NUM> from the target signal xi to produce the error signal ei. A calculator <NUM> computes the energy <NUM> of the error signal ei and supplies it back to the gain codebook searching mechanism. All or a subset of the indices of the gain codebook <NUM> are searched in this manner and the index of the gain codebook <NUM> yielding the lowest error energy <NUM> is selected as the winning index and sent to the decoder.

The gain quantization can be performed by minimizing the energy of the error in Equation (<NUM>). The energy is given by <MAT>.

Substituting gc by γgc<NUM> the following relation is obtained <MAT> where the constants or correlations c<NUM>, c<NUM>, c<NUM> c<NUM>, c<NUM> and c<NUM> are calculated as in Equation (<NUM>) above. The constants or correlations c<NUM>, c<NUM>, c<NUM>, c<NUM>, c<NUM> and c<NUM>, and the estimated gain gc<NUM> are computed before the search of the gain codebook <NUM>, and then the energy in Equation (<NUM>) is calculated for each codebook index (each set of entry values gp and γ).

The codevector from the gain codebook <NUM> leading to the lowest energy <NUM> of the error signal ei is chosen as the winning codevector and its entry values correspond to the quantized values gp and γ. The quantized value of the fixed codebook gain is then calculated as <MAT>.

<FIG> is a schematic block diagram of an equivalent gain quantizer <NUM> as in <FIG>, performing calculation of the energy Ei of the error signal ei using Equation (<NUM>). More specifically, the gain quantizer <NUM> comprises a gain codebook <NUM>, a calculator <NUM> of constants or correlations, and a calculator <NUM> of the energy <NUM> of the error signal. The calculator <NUM> calculates the constants or correlations c<NUM>, c<NUM>, c<NUM> c<NUM>, c<NUM> and c<NUM> using Equation (<NUM>) and the target vector x, the filtered adaptive excitation vector y from the adaptive codebook, and the filtered fixed codevector z from the fixed codebook, wherein t denotes vector transpose. The calculator <NUM> uses Equation (<NUM>) to calculate the energy Ei of the error signal ei from the estimated fixed codebook gain gc<NUM>, the correlations c<NUM>, c<NUM>, c<NUM> c<NUM>, c<NUM> and c<NUM> from calculator <NUM>, and the quantized adaptive codebook gain gp and the correction factor γ from the gain codebook <NUM>. The energy <NUM> of the error signal from the calculator <NUM> is supplied back to the gain codebook searching mechanism. Again, all or a subset of the indices of the gain codebook <NUM> are searched in this manner and the index of the gain codebook <NUM> yielding the lowest error energy <NUM> is selected as the winning index and sent to the decoder.

In the gain quantizer <NUM> of <FIG>, the gain codebook <NUM> has a size that can be different depending on the sub-frame. Better estimation of the fixed codebook gain is attained in later sub-frames in a frame due to increased number of estimation parameters. Therefore a smaller number of bits can be used in later sub-frames. In one embodiment, four (<NUM>) sub-frames are used where the numbers of bits for the gain codebook are <NUM>, <NUM>, <NUM>, and <NUM> corresponding to sub-frames <NUM>, <NUM>, <NUM>, and <NUM>, respectively. In another embodiment at a lower bit rate, <NUM> bits are used in each sub-frame.

In the decoder, the received index is used to retrieve the values of quantized adaptive codebook gain gp and correction factor γ from the gain codebook. The estimation of the fixed codebook gain is performed in the same manner as in the coder, as described in the foregoing description. The quantized value of the fixed codebook gain is calculated by the equation gc = gc<NUM>. Both the adaptive codevector and the innovation codevector are decoded from the bitstream and they become adaptive and fixed excitation contributions that are multiplied by the respective adaptive and fixed codebook gains. Both excitation contributions are added together to form the total excitation. The synthesis signal is found by filtering the total excitation through a LP synthesis filter as known in the art of CELP coding.

Different methods can be used for determining classification of a frame, for example parameter t of <FIG>. A non-limitative example is given in the following description where frames are classified as unvoiced, voiced, generic, or transition frames. However, the number of voice classes can be different from the one used in this example. For example the classification can be only voiced or unvoiced in one embodiment. In another embodiment more classes can be added such as strongly voiced and strongly unvoiced.

Signal classification can be performed in three steps, where each step discriminates a specific signal class. First, a signal activity detector (SAD) discriminates between active and inactive speech frames. If an inactive speech frame is detected (background noise signal) then the classification chain ends and the frame is encoded with comfort noise generation (CNG). If an active speech frame is detected, the frame is subjected to a second classifier to discriminate unvoiced frames. If the classifier classifies the frame as unvoiced speech signal, the classification chain ends, and the frame is encoded using a coding method optimized for unvoiced signals. Otherwise, the frame is processed through a "stable voiced" classification module. If the frame is classified as stable voiced frame, then the frame is encoded using a coding method optimized for stable voiced signals. Otherwise, the frame is likely to contain a non-stationary signal segment such as a voiced onset or rapidly evolving voiced signal. These frames typically require a general purpose coder and high bit rate for sustaining good subjective quality. The disclosed gain quantization technique has been developed and optimized for stable voiced and general-purpose frames. However, it can be easily extended for any other signal class.

In the following, the classification of unvoiced and voiced signal frames will be described.

The unvoiced parts of the sound signal are characterized by missing periodic component and can be further divided into unstable frames, where energy and spectrum change rapidly, and stable frames where these characteristics remain relatively stable. The classification of unvoiced frames uses the following parameters:.

The normalized correlation, used to determine the voicing measure, is computed as part of the open-loop pitch analysis. In the art of CELP coding, the open-loop search module usually outputs two estimates per frame. Here, it is also used to output the normalized correlation measures. These normalized correlations are computed on a weighted signal and a past weighted signal at the open-loop pitch delay. The weighted speech signal sw(n) is computed using a perceptual weighting filter. For example, a perceptual weighting filter with fixed denominator, suited for wideband signals, is used. An example of a transfer function of the perceptual weighting filter is given by the following relation: <MAT> where A(z) is a transfer function of linear prediction (LP) filter computed by means of the Levinson-Durbin algorithm and is given by the following relation <MAT>.

LP analysis and open-loop pitch analysis are well known in the art of CELP coding and, accordingly, will not be further described in the present description.

The voicing measure rx is defined as an average normalized correlation given by the following relation: <MAT> where Cnorm(d<NUM>), Cnorm(d<NUM>) and Cnorm(d<NUM>) are, respectively, the normalized correlation of the first half of the current frame, the normalized correlation of the second half of the current frame, and the normalized correlation of the look-ahead (the beginning of the next frame). The arguments to the correlations are the open-loop pitch lags.

The spectral tilt contains information about a frequency distribution of energy. The spectral tilt can be estimated in the frequency domain as a ratio between the energy concentrated in low frequencies and the energy concentrated in high frequencies. However, it can be also estimated in different ways such as a ratio between the two first autocorrelation coefficients of the signal.

The energy in high frequencies and low frequencies is computed following the perceptual critical bands as described in [<NPL>]. The energy in high frequencies is calculated as the average energy of the last two critical bands using the following relation: <MAT> where ECB(i) is the critical band energy of ith band and bmax is the last critical band. The energy in low frequencies is computed as average energy of the first <NUM> critical bands using the following relation: <MAT> where bmin is the first critical band.

The middle critical bands are excluded from the calculation as they do not tend to improve the discrimination between frames with high energy concentration in low frequencies (generally voiced) and with high energy concentration in high frequencies (generally unvoiced). In between, the energy content is not characteristic for any of the classes discussed further and increases the decision confusion.

The spectral tilt is given by <MAT> where Nh and Nl are, respectively, the average noise energies in the last two critical bands and first <NUM> critical bands, computed in the same way as Eh and El. The estimated noise energies have been added to the tilt computation to account for the presence of background noise. The spectral tilt computation is performed twice per frame and average spectral tilt is calculated which is then used in unvoiced frame classification. That is <MAT> where eold is the spectral tilt in the second half of the previous frame.

The maximum short-time energy increase at low level dE<NUM> is evaluated on the input sound signal s(n), where n=<NUM> corresponds to the first sample of the current frame. Signal energy is evaluated twice per sub-frame. Assuming for example the scenario of four sub-frames per frame, the energy is calculated <NUM> times per frame. If the total frame length is, for example, <NUM> samples, each of these short segments may have <NUM> samples. In the calculation, short-term energies of the last <NUM> samples from the previous frame and the first <NUM> samples from the next frame are also taken into consideration. The short-time energies are calculated using the following relations: <MAT> where j=-<NUM> and j=<NUM> correspond to the end of the previous frame and the beginning of the next frame, respectively. Another set of nine short-term energies is calculated by shifting the signal indices in the previous equation by <NUM> samples using the following relation: <MAT>.

For energies that are sufficiently low, i.e. which fulfill the condition <MAT>, the following ratio is calculated <MAT> for the first set of energies and the same calculation is repeated for <MAT> with j=<NUM>,. ,<NUM> to obtain two sets of ratios rat(<NUM>) and rat(<NUM>). The only maximum in these two sets is searched by <MAT> which is the maximum short-time energy increase at low level.

This parameter dE is similar to the maximum short-time energy increase at low level with the difference that the low-level condition is not applied. Thus, the parameter is computed as the maximum of the following four values: <MAT> <MAT> <MAT> <MAT>.

The classification of unvoiced signal frames is based on the parameters described above, namely: the voicing measure rx, the average spectral tilt et , the maximum short-time energy increase at low level dE<NUM> and the maximum short-time energy variation dE. The algorithm is further supported by the tonal stability parameter, the SAD flag and the relative frame energy calculated during the noise energy update phase. For more detailed information about these parameters, see for example [<NPL>].

The relative frame energy is given by <MAT> where Et is the total frame energy (in dB) and Ef is the long-term average frame energy, updated during each active frame by Ef =<NUM>Ef- <NUM>Et.

The rules for unvoiced classification of wideband signals are summarized below.

The first line of this condition is related to low-energy signals and signals with low correlation concentrating their energy in high frequencies. The second line covers voiced offsets, the third line covers explosive signal segments and the fourth line is related to voiced onsets. The last line discriminates music signals that would be otherwise declared as unvoiced.

If the combined conditions are fulfilled the classification ends by declaring the current frame as unvoiced.

If a frame is not classified as inactive frame or as unvoiced frame then it is tested if it is a stable voiced frame. The decision rule is based on the normalized correlation rx in each sub-frame (with <NUM>/<NUM> subsample resolution), the average spectral tilt et and open-loop pitch estimates in all sub-frames (with <NUM>/<NUM> subsample resolution).

The open-loop pitch estimation procedure calculates three open-loop pitch lags: d<NUM>, d<NUM> and d<NUM>, corresponding to the first half-frame, the second half-frame and the look-ahead (first half-frame of the following frame). In order to obtain a precise pitch information in all four sub-frames, <NUM>/<NUM> sample resolution fractional pitch refinement is calculated. This refinement is calculated on a perceptually weighted input signal swd(n) (for example the input sound signal s(n) filtered through the above described perceptual weighting filter). At the beginning of each sub-frame a short correlation analysis (<NUM> samples) with resolution of <NUM> sample is performed in the interval (-<NUM>,+<NUM>) using the following delays: d<NUM> for the first and second sub-frames and d<NUM> for the third and fourth sub-frames. The correlations are then interpolated around their maxima at the fractional positions dmax - <NUM>/<NUM>, dmax - <NUM>/<NUM>, dmax - <NUM>/<NUM>, dmax , dmax + <NUM>/<NUM>, dmax + <NUM>/<NUM>, dmax + <NUM>/<NUM>. The value yielding the maximum correlation is chosen as the refined pitch lag.

Let the refined open-loop pitch lags in all four sub-frames be denoted as T(<NUM>), T(<NUM>), T(<NUM>) and T(<NUM>) and their corresponding normalized correlations as C(<NUM>), C(<NUM>), C(<NUM>) and C(<NUM>). Then, the voiced signal classification condition is given by.

The above voiced signal classification condition indicates that the normalized correlation must be sufficiently high in all sub-frames, the pitch estimates must not diverge throughout the frame and the energy must be concentrated in low frequencies. If this condition is fulfilled the classification ends by declaring the current frame as voiced. Otherwise the current frame is declared as generic.

Claim 1:
A device for producing a quantized value of a gain of a fixed contribution of an excitation in a frame, including sub-frames, of a coded sound signal, comprising:
an input for a parameter representative of a classification of the frame;
an estimator for producing an estimated gain of the fixed contribution of the excitation in a sub-frame of said frame; and
a predictive quantizer for quantizing the gain of the fixed contribution of the excitation, in the sub-frame, using the estimated gain;
characterised in that
the estimator is configured to calculate a linear estimation of the gain of the fixed contribution of the excitation in logarithmic domain using the parameter representative of the classification of the frame and without requiring information from a previous frame.