METHODS FOR SPEECH QUANTIZATION AND ERROR CORRECTION

Abstract: The redundancy contained within the spectral amplitudes is reduced, and as a result the quantization of the spectral amplitudes is improved. The prediction of the spectral amplitudes of the current segment from the spectral amplitudes of the previous is adjusted to account for any change in the fundamental frequency between the two segments. The spectral amplitudes prediction residuals are divided into a fixed number of blocks each containing approximately the same number of elements. A prediction residual block average (PRBA) vector is formed; each element of the PRBA is equal to the average of the prediction residuals within one of the blocks. The PRBA vector is vector quantized, or it is transformed with a Discrete Cosine Transform (DCT) and scalar quantized. The perceived effect of bit errors is reduced by smoothing the voiced/unvoiced decisions. An estimate of the error rate is made by locally averaging the number of correctable bit errors within each segment. If the estimate of the error rate is greater than a threshold, then high energy spectral amplitudes are declared voiced.

Description: Methods for Speech Quantization and Error Correction This invention relates to methods for quantizing speech and for preserving the quality of speech during the presence of bit errors. Relevant publications include: J. L. Flanagan, Speech Analysis, Synthesis and Per- ception, Springer- Verlag, 1972, pp. 378-386, (discusses phase vocoder - frequency- based speech analysis-synthesis system); Quatieri, et al., "Speech Transformations Based on a Sinusoidal Representation", IEEE TASSP, Vol, ASSP34, No. 6, Dec. 1986, pp. 1449-1986, (discusses analysis-synthesis technique based on a sinusoidal represen- tation); Griffin, "Multiband Excitation Vocoder", Ph.D. Thesis, M.I.T, 1987, (dis¬ cusses an 8000 bps Multi-Band Excitation speech coder); Griffin, et al, "A High Qual¬ ity 9.6 kbps Speech Coding System", Proc. ICASSP 86, pp. 125-128, Tokyo, Japan, April 13-20, 1986, (discusses a 9600 bps Multi-Band Excitation speech coder); Griffin, et al., "A New Model-Based Speech Analysis/Synthesis System", Proc. ICASSP 85. pp. 513-516. Tampa. FL., March 26-29. 19S5, (discusses Multi-Band Excitation speech model); Hardwick, "A 4.8 kbps Multi-Band Excitation Speech Coder", S.M. Thesis, M.I.T, May 1988, (discusses a 4800 bps Multi-Band Excitation speech coder); McAulay et al., "Mid- Rate Coding Based on a Sinusoidal Representation of Speech", Proc. ICASSP 85, pp. 945-948, Tampa, FL., March 26-29, 1985, (discusses speech coding based on a sinusoidal representation); Campbell et al., "The New 4800 bps Voice Coding Standard", Mil Speech Tech Conference, Nov. 1989, (discusses er¬ ror correction in low rate speech coders); Campbell et al., "CELP Coding for Land Mobile Radio Applications", Proc. ICASSP 90, pp. 465-468, Albequerque, NM. April 3-6, 1990, (discusses error correction in low rate speech coders); Levesque et al., Error-Control Techniques for Digital Communication, Wiley, 1985, pp. 157-170, (discusses error correction in general); Jayant et al., Digital Coding of Waveforms, Prentice-Hall, 1984 (discusses quantization in general); Makhoul, et.al. "Vector Quantization in Speech Coding", Proc. IEEE, 1985, pp. 1551-1588 (discusses vector quantization in general); Jayant et al., "Adaptive Postfiltering of 16 kb/s-ADPCM Speech", Proc. ICASSP 86, pp. 829-832, Tokyo, Japan, April 13-20, 1986, (discusses adaptive postfiltering of speech). The contents of these publications axe incorporated herein by reference. The problem of speech coding (compressing speech into a small number of bits) has a large number of applications, and as a result has received considerable attention in the literature. One class of speech coders (vocoders) which have been extensively studied and used in practice is based on an underlying model of speech. Examples from this class of vocoders include linear prediction vocoders, homomorphic vocoders, and channel vocoders. In these vocoders, speech is modeled on a short-time basis as the response of a linear system excited by a periodic impulse train for voiced sounds or random noise for unvoiced sounds. For this class of vocoders, speech is analyzed by first segmenting speech using a window such as a Hamming window. Then, for each segment of speech, the excitation parameters and system parameters are estimated and quantized. The excitation parameters consist of the voiced/unvoiced decision ahd the pitch period. The system parameters consist of the spectral envelope or the impulse response of the system. In order to reconstruct speech, the quantized exci¬ tation parameters are used to synthesize an excitation signal consisting of a periodic impulse train in voiced regions or random noise in unvoiced regions. This excitation signal is then filtered using the quantized system parameters. Even though vocoders based on this underlying speech model have been quite successful in producing intelligible speech, they have not been successful in producing high-quality speech. As a consequence, they have not been widely used for high- quality speech coding. The poor quality of the reconstructed speech is in part due to the inaccurate estimation of the model parameters and in part due to limitations in the speech model. A new speech model, referred to as the Multi-Band Excitation (MBE) speech model, was developed by Griffin and Lim in 1984. Speech coders based on this new speech model were developed by Griffin and Lim in 1986, and they were shown to be capable of producing high quality speech at rates above 8000 bps (bits per second). Subsequent work by Hardwick and Lim produced a 4800 bps MBE speech coder which was also capable of producing high quality speech. This 4800 bps speech coder used more sophisticated quantization techniques to achieve similar quality at 4800 bps that earlier MBE speech coders had achieved at 8000 bps. The 4800 bps MBE speech coder used a MBE analysis/synthesis system to esti¬ mate the MBE speech model parameters and to synthesize speech from the estimated MBE speech model parameters. A discrete speech signal, denoted by s(n), is obtained by sampling an analog speech signal. This is typically done at an 8 kHz. sampling rate, although other sampling rates can easily be accommodated through a straight¬ forward change in the various system parameters. The system divides the discrete speech signal into small overlapping segments or segments by multiplying s(n) with a window w(n) (such as a Hamming window or a Kaiser window) to obtain a windowed signal s w (n). Each speech segment is then analyzed to obtain a set of MBE speech model parameters which characterize that segment. The MBE speech model param¬ eters consist of a fundamental frequency, which is equivalent to the pitch period, a set of voiced/unvoiced decisions, a set of spectral amplitudes, and optionally a set of spectral phases. These model parameters are then quantized using a fixed number of bits for each segment. The resulting bits can then be used to reconstruct the speech signal, by first reconstructing the MBE model parameters from the bits and then synthesizing the speech from the model parameters. A block diagram of a typical MBE speech coder is shown in Figure 1. The 4800 bps MBE speech coder required the use of a sophisticated technique to quantize the spectral amplitudes. For each speech segment the number of bits which could be used to quantize the spectral amplitudes varied between 50 and 125 bits. In addition the number of spectral amplitudes for each segment varies between 9 and 60. A quantization method was devised which could efficiently represent all of the spectral amplitudes with the number of bits available for each segment. Although this spectral amplitude quantization method was designed for use in an MBE speech coder the quantization techniques axe equally useful in a number of different speech coding methods, such as the Sinusoidal Transform Coder and the Harmonic Coder . For a particular speech segment, L denotes the number of spectral amplitudes in that segment. The value of L is derived from the fundamental frequency, ώ 0 , according to the relationship, where 0 < β < 1.0 determines the speech bandwidth relative to half the sampling rate. The function [xj, referred to in Equation (1), is equal to the largest integer less than or equal to x. The L spectral amplitudes are denoted by Mi for 1 < < L, where Λf x is the lowest frequency spectral amplitude and Mi is the highest frequency spectral amplitude. The spectral amplitudes for the current speech segment are quantized by first calculating a set of prediction residuals which indicate the amount the spectral am¬ plitudes have changed between the current speech segment and the previous speech segment. If L° denotes the number of spectral amplitudes in the current speech segment and L~ x denotes the number of spectral amplitudes in the previous speech segment, then the prediction residuals, T / for 1 < / < Lr axe given by, . f log 2 ώ? - 7 - Mf 1 if < - - 1 log 2 M° — 7 • Mi_ j _ otherwise where Mf denotes the spectral amplitudes of the current speech segment and Mf l denotes the quantized spectral amplitudes of the previous speech segment. The con¬ stant 7 is typically equal to .7, however any value in the range 0 < 7 < 1 can be used. The prediction residuals are divided into blocks of K elements, where the value of K is typically in the range 4 < K < 12. If L is not evenly divisible by K, then the highest frequency block will contain less than K elements. This is shown in Figure 2 for L = 34 and K = 8. Each of the prediction residual blocks is then transformed using a Discrete Cosine Transform (DCT) defined by, The length of the transform for each block, J, is equal to the number of elements in the block. Therefore, all but the highest frequency block are transformed with a DCT of length A', while the length of the DCT for the highest frequency block is less than or equal to K. Since the DCT is an invertible transform, the L DCT coefficients completely specify the spectral amplitude prediction residuals for the current segment. The total number of bits available for quantizing the spectral amplitudes is divided among the DCT coefficients according to a bit allocation rule. This rule attempts to give more bits to the perceptually more important low-frequency blocks, than to the perceptually less important high-frequency blocks. In addition the bit allocation rule divides the bits within a block to the DCT coefficients according to their relative long-term variances. This approach matches the bit allocation with the perceptual characteristics of speech and with the quantization properties of the DCT. Each DCT coefficient is quantized using the number of bits specified by the bit allocation rule. Typically, uniform quantization is used, however non-uniform or vector quantization can also be used. The step size for each quantizer is determined from the long-term variance of the DCT coefficients and from the number of bits used to quantize each coefficient. Table 1 shows the typical variation in the step size as a function of the number of bits, for a long-term variance equal to σ 2 . Once each DCT coefficient has been quantized using the number of bits specified by the bit allocation rule, the binary representation can be transmitted, stored, etc., Table 1: Step Size of Uniform Quantizers depending on the application. The spectral amplitudes can be reconstructed from the binary representation by first reconstructing the quantized DCT coefficients for each block, performing the inverse DCT on each block, and then combining with the quantized spectral amplitudes of the previous segment using the inverse of Equation (2). The inverse DCT is given by, where the length, J, for each block is chosen to be the number of elements in that block, a(j) is given by, One potential problem with the 4800 bps MBE speech coder is that the perceived quality of the reconstructed speech may be significantly reduced if bit errors are added to the binary representation of the MBE model parameters. Since bit errors exist in many speech coder applications, a robust speech coder must be able to correct, detect and/or tolerate bit errors. One technique which has been found to be very successful is to use error correction codes in the binary representation of the model parameters. Error correction codes allow infrequent bit errors to be corrected, and they allow the system to estimate the error rate. The estimate of the error rate can then be used to adaptively process the model parameters to reduce the effect of any remaining bit errors. Typically, the error rate is estimated by counting the number of errors corrected (or detected) by the error correction codes in the current segment, and then using this information to update the current estimate of error rate. For example if each segment contains a (23,12) Golay code which can correct three errors out of the 23 bits, and ej denotes the number of errors (0-3) which were corrected in the current segment, then the current estimate of the error rate, e / -*, is updated according to: where β is a constant in the range 0 < β < 1 which controls the adaptability of e / j. When error correction codes or error detection codes are used, the bits representing the speech model parameters are converted to another set of bits which are more robust to bit errors. The use of error correction or detection codes typically increases the number of bits which must be transmitted or stored. The number of extra bits which must be transmitted is usually related to the robustness of the error correction or detection code. In most applications, it is desirable to minimize the total number of bits which are transmitted or stored. In this case the error correction or detection codes must be selected to maximize the overall system performance. Another problem in this class of speech coding systems is that limitations in the estimation of the speech model parameters may cause quality degradation in the synthesized speech. Subsequent quantization of the model parameters induces further degradation. This degradation can take the form of reverberant or muffled quality to the synthesized speech. In addition background noise or other artifacts may be present which did not exist in the orignal speech. This form of degradation occurs even if no bit errors are present in the speech data, however bit errors can make this problem worse. Typically speech coding systems attempt to optimize the parameter estimators and parameter quantizers to minimize this form of degradation. Other systems attempt to reduce the degradations by post-filtering. In post-filtering the output speech is filtered in the time domain with an adaptive all-pole filter to shaxpen the format peaks. This method does not allow fine control over the spectral enhancement process and it is computationally expensive and inefficient for frequency domain speech coders. The invention described herein applies to many different speech coding methods, which include but are not limited to linear predictive speech coders, channel vocoders, homomorphic vocoders, sinusoidal transform coders, multi-band excitation speech coders and improved multiband excitation (IMBE) speech coders. For the purpose of describing this invention in detail, we use the 6.4 kbps IMBE speech coder which has recently been standardized as part of the INMARSAT-M (International Marine Satellite Organization) satellite communication system. This coder uses a robust speech model which is referred to as the Multi-Band Excitation (MBE) speech model. Efficient methods for quantizing the MBE model parameters have been developed. These methods are capable of quantizing the model parameters at virtually any bit rate above 2 kbps. The 6.4 kbps IMBE speech coder used in the INMARSAT-M satellite communication system uses a 50 Hz frame rate. Therefore 128 bits are available per frame. Of these 128 bits, 45 bits are reserved for forward error correction. The remaining 83 bits per frame are used to quantize the MBE model parameters, which consist.of a fundamental frequency ώo, a set of V/UV decisions ϋ k for 1 < k < iv , and a set of spectral amplitudes Mj f or 1 < / < L. The values of K and L vary depending on the fundamental frequency of each frame. The 83 available bits are Table 2: Bit Allocation Among Model Parameters divided among the model parameters as shown in Table 2. The fundamental frequency is quantized by first converting it to its equivalent pitch period using Equation (7). A 2τr The value of P 0 is typically restricted to the range 20 < o ≤ 120 assuming an 8 kHz sampling rate. In the 6.4 kbps IMBE system this parameter is uniformly quantized using 8 bits and a step size of .5. This corresponds to a pitch accuracy of one half sample. The K V/UV decisions are binary values. Therefore they can be encoded using a single bit per decision. The 6.4 kbps system uses a maximum of 12 decisions, and the width of each frequency band is equal to 3ώo. The width of the highest frequency band is adjusted to include frequencies up to 3.8 kHz. The spectral amplitudes are quantized by forming a set of prediction residuals. Each prediction residual is the difference between the logarithm of the spectral ampli¬ tude for the current frame and the logarithm of the spectral amplitude representing the same frequency in the previous speech frame. The spectral amplitude prediction residuals are then divided into six blocks each containing approximately the same number of prediction residuals. Each of the six blocks is then transformed with a Discrete Cosine Transform (DCT) and the D.C. coefficients from each of the six blocks are combined into a 6 element Prediction Residual Block Average (PRBA) vector. The mean is subtracted from the PRBA vector and quantized using a 6 bit non-uniform quantizer. The zero-mean PRBA vector is then vector quantized using a 10 bit vector quantizer. The 10 bit PRBA codebook was designed using a k-means clustering algorithm on a large training set consisting of zero-mean PRBA vectors from a variety of speech material. The higher-order DCT coefficients which are not included in the PRBA vector are quantized with scalar uniform quantizers using the 59 — K remaining bits. The bit allocation and quantizer step sizes are based upon the long-term variances of the higher order DCT coefficients. There are several advantages to this quantization method. First, it provides very good fidelity using a small number of bits and it maintains this fidelity as L varies over its range. In addition the computational requirements of this approach are well within the limits required for real-time implementation using a single DSP such as the AT&T DSP32C. Finally this quantization method separates the spectral amplitudes into a few components, such as the mean of the PRBA vector, which are sensitive to bit errors, and a large number of other components which are not very sensitive to bit errors. Forward error correction can then be used in an efficient manner by providing a high degree of protection for the few sensitive components and a lesser degree of protection for the remaining components. This is discussed in the next section. In a first aspect, the invention features an improved method for forming the pre- dieted spectral amphtudes. They axe based on interpolating the spectral amphtudes of a previous segment to estimate the spectral amphtudes in the previous segment at the frequencies of the current segment. This new method corrects for shifts in the frequencies of the spectral amphtudes between segments, with the result that the prediction residuals have a lower variance, and therefore can be quantized with less distortion for a given number of bits. In preferred embodiments, the frequencies of the spectral amplitudes axe the fundamental frequency and multiples thereof. In a second aspect, the invention features an improved method for dividing the prediction residuals into blocks. Instead of fixing the length of each block and then dividing the prediction residuals into a variable number of blocks, the prediction residuals are divided into a predetermined number of blocks and the size of the blocks varies from segment to segment. In preferred embodiments, six (6) blocks are used in all segments; the number of prediction residuals in a lower frequency block is not larger that the number of prediction residuals in a higher frequency block; the difference between the number of elements in the highest frqeuency block and the number of elements in the lowest frequency block is less than or equal to one. This new method more closely matches the characteristics of speech, and therefore it allows the prediction residuals to be quantized with less distortion for a given number of bits. In addition it can easily be used with vector quantization to further improve the quantization of the spectral amplitudes. In a third aspect, the invention features an improved method for quantizing the prediction residuals. The prediction residuals are grouped into blocks, the average of the prediction residuals within each block is determined, the averages of all of the blocks are grouped into a prediction residual block average (PRBA) vector, and the PRBA vector is encoded. In preferred embodiments, the average of the prediction residuals is obtained by adding the spectral amplitude prediction residuals within the block and dividing by the number of prediction residuals within that block, or by computing the DCT of the spectral amplitude prediction residuals within a block and using the first coefficient of the DCT as the average. The PRBA vector is preferably encoded using one of two methods: (1) performing a transform such as the DCT on the PRBA vector and scalar quantizing the transform coefficients; (2) vector quantizing the PRBA vector. Vector quantization is preferably performed by determining the average of the PRBA vector, quantizing said average using scalar quantization, and quantizing the zero-mean PRBA vector using vector quantization with a zero-mean code-book. An advantage of this aspect of the invention is that it allows the prediction residuals to be quantized with less distortion for a given number of bits. In a fourth aspect, the invention features an improved method for determining the voiced/unvoiced decisions in the presence of a high bit error rate. The bit error rate is estimated for a current speech segment and compared to a predetermined error-rate threshold, and the voiced/unvoiced decisions for spectral amphtudes above a predetermined energy threshold are all declared voiced for the current segment when the estimated bit error rate is above the error-rate threshold. This reduces the perceptual effect of bit errors. Distortions caused by switching from voiced to unvoiced are reduced. In a fifth aspect, the invention features an improved method for error correction (or error detection) coding of the speech model parameters. The new method uses at least two types of error correction coding to code the quantized model parameters. A first type of coding, which adds a greater number of additional bits than a second type of coding, is used for a group of parameters that is more sensitive to bit errors. The other type of error correction coding is used for a second group of parameters that is less sensitive to bit errors than the first. Compared to existing methods, the new method improves the quality of the synthesized speech in the presence of bit errors while reducing the amount of additional error correction or detection bits which must be added. In preferred embodiments, the different types of error correction include Golay codes and Hamming codes. In a sixth aspect, the invention features a further method for improving the quality of synthesized speech in the presence of bit errors. The error rate is estimated from the error correction coding, and one or more model parameters from a previous segment are repeated ϊir a current segment when the error rate for the parameters exceeds a predetermined level. In preferred embodiments, all of the model parameters are repeated. In a seventh aspect, the invention features a new method for reducing the degra¬ dation caused by the estimation and quantization of the model parameters. This new method uses a frequency domain representation of the spectral envelope parameters to enhance regions of the spectrum which are perceptually important and to atten- uate regions of the spectrum which axe perceptually insignificant. The result is that degradaion in the synthesized speech is reduced. A smoothed spectral envelope of the segment is generated by smoothing the spectral envelope, and an enhanced spectral envelope is generated by increasing some frequency regions of the spectral envelope for which the spectral envelope has greater amplitude than the smoothed envelope and decreasing some frequency regions for which the spectral envelope has lesser amphtude than the smoothed envelope. In preferred embodiments, the smoothed spectral enve¬ lope is generated by estimating a low-order model (e.g. an all-pole model) from the spectral envelope. Compared to existing methods this new method is more compu¬ tationally efficient for frequency domain speech coders. In addition this new method improves speech quality by removing the frequency domain constraints imposed by time-domain methods. Other features and advantages of the invention will be apparent from the following description of preferred embodiments and from the claims. Brief Description of the Drawings Figures 1-2 are diagrams showing prior art speech coding methods. Figure 3 is a flow chart showing a preferred embodiment of the invention in which the spectral amplitude prediction accounts for any change in the fundamental fre¬ quency Figure 4 is a flow chart showing a preferred embodiment of the invention in which the spectral amplitudes are divided into a fixed number of blocks Figure 5 is a flow chart showing a preferred embodiment of the invention in which a prediction residual block average vector is formed. Figure 6 is a flow chart showing a preferred embodiment of the invention in which the prediction residual block average vector is vector quantized Figure 7 is a flow chart showing a preferred embodiment of the invention in which the prediction residual block average vector is quantized with a DCT and scalar quantization. Figure 8 is a flow chart showing a preferred embodiment of the invention encoder in which different error correction codes are used for different model parameter bits. Figure 9 is a flow chart showing a preferred embodiment of the invention decoder in which different error correction codes are used for different model parameter bits. Figure 10 is a flow chart showing a preferred embodiment of the invention in which frequency domain spectral envelope parameter enhancement is depicted. Description of Preferred Embodiments of the Invention In the prior art, the spectral amphtude prediction residuals were formed using Equation (2). This method does not account for any change in the fundamental frequency between the previous segment and current segment. In order to account for the change in the fundamental frequency a new method has been developed which first interpolates the spectral amplitudes of the previous segment. This is typically done using linear interpolation, however various other forms of interpolation could also be used. Then the interpolated spectral amphtudes of the previous segment are resampled at the frequency points corresponding to the multiples of the fundamental frequency of the current segment. This combination of interpolation and resampling produces a set of predicted spectral amphtudes, which have been corrected for any inter-segment change in the fundamental frequency. Typically a fraction of the base two logarithm of the predicted spectral amphtudes is subtracted from the base two logarithm of the spectral amphtudes of the current segment. If linear interpolation is used to compute the predicted spectral amplitudes, then this can be expressed mathematically as: t, = log 2 Mf - 7 [(1 - δ,) log 2 M fe - J + δ, log 2 ^] (8) where δι is given by, where 7 is a constant subject to 0 < 7 < 1. Typically, 7 = .7, however other values of 7 can also be used. For example 7 could be adaptively changed from segment to segment in order to improve performance. The parameters ώ° and ώo -1 in Equation (9) refer to the fundamental frequency of the current segment and the previous segment, respectively. In the case where the two fundamental frequencies are the same, the new method is identical to the old method. In other cases the new method produces a prediction residual with lower variance than the old method. This allows the prediction residuals to be quantized with less distortion for a given number of bits. In another aspect of the invention a new method has been developed to divide the spectral amplitude prediction residuals into blocks. In the old method the L prediction residuals from the current segment were divided into blocks of K elements, where K = 8 is a typical value. Using this method, the characteristics of each block were found to be significantly different for large and small values of L. This reduced the quantization efficiency, thereby increasing the distortion in the spectral amphtudes. In order to make the characteristics of each block more uniform, a new method was divised which divides the L prediction residuals into a fixed number of blocks. The length of each block is chosen such that all blocks within a segment have nearly the same length, and the sum of the lengths of all the blocks within a segment equal. L. Typically the total number of prediction residuals is divided into 6 blocks, where the length of each block is equal to [ J • If £ is not evenly divisible by 6 then the length of one or more higher frequency blocks is increased by one, such that all of the spectral magnitudes are included in one of the six blocks. This new method is shown in Figure 4 for the case where 6 blocks are used and L = 34. In this new method the approximate percentage of the prediction residuals contained in each block is independent of L. This reduces the variation in the characteristics of each block, and it allows more efficient quantization of the prediction residuals. The quantization of the prediction residuals can be further improved by forming a prediction residual block average (PRBA) vector. The length of the PRBA vector is equal to the number of blocks in the current segment. The elements of this vector correspond to the average of the prediction residuals within each block. Since the first DCT coefficient is equal to the average (or D.C. value), the PRBA vector can be formed from the first DCT coefficient from each block. This is shown in Figure 5 for the case where 6 blocks axe present in the current segment and L * ■ * **• 34. This process can be generalized by forming additional vectors from the second (or third, fourth, etc.) DCT coefficient from each block. The elements of the PRBA vector are highly correlated. Therefore a number of methods can be used to improve the quantization of the spectral amphtudes. One method which can be used to achieve very low distortion with a small number of bits is vector quantization. In this method a codebook is designed which contains a number of typical PRBA vectors. The PRBA vector for the current segment is compared against each of the codebook vectors, and the one with the lowest error is chosen as the quantized PRBA vector. The codebook index of the chosen vector is used to form the binaxy representation of the PRBA vector. A method for performing vector quantization of the PRBA vector has been developed which uses the cascade of a 6 bit non-uniform quantizer for the mean of the vector, and a 10 bit vector quantizer for the remaining information. This method is shown in Figure 6 for the case where the PRBA vector always contains 6 elements. Typical values for the 6 bit and 10 bit quantizers are given in the attached appendix. An alternative method for quantizing the PRBA vector has also been developed. This method requires less computation and storage than the vector quantization method. In this method the PRBA vector is first transformed with a DCT as defined in Equation (3). The length of the DCT is equal to the number of elements in the PRBA vector. The DCT coefficients are then quantized in a manner similar to that discussed in the prior art. First a bit allocation rule is used to distribute the total number of bits used to quantize the PRBA vector among the DCT coefficients. Scalar quantization (either uniform or non-uniform) is then used to quantize each DCT coefficient using the number of bits specified by the bit allocation rule. This is shown in Figure 7 for the case where the PRBA vector always contains 6 elements. Various other methods can be used to efficiently quantize the PRBA vector. For example other transforms such as the Discrete Fourier Transform, the Fast Fourier Transform, the Karhunen-Louve Transform could be used instead of the DCT. In addition vector quantization can be combined with the DCT or other transform. The improvements derived from this aspect of the invention can be used with a wide variety of quantization methods. In another aspect a new method for reducing the perceptual effect of bit errors has been developed. Error correction codes are used as in the prior art to correct infrequent bit errors and to provide an estimate of the error rate CR * The new method uses the estimate of the error rate to smooth the voiced/unvoiced decisions, in order to reduce the perceived effect of any remaining bit errors. This is done by first comparing the error rate against a threshold which signifies the rate at which the distortion from uncorrected bit errors in the voiced/unvoiced decisions is significant. The exact value of this threshold depends on the amount of error correction applied to the voiced/unvoiced decisions, but a threshold value of .003 is typical if little error correction has been apphed. If the estimated error rate, CR, is below this threshold then the voiced/unvoiced decisions are not perturbed. If CR is above this threshold then every spectral amphtude for which Equation (10) is satisfied is declared voiced. Mi > < f * -003 < e R < .02 (10) Although Equation (10) assumes a threshold value of .003, this method can easily be modified to accommodate other thresholds. The parameter SE is a measure of the local average energy contained in the spectral amphtudes. This parameter is typically updated each segment according to: - .95 S E + -05 Re if .95 S E + .05Ro < 10000.0 (11) 10000.0 otherwise where o is given by, Ro = ∑M? (12) 1=1 The initial value of SE is set to an arbitrary initial value in the range 0 < SE < 10000.0. The purpose of this parameter is to reduce the dependency of Equation (10 • on the average signal level. This ensures that the new method works as well for low- level signals as it does for high level signals. The specific forms of Equations (10), (11) and (12) and the constants contained within them can easily be modified, while maintaining the essential components of the new method. The main components of this new method are to first use an estimate of the error rate to determine whether the voiced/unvoiced decisions need to be smoothed. Then if smoothing is required, the voiced/unvoiced decisions are perturbed such that all high energy spectral amphtudes are declared voiced. This ehminates any high energy voiced to unvoiced or unvoiced to voiced transitions between segments, and as a result it improves the perceived quahty of the reconstructed speech in the presence of bit errors. In our invention we divide the quantized speech model parameter bits into three or iriore different groups according to their sensitivity to bit errors, and then we use different error correction or detection codes for each group. Typically the group of data bits which is determined to be most sensitive to bit errors is protected using very effective error correction codes. Less effective error correction or detection codes, which require fewer additional bits, are used to protect the less sensitive data bits. This new method allows the amount of error correction or detection given to each group to be matched to its sensitivity to bit errors. Compared to the prior art, this method has the advantage that the degradation caused by bit errors is reduced and the number of bits required for forward error correction is also reduced. The particular choice of error correction or detection codes which is used depends upon the bit error statistics of the transmission or storage medium and the desired bit rate. The most sensitive group of bits is typically protected with an effective error correction code such as a Hamming code, a BCH code, a Golay code or a Reed- Solomon code. Less sensitive groups of data bits may use these codes or an error detection code. Finally the least sensitive groups may use error correction or detection codes or they may not use any form of error correction or detection. The invention is described herein using a particular choice of error correction and detection codes which was well suited to a 6.4 kbps IMBE speech coder for satellite communications. In the 6.4 kbps IMBE speech coder, which was standardized for the INMARSAT- M satellite communciation system, the 45 bits per frame which are reserved for for- ward error correction are divided among [23,12] Golay codes which can correct up to 3 errors, [15,11] Hamming codes which can correct single errors and parity bits. The six most significant bits from the fundamental frequency and the three most signif¬ icant bits from the mean of the PRBA vector are first combined with three parity check bits and then encoded in a [23,12] Golay code. A second Golay code is used to encode the three most significant bits from the PRBA vector and the nine most sensitive bits from the higher order DCT coefficients. All of the remaining bits except the seven least sensitive bits are then encoded into five [15,11] Hamming codes. The seven least significant bits are not protected with error correction codes. Prior to transmission the 128 bits which represent a particular speech segment are interleaved such that at least five bits separate any two bits from the same code word. This feature spreads the effect of short burst errors over several different codewords, thereby increasing the probability that the errors can be corrected. At the decoder the received bits are passed through Golay and Hamming decoders which attempt to remove any bit errors from the data bits. The three parity check bits are checked and if no uncorrectable bit errors are detected then the received bits are used to reconstruct the MBE model parameters for the current frame. Otherwise if an uncorrectable bit error is detected then the received bits for the current frame are ignored and the model parameters from the previous frame are repeated for the current frame. The use of frame repeats has been found to improve the perceptual quality of the speech when bit errors axe present. The invention examines each frame of received bits and determines whether the current frame is likely to contain a large number of uncorrectable bit errors. One method used to detect uncorrectable bit errors is to check extra parity bits which are inserted in the data. The invention also determines whether a large burst of bits errors has been encountered by comparing the number of correctable bit errors with the local estimate of the error rate. If the number of correctable bit errors is substantially greater than the local estimate of the error rate then a frame repeat is performed. Additionally, the invention checks each frame for invalid bit sequences (i.e. groups of bits which the encoder never transmits). If an invalid bit sequence is detected a frame repeat is performed. The Golay and Hamming decoders also provide information on the number of correctable bit errors in the data. This information is used by the decoder to estimate the bit error rate. The estimate of the bit error rate is used to control adaptive smoothers which increase the perceived speech quality in the presence of uncorrectable bit errors. In addition the estimate of the error rate can be used to perform frame repeats in bad error environments. This aspect of the invention can be used with soft-decision coding to further improve performance. Soft-decision decoding uses additional information on the like- hhood of each bit being in error to improve the error correction and detection capabil¬ ities of many different codes. Since this additional information is often available from a demodulator in a digital communication system, it can provide improved robustness to bit errors without requiring additional bits for error protection. The invention uses a new frequency domain parameter enhancement method which improves the quality of synthesized speech. The invention first locates the percep¬ tually important regions of the speech spectrum. The invention then increases the amplitude of the perceptually important frequency regions relative to other frequency regions. The preferred method for performing frequency domain parameter enhance¬ ment is to smooth the spectral envelope to estimate the general shape of the spectrum. The spectrum can be smoothed by fitting a low-order model such as an all-pole model, a cepstral model, or a polynomial model to the spectral envelope. The smoothed spec¬ tral envelope is then compared against the unsmoothed spectral envelope and per¬ ceptually important spectral regions are identified as regions where the unsmoothed spectral envelope has greater energy than the smoothed spectral envelope. Similarly regions where the unsmoothed spectral envelope has less energy than the smoothed spectral envelope are identified as perceptually less important. Parameter enhance¬ ment is performed by increasing the amphtude of perceptually important frequency regions and decreasing the amphtude of perceptually less important frequency re¬ gions. This new enhancement method increases speech quality by eliminating or reducing many of the artifacts which are introduced during the estimation and quan¬ tization of the speech parameters. In addition this new method improves the speech intelligibility by sharpening the perceptually important speech formants. In the IMBE speech decoder a first-order all-pole model is fit to the spectral envelope for each frame. This is done by estimating the correlation parameters, _Ro and R x from the decoded model paxameters according to the following equations, Jk = ∑ώ? (13) /=ι L R^ ∑Mf cosiωo l) (14) 1=1 where Mi for 1 < / < L are the decoded spectral amplitudes for the current frame, and α?o is the decoded fundamental frequency for the current frame. The correlation parameters Rr, and R can be used to estimate a first-order all-pole model. This model is evaluated at the frequencies corresponding to the spectral amphtudes for the current frame (i.e. k • ώ 0 for 1 < < _ ) and used to generate a set of weights Wι according to the following formula. These weights indicate the ratio of the smoothed all-pole spectrum to the IMBE spectral amplitudes. They are then used to individually control the amount of pa- rameter enhancement which is apphed to each spectral amphtude. This relationship is expressed in the following equation, where Mi for 1 < < are the enhanced spectral amplitudes for the current frame. The enhanced spectral amplitudes are then used to perform speech synthesis. The use of the enhanced model parameters improves speech quahty relative to synthesis from the unenhanced model parameters. Further description of the preferred embodiment is given in the attached Ap- pendix. INMARSAT M Voice Codec ©Copyright, Digital Voice Systems Inc., 1991 Version 1.7 13 September 1991 Digital Voice Systems Inc. (DVSI, U.S.A.) claims certain rights in the Improved Multi- Band Excitation voice coding algorithm described in this document and elsewhere in the INMARSAT M System Definition Manual. DVSI is willing to grant a royalty-free license to use the IMBE voice coding algorithm strictly in connection with the INMARSAT M system on certain conditions of reciprocity. Details may be obtained from INMARSAT. This document may contain errors in the description of the IMBE voice coding algo¬ rithm. An attempt will be made to correct these errors in future updates of this document. DVSI acknowledges the Massachusetts Institute of Technology where the Multi-Band Excitation speech model was developed. In addition DVSI acknowledges the Rome Air Development Center of the United States Air Force which supported the real-time hardware used "in the IN MARS AT/ AUS SAT voice coding evaluation. Contents 1 Introduction β Multi-Band Excitation Speech Model 7 Speech Analysis 11 3.1 Pitch Estimation 13 3.1.1 Determination of E(P) 15 3.1.2 Pitch Tracking 15 3.1.3 Look-Back Pitch Tracking 16 3.1.4 Look-Ahead Pitch Tracking 17 3.1.5 Pitch Refinement 19 3.2 Voiced/Unvoiced Determination 21 3.3 Estimation of the Spectral Amphtudes . . 23 Parameter Encoding and Decoding 25 4.1 Fundamental Frequency Encoding and Decoding 25 4.2 Voiced/Unvoiced Decision Encoding and Decoding 27 4.3 Spectral Amphtudes Encoding 27 4-3.1 Encoding the PRBA Vector 31 4.3.2 Encoding the Higher Order DCT Coefficients 32 4.4 Spectral Amplitudes Decoding 34 4.4.1 Decoding the PRBA Vector 36 4.4.2 Decoding the Higher Order DCT Coefficients 37 4.4.3 Spectral Amplitude Enhancement 37 Forward Error Correction and Bit Interleaving 39 5.1 Error Correction Encoding • . 39 5.2 Bit Interleaving 42 5.3 Error Correction Decoding 42 5.4 Adaptive Smoothing 43 β Parameter Encoding Example 45 7 Speech Synthesis 51 7.1 Speech Synthesis Notation 51 7.2 Unvoiced Speech Synthesis 52 7.3 Voiced Speech Synthesis 54 8 Additional Notes 57 A Variable Initialization 58 B Initial Pitch Estimation Window 59 C Pitch Refinement Window 61 D FIR Low Pass Filter 63 E Mean Prediction Residual Quantizer Levels 64 F Prediction Residual Block Average Quantization Vectors 65 G Spectral Amplitude Bit Allocation 97 H Bit Frame Format 118 I Speech Synthesis Window 120 J Flow Charts 122 List of Figures 1 Improved Multi-Band Excitation Speech Coder 7 2 Comparison of Traditional and MBE Speech Models 9 3 IMBE Speech Analysis Algorithm 11 4 High Pass Filter Frequency Response at 8 kHz. Samphng Rate 12 5 Relationship between Speech frames 13 6 Window Alignment 14 7 Initial Pitch Estimation 16 8 Pitch Refinement 19 9 IMBE Voiced/Unvoiced Determination . 21 10 IMBE Frequency Band Structure 23 11 IMBE Spectral Amphtude Estimation 24 12 Fundamental Frequency Encoding and Decoding 27 13 V/UV Decision Encoding and Decoding 28 14 Encoding of the Spectral Amphtudes 28 15 Prediction Residual Blocks for L = 34 29 16 Formation of Prediction Residual Block Average Vector 30 17 Decoding of the Spectral Amphtudes 36 18 Error Correction Encoding 39 19 Format of ύo and CQ 41 20 Format of ύi and c \ . 41 21 IMBE Speech Synthesis 52 List of Tables 1 Bit Allocation Among Model Parameters 25 2 Eight Bit Binary Representation 26 3 Standard Deviation of PRBA Quantization Errors 33 4 Step Size of Uniform Quantizers 33 5 Standard Deviation of DCT Coefficients for 1 < i < 6 34 Division of Prediction Residuals into Blocks in Encoding Example 45 Quantizers for Qi in Encoding Example 46 Quantizers for C.j in Encoding Example 47 Construction of ύ,- in Encoding Example (1 of 3) 48 Construction of «,* in Encoding Example (2 of 3) 49 Construction of ύ,- in Encoding Example (3 of 3) 50 Breakdown of Algorithmic Delay 57 1 Introduction This document provides a complete functional description of the INMARSAT-M speech coding algorithm. This document describes the essential operations which are necessary and sufficient to implement this algorithm. It is recommended that implementations begin with a high-level language simulation of the algorithm, and then proceed to a real-time implementation using a floating point digital signal processor such as the AT&T DSP32C, Motorola 96002 or TI TMS320C30 [2]. In addition it is highly recommended that the references be studied prior to the implementation of this algorithm. The INMARSAT M speech coder is based upon the Improved Multi-Band Excitation (IMBE) speech coder [7]. This coder uses a new robust speech model which is referred to as the Multi-Band Excitation (MBE) speech model [5]. The basic methodology of the coder is to divide the speech signal into overlapping speech segments (or frames) using a window such as a Kaiser window. Each speech frame is then compared with the underlying speech model, and a set of model parameters are estimated for that particular frame. The encoder quantizes these model parameters and transmits a bit stream at 6.4 kbps. The decoder receives this bit stream, reconstructs the model parameters, and uses these model parameters to generate a synthetic speech signal. This synthesized speech signal is the output of the IMBE speech coder as shown in Figure 1. The IMBE speech coder is a model-based speech coder, or vocoder. This means that the IMBE speech coder does not try to reproduce the input speech signal on a sample by sample basis. Instead the IMBE speech coder constructs a synthetic speech signal which contains the same perceptual information as the original speech signal. Many previous vocoders (such as LPC vocoders, homomorphic vocoders, and channel vocoders) have not been successful in producing high quality synthetic speech. The IMBE speech coder has two primary advantages over these vocoders. First, the IMBE speech coder is based on the MBE speech model which is a more robust model than the traditional speech models used in previous vocoders. Second, the IMBE speech coder uses more sophisticated algorithms to estimate the speech model parameters, and to synthesize the speech signal from these model parameters. This document is organized as follows. In Section 2 the MBE speech model is briefly Transmitter Analysis Quantization and Encoding Speech : Speech Model • Bit Stream Parameters at 6.4 kbps Receiver Synthesis Decoding and Reconstruction «•-»- Synthesized Speech Model Bit Stream Speech Parameters at 6.4 kbps Figure 1: Improved Multi-Band Excitation Speech Coder discussed. Section 3 examines the methods used to estimate the speech model parameters, and Section 4 examines the quantization, encoding, decoding and reconstruction of the MBE model parameters. The error correction and the format of the 6.4 kbps bit stream is discussed in Section 5. This is followed by an example in Section 6, which demonstrates the encoding of a typical set of model parameters. Section 7 discusses the synthesis of speech from the MBE model parameters. A few additional comments on the algorithm and this document are provided in Section 8. The attached appendices provide necessary information such as the initialization for parameters. In addition Appendix J contains flow charts for some of the algorithms described in this document. 2 Multi-Band Excitation Speech Model Let s(n) denote a discrete speech signal obtained by samphng an analog speech signal. In order to focus attention on a short segment of speech over which the model parameters are assumed to be constant, a window w(n) is apphed to the speech signal s(n). The windowed speech signal *s w (n) is defined by The sequence s w (n) is referred to as a speech segment or a speech frame. The IMBE analysis algorithm actually uses two different windows, t_.jj(n) and «" / (n), each of which is apphed separately to the speech signal via Equation (1). This will be explained in more detail in Section 3 of this document. The speech signal s(n) is shifted in time to select any desired segment. For notational convenience s ω (n) refers to the current speech frame. The next speech frame is obtained by shifting s(n) by 20 s. A speech segment s w (n) is modelled as the response of a hnear filter ^(n) to some excitation signal e w (n). Therefore, S w (ω), the Fourier Transform of s w (n), can be expressed as S w (ω) = H w {ω)E w [ω) (2) where H w (ω) and E w (ω) are the Fourier Transforms of Λ„,(n) and e w (n), respectively. In traditional speech models speech is divided into two classes depending upon the nature of the excitation signal. For voiced speech the excitation signal is a periodic impulse sequence, where the distance between impulses is the pitch period o- For unvoiced speech the excitation signal is a white noise sequence. The primary differences among traditional vocoders are in the method in which they model the hnear filter Λ ω (n). The spectrum of this filter is generally referred to as the spectral envelope of the speech signal. In a LPC vocoder, for example, the spectral envelope is modelled with a low order all-pole model. Similarly, in a homomorphic vocoder, the spectral envelope is modelled with a small number of cepstral coefficients. The primary difference between traditional speech models and the MBE speech model is the excitation signal. In conventional speech models a single voiced/unvoiced (V/UV) decision is used for each speech segment. In contrast the MBE speech model divides the excitation spectrum into a number of non-overlapping frequency bands and makes a V/UV decision for each frequency band. This allows the excitation signal for a particular speech segment to be a mixture of periodic (voiced) energy and noise-like (unvoiced) energy. This added degree of freedom in the modelling of the excitation allows the MBE speech model Voiced Speech Unvoiced Speech Speech Spectrum Spectrum Spectrum f Traditional Speech MBE Speech Model Model (voiced) Figure 2: Comparison of Traditional and MBE Speech Models to generate higher quality speech than conventional speech models. In addition it allows the MBE speech model to be robust to the presence of background noise. In the MBE speech model the exaltation spectrum is obtained from the pitch period (or the fundamental frequency) and the V/UV decisions. A periodic spectrum is used in the frequency bands declared voiced, while a random noise spectrum is used in the frequency bands declared unvoiced. The periodic spectrum is generated from a windowed periodic impulse train which is completely determined by the window and the pitch period. The random noise spectrum is generated from a windowed random noise sequence. A comparison of a traditional speech model and the MBE speech model is shown in Figure 2. In this example the traditional model has classified the speech segment as voiced, and consequently the traditional speech model is comprised completely of periodic energy. The MBE model has divided the spectrum into 10 frequency bands in this example. The fourth, fifth, ninth and tenth bands have been declared unvoiced while the remaining bands have been declared voiced. The excitation in the MBE model is comprised of periodic energy only in the frequency bands declared voiced, while the remaining bands are comprised of noise-like energy. This example shows an important feature of the MBE speech model. Namely, the V/UV determination is performed such that frequency bands where the ratio of periodic energy to noise-Uke energy is high are declared voiced, while frequency bands where this ratio is low are declared unvoiced. The details of this procedure are discussed in Section 3.2. n) Discrete SpMC ■ Sigma! Mi l≤l≤ Figure 3: IMBE Speech Analysis Algorithm 3 Speech Analysis This section presents the methods used to estimate the MBE speech model parameters. To develop a high quality vocoder it is essential that robust and accurate algorithms are used to estimate the model parameters. The approach which is presented here differs from con¬ ventional approaches in a fundamental way. Typically algorithms for the estimation of the excitation parameters and algorithms for the estimation of the spectral envelope parameters operate independently. These parameters are usually estimated based on some reasonable but heuristic criterion without explicit consideration of how close the synthesized speech will be to the original speech. This can result in a synthetic spectrum quite different from the original spectrum. In the approach used in the IMBE speech coder the excitation and spec¬ tral envelope parameters are estimated simultaneously, so that the synthesized spectrum is closest in the least squares sense to the original speech spectrum. This approach can be viewed as an "analysis-by-synt esis" method. The theoretical derivation and justification of this approach is presented in references [5,6,8}. A block diagram of the analysis algorithm is shown in Figure 3. The MBE speech model parameters which must be estimated for each speech frame are the pitch period (or equiva- f(Hz.) Figure 4: High Pass Filter Frequency Response at 8 kHz. Sampling Rate lently the fundamental frequency), the V/UV decisions, and the spectral amphtudes which characterize the spectral envelope. A discrete speech signal is obtained by sampling an ana¬ log speech signal at 8 kHz. The speech signal should be scaled such that the maximum and minimum sample values are in the ranges [16383, 32767] and [-32768, -16385], respectively. In addition any non-hnear companding which is introduced by the samphng system (such as a-law or u-law) should be removed prior to performing speech analysis. The discrete speech signal is first passed through a discrete high-pass filter with the following transfer function. (3) Figure 4 shows the frequency response of the filter specified in equation (3) assuming an 8 kHz. sampling rate. The resulting high-pass filtered signal is denoted by s(n) throughout the remainder of this section. The organization of this section is as follows. Section 3.1 presents the pitch estimation algorithm. The V/UV determination is discussed in Section 3.2, and Section 3.3 discusses the estimation of the spectral amphtudes. Praviou* Frame* Future Frame* PrcMtit Frame Pitch Values: P-2 P-i Po Pi p 2 Error Function: E. 2 (P) E.,(P) E<<F) Eι(P) E2(P) Figure 5: Relationship between Speech Frames 3.1 Pitch Estimation The objective in pitch estimation is to determine the pitch o corresponding to the "current speech frame s w (n). Po is related to the fundamental frequency ω 0 by 2JΓ o = (4) ωo The pitch estimation algorithm attempts to preserve some continuity of the pitch between neighboring speech frames. A pitch tracking algorithm considers the pitch from previous and future frames, when determining the pitch of the current frame. The next speech frame is obtained by shifting the speech signal s(n) "left" by 160 samples (20 ms.) prior to the application of the window in Equation (1). The pitches corresponding to the next two speech frames are denoted by P \ and -P 2 . Similarly, the previous frame is obtained by shifting -»(n) "right" by 160 samples prior to the application of the window. The pitches corresponding to the previous two speech frames axe denoted by -P_ι and P_ 2 . These relationships are shown in Figure 5. The pitch is estimated using a two-step procedure. First an initial pitch estimate, denoted by Pi, is obtained. The initial pitch estimate is restricted to be a member of the set {21, 21.5, ... 113.5, 114}. It is then refined to obtain the final estimate of the fundamental frequency ώo, which has one-quarter-sample accuracy. This two-part procedure is used in part to reduce the computational complexity, and in part to improve the robustness of the pitch estimate. One important feature of the pitch estimation algorithm is that the initial pitch estima- Figure 6: Window Ahgnment tion algorithm uses a different window than the pitch refinement algorithm. The window used for Initial pitch estimation, t-? / (n), is 281 samples long and is given in Appendix B. The window used for pitch refinement (and also for spectral amphtude estimation and V/UV determination), WR(Π), is 221 samples long and is given in Appendix C. Throughout this document the window functions are assumed to be equal to zero outside the range given in the Appendices. The center point of the two windows must coincide, therefore the first non-zero point of WR(Π) must begin 30 samples after the first non-zero point of w / (n). This constraint is typically met by adopting the convention that W ( ) — WR(—II) and wι(n) = u? / (— ), as shown in Figure 6. The amount of overlap between neighboring speech segments is a function of the window length. Specifically the overlap is equal to the window length minus the distance between frames (160 samples). Therefore the overlap when using W R (n) is equal to 61 samples and the overlap when using wι(n) is equal to 121 samples. 3.1.1 Determination of E(P) To obtain the initial pitch estimate an error function, E(P), is evaluated for every P in the set {21, 21.5, ... 113.5, 114}. Pitch tracking is then used to compare the evaluations of E(P), and the best candidate from this set is chosen as j. This procedure is shown in Figure 7. The function E(P) is defined by £( ) " E3-» MO P 0 / 2 U)][I - p • ∑S MO « ιωj (5) where w / (n) is normalized to meet the constraint 140 ∑ «?(i) - l-0 (6) j-=-140 This constraint is satisfied for t_>j(n) hsted in Appendix B. The function r(t) is defined for integer values of t by 140 * ■ (<) = ∑ *I J ?0 LPF0 ' + W/0 ' + ') (7) j=-140 The function r(t) is evaluated at non-integer values of t through hnear interpolation: r(t) = (1 + W " • r(W) + (« - W) • r( W + 1) (8) where zj is equal to the largest integer less than or equal to x (i.e. truncating values of x). The low-pass filtered speech signal is given by 10 *LPF{n) = ∑ a( - j)h LPF (j) (9) j=-10 where Ajy»r( n ) is a 21 point FIR filter given in Appendix D. The function E(P) in Equation (5) is derived in [5,8]. The initial pitch estimate Pi is chosen such that E(Pι) is small, however, / is not chosen simply to minimize E(P). Instead pitch tracking must be used to account for pitch continuity between neighboring speech frames. 3.1.2 Pitch Tracking Pitch tracking is used to improve the pitch estimate by attempting to limit the pitch devia¬ tion between consecutive frames. If the pitch estimate is chosen to strictly minimize E(P), s(n)wι(n) -i Calculate E(P) Error Function Look-Ahsad Pitch Tracking PF Figure 7: Initial Pitch Estimation then the pitch estimate may change abruptly between succeeding frames. This abrupt change in the pitch can cause degradation in the synthesized speech. In addition, pitch typically changes slowly; therefore, the pitch estimates from neighboring frames can aid in estimating the pitch of the current frames. For each speech frame two different pitch estimates are computed. The first, PB, is a backward estimate which maintains pitch continuity with previous speech frames. The sec¬ ond, f , is a forward estimate which maintains pitch continuity with future speech frames. The backward pitch estimate is calculated with the look-back pitch tracking algorithm, while the forward pitch estimate is calculated with the look-ahead pitch tracking algorithm. These two estimates are compared with a set of decision rules defined below, and either the backward or forward estimate is chosen as the initial pitch estimate, P / . 3.1.3 Look-Back Pitch Tracking Let P~ \ and P-w denote the initial pitch estimates which are calculated during the analysis of the previous two speech frames. Let f._ι(P) and JE.- 2 (P) denote the error functions of Equation (5) obtained from the analysis of these previous two frames as shown in Figure 5. Then -E._ι(-P_ι) and -E_ 2 ( - 2 ) will have some specific values. Upon initialization the error functions -E_ι(P) and E- 2 (P) are assumed to be equal to zero, and -P_ι and _P_ 2 are assumed to be equal to 100. Since pitch continuity with previous frames is desired, the pitch for the current speech frame is considered in a range near P_ι. First, the error function E(P) is evaluated at each value of P which satisfies constraints (10) and (11). .8P_i < P < 1.2P-1 (10) P € {21,21.5,...113.5, 114} (11) These values of E(P) are compared and PB is defined as the value of P which satisfies these constraints and which minimizes E(P). The backward cumulative error CEB(PB) is then computed using the following formula. CEB(PB) = E(PB) + £-ι(-P-ι) + £- 2 (P- 2 ) (12) The backward cumulative error provides a confidence measure for the backward pitch esti¬ mate. It is compared against the forward cumulative error using a set of heuristics defined in Section 3.1.4. This comparison determines whether the forward pitch estimate or the backward pitch estimate is selected as the initial pitch estimate for the current frame. 3.1.4 Look-Ahead Pitch Tracking Look-ahead tracking attempts to preserve pitch continuity between future speech frames. Let Eχ(P) and E<ι(P) denote the error functions of Equation (5) obtained from the two future speech frames as shown in Figure 5. Since the pitch has not been determined for these future frames, the look-ahead pitch tracking algorithm must select the pitch of these future frames. This is done in the Mowing manner. First, o is assumed to be fixed. Then the i and P 2 are found which jointly minimize Eι(P ) + subject to constraints (13) through (16). P X € {21,21.5,...113.5, 114} (13) P 2 € {21,21.5,...113.5, 114} (15) The values of P l and P \ which jointly minimize E \ (P \ )+ Ei^P^) subject to these constraints are denoted by i and , respectively. Once P and _P 2 have been computed the forward cumulative error function CEF(P O ) is computed according to: CEF(PO) = E(Po) + Eι(Pι) + E 2 (P 2 ) (17) WO 92/10830 _ 4Q _ PCT/US91/09135 This process is repeated for each Po in the set {21,21.5, ...113.5, 114}. The corresponding values of CEF(P O ) axe compared and Po is defined as the value of P 0 in this set which results in the minimum value of CEF(PO)- Once Po has been found the integer sub-multiples of Po (i.e. -ψ, , —^) must ^ e considered. Every sub-multiple which is greater than or equal to 21 is computed and replaced with the closest member of the set {21, 21.5, ... 113.5, 114} (where closeness is measured with mean-square error). Sub-multiples which are less than 21 axe disregarded. The smallest of these sub-multiples is checked against constraints (18), (19) and (20). If this sub-multiple satisfies any of these constraints then it is selected as the forward pitch estimate, PF- Otherwise the next largest sub-multiple is checked against these constraints, and it is selected as the forward pitch estimate if it satisfies any of these constraints. This process continues until all pitch sub-multiples have been tested against these constraints. If no pitch sub-multiple satisfies any of these constraints then Pp = Po- Note that this procedure will always select the smallest sub-multiple which satisfies any of these constraints as the forward pitch estimate. CE F (— ) < -85 and CEp (f ) < 7 ( 18 ) n ' ~ C£. F (Po) CE F ( 3 5 π 9 , C£F(— ) < .05 (20) Once the forward pitch estimate and the backward pitch estimate have both been com¬ puted the forward cumulative error and the backward cumulative error are compared. De¬ pending on the result of this comparison either PF or PB will be selected as the initial pitch estimate Pj. The following set of decision rules is used select the initial pitch estimate from among these two candidates. If CEB(PB) < -48, then P/ = P B (21) Else if CEB(PB) < CEF(PF), then P / = P B (22) ωb Figure 8: Pitch Refinement Else PI = PF (23) This completes the initial pitch estimation algorithm. The initial pitch estimation, Pi, is a member of the set {21, 21.5, ... 113.5, 114}, and therefore it has half-sample accuracy. 3.1.5 Pitch Refinement The pitch refinement algorithm improves the resolution of the pitch estimate from one half sample to one quarter sample. Ten candidate pitches axe formed from the initial pitch estimate. These axe P / - 1, Pj - , ..., P; + , and P / + §. These candidates are converted to their equivalent fundamental frequency using Equation (4). The error function ER( J O ), defined in Equation (24), is evaluated for each candidate fundamental frequency ωo. The candidate fundamental frequency which results in the minimum value of ER( 0 ) is selected as the refined fundamental frequency ώo. A block diagram of this process is shown in Figure 8 . The synthetic spectrum -? u ,(m,ωo) is given by, where α / , 6 / and - j axe defined in equations (26) thru (28), respectively. The notation f-s] denotes the smallest integer greater than or equal to i. 256 ; * (26) έ ' = lτ ( + " 5)ωo (27) ^ ∑ »M-iF-ι,1 S yl (m)W R ([64m - ^lω Q + .5J) (28) The function S w (m) refers to the 256 point Discrete Fourier Transform of s(n) • WR(Π), and W j(m) refers to the 16384 point Discrete Fourier Transform of WR(Π). These relationships are expressed below. Reference [15] should be consulted for more information on the DFT. no S ω ( ) = ∑ s(n)iv R (n)e- j -%tr for -128 < m < 127 (29) n-s-UO no W R (m) = ∑ tc Λ (n)e- τSτ for -8192 < m < 8191 (30) n=-110 The notation WR(TT.) refers to the complex conjugate of WJ R (m). However, since u-β(n) is a real symmetric sequence, WJ j (m) = WR^ΠI). Once the refined fundamental frequency has been selected from among the ten candi¬ dates, it is used to compute the number of harmonics in the current segment, L, according to the relationship: Figure 9: IMBE Voiced/Unvoiced Determination In addition the parameters ά; and 6 / for 1 < / < L axe computed from ώo according to equations (32) and (33), respectively. 256. aι = -^{1 - -5)ώo (32) b, = § ( + -5)ώo (33) 3.2 Voiced/Unvoiced Determination The voiced/unvoiced (V/UV) decisions, v* for 1 < k < K, axe found by dividing the spectrum into K frequency bands and evaluating a voicing measure, D k , for each band. The number of frequency bands is a function of L and is given by: The voicing measure for 1 < k < K - 1 is given by where ώo is the refined fundamental frequency, and ά / , δ / , S^m), and S w (m,ωo) are defined in section 3.1.5. Similarly, the voicing measure for the highest frequency band is given by The parameters D k for 1 < k < K are compared with a threshold function Θζ(k,ώo) given by Θ ξ (k,ώo) = (.35 + .557ώo)(1.0 - .4775(fc - l)ώo) • M(ξo,ξ αvg ,ξ min ,ξ mαx ) (37) The parameter ξo is equal to the energy of the current segment, and it is given by & = ∑ \S w (m)\ 2 (38) m=0 The parameters ξ αvg , ξ mα3; and ξ m ,„ roughly correspond to the local average energy, the local maximum energy and the local minimum energy, respectively. These three paxameters are updated each speech frame according to the rules given below. The notation ξ α vg(Q), ξ mαx (0) and ξ πι i τ -(O) refers to the value of the parameters in the current frame, while the notation ξ αvg (-l), mo *(-l) and Cmin(-l) refers to the value of the parameters in the previous frame. After these parameters are updated, the two constraints expressed below are apphed to £m,„(0) = 200 if „(0) < 200 (42) £ m« (0) = 20000 if ξ mαx (0) < 20000 (43) The updated energy parameters for the current frame are used to calculate the function M(ξ 0 ,ξ αυg ,ξ m i n ,ξmαx) ' For notational convenience ξ αυg , ξ m , n . and ξ mαs refer to ξ α v g (P), ξ m i n ( ) and ξ TOO χ(0), respectively. •*" (44) L≤36, 3K-2<L≤3K Spectral Amplitudes M, M 2 M 3 ML-I M L 1 1 1 I I I 1 I M — O So 2ά_o 3Sb (L-l)S £i π I II I I II I Band 1 Band 2 Band K-l Band K Frequency Pan ls Figure 10: IMBE Frequency Band Structure The function M(ξo,ξ aυg , f mtn . £ mαx ) is used in Equation (37) to calculate the V/UV thresh¬ old function. If D k is less than the threshold function then the frequency band &z k - 2 < ω < bs k is declared voiced; otherwise this frequency band is declared unvoiced. A block diagram of this procedure is shown in Figure 9. The adopted convention is that if the frequency band 0 3f c_ 2 < u; < 6 3 * is declared voiced, then «/t = 1. Alternatively, if the frequency band β 3 *- 2 < w < 6 3 * is declared unvoiced, then ϋk = 0. With the exception of the highest frequency band, the width of each frequency band is equal to 3ώ 0 . Therefore all but the highest frequency band contain three harmonics of the refined fundamental frequency. The highest frequency band (as defined by Equation (36))may contain more or less than three harmonics of the fundamental frequency. If a particular frequency band is declared voiced, then all of the harmonics within that band a e defined to be voiced harmonics. Similarly, if a particular frequency band is declared unvoiced, then all of the harmonics within that band are defined to be unvoiced harmonics. 3.3 Estimation of the Spectral Amplitudes Once the V/UV decisions have been determined the spectral envelope can be estimated as shown in Figure 11. In the IMBE speech coder the spectral envelope in the frequency band Hk- 2 < ω < fe f c is specified by 3 spectral amphtudes, which are denoted by Mz k - 2 , Mz k - \ , S„(m) . Calculate Unvoiced oio ■ Amplitude 1 Select Voiced or Unvoiced M, Spectral Amplitude i≤i- - S„(m) * Calculate Voiced Amplitude 3 ~ l≤k≤K Figure 11: IMBE Spectral Amphtude Estimation and M 3k' The relationship between the frequency bands and the spectral amphtudes is shown in Figure 10. If the frequency band άzk-2 __> ω < 63^ is declared voiced, then Ms k - 2 , Mz k - \ι and at are estimated by, for I in the range 3fc — 2 < I < 3fc and where Aι(ωo) is given in Equation (28). Alternatively, if the frequency band 0 3J t_ 2 < ω < fe f c is declared unvoiced, then Mjj f e-a, Mz k - \ , and M are estimated according to: for in the range 3fc - 2 < / < 3fc. This procedure must be modified slightly for the highest frequency band which covers the frequency interval ά 3 #_- 2 < w < b^. The spectral envelope in this frequency band is represented by L — 3-δT + 3 βpectral amphtudes, denoted 3 _ 2 , •M 3j f_ 1. • • • . ^. If this frequency band is declared voiced then these spectral amphtudes are estimated using equation (45) for 3-8. — 2 < / < L. Alternatively, if this frequency band is declared unvoiced then these spectral amphtudes are estimated using equation (46) for 3-K " — 2 < / < L. As described above, the spectral amphtudes Mi are estimated in the range 1 < I < L, where L is given in Equation (31). Note that the lowest frequency band, θχ < ω < 6 3 , is specified by Mi, M 2 , and M 3 . The D.C. spectral amphtude, o, is ignored in the IMBE speech coder and can be assumed to be zero. Table 1: Bit Allocation Among Model Parameters 4 Parameter Encoding and Decoding The analysis of each speech frame generates a set of model parameters consisting of the fundamental frequency, ώo, the V/UV decisions, v* for 1 < k < k, and the spectral amplitudes, Mj for 1 < / < L. Since this voice codec is designed to operate at 6.4 kbps with a 20 ms. frame length, 128 bits per frame are available for encoding the model parameters. Of these 128 bits, 45 are reserved for error correction as is discussed in Section 5 of this document, and the remaining 83 bits are divided among the model parameters as shown in Table 1. This section describes the manner in which these bits are used to quantize, encode, decode and reconstruct the model parameters. In Section 4.1 the encoding and decoding of the fundamental frequency is discussed, while Section 4.2 discusses the encoding and decoding of the V/UV decisions. Section 4.3 discusses the quantization and encoding of the spectral amplitudes, and Section 4.4 discusses the decoding and reconstruction of the spectral amphtudes. Reference [9] provides general information on many of the techniques used in this section. 4.1 Fundamental Frequency Encoding and Decoding The fundamental frequency is estimated with one-quarter sample resolution in the inter- ^ n & 25 - ** - 1 9.875 * however, it is only encoded at half-sample resolution. This is accomplished by finding the value of bo which satisfies: So = l£ -39j (47) ωo The quantity bo can be represented with 8 bits using the unsigned binary representation shown in Table 2. This binary representation is used throughout the encoding and decoding Table 2: Eight Bit Binary Representation of the IMBE model parameters. The fundamental frequency is decoded and reconstructed at the receiver by using Equa¬ tion (48) to convert &o to the received fundamental frequency ώo. In addition 6o is used to calculate K and L, the number of V/UV decisions and the number of spectral amphtudes, respectively. These relationships are given in Equations (49) and (50). 4JΓ ωo = ■ = ■ (48) bo + 39.5 K = L^J if L < 36 (50) 12 otherwise Since K and L control subsequent bit allocation by the receiver, it is important that they equal K and L, respectively. This occurs if there axe no uncorrectable bit errors in the six most significant bits (MSB) of 6 0 . For this reason these six bits axe well protected by the error correction scheme discussed in Section 5. A block diagram of the fundamental frequency encoding and decoding process is shown in Figure 12. Note that the encoder also uses equation (48) to reconstruct the fundamental frequency from So as shown in Figure 12. This is necessary because the encoder needs ώo in order to compute the spectral amphtude prediction residuals via equations (53) through (54). Fundamental Ob Frequency Encoding ♦ & Fundamental Frequency Cflo Decoding G-0 L K Figure 12: Fundamental Frequency Encoding and Decoding 4.2 Voiced/Unvoiced Decision Encoding and Decoding The V/UV decisions t)*, for 1 < k < K , axe binaxy values which classify each frequency band as either voiced or unvoiced. These values are encoded using = The encoded value b \ is represented with K bits using the binary representation shown in Table 2. At the receiver the K bits corresponding to ϊj are decoded into the V/UV decisions it for 1 < k < K. This is done with the following equation. Vk J J -a for 1 < Jt < K (52) If there axe no uncorrectable bit errors in b \ and if L = ϊ, then the transmitted V/UV decisions, vjt, will equal the received V/UV decisions v*. Figure 13 shows a block diagram of the V/UV decision encoding and decoding process. 4.3 Spectral Amplitudes Encoding Figure 13: V/UV Decision Encoding and Decoding Figure 14: Encoding of the Spectral Amphtudes The spectral amphtudes Mr, for 1 < / < X, axe real values which must be quantized prior to encoding. This is accomplished as shown in Figure 14, by forming the prediction residuals T} for 1 < / < X, according to Equations (53) through (54). For the purpose of this discussion M*(0) refers to the unquantized spectral amphtudes of the current frame, M / (— 1) refers to the quantized spectral amphtudes of the previous frame, ώo(0) refers to the reconstructed fundamental frequency of the current frame and ώo(— 1) refers to the reconstructed fundamental frequency of the previous frame. Upon initialization Mr(— 1) should be set equal to 1.0 for all I, and <-Λ)(-l) — -02τ. ώo(0) */ = - / (53) ώo(-l) £=34 Block 1 aAl fflfit&l B &A Block s Blocks Cij c^ c 3J c J c 5J c 6J -ϊi ?-ϊβ T "TVI f 'ϊπ ^ ^ ϊ?ϊ » f? Length: Ji = 5 J 2 = 5 J 3 = 6 J 4 = 6 J 5 = 6 J 6 = 6 Low Frequency * * » High Frequency Figure 15: Prediction Residual Blocks for X = 34 Tι = log 2 M.(0) - .75 [(1 + [k,\ - kι) log 2 M LfciJ (-l) + (A, - j) log 2 M L *, J+1 (-1)] (54) In order to form 7 / using equations (53) and (54), the following assumptions are always made: Mo(-l) = 1.0 (55) Mι(-l) = £( _ 1} (-1) for / > X(-l) (56) The X prediction residuals are then divided into 6 blocks. The length of each block, denoted J, for 1 < i < 6, is adjusted such that the following constraints are satisfied. ∑ Ji = X (57) ts l j < Ji < Ji+i ≤ T l for 1 < t < 5 (58) The first or lowest frequency block is denoted by cij for 1 < j < J \ , and it consists of the first J \ consecutive elements of 7 / (i.e. 1 < / < J\). The second block is denoted by c 2j for 1 < j < J 2 , and it consists of the next J 2 consecutive elements of Tι (i.e. Jι+1 < / < Ji+h)- This continues through the sixth or highest frequency block, which is denoted by ce j for 1 < j < - It consists of the last consecutive elements of Tj (i.e. L + 1 - Jβ < I < L). An example of this process is shown in Figure 15 for X = 34. Each of the six blocks is transformed using a Discrete Cosine Transform (DCT), which is discussed in [9]. The length of the DCT for the i'th block is equal to j . . The DCT £=34 PRBA Vector Figure 16: Formation of Prediction Residual Block Average Vector coefficients are denoted by ,*, where 1 < i < 6 refers to the block number, and 1 < Jfc < J,* refers to the particular coefficient within each block. The formula for the computation of these DCT coefficients is as follows: The DCT coefficients from each of the six blocks are then divided into two groups. The first group consists of the first DCT coefficient (i.e the D.C value) from each of the six blocks. These coefficients are used to form a six element vector, -R,* for 1 < t < 6, where -R,* = C ..1 . The vector Ri is referred to as the Prediction Residual Block Average (PRBA) vector, and its construction is shown in Figure 16. The quantization of the PRBA vector is discussed in section 4.3.1. The second group consists of the remaining higher order DCT coefficients. These coef¬ ficients correspond to C, , where 1 < t < 6 and 2 < j < ,*. Note that if j,- = 1, then there axe no higher order DCT coefficients in the i'th block. The quantization of the higher order DCT coefficients is discussed in section 4.3.2. One important feature of the spectral amphtude encoding algorithm, is that the spectral amphtude information is transmitted differentially. Specifically a prediction residual is transmitted which measures the change in the spectral envelope between the current frame and the previous frame. In order for a differential scheme of this type to work properly, the encoder must simulate the operation of the decoder and use the reconstructed spectral amphtudes from the previous frame to predict the spectral amphtudes of the current frame. The IMBE spectral amphtude encoder simulates the spectral amphtude decoder by setting X = X and then reconstructing the spectral amplitudes as discussed above. This is shown as the feedback path in Figure 14. 4.3.1 Encoding the PRBA Vector The PRBA vector is quantized using a three step procedure. First the vector mean πi R is computed using equation (60), and it is scalar quantized using the 6 bit non- uniform quantizer defined in Appendix E. Next the PRBA vector is vector quantized using the 10 bit zero-mean codebook defined in Appendix F. Finally a six element quantization error vector, (?,* for 1 < * < 6 . is computed by adding the quantized vector mean to the selected entry from the 10 bit zero-mean codebook and then subtracting the result from the unquantized PRBA vector _£,. If X < 24, then the six elements of Q a e scalar quantized using uniform quantization. The step size and bit allocation for these uniform quantizers is documented later in this section. If X > 24, then Qi is disregarded. The first step in quantizing the PRBA vector is to calculate the mean ITIR as defined in Equation (60). 1 β m R = - ∑Ri (60) The mean is scalar quantized by computing the mean square error between the unquantized mean and each of the 64 quantization levels listed in Appendix E. The 6 bit value is defined as the index of the quantizer value (as shown in Appendix E) which is closest, in a mean-square error sense, to THR. It is represented using the same binary representation as is shown in Table 2. After the mean is quantized the PRBA vector is vector quantized using the codebook hsted in Appendix F. This is accomplished by computing the mean square error between the unquantized vector and each of the 1024 quantization vectors hsted in Appendix F. Note that each of these quantization vectors has zero mean. The 10 bit value 6 3 is defined as the index of the quantization vector (as shown in Appendix F) which yields the minimum mean-square error, and it is represented using the same binary representation as is shown in Table 2. Additional information on vector quantization can be found in [12]. Finally the quantized mean from Appendix E is added to each element of the selected zero-mean quantization vector from Appendix F. The resulting vector is then subtracted from Ri to form the vector ?,-. Appendix G is then used to find the bit allocation for the six elements of this vector. This appendix lists the number of bits allocated to the values & _ 2 through b +3 , which correspond to the elements Q through Qβ, respectively. Note that if X > 24, then the bit allocation is equal to zero for these six elements. Each element of Qi is uniformly scalar quantized using a step size which is computed using Tables 3 and 4. Table 3 hsts the standard deviation for the six elements of Q i while Table 4 lists the step size for each uniform quantizer as a function of the number of bits allocated to that quantizer and the standard deviation of the element. For example if <j 2 is to be quantized using 3 bits, the step size is equal to .18 * .65 = .117. If the number of bits allocated to a particular element is greater than zero, then it is uniformly quantized using equation (61). Otherwise, if the number of bits allocated to a particular element is equal to zero, then that element is assumed to be equal to zero and is not encoded. The parameters 6, B and Δ in equation (61) refer to the bit encoding, the number of bits and the step size which has been computed for <?,, respectively. Note that if the value of b is outside the range 0 < b < 2 B - 1, then it is set equal to the closest value within this range. Finally, each encoding is converted into the appropriate binary representation using the same representation as is shown in Table 2. 4.3.2 Encoding the Higher Order DCT Coefficients Once the PRBA vector has been quantized, the remaining bits are used to encode the X — 6 higher order DCT coefficients which complete the representation of the spectral amphtudes. Appendix G shows the bit allocation as a function of X for these coefficients. For each value of X the first X —6 entries, labeled 4 through δ^_ 3 , provide the bit allocation for the higher Table 3: Standard Deviation of PRBA Quantization Errors Table 4: Step Size of Uniform Quantizers order DCT coefficients. The adopted convention is that [b 4 , 6 5 , . .., δ£_ 3 ] correspond to [C1-3, Cι,3. • • •. C x j. , • .., Cβ,2, Cβ,3. • • •» C'β.Λ-l- respectively. Once the bit allocation for the higher order DCT coefficients has been obtained, these coefficients are quantized using uniform quantization. The step size used to quantize each coefficient is a function of the bit allocation and the standard deviation of the DCT coeffi¬ cient. This relationship is summarized in Tables 4 and 5. For example, if 4 bits are allocated for a particular coefficient, then from Table 4 the step size, Δ, equals Λ2σ. If this was the the third DCT coefficient from any block (i.e. Ci $ ), then σ = .216 as shown in Table 5. This equates to a step size of .09072. If the number bits allocated to a particular coefficient is greater than zero, then that coefficient is encoded using equation (62). Otherwise, if the Table 5: Standard Deviation of DCT Coefficients for 1 < t < 6 number of bits allocated to a particular coefficient is equal to zero, then that element is assumed to be equal to zero and is not encoded. (62) Δ The parameters S, B and Δ in equation (62) refer to the bit encoding, the number of bits and the step size which has been computed for C,*,*, respectively. Note that if the value of S is outside the range 0 < b < 2 B — 1, then it is set equal to the closest value within this range. Finally, each encoding is converted into the appropriate binary representation using the same representation as is shown in Table 2. 4.4 Spectral Amplitudes Decoding The spectral amphtudes are decoded and reconstructed by inverting the quantization and encoding procedure. First six blocks axe generated. The length of each block, t * for 1 < i < 6, is adjusted to meet the following constraints. if j ≤ i ≤ i+i ≤ rfi for 1 < t < 5 (64) The elements of these blocks are denoted by Ci tk , where 1 < i < 6 denotes the block number and where 1 < k < i denotes the element within that block. The first element of each block is then set equal to the decoded PRBA vector Ri via equation (65). The formation of the decoded PRBA vector is discussed in Section 4.4.1. C, (1 = Ri for 1 < i < 6 (65) The remaining elements of each block correspond to the decoded higher order DCT coeffi¬ cients which are discussed in Section 4.4.2. Once the DCT coefficients Ci, k have been reconstructed, an inverse DCT is computed on each of the six blocks to form the vectors Ci . This is done using the foUowing equations for 1 < < 6. The six transformed blocks c, a e then joined to form a single vector of length X, which is denoted ? / for 1 < / < X. The vector T / corresponds to the reconstructed spectral amphtude prediction residuals. The adopted convention is that the first Jj elements of 7 / axe equal to ci for 1 < j < J \ . The next / 2 elements of T} axe equal to c 2 j for 1 < _;' < J 2 . This continues until the last jg elements of Tj axe equal to cβ for 1 < j < J β . Finally, the reconstructed spectral amphtudes for the current frame axe computed using the foUowing equations. (0) = exp[ln2.(f,+.75 [(l+ L*,J -fc / )log 2 M w (-l)+(* / - [* / J)log 2 M Lfc(j+1 (-l)])] (69) Upon initialization M / (-l) should be set equal to 1.0 for aU /, and ώo(-l) = .02τ. In order to reconstruct M;(0) using equations (68) and (69), the foUowing assumptions are always made: Mo(-l) = 1.0 (70) M,(-l) = for / > X(-l) (71) The last step is that the spectral amphtudes are enhanced using the techniques discussed in Section 4.4.3. A block diagram of the spectral amphtude decoder is shown in Figure 17. Refoπn Spectral from ΦH Amplitude M,(0) 6 Blocks 2 X Enhancement 2_-i__L+3 + lSl≤L Higher Order Coefficients Unenhanced O) l≤I≤L tύo(0) Compute Predicted 1 Frame Spectral Delay Amplitudes ra Figure 17: Decoding of the Spectral Amphtudes In order for the IMBE speech coder to operate properly the encoder and decoder must each be using the same bit allocation and step sizes. As is discussed above the encoder varies the bit allocation and step sizes depending on X, the number of spectral amphtudes in a particular frame. The encoder uses X to find the bit allocation from Appendix G, while the decoder uses X to find the bit aUocation from Appendix G. Consequently the property that X = X is extremely critical for the proper operation of the voice codec. The voice coding algorithm has been designed such that this property is always maintained, except in the presence of a very large number of bit errors. 4.4.1 Decoding the PRBA Vector The PRBA is decoded by using the 6 bit value 6-j as an index into the quantizer values hsted in Appendix E. The vector mean πiR is decoded as the quantizer value corresponding to this index. Similarly, the 10 bit value 6 3 is interpreted as an index into the quantization vectors listed in Appendix F. The decoded vector mean πi is added to each element of the quantization vector corresponding to this index, and the result is then added to the decoded quantization error vector to form the decoded PRBA vector which is denoted -R,*. The quantization error vector Qi is decoded by first using X and Appendix G to find the bit aUocation for &£_ 2 through &£ +3 , which corresponds to the elements Qι and Q 6 , respectively. Note that if X > 24, then the bit aUocation is equal to zero for these six elements. Next the quantizer step size is computed for each element of Qi using Tables 3 and 4. This is done in the same manner as is discussed in Section 4.3.1. If the number of bits allocated to a particular element is greater than zero, then that element is decoded using equation (72). Otherwise, if the number of bits allocated to a particular element is equal to zero, then that element is set equal to zero. Q i = A (b - 2 B - 1 + .5) (72) The parameters b, B and Δ in equation (72) refer to the bit encoding, the number of bits and the step size which has been computed for Qi, respectively. 4.4.2 Decoding the Higher Order DCT Coefficients The higher order DCT coefficients, which are denoted by Ci, k for 2 < » ' < 6 and 1 < k < Ji, are reconstructed from the bit encodings 6 4 , 6 5 , ... , &£_ 3 . First the bit allocation table hsted in Appendix G is used to determine the appropriate bit allocation. The adopted convention is that [6 4 , 65, ..., _ 3 ] correspond to [Cι, 2 , C \ , ..., C^ j , ..., Ce, ι C , ... . C 6 j ], respectively. Once the bit aUocation has been determined the step sizes for each d, k axe computed using Tables 4 and 5. If the number of bits allocated to a particular coefficient is greater than zero, then that element is decoded using equation (73). Otherwise, if the number of bits allocated to a particular coefficient is equal to zero, then that element is set equal to zero. C, * , Jfe = Δ (6 - J_ - 1 + .5) (73) The parameters b, B and Δ in equation (73) refer to the bit encoding the number of bits and the step size which has been computed for C,,t, respectively. 4.4.3 Spectral Amplitude Enhancement The IMBE speech decoder attempts to improve the perceived quality of the synthesized speech by enhancing the spectral amphtudes. The unenhanced spectral amphtudes are required by future frames in the computation of Equation (69). However, the enhanced spectral amphtudes are used in speech synthesis. The spectral amphtude enhancement is - oU - accomphshed by generating a set of spectral weights from the model parameters of the current frame. First Ro and R are calculated as shown below Ro = ∑ M? (74) 1=1 L Rι = ∑M? cos(ώo l) (75) i=l Next, the parameters RQ, and R \ are used to calculate a set of weights, W}, given by These weights are then used to enhance the spectral amphtudes for the current frame according to the relationship For notational simplicity the weighted and unweighted spectral amphtudes are both referred to as Mi in Equation (77). As mentioned previously, the unenhanced spectral amphtudes are used in the decoding the spectral amphtudes of future frames, while the enhanced spectral amphtudes are used in speech synthesis. This is shown in Figure 17. The value of -So corresponds to the energy of the spectral amphtudes. This value is used to update the current frame parameter Sεiβ) from the previous frame parameter SE(— 1) according to the foUowing equation. { .955 £ (-l) + .05.Ro if .955 £ (-l) + .05 Λo > 10000.0 10000.0 otherwise The value of SE is required in Section 5.4. Figure 18: Error Correction Encoding 5 Forward Error Correction and Bit Interleaving The IMBE speech coder uses a number of different error protection measures in order to increase its robustness to channel degradations. The encoded model parameters, bo, bι, ... , f , ,, axe first rearranged into a new set of vectors denoted ύo > «ι . • • • , ύ 7 . These vectors are then protected with error correction codes to produce a set of code vectors denoted co, c \ , ... , cγ. Intra-frame bit interleaving is then used on the error correction code vectors in order to spread the effect of short burst errors. A block diagram of the error correction encoding is shown if Figure 18. The effect of bit errors is further reduced at the decoder through the use of frame repeats and adaptive smoothing of the decoded model parameters. 5.1 Error Correction Encoding The IMBE speech coder uses 83 bits per frame to encode the model parameters and 45 bits per frame for forward error correction. The 45 error correction bits axe divided between parity checks, 23/12 Golay codes and 15/11 Hamming codes. This division is performed according to the each bits relative sensitivity to bit errors. The encoding and decoding algorithms for the Golay and Hamming codes axe discussed in the open literature [10,11]. In order to ensure sufficient performance, all error correction codes should be decoded up to their maximum error correction capability. Optionally soft-decision decoding can be use used to further improved performance. The 23/12 Golay code is defined by the foUowing matrix operation, where aU operations are modulo 2. The vectors c,* and u,- axe assumed to be row vectors, where the "left" most bit is the MSB. Similarly, the 15/11 Hamming code is defined in foUowing matrix operation, where aU operations are modulo 2. The vectors et and «, * are assumed to be row vectors. In both of the preceding matrices, absent entries axe assumed to equal zero. MSB LSfi So 23/12 CO 1 11 *ll s 3 »ι 2 °l Golay Encode bo b 2 *«*y Figure 19: Format of ύo and CQ b 3 b- bs, Figure 20: Format of t-i and ci The nine most sensitive source bits a e first parity checked with three bits, and all twelve bits axe then encoded in a 23/12 Golay code. The nine most sensitive bits consist of the the six most significant bits of 6o » and the three most significant bits of 6 2 . One parity check bit is used for the three most significant bits of o, one paxity check bit is used for the next three most significant bits of b 0 , and one parity check bit is used for the three most significant bits of 6 2 . A parity check bit is computed as the modulo 2 sum of the appropriate bits. The resulting 12 bits, denoted ύo . are encoded with a Golay code into the 23 bit code word co as shown in Figure 19. The 12 next most significant source bits, t-i, axe encoded with a Golay code into the 23 bit code word c \ . The vector t-i consists of the three most significant of 6 3 and the most significant nine bits from the set {6 4 , S 5 , ... , δ£_ 3 }, where only the three most significant bits from each element are considered. For example, if each element of the set was encoded with four bits, then the three most significant bits from 6 4 , 6 5 , and b$, in that order, comprise the last nine bits of t-i. The format of t- and ci axe shown in Figure 20. The remaining 62 bits axe divided into five 11 bit vectors, ύ 2 , ..., ύβ, and one 7 bit vector, U 7 . The 11 bit vectors axe encoded with a 15/11 Hamming code into the 15 bit codewords, c 2 , ..., cβ. The seven bit vector is not error protected, therefore c 7 = ύ 7 . The vectors *ύ 2 , ... , ύβ are formed in the foUowing manner. First a large 62 bit vector is formed by concatenating (in order) the k bit vector δi, the fourth and fifth most significant bits from 6 2 , the seven least significant bits from 6 3 , the bits from the set {6 4 , 6 5 , ... , & . 3 } (except the nine bits which were included in t_ι), the two least significant bits from 6 0 and the least significant bit from 6 2* For the purpose of this discussion the most significant bit of Si is referred to as the most significant bit of this large 62 bit vector. The vectors ύ 2 , ... , £ 7 are formed from this large 62 bit vector in the foUowing manner. The 11 most significant bits axe set equal to r- 2 . The next 11 most significant bits are set equal to 6 3 . This process continues until the 7 least significant bits axe set equal to ύ 7 . 5.2 Bit Interleaving Intra-frame bit interleaving is used to spread short burst errors among several code words. The minimum separation between any two bits of the same error correction code is 5 bits. The exact order of the 128 bits in each frame is given in Appendix H. The notation in this appendix is that the bit number corresponds to the significance of a particular bit. For example, bit number 2 of cj, refers to the second to least significant bit of that code word. The notation Qo and Jo refers to the first bits to be modulated onto the Q channel and I channel, respectively, and the notation Q and X 53 refers to the last bits to be modulated onto the Q channel and I channel, respectively. 5.3 Error Correction Decoding The error correction decoding of the received bits into the bit vectors o . i, ..., [ t 3 is a straightforward inverse of the error correction encoding procedure. First Appendix H is used to map the received bits into the code vectors Co, c * ι, ..., c 7 . Then the 23 bits code words co and c are each passed through a Golay decoder, which can correct up to three errors. The output of the Golay decoder is the 12 bit vectors ύ 0 and t_χ. The parity of t∑o is checked to ensure that it agrees with the three parity bits which were added to the input. If the parity does not check then a frame repeat is performed, as described in Section 5.4. If the parity does check, then the six most significant bits of o and the three most significant bits of S 2 axe recovered. Similarly the 12 bit vector ύ \ is used to recover the three most significant bits of 3 and the nine most significant bits from the set {S 4 , S 5 , ... , £_ 3 }. Next, the 15 bit code words c 2 through cβ are passed through a Hamming decoder, which can correct a single bit error, and the outputs axe set equal to t_ 2 through ttβ, respectively. In addition the seven bit vector c 7 is set equal to ύ 7 . From these vectors the 62 remaining bits are recovered in accordance with the procedure described in Section 5.1. Since o is represented with 8 bits, it is constrained to the range 0 < o < 255. However because of the hmitation imposed by the pitch estimation algorithm, not all of the possible values of So represent vahd pitch estimates. In particular the values 192 < So < 255 do not represent vahd pitch estimates. If the decoder receives a value of o in this range, it should not continue decoding the model parameters, but should instead take some alternative action. Specifically, if the decoder receives a value of 6Q in the range 192 < So ≤ 199 or 204 < So < 255 a frame repeat should be performed as is described in Section 5.4. Alternatively, a received value of So in the range 200 < o < 203 signifies that a silence frame should be synthesized, and the decoder should perform the appropriate muting or noise insertion. 5.4 Adaptive Smoothing The IMBE speech decoder estimates the number of errors in each frame of data. This estimate is obtained from the Golay and Hamming codes which axe used for forward error correction. This estimate is used to adaptively smooth the V/UV decisions, and to control a frame repeat mechanism. The decoder calculates the total number of errors which axe corrected by the Golay decoders and the Hamming decoders for each of the received codewords c , ci, .. ., cβ» The number of errors in each codeword is estimated by the number of corrected errors in that codeword. The only exception is that if any of the parity checks in ύo axe incorrect, then the estimate of the number of errors in Co is changed from x to 7- x (for example 2 becomes 5). The estimate of the total number of errors, ej, is equal to the sum of the error estimates from each individual codeword. This estimate is then used to update the current estimate of the error rate ejι(0) from the previous estimate of the error rate €R(-1), according to: c Λ (0) = .95 e Λ (-l) + .00042 c τ (79) The current estimate of the error rate is used by the decoder to adaptively smooth the V/UV decisions. First an adaptive threshold y is calculated using equation (80). Then if €R(0) > .003, each decoded spectral amphtude M; for 1 < / < X is compared against My, and any spectral amphtude which is greater than MT is declared voiced, regardless of the decoded V/UV decisions. If £R(0) < .003 or if a spectral amphtude is less than MT, then the received V/UV decision for that spectral amphtude is left unchanged. M T = { ssagg tf<«(0) < .02 1.414 (5 £ (0))- 375 otherwise Sjs(0) is defined in Equation (78) in Section 4.4.3. A frame repeat is performed by the IMBE speech decoder if too many errors axe found in the current frame, or if the value of So is outside the allowable range, or if an error is detected in the most sensitive bits. Specifically a frame repeat is performed if €R(0) < .02 and e τ > 9, or if e Λ (0) > .1, or if e τ > 12, or if 192 < S 0 < 199, or if 204 < So < 255, or if any of the parity checks in ύo are incorrect. If a frame repeat is performed, the IMBE model parameters for the current frame axe replaced by the model parameters for the previous frame. SpecificaUy, the foUowing replacements are made: ώ 0 (0) = ώo(-l) (81) 1(0) = X(-l) (82) δ*(0) = ^(-1) (83) - M.(0) = M,(-l) (84) If a frame repeat is performed, the information contained in the bit vectors So, δi, ... is not used by the decoder, and speech synthesis proceeds using the replaced model parameters. In some bad burst error conditions it is possible that several consecutive frame repeats will be required. In this case the model parameters received for the current frame are replaced with the model parameters from the last acceptable frame. Table 6: Division of Prediction Residuals into Blocks in Encoding Example 6 Parameter Encoding Example This section provides an example of the encoding and error correction for a typical parameter frame. In this example the fundamental frequency is assumed to be equal to: ώo = — 2 22 * 35.125 ' Since the values of X and K are related to ώo through equations (31) and (34), they are equal to: X = 16 and K = 6. The remaining model parameters axe left unspecified since they do not affect the numbers presented in this example. The encoding of this example parameter frame proceeds as foUows. First the fun¬ damental frequency is encoded into the 8 bit value δo using equation (47), and the 6 voiced/unvoiced decisions are encoded into the 6 bit value δ using equation (51). The 16 spectral amphtude prediction residuals, T) for 1 < / < 16, are then formed using equa¬ tions (53) through (54). Next, these prediction residuals are divided into six blocks where the lengths of each block, J, for 1 < * < 6, are shown in Table 6. The spectral amphtude prediction residuals axe then divided into the six vectors et ' ,,; ' for 1 < t < 6 and l < j < Ji- The first J elements of fι form c \ j. The next J 2 elements of T for C 2 j, and so on. This is shown in Table 6. Each block Cij for 1 < * < 6, is transformed with a Ji point DCT using equation (59) to produce the set DCT coefficients C,*,* for 1 < k < Ji. The first DCT coefficient from each of the six blocks is used to form the PRBA vector Ri, and it is quantized and encoded into the 6 bit value S 2 and the 10 bit value 6 3 using appendices E and F, respectively. The quantization error vector Qi is found by adding the quantized mean, to each element of the selected codebook vector and then subtracting the result from Table 7: Quantizers for Qi in Encoding Example Ri. Appendix G is used to find the bit aUocation for the elements of the vector Qi and this is shown in Table 7. The first four elements are uniformly quantized using equation (61), and the step sizes for these four elements are calculated from Tables 3 and 4. The resulting step sizes are shown in Table 7. The last two elements are not quantized since the number of bits allocated to those elements is equal to zero. After the PRBA vector has been quantized and encoded, the remaining bits are dis¬ tributed among the ten higher order DCT coefficients, C,*^ for 1 < i < 6 and 2 < k < Ji. This is done using Appendix G and the resulting bit aUocation is shown in Table 8. Each DCT coefficient is then quantized using equation (61). The step sizes for these quantizers are computed using Tables 4 and 5, and the results are also shown in Table 8. The 20 bit encodings o through 1 9 are then rearranged into the eight vectors ώo through t- 7 . This is accomphshed using the procedure described in Section 5, and the result is shown in Tables 9 through 11. The convention in these tables is that the appropriate bit from the vector listed in the first two columns is set equal to the appropriate bit from the bit encoding hsted in the last two columns, where the least significant bit corresponds to bit 0. Bit 2 of vector ύo is set equal to parity check of bits 11 - 9. Similarly, bits 1 and 0 are set equal to the parity check of bits 8 - 6 and bits 5 - 3, respectively. The vectors o and ύi are each encoded with a 23/12 Golay code into the code vectors Co and £χ, respectively. The five vectors ύ ∑ through β are encoded with a 15/11 hamming code into the code vectors £ 2 through CQ, respectively. The vector C 7 is set equal to 7 . These code vectors are then interleaved as specified in Appendix H, and finally the frame Table 8: Quantizers for Cij in Encoding Example bits are transmitted to the decoder in ascending order (i.e bit 0 first and bit 127 last). Table 9: Construction of ύ. in Encoding Example (1 of 3) Table 10: Construction of ύ,- in Encoding Example (2 of 3) Table 11: Construction of ύ,- in Encoding Example (3 of 3) 7 Speech Synthesis As was discussed in Section 3, the IMBE speech coder estimates a set of model parameters for each speech frame. These parameters consist of the fundamental frequency ώo, the V/UV decisions for each frequency band v*, and the spectral amphtudes Mj. After the transmitted bits are received and decoded a reconstructed set of model parameters is available for synthesizing speech. These reconstructed model parameters are denoted ώo, v* and Mi, and they correspond to the reconstructed fundamental frequency, V/UV decisions and spectral amphtudes, respectively. In addition the parameter X, defined as the number of spectral amphtudes in the current frame, is generated from o according to Equation (49). Because of quantization noise and channel errors the reconstructed model parameters are not the same as the estimated model parameters ώo, v* and M/. 7.1 Speech Synthesis Notation The IMBE speech synthesis algorithm uses the reconstructed model parameters to generate a speech signal which is perceptually similar to the original speech signal. For each new set of model parameters, the synthesis algorithm generates a 20 ms. frame of speech, 5(n), which is interpolated between the previous set of model parameters and the newest or current set of model parameters. The notation X(0), ώ o (0), v*(0) and M / (0) is used to denote the current set of reconstructed model parameters, whUe X(-l), ώo(-l), V k (-l) and M / (-l) is used to denote the previous set of reconstructed model parameters. For each new set of model parameters, 5(n) is generated in the range 0 < n < N, where N equals 160 samples (20 ms.). This synthetic speech signal is the output of the IMBE voice coder and is suitable for digital to analog conversion with a sixteen bit converter. The synthetic speech signal is divided into a voiced component s v (n) and an unvoiced component s uυ (n). These two components axe synthesized separately, as shown in Figure 21, and then summed to form s(n). The unvoiced speech synthesis algorithm is discussed in Section 7.2 and the voiced speech synthesis algorithm is discussed in Section 7.3. For the purpose of speech synthesis each spectral amphtude is declared to be either voiced or unvoiced. The /'th spectral amphtude is declared voiced if the frequency ω = l-ώo is within a voiced frequency band. The frequency band (3A: - 2.5)ώo < ω < (3ifc + .5)ώo for MBE Model Parameters Figure 21: IMBE Speech Synthesis 1 < k < K — l is voiced if v* = 1, otherwise it is unvoiced. Similarly, the highest frequency band (ZK - 2.5)ώo ω < (X + .5)ώo is voiced if v = • 1, otherwise it is unvoiced. The Tth spectral amphtude is also declared voiced if €R > .003 and Mi > r as is discussed in section 5.4. In aU other cases the 'th spectral amphtude is declared unvoiced. 7.2 Unvoiced Speech Synthesis The energy from unvoiced spectral amphtudes is synthesized with an unvoiced speech syn¬ thesis algorithm. First a white noise sequence, u(π), is generated. This noise sequence can have an arbitrary mean. A recommended noise sequence [14] can be generated as shown below. 17lu(n) + 11213 u(n + 1) = 171tt(n) + 11213 - 53125 [- 53125 J (85) The noise sequence is initialized to t(— 105) = 3147. For each successive synthesis frame, u(n) is shifted by 20 ms. (160 samples) and win¬ dowed with t_?s(n) . which is given in Appendix I. Since u>s(n) has a non-zero length of 209 samples, there is a 49 sample overlap between the noise signal used in successive synthesis frames. Once the noise sequence has been shifted and windowed, the 256 point Discrete Fourier Transform U w (m) is computed according to: 104 2-rτnn. U w (m) = ∑ u(n)w s (n)e~ ~ s for -128 < m < 127 (86) n=-104 The function U w (m) is generated in a manner which is analogous to S w (m) defined in - - Equation (29) except that _(n) and ws(n) are used in place of s(n) and W (n). The function U w (m) is then modified to create U w (m). For each / in the range 1 < / < X(0), U w (m) is computed according to Equation (87) if the l'th spectral amphtude is voiced, and according to Equation (88) if the l'th spectral amphtude is unvoiced. U w {m) = f ur w f( m m) . _ = The unvoiced scahng coefficient η w is a function of the synthesis window ws(n) and the pitch refinement window W R (n). It is computed according to the formula: The frequency bands edges ά / and S / are computed from ϋo according to equations (90) and (91), respectively. / = - ■■ -(/ + .5) - u* (91) FinaUy, the very low frequency and very high frequency components of U w (m) axe set equal to zero as shown in the foUowing equation. The sequence ύ ω (n), defined as the 256 point Inverse Discrete Fourier Transform of U w {m), is the unvoiced speech for the current frame. The sequence ύ w (n) is computed as shown in the foUowing equation. 1 ύ ω (n) = -- J ϋ w [m) i ^ 1 for -128 < n < 127 (93) * ^ 6 =-128 In order to generate s uv (n), ύ w (n) must be combined with the unvoiced speech from the previous frame. This is accomphshed using the Weighted Overlap Add algorithm described in [6]. is used to denote the unvoiced speech for the current frame, and ύ w ( , —1) is used to denote the unvoiced speech for the previous frame, then 3 ut ,(π) is given by « f n\ - w s(n)ύw(n,-l) + ws(.n - N)ύ w (n - N,0) Su ;(n = ω| Tr(Tn) +~, — u; 2 ?(n - N Sn) for 0 < n < N (94) In this equation u>s(n) is assumed to be zero outside the range —105 < n < 105, and ύ„,(n,0) and ύ„,(n, —1) are assumed to be zero outside the range —128 < n < 127. 7.3 Voiced Speech Synthesis The voiced speech is synthesized by summing a voiced signal for each spectral amphtude according to the foUowing equation. maxfI(-i) (o)] s v (n) = ∑ 2 - S v , / (n) f or 0 n < N (95) /=ι The reader is referred to [1,5] for background information on the algorithm described in this section. The voiced synthesis algorithm attempts to match the l'th. spectral amphtude of the current frame with the 'th spectral amphtude of the previous frame. The algorithm assumes that that all spectral amphtudes outside the allowed range are equal to zero as shown in Equations (96) and (97). M / (0) = 0 for / > 2(0) (96) Mj(-l) = 0 for / > X(-l) (97) In addition it assumes that these spectral amphtudes are unvoiced. These assumptions are needed for the case where the number of spectral amphtudes in the current frame is not equal to the number of spectral amphtudes in the previous frame (i.e. X(0) ≠ X(— 1)). The signal S υ j(n) is computed differently for each spectral amphtude. If the 'th spectral amphtude is unvoiced for both the previous and current speech frame then s vj (n) is set equal to zero as shown in the foUowing equation. In this case the energy in this region of the spectrum is completely synthesized by the unvoiced synthesis algorithm described in the previous section. SυΛ ) = for 0 < n < N (98) Alternatively, if the 'th spectral amphtude is unvoiced for the current frame and voiced for the previous frame then -s v Λ n ) 1B iven by the foUowing equation. In this case the energy in this region of the spectrum transitions from the voiced synthesis algorithm to the unvoiced synthesis algorithm. SvA") = w s (n) Mi(-l) cos[ώo(- 1) n / + φι(- 1)] for 0 < n < N (99) SimUarly, if the 'th spectral amphtude is voiced for the current frame and unvoiced for the previous frame then s υ j(n) is given by the foUowing equation. In this case the energy in this region of the spectrum transitions from the unvoiced synthesis algorithm to the voiced synthesis algorithm. s Vι i{n) = w s (n - N) M,(0) cos[ώo(0)(n - N) I + φι(0)] for 0 < n < N (100) Otherwise, if the /'th spectral amphtude is voiced for both the current and the previous frame, and if |ώo(0) -ώo(-l)| > .1 ώo(0), then S v j(n) is given by the foUowing equation. In this case the energy in this region of the spectrum is completely synthesized by the voiced synthesis algorithm. s υ j(n) = tϋs(n) M/(-l) cos[ώo(-l) n/ + ψ / (-l)] + u. 5 (n - N) M/(0) cos[ώo(0)(n - N)/ + ^(0)] (101) The variable n is restricted to the range 0 < n < N. The synthesis window ws(n) used in Equations (99), (100) and (101) is assumed to be equal to zero outside the range -105 < n < 105. A final rule is used if the 'th spectral amphtude is voiced for both the current and the previous frame, and if |άto(0) - ώo(-l)| < .1 ώo(0). In this case s v j(n) is given by the foUowing equation, and the energy in this region of the spectrum is completely synthesized by the voiced synthesis algorithm. S v ,.(n) = α,(n) cos[0,(n)] for 0 < n < N (102) The amphtude function cj(n) is given by, a,(n) = M,(-l) + [M,(0) - M / (-l)] (103) and the phase function 0/(π) is given by Equations (104) through (106). /n 2 Ofa) = Λ(-l) + [ώto(-l) • ' + Δw/(0)Jn + [ώ 0 (0) - ώ 0 (-l)] • — (104) IN Δ (0) = &(0) ~ Λ(-l) ~ [ώb(-l) + ώo(0)] • — (105) The phase parameter φι which is used in the above equations must be updated each frame using Equations (107) through (109). The notation φι(0) and φι(0) refers to the parameter values in the current frame, while φι(— 1) and φι{— 1) denotes their counterparts in the previous frame. IN /(0) = Φι{- 1) + [ώo(-l) + ώ 0 ( Q )I • — for 1 < / < 51 (107) Φι( ) *+ ^ for L-f J < < max[X(-l), X(0)] The parameter X BV (0) is equal to the number of unvoiced spectral amphtudes in the current frame, and the parameter pι(Q) used in equation (108) is defined to be a random number which is uniformly distributed in the interval [— r, x). This random number can be generated using the foUowing equation, where u(l) refers to shifted noise sequence for the current frame, which is described in Section 7.2. Note that φι(0) must be updated every frame using Equation (107) for 1 < / < 51, regardless of the value of X or the value of the V/UV decisions. Once s Vt/ (n) is generated for each spectral amphtude the complete voiced component is generated according to equation (95). The synthetic speech signal is then computed by summing the voiced and unvoiced components as shown in equation (110). J(n) = s ttV (n) + s v (n) for 0 < n < N. (110) This completes the IMBE speech synthesis algorithm. Table 12: Breakdown of Algorithmic Delay 8 Additional Notes The total algorithmic delay is 78.75ms. This does not include any processing delay or transmission delay. The break down of the delay is shown in Table 12 Throughout the figures and flow charts, the variable x is equivalent to the variable x. For example the variable X in Figure 13 refers to the variable X in the text. This notational discrepancy is a consequence of the graphical software used to produce this document. A Variable Initialization B Initial Pitch Estimation Window Pitch Refinement Window - - D FIR Low Pass Filter E Mean Prediction Residual Quantizer Levels ediction Residual Block Average Quantization Vectors - - - - 2/10830 - 96 - - - - - /108 - 101 - - - Quantizer Vector 736 1.Q67854 0.837118 -0.464543 -0.492255 -0.384354 -0.563780 737 0.908982 1.528894 -0.409411 -1.477329 -0.876626 0.325529 738 0.659183 0.867163 -0.526189 -0.336544 0.266281 -0.929854 739 0.910398 1.021428 -0.606754 -1.690298 0.333340 0.031927 740 0.665292 1.305351 -0.284063 -0.074919 -0.595487 -1.016135 741 0.810900 0.906065 -0.356411 -0.259857 -0.777033 -0.323624 742 0.698607 1.540071 -0.138335 0.154711 -0.095495 -2.159519 743 0.828931 0.773549 -0.648167 0.205305 -0.082341 -1.077237 744 1.035539 2.147201 0.102250 -0.985304 -0.951437 -1.348209 745 0.771602 1.537148 0.023990 -0.375673 -0.997600 -0.959427 746 0.963166 1.313640 0.044302 -0.472714 -0.501268 -1.347086 747 0.732260 0.885521 -0.057732 -0.510388 -0.446793 -0.602828 748 0.723920 2.113869 0.028029 0.072072 -1.094701 -1.843150 749 1.028151 0.917838 0.032486 -0.020166 -0.753818 -1.204452 750 1.049587 0.847932 -0.119042 -0.062491 -0.039036 -1.676910 751 0.711156 1.046887 -0.082722 0.498057 -0.548487 -1.624852 752 0.730230 1.396163 0.331360 -0.860849 -1.131899 -0.464965 753 0.881444 0.930492 0.162932 -0.790161 -1.116540 -0.068127 754 0.755704 1.264275 0.132503 -0.982095 -0.361487 -0.808860 755 0.950261 0-863869 0.542618 -0.916468 -0.675289 -0.764951 756 0.800224 1.163514 0.484118 -0.526432 -0.948121 -0.973261 757 0.759073 1.139259 0.298668 0.168122 -1.412991 -0.952091 758 0.897684 0.923979 0.641481 -0.361091 -0.534791 -1.567221 759 1.059396 0.778032 0.390139 -0.772356 -0.192180 -1.262991 760 0.644600 1.566101 1.168977 -0.114448 -0.946085 -2.319105 761 0.810781 0.881695 0.890725 -1.021031 -1.047354 -0.514775 762 0.807760 1.251866 1.458648 -0.517903 -0.725806 -2.274525 763 0.878220 1.151283 0.904055 -0.950605 -0.300031 -1.682882 764 1.051069 1.605839 1.943525 0.422384 •1.690559 -3.332219 765 0.698050 0.889581 184059 -0.075128 •1.612205 -1.084317 766 0.754748 1.162021 1.114658 0.932107 ■ 1.462001 -2.501494 767 0.928043 0.980764 0.748813 0.220816 1.172848 -1.705548 Quantizer Vector 800 1.113377 0.423909 -0.350878 -0.349413 -0.032109 -0.804846 801 1.391287 0.205485 -1.112374 -1.053568 0.167451 0.401759 802 1.258574 0.529991 -1.058461 -0.217937 0.316145 -0.828273 803 1.557443 0.134419 -0.784606 -0.470884 0.194697 -0.631029 804 1.123889 0.324566 -0.413198 1.019312 -0.593714 -1.460815 805 1.424896 0.132296 -0.956908 0.097960 -0.574372 -0.123832 806 1.114208 0.174453 -0.514443 -0.095098 0.930183 -1.609262 807 1.406068 0.476954 -0.934339 0.415907 -0.39.6806 -0.967745 808 1.459057 0.508394 -0.166010 -0.538420 -0.806214 -0.456767 809 1.299506 0.156071 -0.122942 -0.545150 -0.916507 0.129062 810 1.693019 0.303393 -0.344569 -0.544582 -0.462293 -0.644928 811 1.490250 0.110190 -0.211768 -0.894662 -0.222186 -0.271784 812 1.253319 0.368373 -0.186163 0.307421 -0.555753 -1.187157 813 1.100344 0.359210 -0.346801 -0.381044 -0.599926 -0.131743 814 1.584697 0.211893 -0.207103 0.494673 0.243191 -2.327311 815 1.718991 0.270794 -0.266590 0.067791 -0.155798 -1.635148 816 1.611612 0.542995 -0.043567 -0.318131 -0.601703 -1.191166 817 1.086250 0.320294 0.209568 -1.246123 -0.411722 0.041773 818 1.126973 0.155463 0.035945 -0.315373 0.275449 -1.278417 819 1.539142 0.157958 0.230231 -0.637832 -0.307778 -0.981681 820 1.330283 0.458990 0.237640 0.796315 -1.064190 -1.758998 821 1.189861 0.256401 0.021205 0.116117 -1.072125 -0.511420 822 1.451143 0.451207 0.113187 1.215563 -0.424395 -2.806664 823 1.317885 0.147666 -0.099792 -0.042880 -0.064126 -1.258712 824 1.301633 0.329117 0.374438 -0.232333 -0.843961 -0.928854 825 1.209469 0.143386 1.025251 -0.722079 -1.060738 -0.595249 826 1.675140 0.451737 0.538691 -0.768402 -0.499149 -1.397977 827 1.168223 0.338396 0.300066 -0.606049 -0.759432 -0.441164 828 1.588523 0.406328 1.062368 0.447130 -1.663600 -1.840709 829 1.219895 0.499146 1.605775 -0.161465 -1.639130 -1.524181 830 1.388833 0.406096 1.193858 -0.109652 -0.951404 -1.927691 831 1.468814 0.364918 0.405539 i 0.095785 -0.772066 -1.562950 pectral Amplitude Bit Allocation - - - - H Bit Frame Format Speech Synthesis Window J Flow Charts Encoder Channel Decoder Flow Chart 1: IMBE Voice Coder Flow Chart 2: Initial Pitch Estimation Flow Chart 3: Look-Back Pitch Tracking Flow Chart 4: Look-Ahead Pitch Tracking (1 of 3) (e) Flow Chart 4: Look-Ahead Pitch Tracking (2 of 3) Flow Chart 4: Look-Ahead Pitch Tracking (3 of 3) Flow Chart 5: VUV Determination (1 of 2) Flow Chart 5: V/UV Determination (2 of 2) (a) (b) Flow Chart 6: Unvoiced Speech Synthesis (1 of 2) Flow Chart 6: Unvoiced Speech Synthesis (2 of 2) ( Flow Chart 7: Voiced Speech Synthesis (lof2) (a) (b) (c) Flow Chart 7: Voiced Speech Synthesis (2 of 2) - - Flow Chart 8: Spectral Amplitude Enhancement - 158 - (a) Flow Chart 9: Adaptive Smoothing (1 of 3) (a) (b) (c) Flow Chart 9: Adaptive Smoothing (2 of 3) (b) (C) Flow Chart 9: Adaptive Smoothing (3 of 3) - - (a) Flow Chart 10: FEC Encoding (1 of 2) Flow Chart 10: FEC Encoding (2 of 2) (a) (b) (C) Flow Chart 11: Pitch Refinement (lof2) (a) (b) (c) Flow Chart 11: Pitch Refinement (2 of 2) References [1] L. B. Almeida and F. M. Silva, "Variable Frequency Synthesis: An Improved Harmonic Coding Scheme," Proc. ICASSP 84, San Diego, CA, pp. 289-292, March 1984. [2] M. S. Brandstein et. al., "A Real-Time Implementation of the Improved MBE Speech Coder," Proc. ICASSP 90, Albuquerque, N.M., pp. 5-8, April 1990. [3] J. P. Campbell et. al., "The new 4800 bps Voice Coding Standard," Proc. Mil. Speech Tech. 89, Washington D.C, pp. 64-70, Nov. 1989. [4] B. Atal et. al.. Editors, Advances in Speech Coding, pp. 215-224, Kluwer Academic Publishers, 1991. [5] D. W. Griffin and J. S. Lim, "Multiband Excitation Vocoder," IEEE Transactions on ASSP, Vol. 36, No. 8, August 1988. [6] D. W. Griffin and J. S. Lim, "Signal Estimation From Modified Short-Time Fourier Transform," IEEE Transactions on ASSP, Vol. 32, No. 2, pp. 236-243, April 1984. [7] J. C. Hardwick and J. S. Lim, "A 4800 bps Improved Multi-Band Excitation Speech Coder," Proc. of IEEE Workshop on Speech Coding for Tele., Vancouver, B.C., Canada, Sept 5-8, 1989. [8] J. C. Hardwick, "A 4.8 Kbps Multi-Band Excitation Speech Coder," S.M. Thesis, E.E.C.S Department, M.I.T., May 1988. [9] N. Jayant and P. Noll, Digital Coding of Waveforms, Prentice-Hall, 1984. [10] A. Levesque and A. Michelson, Error-Control Techniques for Digital Communication, Wiley, 1985. [11] Lin and Costello, Error Control Coding: Fundamentals and Applications, Prentice- Hall, 1983. [12] Makhoul et. al., "Vector Quantization in Speech Coding," Proc. of the IEEE, pp. 1551-1588, 1985. [13] R. McAulay and T. Quatieri, "Speech Analysis-Synthesis Based on a Sinusoidal Rep¬ resentation," IEEE Transactions on ASSP, Vol. ASSP-34, No. 4, Aug. 1986. [14] W. Press et. al., Numerical Recipes in C, Cambridge University Press, 1988. [15] A. Oppenheim and R. Schafer, Discrete Time Signal Processing, Prentice-Hall, 1989.

Claims: Claims 1. A method of encoding speech wherein the speech is broken into segments and for each segment the spectrum is sampled at a set of frequencies to form a set of spectral amplitudes, with the frequencies at which the spectrum is sampled generally differing from one segment to the next, and wherein the spectral amplitudes for at least one previous segment are used to predict the spectral amphtudes for a current segment, and wherein the prediction residuals based on the difference between the actual spectral amphtudes for the current segment and the predicted spectral ampli- tudes for the current segment are used in subsequent encoding, characterized in that the predicted spectral amphtudes for the current segment are based at least in part on interpolating the spectral amplitudes of a previous segment to estimate the spectral amphtudes in the previous segment at the frequencies of the current segment. 2. A method of encoding speech wherein the speech is broken into segments and for each segment the spectrum is sampled at a set of frequencies to form a set of spectral amphtudes, with the frequencies at which the spectrum is sampled generally differing from one segment to the next, and wherein the spectral amphtudes for at least one previous segment axe used to predict the spectral amphtudes for a current segment, and wherein prediction residuals based on the difference between the actual spectral amplitudes for the current segment and the predicted spectral amphtudes for the current segment are used in subsequent encoding, characterized in that the prediction residuals are grouped into a predetermined number of blocks, the number of blocks being independent of the number of residuals for particular blocks, and the blocks are encoded. 3. The method of claim 2 wherein the predicted spectral amphtudes for the current segment are based at least in part on interpolating the spectral amphtudes of a previous segment to estimate the spectral amplitudes in the previous segment at the frequencies of the current segment. 4. A method of encoding speech wherein the speech is broken into segments and for each segment the spectrum is sampled at a set of frequencies to form a set of spectral amphtudes, with the frequencies at which the spectrum is sampled generally differing from one segment to the next, and wherein the spectral amphtudes for at least one previous segment are used to predict the spectral amplitudes for a current segment, and wherein prediction residuals based on the difference between the actual spectral amplitudes for the current segment and the predicted spectral amplitudes for a current segment are used in subsequent encoding, characterized in that the prediction residuals are grouped into blocks, the average of the prediction residuals within each block is determined, the average of all of the blocks are grouped into a prediction residual block average (PRBA) vector, and the PRBA vector is encoded. 5. The method of claim 4 wherein there are a predetermined number of blocks, with the number being independent of the number of prediction segments. 6. The method of claim 5 wherein the predicted spectral amphtudes for the current segment are based at least in part on interpolating the spectral amplitudes of a previous segment to estimate the spectral amplitudes in the previous segment at the frequencies of the current segment. 7. The method of claim 4 wherein the difference between the actual spectral am- plitudes for the current segment and the predicted spectral amplitudes for the current segment is formed by subtracting a fraction of the predicted spectral amplitudes from the actual spectral amplitudes. 8. The method of claim 1, 2 or 4 wherein the spectral amplitudes are obtained using the Multiband Excitation speech model. 9. The method of claim 1, 2 or 4 wherein only spectral amplitudes from the most recent previous segment are used in forming the predicted spectral amphtudes of the current segment. 10. The method of claim 1, 2 or 4 wherein the set of frequencies for a given segment are multiples of the fundamental frequency of the segment. 11. The method of claim 2, 5 or 6 wherein the number of blocks is equal to six (6). 12. The method of claim 2, 5 or 6 wherein the number of prediction residuals in a lower frequency block is not larger than the number of prediction residuals in a higher frequency block. 13. The method of claim 11 wherein the number of prediction residuals in a lower frequency block is not larger than the number of prediction residuals in a higher frequency block. 14. The method of claim 13 wherein the difference between the number of elements in the highest frequency block and the number of elements in the lowest frequency block is less than or equal to one. 15. The method of claim 4, 5 or 6 wherein said average is computed by adding the spectral amphtude prediction residuals within the block and dividing by the number of prediction residuals within that block. 16. The method of claim 15 wherein said average is obtained by computing the DCT of the spectral amplitude prediction residuals within a block and using the first coefficient of the DCT as the average. 17. The method of claim 4, 5 or 6 wherein the PRBA vector is encoded using one of two methods: (1) performing a transform such as the DCT on the PRBA vector and scalar quantizing the transform coefficients; (2) vector quantizing the PRBA vector. 18. The method of claim 17 wherein said vector quantization is performed using a method comprising the steps of: determining the average of the PRBA vector; quantizing said average using scalar quantization; subtracting said average from the PRBA vector to form a zero-mean PRBA vector; and - o - quantizing said zero-mean PRBA vector using vector quantization with a zero- mean code-book. 19. A method of encoding speech wherein the speech is broken into segments, and voiced/unvoiced decisions are made for each segment or for each band within a segment, and for each segment the spectrum is sampled at a set of frequencies to form a set of spectral amphtudes, characterized in that the bit error rate is estimated for a current speech segment and compared to a predetermined error-rate threshold, the voiced/unvoiced decisions for spectral amplitudes above a predetermined energy threshold are all declared voiced for the current segment when the estimated bit error rate is above the error-rate threshold. 20. The method of claim 19 wherein the predetermined energy threshold is de- pendent on the estimate of bit error rate for the current segment. 21. A method of encoding speech wherein the speech is encoded using a speech model characterized by model parameters, wherein the speech is broken into time segments and for each segment model parameters are estimated and quantized, and wherein at least some of the quantized model parameters are coded using error cor- rection coding, characterized in that at least two types of error correction coding are used to code the quantized model parameters, a first type of coding, which adds a greater number of additional bits than a second type of coding, is used for a first group of quantized model parameters, which is more sensitive to bit errors than a second group of quantized model parameters. 22. The method of claim 21 wherein the different types of error correction coding include Golay codes and Hamming codes. 23. A method of encoding speech wherein the speech is encoded using a speech model characterized by model parameters, wherein the speech is broken into time seg- ments and for each segment model parameters are estimated and quantized, wherein at least some of the quantized model parameters are coded using error correction cod- ing, and wherein speech is synthesized from the decoded quantized model parameters, characterized in that the error correction coding is used in synthesis to estimate the error rate, and one or more model parameters from a previous segment are repeated in a current segment when the error rate for the parameter exceeds a predetermined level. 24. The method of claim 21, 22 or 23 wherein the quantized model parameters are those associated with the Multi-Band Excitation (MBE) speech coder or Improved Multi-Band Excitation (IMBE) speech coder. 25. The method of claim 21 or 22 wherein error rates are estimated using the error correction codes. 26. The method of claim 25 wherein one or more model parameters are smoothed across a plurality of segments based on estimated error rate. 27. The method of claim 26 wherein the model parameters smoothed include voiced/unvoiced decisions. 28. The method of claim 26 wherein the model parameters smoothed include parameters for the Multi-Band Excitation (MBE) speech coder or Improved Multi- Band Excitation (IMBE) speech coder. 29. The method of claim 28 wherein the value of one or more model parameters in a previous segment are repeated in a current segment when the estimated error rate for the parameters exceeds a predetermined level. 30. A method of enhancing speech wherein a speech signal is broken into segments, and wherein frequency domain representations of a segment is determined to provide a spectral envelope of the segment, and speech is synthesized from an enhanced spectral envelope, characterized in that a smoothed spectral envelope of the segment is generated by smoothing the spectral envelope, and an enhanced spectral envelope is generated by increasing some frequency regions of the spectral envelope for which the spectral envelope has greater amplitude than the smoothed envelope and decreasing _ _ some frequency regions for which the spectral envelope has lesser amplitude than the smoothed envelope. 31. The method of claim 30 wherein the frequency domain representation of the spectral envelope is the set of spectral amplitude parameters of the Multi-Band Excitation (MBE) speech coder or Improved Multi-Band Excitation (IMBE) speech coder. 32. The method of claim 30 or 31 wherein the smoothed spectral envelope is generated by estimating a low-order model from the spectral envelope. 33. The method of claim 32 wherein the low-order model is an all-pole model.

Inventors: HARDWICK JOHN C, LIM JAE S, HARDWICK, JOHN, C., LIM, JAE, S.
Applicants: DIGITAL VOICE SYSTEMS INC, DIGITAL VOICE SYSTEMS, INC.
Application year: 1991
Main classification: G10L5
IPC codes: G10L19, H03M13