Methods and apparatus with bit allocation for quantizing and de-quantizing of transformed voice signals

Abstract: Reconstructing adaptively transformed voice signals is done using noise shaping (110) to scale the spectral envelope (98) before generating the bit allocation (111). Generating discrete cosine transform coefficients (80) is accomplished by determining from the bit allocation (111) to which of the transform coefficients (80) no bits were allocated, retrieving the spectral envelope information (98) corresponding to the transform coefficients (80) to which no bits are allocated and substituting each item of spectral envelope information (98) into the block of quantized (82) transform coefficients (80) after each item has been given a sign and scaled.

Description: Field of the Invention The present invention relates to the field of speech coding, and more particularly, to improvements in the field of adaptive transform coding of speech signals wherein the resulting digital signal is maintained at a minimum bit rate. Background of the Invention One of the first digital telecommunication carriers was the 24-voice channel 1.544 Mb/s T1 system, introduced in the United States in approximately 1962. Due to advantages over more costly analog systems, the T1 system became widely deployed. An individual voice channel in the T1 system is generated by band limiting a voice signal in a frequency range from about 300 to 3400 Hz, sampling the limited signal at a rate of 8 kHz, and thereafter encoding the sampled signal with an 8 bit logarithmic quantizer. The resultant signal is a 64 kb/s digital signal. The T1 system multiplexes the 24 individual digital signals into a single data stream. Because the data transmission rate is fixed at 1.544 Mb/s, the T1 system is limited to 24 voice channels when using the 8 kHz sampling and 8 bit logarithmic quantizing scheme. In order to increase the number of channels and still maintain a system transmission rate of approximately 1.544 Mb/s, the individual signal transmission rate must be reduced from 64 kb/s to some lower rate. One method used to reduce this rate is known as transform coding. In transform coding of speech signals, the individual speech signal is divided into sequential blocks of speech samples. The samples in each block are thereafter arranged in a vector and transformed from the time domain to an alternate domain, such as the frequency domain. Transforming the block of samples to the frequency domain creates a set of transform coefficients having varying degrees of amplitude. Each coefficient is independently quantized and transmitted. On the receiving end, the samples are dequantized and transformed back into the time domain. The importance of the transform coding is that the signal representation in the transform domain reduces the amount of redundant information, i.e. there is less correlation between samples. Consequently, fewer bits are needed to quantize a given sample block with respect to a given error measure (eg. mean square error distortion) than the number of bits which would be required to quantize the same block in the original time domain. Since fewer bits are needed for quantization, the transmission rate for an individual channel can be reduced. While the transform coding scheme in theory satisfied the need to reduce the bit rate of individual T1 channels, historically the quantization process produced unacceptable amounts of noise and distortion. In general, quantization is the procedure whereby an analog signal is converted to digital form. Max, Joel "Quantization for Minimum Distortion" IRE Transactions on Information Theory, Vol. IT-6 (March, 1960), pp. 7-12 (MAX) discusses this procedure. In quantization, the amplitude of a signal is represented by a finite number of output levels. Each level has a distinct digital representation. Since each level encompasses all amplitudes falling within that level, the resultant digital signal does not precisely reflect the original analog signal. The difference between the analog and digital signals is quantization noise. Consider for example the uniform quantization of the signal x, where x is any real number between 0.00 and 10.00, and where five output levels are available, at 1.00, 3.00, 5.00, 7.00 and 9.00, respectively. The digital signal representative of the first level in this example can signify any real number between 0.00 and 2.00. For a given range of input signals, it can be seen that the quantization noise produced is inversely proportional to the number of output levels. Additionally, in early quantization investigations for transform coding, it was found that not all transform coefficients were being quantized and transmitted at low bit rates. Attempts to improve transform coding involved investigating the quantization process using dynamic bit assignment and dynamic step-size determination processes. Bit assignment was adapted to short term statistics of the speech signal, namely statistics which occurred from block to block, and step-size was adapted to the transform's spectral information for each block. These techniques became known as adaptive transform coding methods. In adaptive transform coding, optimum bit assignment and step-size are determined for each sample block by adaptive algorithms which operate upon the variance of the amplitude of the transform coefficients in each block. The spectral envelope is that envelope formed by the variance of the transform coefficients in each sample block. Knowing the spectral envelope in each block, allows a more optimal selection of step size and bit allocation, yielding a more precisely quantized signal having less distortion and noise. Since variance or spectral envelope information is developed to assist in the quantization process prior to transmission, this same information will be necessary in the de-quantization process at reception. Consequently, in addition to transmitting the quantized transform coefficients, adaptive transform coding also provides for the transmission of the variance or spectral envelope information. This is referred to as side information. The spectral envelope represents in the transform domain the dynamic properties of speech, namely formants. Speech is produced by generating an excitation signal which is either periodic (voiced sounds), aperiodic (unvoiced sounds), or a mixture (eg. voiced fricatives). The periodic component of the excitation signal is known as the pitch. During speech, the excitation signal is filtered by a vocal tract filter, determined by the position of the mouth, jaw, lips, nasal cavity, etc. This filter has resonances or formants which determine the nature of the sound being heard. The vocal tract filter provides an envelope to the excitation signal. Since this envelope contains the filter formants, it is known as the formant or spectral envelope. Hence, the more precise the determination of the spectral envelope, the more optimal the step-size and bit allocation determinations used to code transformed speech signals. The development of particular adaptive transform coding techniques was described in Improved Adaptive Transform Coding, Serial Number 199,360 and will not be repeated herein. The novel apparatus and methods described in that case were an advance in the art because adaptive transform coding at a rate of 16 kb/s in a single so-called LSI digital signal processor became possible for the first time. Such results were achieved by generating an even extension of each block of time domain samples, generating an auto-correlation function from such extension, deriving linear prediction coefficients from the auto-correlation function and performing a Fast Fourier Transform on such linear prediction coefficients such that the variance or formant information of each transform coefficient was equal to the square of the gain of each FFT coefficient. It was also disclosed that the number of bits to be assigned to each transform coefficient was achieved by determining the logarithm of a predetermined base of the formant information of the transform coefficients then determining the minimum number of bits which will be assigned to each transform coefficient and then determining the actual number of bits to be assigned to each of the transform coefficients by adding the minimum number of bits to the logarithmic number. The problem with this device was that as the transmission rate was reduced below 16 kb/s, not all portions of the signal were quantized and transmitted. One reason for losing essential speech elements in early adaptive transform coders was that such coders were non-speech specific. In speech specific techniques both pitch and formant (i.e. spectral envelope) information are taken into account during bit assignment to ensure that certain information was assigned bits and quantized. One prior speech specific technique described in Tribolet, J., et al. "Frequency Domain Coding Of Speech", IEEE Transactions On Acoustics, Speech, and Signal Processing, Vol. ASSP-27, No. 5 (October, 1979), pp. 512-530 took pitch information, or pitch striations, into account by generating a pitch model from the pitch period and the pitch gain. To determine these two factors, this technique searched the pseudo-ACF to determine a maximum value which became the pitch period. The pitch gain was thereafter defined as the ratio between the value of the pseudo-ACF function at the point where the maximum value was determined and the value of the pseudo-ACF at its origin. With this information the pitch striations, i.e. a pitch pattern in the frequency domain, could be generated. To generate the pitch pattern in the frequency domain using this prior technique, one would define a time domain impulse sequence. This sequence was windowed by a trapezoidal window to generate a finite sequence of length 2N. To generate a spectral response for only N points, a 2N-point complex FFT was taken of the sequence. The magnitude of the result, when normalized for unity gain, yielded the required spectral response. In order to generate the final spectral estimate, the pitch striations and the spectral envelope were multiplied and normalized. In graphing the combined pitch striation and spectral envelope information, the pitch striations appear as a series of "U" shaped curves wherein there exists a number of replications in a 2N-point window. This entire process was adaptively performed for each sample block. The problem with this prior technique was its implementation complexity. In Speech Specific Adapting Transform Coder, Serial number 199,015, pitch striations were taken into account with a much simpler implementation. Consider a case, in light of the previously described Tribolet, et al. technique, where the pitch period is one (1) and the window used to generate a finite sequence is rectangular. The resultant spectral response of the pitch is a single "U" shape. In Serial Number 199,015, it was said that for different values of the pitch period, other than one (1), the spectral response, is solely a sampled version of the pitch spectral response where the pitch period is one. Additionally, it was stated that the differences between the pitch striations for different values of pitch gain, maintaining the same pitch period, when scaled for energy and magnitude, are mainly related to the width of the "U" shape. Based on the above, it was determined that it was not necessary to adaptively determine the pitch spectral response for each sample block, but rather, such information was generated by using information developed before hand. The pitch spectral response, was adaptively generated from a look-up-table developed before hand and stored in data memory. Before the look-up-table was sampled to generate pitch information, it was first adaptively scaled for each sample block in relation to the pitch period and the pitch gain. Once the scaling factor was determined, the look-up-table was multiplied by the scaling factor and the resulting scaled table was sampled modulo 2N to determine the pitch striations. Similar to Serial Number 199,360, the problem with this technique is that while providing good performance at 16 kb/s, the same problem exhibited by prior systems emerged at rates of approximately 9.6 kb/s, namely certain speech elements were lost due to non-quantization. This loss was particularly apparent for sounds such as "sh", "th", "ph", "sc" and "pth". In Atal, B.S., Predictive Coding of Speech at Low Bit Rates, IEEE Transactions on Communications, Vol. COM-30, No. 4 (April, 1982), pages 600-614, it is suggested that the use of so-called adaptive predictive coding of speech signals can achieve transmission rates of 10 kb/s or less. In predictive coding, redundant structure is now removed from a time domain signal which is thereafter quantized and transmitted. Such structure is removed by estimating a predictor value and subtracting that value from a current signal value. The predictor is transmitted separately and added back to the time domain signal by the receiver. The predictor is said to include two components, one based on the short-time spectral envelope of the speech signal and the other based on the short-time spectral fine structure, which is determined mainly by the pitch period and the degree of voice periodicity. Atal also suggests the use of noise shaping in predictive coding to control the spectrum of the quantizing noise. Particularly, Atal utilizes a prefilter/post-filter approach to produce a noise-shaped predictive model spectrum. The problem with the Atal approach is its implementation complexity. It will also be noted that until the present invention, transform coding and predictive coding were separate and distinct techniques. Accordingly, a need still exists for an adaptive transform coder which is capable of efficient operation at lower bit rates, has low noise levels, and which is capable of reasonable cost and processing time implementation. Summary of the Invention The objects and advantages of the invention are achieved in an apparatus and method as set forth in the appended claims. These and other objects and advantages of the invention will become more apparent from the following detailed description when taken in conjunction with the following drawings. Brief Description of the Drawings Fig. 1 is a schematic view of an adaptive transform coder in accordance with the present invention; Fig. 2 is a general flow chart of those operations performed in the adaptive transform coder shown in Fig. 2, prior to transmission; Fig. 3a and 3b are flow charts of those operations performed in the adaptive transform coder shown in Fig. 1, when determining voiced blocks; Fig. 4 is a more detailed flow chart of the LPC coefficients operation shown in Figs. 2 and 7; Fig. 5 is a more detailed flow chart of the integer bit allocation operation shown in Figs. 2 and 7; Fig. 6 is a more detailed flow chart of the envelope generation operation shown in Figs. 2 and 7; Fig. 7 is a flow chart of those operations performed in the adaptive transform coder shown in Fig. 1, subsequent to reception; Fig. 8 is a histogram used to develop a sign table; and Fig. 9 is a flow chart of those operations performed in the adaptive transform coder shown in Fig. 1, subsequent to reception to perform energy substitution. Detailed Description of the Preferred Embodiment As will be more completely described with regard to the figures, the present invention is embodied in a new and novel apparatus and method for adaptive transform coding wherein rates have been significantly reduced. Generally the present invention enhances signals transmitted by adaptive transform coding using reduced transmission rates by scaling the bit allocation and by reconstruction of lost signal. In other words, a transform coder in accordance with the present invention distributes the bits more evenly for the quantization of non-voiced signals and substitutes a reconstructed signal for those signal components which were not quantized. An adaptive transform coder in accordance with the present invention is depicted in Fig. 1 and is generally referred to as 10. The heart of coder 10 is a digital signal processor 12, which in the preferred embodiment is a TMS320C25 digital signal processor manufactured and sold by Texas Instruments, Inc. of Houston, Texas. Such a processor is capable of processing pulse code modulated signals having a word length of 16 bits. Processor 12 is shown to be connected to three major bus networks, namely serial port bus 14, address bus 16, and data bus 18. Program memory 20 is provided for storing the programming to be utilized by processor 12 in order to perform adaptive transform coding in accordance with the present invention. Such programming is explained in greater detail in reference to Figs. 2 through 9. Program memory 20 can be of any conventional design, provided it has sufficient speed to meet the specification requirements of processor 12. It should be noted that the processor of the preferred embodiment (TMS320C25) is equipped with an internal memory. Although not yet incorporated, it is preferred to store the adaptive transform coding programming in this internal memory. Data memory 22 is provided for the storing of data which may be needed during the operation of processor 12, for example, logarithmic tables the use of which will become more apparent hereinafter. A clock signal is provided by conventional clock signal generation circuitry, not shown, to clock input 24. In the preferred embodiment, the clock signal provided to input 24 is a 40 MHz clock signal. A reset input 26 is also provided for resetting processor 12 at appropriate times, such as when processor 12 is first activated. Any conventional circuitry may be utilized for providing a signal to input 26, as long as such signal meets the specifications called for by the chosen processor. Processor 12 is connected to transmit and receive telecommunication signals in two ways. First, when communicating with adaptive transform coders constructed in accordance with the present invention, processor 12 is connected to receive and transmit signals via serial port bus 14. Channel interface 28 is provided in order to interface bus 14 with the compressed voice data stream. Interface 28 can be any known interface capable of transmitting and receiving data in conjunction with a data stream operating at the prescribed transmission rate. Second, when communicating with existing 64 kb/s channels or with analog devices, processor 12 is connected to receive and transmit signals via data bus 18. Converter 30 is provided to convert individual 64 kb/s channels appearing at input 32 from a serial format to a parallel format for application to bus 18. As will be appreciated, such conversion is accomplished utilizing known codecs and serial/parallel devices which are capable of use with the types of signals utilized by processor 12. In the preferred embodiment processor 12 receives and transmits parallel 16 bit signals on bus 18. In order to further synchronize data applied to bus 18, an interrupt signal is provided to processor 12 at input 34. When receiving analog signals, analog interface 36 serves to convert analog signals by sampling such signals at a predetermined rate for presentation to converter 30. When transmitting, interface 36 converts the sampled signal from converter 30 to a continuous signal. With reference to Figs. 2-9, the programming will be explained which, when utilized in conjunction with those components shown in Fig. 1, provides a new and novel adaptive transform coder. Adaptive transform coding for transmission of telecommunications signals in accordance with the present invention is shown in Fig. 2. Telecommunication signals to be coded and transmitted appear on bus 18 and are presented to input buffer 40. Such telecommunication signals are sampled signals made up of 16 bit PCM representations of each sample where sampling occurs at a frequency of 8 kHz. For purposes of the present description, assume that a voice signal sampled at 8 kHz is to be coded for transmission. Buffer 40 accumulates a predetermined number of samples into a sample block. In the preferred embodiment, there are 120 samples in each block. The pitch and pitch gain is calculated at 41 for each sample block in order to first determine the voicing, that is whether a given block is voiced or non-voiced. The significance of this information will be more fully appreciated in relation to the noise shaping operation described herein. Determining pitch is not new per se. Previously, pitch has been determined by first deriving an autocorrelation functions (ACF) of a block of samples and then searching the ACF over a specified range for a maximum value which was termed the pitch. (See Tribolet, et al.) Unfortunately, it has been discovered that components other than pitch may be present. Consequently, the ACF derived from a block of samples can exhibit spurious peaks which may lead to inaccurate pitch estimates. As shown in Fig. 3a, a block of samples supplied by buffer 40 is first filtered through low pass filter 42. In the preferred embodiment low pass filter 42 is an eight-tap finite impulse response filter having 3 dB cutoff frequencies at 1800 Hz and 2400 Hz. It will be noted that the frequency range of interest is from approximately 50 Hz to 1650 Hz. This range permits the accommodation of dual tone multi-frequency (DTMF) signals. One of the properties of the coder of the present invention is its ability to pass DTMF information. Consequently, the filter is preferred to include the frequency range of 697-1633 Hz. The filtered signal is thereafter processed utilizing a 3-level center clipping technique at 44. Referring briefly to Fig. 3b, the 3-level center clipping technique will be described in greater detail. It will be noted that center level clipping in relation to determining pitch in a speech signal is not new. Dubnowski, et al., "Real-Time Digital Hardware Pitch Detector", IEEE Transactions on Acoustics, Speech and Signal Processing, Vol. ASSP-24, No. 1 (February 1987), discloses one such technique. However, center level clipping in an adaptive transform coder is new. The sample block from low pass filter 42 is first divided into two equal segments at 46. These segments are designated in this application x 1 and x 2 . The first half x 1 of the sample block is evaluated at 48 to determine the absolute maximum value contained in x 1 . This absolute maximum value is used to derive a threshold, which in the preferred embodiment is 57% of the maximum value. It should be noted that the reason for splitting the time domain signal in half is to protect against amplitude fluctuations between blocks. Such fluctuations could affect the completeness of the subsequently developed auto correlation function and the eventual pitch determination. To prevent such events, the time domain signal, is split in half. The 3-level center clip operation is performed at 50 in accordance with the following formula: c(n) = +1 s(n) ≥ T c = -1 s(n) ≤ -T c = 0 otherwise where T c = amplitude threshold It will be seen from the above that only those values which exceed the threshold values (57% of the maximum determined at 48) are retained. Consequently, the maximum values have been emphasized which emphasis will become apparent in relation to later processing described in Fig. 3. Having performed the 3-level center clip operation with relation to the first half x 1 of the sample block, the absolute maximum for the second half x 2 of the sample block is determined at 52. The 3-level center clip operation is performed in relation to x 2 at 54. It will be noted that the threshold value utilized at step 54 is based upon the absolute maximum determined at 52. After performing the 3-level center clip operation at 54, the center clipped results are combined into a whole processed block at 56. Having performed a 3-level center clipping operation in relation to the entire sample block, the autocorrelation function of the sample block is now derived at 58 and search to determine the maximum autocorrelation function, denoted ACF (M). This maximum value is defined as the pitch. Having effectively determined the pitch at 58, pitch gain is now calculated at 60. Pitch gain is calculated according to the following formula: Pitch Gain = R(M) R(O) where R(M) is the pitch; and R(O) is the value of the autocorrelation function at its origin. Having determined the pitch gain at 60, it is now determined whether the pitch gain is greater than a threshold value at 62. It will be noted that the pitch gain is a ratio and thus is a dimensionless number. In the preferred embodiment, the threshold used at step 62 is the value 0.25. If the pitch gain is larger than this threshold value, the block of samples is termed a voiced block. If the pitch gain is less than the threshold value, the sample block is termed a non-voiced block. The significance of whether a sample block is voiced or non-voiced is important in relation to the noise shaping operation to be described herein. It has been discovered that noise shaping need not be performed on every sample. Blocks for which noise shaping is not necessary are voiced blocks. Each block of samples is windowed at 64. In the preferred embodiment the windowing technique utilized is a trapezoidal window [h(sR-N)] where each block of N speech samples are overlapped by R samples. The subject block is transformed from the time domain to the frequency domain utilizing a discrete cosine transform at 80. Such transformation results in a block of transform coefficients which are quantized at 82. Quantization is performed on each transform coefficient by means of a quantizer optimized for a Gaussian signal, which quantizers are known (See MAX). The choice of gain (step-size) and the number of bits allocated per individual coefficient are fundamental to the adaptive transform coding function of the present invention. Without this information, quantization will not be adaptive. In order to develop the gain and bit allocation per sample per block, consider first a known formula for bit allocation: R i = R ave + 0.5 * log 2 [v i 2 / V block 2 ] where: V block 2 = n th root of [Product i=1,N v i 2 ] R Total = Sum i=1,N [R i ] where : R i is the number of bits allocated to the i th DCT coefficient; R Total is the total number of bits available per block; R ave is the average number of bits allocated to each DCT coefficient; v i 2 is the variance of the i th DCT coefficient; and V block 2 is the geometric mean of v i for DCT coefficients. Equation (3) is a bit allocation equation from which the resulting R i , when summed, should equal the total number of bits allocated per block. The following new derivation considerably reduces implementation requirements and solves dynamic range problems associated with performing calculations using 16-bit fixed point arithmetic, as is required when utilizing the processor of the preferred embodiment. Equation (3) may be reorganized as follows: R i = [ Rave - log 2 (V block 2 )] + 0.5 * log 2 (v i 2 ) Since the terms within square brackets can be calculated beforehand and since they are not dependent on the coefficient index (i), such terms are constant and may be denoted as Gamma. Hence equation (6) may be rewritten as follows: R i = Gamma + 0.5 * S i S i = log 2 (v i 2 ) The term v i 2 is the variance of the i th DCT coefficient or the value the i th coefficient has in the spectral envelope. Consequently, knowing the spectral envelope allows the solution to the above equations. H(z) = Gain / (1 + Sum k=1,P [a k * z -k ]) evaluated at: z = e j 2 pi (i/2N) [i=0,N-1] where H(z) is the spectral envelope of DCT and a k is the linear prediction coefficient. Equation (9) defines the spectral envelope of a set of LPC coefficients. The spectral envelope in the DCT domain may be derived by modifying the LPC coefficients and then evaluating (9). As shown in Fig. 2, the windowed coefficients are acted upon to determine a set of LPC coefficients at 84. The technique for determining the LPC coefficients is shown in greater detail in Fig. 4. The windowed sample block is designated x(n) at 86. An even extension of x(n) is generated at 88, which even extension is designated y(n). Further definition of y(n) is as follows: y(n) = x(n) n=0,N-1 = x(2N-1-n) n=N,2N-1 An autocorrelation function (ACF) of (10) is generated at 90. The ACF of y(n) is utilized as a pseudo-ACF from which LPCs are derived in a known manner at 92. Having generated the LPCs (a k ), equation (9) can now be evaluated to determine the spectral envelope. It will be noted in Fig. 2, that in the preferred embodiment the LPCs are quantized at 94 prior to envelope generation. Quantization at this point serves the purpose of allowing the transmission of the LPCs as side information at 96. As shown in Fig. 2, the spectral envelope is determined at 98. A more detailed description of these determinations is shown in Fig. 6. A signal block z(n) is formed at 100, which block is reflective of the denominator of Equation (9). The block z(n) is further defined as follows: z(n) = 1.0n=0 = a n n=1,P = 0.0n=P+1,2N-1 Block z(n) is thereafter evaluated using a fast fourier transform (FFT). More specifically, z(n) is evaluated at 102 by using an N-point FFT where z(n) only has values from 0 to N-1. Such an operation yields the results v i 2 for i = 0, 2, 4, 6, ..., N-2. Since (8) requires the Log 2 of v i 2 , the logarithm of each variance is determined at 104. To get the odd ordered values, geometric interpolation is performed at 106 in the log domain of v i 2 . It is also possible, although not preferred, to utilize a 2N-point FFT to evaluate z(n). In such a situation it will not be necessary to perform any interpolation. The problem with using a 2N-point FFT is that it takes more processing time than the preferred method since the FFT is twice the size. The variance (v i 2 ) is determined at 108 for each DCT coefficient determined at 80. The variance v i 2 is defined to be the magnitude of (9) where H(z) is evaluated at z=e j 2 pi (i/2N) for i=0,N-1. Put more simply, consider the following: v i 2 = Mag. 2 of [Gain/ FFT i ] The term v i 2 is now relatively easy to determine since the FFT i denominator is the i th FFT coefficient determined at 106. Having determined the spectral envelope, bit allocation can be performed. It will be recalled that equations (3)-(5) set out a known technique for determining bit allocation. Thereafter equations (7) and (8) were derived. Only one piece remains to perform simplified bit allocation. By substituting equation (7) in equation (5) it follows that: R Total = 0.5 * Sum i=1,N [S i ] + N * Gamma Rearranging (15) yields the following: Gamma = [R Total - 0.5 * Sum i=1,N (S i )] / N where N is the number of samples per block and R Total is the number of bits available per block. It will be recalled that at 58 an autocorrelation function was derived and that pitch and pitch gain were calculated. It was also determined whether the subject block of samples was voiced or non-voiced. The noise shaping and bit allocation performed at 110 and 111 are shown in greater detail in Fig. 5. Utilizing (8), each S i is determined at 112, a relatively simple operation. However, if noise shaping is being performed, each S i is scaled by a factor F which is determined empirically. Noise shaping by envelope scaling achieves a similar effect to Atal's pre/post filter approach at a considerably lower computational cost. In the preferred embodiment F=1/8. It is preferred to only perform noise shaping for sample blocks which are determined to be non-voiced sample blocks. If the block is voiced, noise shaping is not performed. Having determined each S i , Gamma is determined at 114 using (16), also a relatively simple operation. In the preferred embodiment, the number of samples per block is 128. Consequently, N is known from the beginning. The number of bits available per block is also known from the beginning. Keeping in mind that in the preferred embodiment each block is being windowed using a trapezoidal shaped window and that sixteen samples are being overlapped, eight on either side of the window, the frame size is 120 samples. If transmission is occurring at a fixed frequency of, for example, 9.6 kb/s and since 120 samples takes approximately 15 ms (the number of samples 120 divided by the sampling frequency of 8 kHz), the total number of bits available per block is 144. Up to fourteen bits are required for transmitting the pitch information. The number of bits required to transmit the LPC coefficient side information is also known. Consequently, R Total is also known from the following: R Total = 144 - bits used with side information Since each S i , R Total , and N are all now known, determining Gamma at 114 is relatively simple using (16). Knowing each S i and Gamma, each R i is determined at 116 using (7). Again a relatively simple operation. This procedure considerably simplifies the calculation of each R i , since it is no longer necessary to calculate the geometric mean, V block 2 , as called for by (6). A further benefit in utilizing this procedure is that using S i as the input value to (7) reduces the dynamic range problems associated with implementing an equation such as (3) in fixed-point arithmetic for real time implementation. Having determined the quantization gain factor at 98 and now having determined the bit allocation at 111, the quantization at 82 can be completed. Once the DCT coefficients have been quantized, they are formatted for transmission with the side information at 118. The resultant formatted signal is buffered at 120 and serially transmitted at the preselected frequency, for example, at 9.6 kb/s. Consider now the adaptive transform coding procedure utilized when a voice signal, adaptively coded in accordance with the principles of the present invention, is received. It will be recalled that such signals are presented on serial port bus 14 by interface 28. Referring to Fig. 7 such signals are first buffered at 121 in order to assure that all of the bits associated with a single block are operated upon relatively simultaneously. The buffered signals are thereafter de-formatted at 122. The LPC coefficients, pitch period, and pitch gain associated with the block and transmitted as side information are gathered at 122. It will be noted that these coefficients are already quantized. The spectral envelope information is thereafter generated at 126 using the same procedure described in reference to Fig. 7. The resultant information is thereafter provided to both the inverse quantization operation 128, since it is reflective of quantizing gain, and to the bit allocation operation 131. The bit allocation determination is performed according to the procedure described in connection with Fig. 6. If noise shaping has been performed, i.e. the pitch gain indicates the block is non-voiced, it will be necessary to multiply S i by the scaling factor F at 130. Since F is known from the beginning, it is not transmitted as side information, but rather, is a factor entered into the memory of the transform coder. The bit allocation information is provided to the inverse quantization operation at 128 so the proper number of bits is presented to the appropriate quantizer. With the proper number of bits, each de-quantizer can de-quantize the DCT coefficients since the gain and number of bits allocated are also known. The de-quantized DCT coefficients can be transformed back to the time domain. As indicated previously, at low bit rates such as 9.6 kb/s, certain of the transformed signal will not be quantized, i.e. certain DCT coefficients will not be quantized. One of the purposes of the present invention is to reconstruct the lost or non-quantized signal at 132. It will be recalled that the spectral envelope was reproduced at 126 from the linear prediction coefficients. Portions of this envelope can be substituted for corresponding portions of the de-quantized signal where no bits had been allocated prior to transmission. Since, the spectral envelope represents an estimate of the magnitude of DCT coefficients for the frequencies of the speech signal, the magnitude and frequency of the missing information is known. Unfortunately, mere substitution of this information in non-quantized locations only produces a "buzz" form of distortion. The missing information to remove the distortion is the assignment of a sign to the magnitude, either positive or negative. Since the actual sign of the magnitude cannot be determined from the spectral envelope, the present invention generates a sign value of either +1 or -1. In the preferred embodiment, these sign values are not purely randomly generated, but rather, are taken from a sign table previously stored in memory. The sign table is generated before hand in relation to the histogram shown in Fig.8, which represents the statistical distribution of the sign of the DCT coefficients associated with a wide range of actual speech signals. The histogram is important because it is not only the sign of the magnitude which is important but also the number of coefficient magnitudes for which the sign remains the same which is important. Consequently, values in the sign table are arranged so that when sign values are being retrieved, the statistical distribution of retrieved sign values will match the histogram in Fig. 8. In an attempt to reduce frame-to-frame correlation, entry into the sign table is randomized. Although the use of the sign table provides a significant improvement in the realized speech quality, a further aspect of the invention is employed to match the stochastic properties of the substituted energy to those expected for an actual fully quantized block of DCT coefficients. The amplitude of a DCT signal is often biased towards lower value samples with high amplitudes occurring much less frequently than lower ones. The preferred embodiment alters the substituted DCT value to approximate this behavior by scaling it by a random variable having an appropriate probability distribution. This scaling outcome is achieved in the preferred embodiment by combining two random variables in accordance with the following formula: x(n) = ¦x 1 (n) + x 2 (n) - 1¦ The present values of x 1 (n) and x 2 (n) are generated from the previous values x 1 (n-1) and x 2 (n-1) according to the following formulae: x 1 (n) = [661x 1 (n-1) + 1] - 2 16 .INT 661x 1 (n-1) + 1 2 16 x 2 (n) = [661x 2 (n-1) + 3] - 2 16 .INT 661x 2 (n-1) + 3 2 16 where INT[y] represents the integer part of y. These two parameters are combined according to equation (18) to produce the required form of probability distribution for x(n). The resulting value is multiplied by the appropriate DCT coefficient. In this manner the value from the spectral envelope has been given a sign and scaled prior to substitution. The process of energy substitution can be more clearly seen in relation to Fig. 9 which procedure is performed for each sample between 0 and N-1 in the block which was inversely quantized at 128. The random sign table entry point is determined at 136. The value k is iterated at 138 between k=0 and N-1. The number k signifies the kth sample in the transformed sample block. The number of bits allocated at 131 to the kth sample is examined at 140 to determine if the number of bits is zero. If the number of allocated bits is not zero the program proceeds to 142 to get the next DCT sample and the next sign from the sign table. If the number of bits assigned to the kth value is determined at 140 to be zero, then the kth spectral envelope value is multiplied by the retrieved sign from the sign table at 144. The random variables x 1 and x 2 are computed at 146. The absolute value of x(n) is determined at 148. The kth value of the spectral envelope is multiplied by x(n) at 150. The now modified value of the kth spectral envelope sample is substituted in the inversely transformed sample block at 152. The next DCT value and sign table value are retrieved at 142. At 154 it is determined whether k=N-1 . If k does not equal N-1, the program loops back to and iterates k by one number. If k does equal N-1 at 154, then the sequence is ended. Having added the non-quantized information back into the time domain signal, it is now necessary to inversely transform the coefficients at 156 and thereafter dewindow the signal at 158. The dewindowed blocks are buffered at 160 and aligned in sequential form prior to presentation on bus 18. Signals thus presented on bus 18 are converted from parallel to serial form by convertor 30 (Fig. 1) and either output at 32 or presented to analog interface 36. While the invention has been described and illustrated with reference to specific embodiments, those skilled in the art will recognize that modification and variations may be made without departing from the principles of the invention as described herein above and set forth in the following claims.

Claims: Apparatus for noise shaping the spectral envelope of a given speech signal in a transform coder, which speech signal is a sampled time domain information signal composed of information samples, wherein said transform coder is operable sequentially to segregate said speech signal into blocks of information samples, the coder transforms each block of samples from the time domain to a block of coefficients in a transform domain, and the coder quantizes said coefficients in response to a bit allocation signal, comprising: envelope generation means for generating the spectral envelope of each of said blocks of information samples; logarithmic means for determining the logarithm to the base two of the value of the spectral envelope; scaling means for scaling the logarithms of said spectral envelope in relation to a fixed reference value; and bit allocation means for generating said bit allocation signal in relation to said spectral envelope after said spectral envelope has been scaled by said scaling means. Apparatus as claimed in claim 1, wherein said envelope generation means comprises: function means for generating an autocorrelation function of said blocks of information samples; derivation means for deriving linear prediction coefficients from said autocorrelation function; second transformation means for performing a Fast Fourier Transform of said coefficients; and squaring means for mathematically squaring the gain of each coefficient resulting from said Fast Fourier Transform, wherein said spectral envelope for each of said blocks is equal to the collection of the squared gains of said Fast Fourier Transform coefficients for said block. Apparatus as claimed in claim 1 or 2, wherein said reference value is 1/8. A method for noise shaping the spectral envelope of a given speech signal in a transform coder, which speech signal is a sampled time domain information signal composed of information samples, wherein said transform coder (80) is operable sequentially to segregate said speech signal into blocks of information samples, the coder transforms each block of samples from the time domain to a block of coefficients in a transform domain, and the coder quantizes said coefficients in response to a bit allocation signal, comprising the steps of: generating the spectral envelope (98) of each of said blocks of information samples; determining the logarithm (110) to the base two of the value of the spectral envelope; scaling said logarithms (110) of said spectral envelope in relation to a fixed reference value; and generating said bit allocation signal (111) in relation to said spectral envelope after said spectral envelope has been scaled by said scaling means. A method as claimed in claim 4, wherein said fixed reference value is 1/8. Apparatus for decoding a coded speech signal wherein such coded speech signal includes sequential blocks of transform coefficients which have been quantized in relation to a bit allocation signal generated in relation to scaled spectral envelope information and side information including linear prediction coefficients representative of the variance of said quantized transform coefficients, comprising: envelope generation means for generating the spectral envelope of each of said blocks of information samples based upon said linear prediction coefficients; logarithmic means for determining the logarithm to the base two of the value of the spectral envelope; scaling means for scaling said logarithms of said spectral envelope in relation to a fixed reference value; bit allocation means for generating a bit allocation signal in relation to said spectral envelope after said spectral envelope has been scaled by said scaling means; de-quantization means for de-quantizing said transform coefficients in response to said bit allocation signal and for generating blocks of de-quantized transform coefficients; and inverse transformation means for transforming said de-quantized transform coefficients from said transform domain into said time domain.

Inventors: CHHATWAL HARPRIT, WILSON PHILIP J, CHHATWAL,HARPRIT, WILSON,PHILIP J.
Applicants: NUERA COMMUNICATIONS INC
Application year: 1990
Main classification: G10L19
IPC codes: G10L19