Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
MULTIMODE SPEECH ENCODER
Document Type and Number:
WIPO Patent Application WO/2001/022402
Kind Code:
A1
Abstract:
A speech compression system (10) capable of encoding a speech signal (18) into a bitstream for subsequent decoding to generate synthesized speech (20) is disclosed. The speech compression system (10) optimizes the bandwidth consumed by the bitstream by balancing the desired average bit rate with the perceptual quality of the reconstructed speech. The speech compression system (10) comprises a full-rate codec (22), a half-rate codec (24), a quarter-rate codec (26) and an eighth-rate codec (28). The codes (22, 24, 26 and 28) are selectively activated based on a rate selection. In addition, the full and half-rate codecs (22 and 24) are selectively activated based on a type classification. Each codec (22, 24, 26 and 28) is selectively activated to encode and decode the speech signal (18) at different bit rates emphasizing different aspects of the speech signal (18) to enhance overall quality of the synthesized speech (20).

Inventors:
GAO YANG (US)
BENYASSINE ADIL (US)
THYSSEN JES (US)
SHOLOMOT EYAL (US)
SU HUAN-YU (US)
Application Number:
PCT/US2000/025182
Publication Date:
March 29, 2001
Filing Date:
September 15, 2000
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
CONEXANT SYSTEMS INC (US)
GAO YANG (US)
BENYASSINE ADIL (US)
THYSSEN JES (US)
SHOLOMOT EYAL (US)
SU HUAN YU (US)
International Classes:
G01L19/14; G10L13/00; G10L19/09; G10L19/12; H03M7/30; H03M7/36; (IPC1-7): G10L19/14
Foreign References:
US5911128A1999-06-08
CA2239294A11999-11-29
Other References:
CELLARIO L ET AL: "CELP CODING AT VARIABLE RATE", EUROPEAN TRANSACTIONS ON TELECOMMUNICATIONS AND RELATED TECHNOLOGIES,IT,AEI, MILANO, vol. 5, no. 5, 1 September 1994 (1994-09-01), pages 69 - 79, XP000470681, ISSN: 1120-3862
OZAWA K ET AL: "M-LCELP SPEECH CODING AT 4 KB/S WITH MULTI-MODE AND MULTI-CODEBOOK", IEICE TRANSACTIONS ON COMMUNICATIONS,JP,INSTITUTE OF ELECTRONICS INFORMATION AND COMM. ENG. TOKYO, vol. E77B, no. 9, 1 September 1994 (1994-09-01), pages 1114 - 1121, XP000474108, ISSN: 0916-8516
Attorney, Agent or Firm:
Hillis, Sanders N. (One Indiana Square Suite 242, Indianapolis IN, US)
Download PDF:
Claims:
What is claimed is:
1. A speech compression system (10) for encoding and decoding frames of a speech signal (18) to generate synthesized speech (20) comprising: a fullrate codec (22) operable to encode and decode the frames, the fullrate codec (22) being selectively activatable based on a rate selection and a type classification of each frame; a halfrate codec (24) operable to encode and decode the frames, the halfrate codec (24) being selectively activatable based on the rate selection and the type classification of each frame; a quarterrate codec (26) operable to encode and decode the frames, the quarterrate codec (26) being selectively activatable based on the rate selection; and an eighthrate codec (28) operable to encode and decode the frames, the eighthrate codec (28) being selectively activatable based on the rate selection.
2. An excitationprocessing module (54) for encoding a fixed codebook gain and an adaptive codebook gain, where the gains are generated during encoding of a frame of a speech signal (18), comprising: a type selector module (68,78) operable to selectively designate the type classification of the frame as Type Zero and Type One; a first subframe processing module (70,80) that is operable to quantize the fixed codebook gain and the adaptive codebook gain when the type classification of the frame is Type Zero, the first subframe processing module (70,80) comprising a twodimensional vector quantizer (164) and a 2D gain quantization table that is searchable by the twodimensional vector quantizer (164), where the 2D gain quantization table comprises a plurality of predetermined vectors that are selectable by the twodimensional vector quantizer (164) to jointly encode the fixed codebook gain and the adaptive codebook gain; a first frame processing module (72,82) that is operable to quantize the adaptive codebook gain when the type classification of the frame is Type One, the first frame processing module (72,82) comprising a multi dimensional pre vector quantizer (166,198) and a pregain quantization table that is searchable by the multi dimensional pre vector quantizer (166,198), where the pregain quantization table comprises a plurality of predetermined vectors that are selectable by the multidimensional pre vector quantizer (166,198) to encode the adaptive codebook gain; and a second frame processing module (76,86) that is operable to quantize the fixed codebook gain based on the type classification of the frame as Type One, the second frame processing module (76,86) comprising a multi dimensional delayed vector quantizer (168,200) and a delayed gain quantization table that is searchable by the multidimensional delayed vector quantizer (168,200), where the delayed gain quantization table comprises a plurality of predetermined vectors that are selectable by the multidimensional delayed vector quantizer (168,200) to encode the fixed codebook gain.
3. A bitstream that represents a frame of a speech signal (18) comprising: a type component (142,174) forming a bit in the bitstream, where the type component (142,174) provides a type classification of the frame and controls the coding; an LSF component (140,172) forming a plurality of the bits in the bitstream, where the LSF component (140,172) comprises a spectral representation of the frame that is encoded in digital form; an adaptive codebook component (144,176) forming a plurality of the bits in the bitstream, where the adaptive codebook component (144,176) comprises a long term predictor of the frame that is encoded in digital form; a fixed codebook component (146,178) forming a plurality of the bits in the bitstream, where the fixed codebook component (144,176) comprises a long term residual of the frame that is encoded in digital form; and a gain component (147,179) forming a plurality of the bits in the bitstream, where the gain component (147,179) comprises an adaptive codebook gain and a fixed codebook gain that is encoded in digital form.
Description:
MULTIMODE SPEECH ENCODER

COPYRIGHT NOTICE REFERENCE A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights.

TECHNICAL FIELD This invention relates to speech communication systems and, more particularly, to systems for digital speech coding.

BACKGROUND ART One prevalent mode of human communication is by the use of communication systems. Communication systems include both wireline and wireless radio based systems. Wireless communication systems are electrically connected with the wireline based systems and communicate with the mobile communication devices using radio frequency (RF) communication. Currently, the radio frequencies available for communication in cellular systems, for example, are in the cellular frequency range centered around 900 MHz and in the personal communication services (PCS) frequency range centered around 1900 MHz. Data and voice transmissions within the wireless system have a bandwidth that consumes a portion of the radio frequency. Due to increased traffic caused by the expanding popularity of wireless communication devices, such as cellular telephones, it is desirable to reduced bandwidth of transmissions within the wireless systems.

Digital transmission in wireless radio communications is increasingly applied to both voice and data due to noise immunity, reliability, compactness of equipment and the ability to implement sophisticated signal processing functions using digital techniques. Digital transmission of speech signals involves the steps of : sampling an analog speech waveform with an analog-to-digital converter, speech compression (encoding), transmission, speech decompression (decoding), digital-to-analog conversion, and playback into an earpiece or a loudspeaker. The sampling of the analog speech waveform with the analog-to-digital converter creates a digital signal. However, the number of bits used in the digital signal to represent the analog speech waveform creates a

relatively large bandwidth. For example, a speech signal that is sampled at a rate of 8000 Hz (once every 0.125 ms), where each sample is represented by 16 bits, will result in a bit rate of 128,000 (16x8000) bits per second, or 128 Kbps (Kilobits per second).

Speech compression may be used to reduce the number of bits that represent the speech signal thereby reducing the bandwidth needed for transmission. However, speech compression may result in degradation of the quality of decompressed speech. In general, a higher bit rate will result in higher quality, while a lower bit rate will result in lower quality. However, modem speech compression techniques, such as coding techniques, can produce decompressed speech of relatively high quality at relatively low bit rates. In general, modem coding techniques attempt to represent the perceptually important features of the speech signal, without preserving the actual speech waveform.

One coding technique used to lower the bit rate involves varying the degree of speech compression (i. e. varying the bit rate) depending on the part of the speech signal being compressed. Typically, parts of the speech signal for which adequate perceptual representation is more difficult (such as voiced speech, plosives, or voiced onsets) are coded and transmitted using a higher number of bits. Conversely, parts of the speech for which adequate perceptual representation is less difficult (such as unvoiced, or the silence between words) are coded with a lower number of bits. The resulting average bit rate for the speech signal will be relatively lower than would be the case for a fixed bit rate that provides decompressed speech of similar quality.

Speech compression systems, commonly called codecs, include an encoder and a decoder and may be used to reduce the bit rate of digital speech signals. Numerous algorithms have been developed for speech codecs that reduce the number of bits required to digitally encode the original speech while attempting to maintain high quality reconstructed speech. Code-Excited Linear Predictive (CELP) coding techniques, as discussed in the article entitled"Code-Excited Linear Prediction: High-Quality Speech at Very Low Rates,"by M. R. Schroeder and B. S. Atal, Proc. ICASSP-85, pages 937-940,1985, provide one effective speech coding algorithm. An example of a variable rate CELP based speech coder is T1A (Telecommunications Industry Association) IS-127 standard that is designed for CDMA (Code Division Multiple Access) applications. The CELP coding technique utilizes several prediction techniques to remove the redundancy from the speech signal. The CELP coding approach is frame-based in the sense that it stores sampled input speech signals into a block of samples called frames. The frames of data may then be processed to create a compressed speech signal in digital form.' The CELP coding approach uses two types of predictors, a short-term predictor and a long-term predictor. The short-term predictor typically is applied before the long-term predictor. A prediction error derived from the short-term predictor is commonly called short-term residual, and a prediction error derived from the long-term predictor is commonly called long-term residual. The long-term residual may be coded using a fixed codebook that includes a plurality of fixed codebook entries or vectors. One of the entries may be selected and multiplied by a fixed codebook gain to represent the long-term residual. The short-term predictor also can be referred to as an LPC (Linear Prediction Coding) or a spectral representation, and typically comprises 10 prediction parameters. The long-term predictor also can be referred to as a pitch predictor or an adaptive codebook and typically comprises a lag parameter and a long-term predictor gain parameter. Each lag parameter

also can be called a pitch lag, and each long-term predictor gain parameter can also be called an adaptive codebook gain. The lag parameter defines an entry or a vector in the adaptive codebook.

The CELP encoder performs an LPC analysis to determine the short-term predictor parameters.

Following the LPC analysis, the long-term predictor parameters may be determined. In addition, determination of the fixed codebook entry and the fixed codebook gain that best represent the long-term residual occurs. The powerful concept of analysis-by-synthesis (ABS) is employed in CELP coding. In the ABS approach, the best contribution from the fixed codebook, the best fixed codeboqk gain, and the best long-term predictor parameters may be found by synthesizing them using an inverse prediction filter and applying a perceptual weighting measure. The short-term (LPC) prediction coefficients, the fixed-codebook gain, as well as the lag parameter and the long-term gain parameter may then be quantized. The quantization indices, as well as the fixed codebook indices, may be sent from the encoder to the decoder.

The CELP decoder uses the fixed codebook indices to extract a vector from the fixed codebook. The vector may be multiplied by the fixed-codebook gain, to create a long-term excitation also known as a fixed codebook contribution. A long-term predictor contribution may be added to the long-term excitation to create a short-term excitation that commonly is referred to simply as an excitation. The long-term predictor contribution comprises the short-term excitation from the past multiplied by the long-term predictor gain. The addition of the long-tenn predictor contribution alternatively can be viewed as an adaptive codebook contribution or as a long- term (pitch) filtering. The short-term excitation may be passed through a short-term inverse prediction filter (LPC) that uses the short-term (LPC) prediction coefficients quantized by the encoder to generate synthesized speech. The synthesized speech may then be passed through a post-filter that reduces perceptual coding noise.

These speech compression techniques have resulted in lowering the amount of bandwidth used to transmit a speech signal. However, further reduction in bandwidth is particular important in a communication system that has to allocate its resources to a large number of users. Accordingly, there is a need for systems and methods of speech coding that are capable of minimizing the average bit rate needed for speech representation, while providing high quality decompressed speech.

DISCLOSURE OF INVENTION This invention provides systems for encoding and decoding speech signals. The embodiments may use the CELP coding technique and prediction based coding as a framework to employ signal-processing functions using waveform matching and perceptual related techniques. These techniques allow the generation of synthesized speech that closely resembles the original speech by including perceptual features while maintaining a relatively low bit rate. One application of the embodiments is in wireless communication systems. In this application, the encoding of original speech, or the decoding to generate synthesized speech, may occur at mobile communication devices. In addition, encoding and decoding may occur within-ยป wireline-based systems or within other wireless communication systems to provide interfaces to wireline-based systems.

One embodiment of a speech compression system includes a full-rate codec, a half-rate codec, a quarter- rate codec and an eighth-rate codec each capable of encoding and decoding speech signals. The full-rate, half- rate, quarter-rate and eighth-rate codecs encode the speech signals at bit rates of 8.5 Kbps, 4 Kbps, 2 Kbps and 0.8

Kbps, respectively. The speech compression system performs a rate selection on a frame of a speech signal to select one of the codecs. The rate selection is performed on a frame-by-frame basis. Frames are created by dividing the speech signal into segments of a finite length of time. Since each frame may be coded with a different bit rate, the speech compression system is a variable-rate speech compression system that codes the speech at an average bit rate.

The rate selection is determined by characterization of each frame of the speech signal based on the portion of the speech signal contained in the particular frame. For example, frames may be characterized as stationary voiced, non-stationary voiced, unvoiced, background noise, silence etc. In addition, the rate selection is based on a Mode that the speech compression system is operating within. The different Modes indicate the desired average bit rate. The codecs are designed for optimized coding within the different characterizations of the speech signals. Optimal coding balances the desire to provide synthesized speech of the highest perceptual quality while maintaining the desired average bit rate, thereby maximizing use of the available bandwidth.

During operation, the speech compression system selectively activates the codecs based on the Mode as well as characterization of the frame in an attempt to optimize the perceptual quality of the synthesized speech.

Once the full or the half-rate codec is selected by the rate selection, a type classification of the speech signal occurs to further optimize coding. The type classification may be a first type (i. e. a Type One) for frames containing a harmonic structure and a formant structure that do not change rapidly or a second type (i. e. a Type Zero) for all other frames. The bit allocation of the full-rate and half-rate codecs may be adjusted in response to the type classification to further optimize the coding of the frame. The adjustment of the bit allocation provides improved perceptual quality of the reconstructed speech signal by emphasizing different aspects of the speech signal within each frame.

Accordingly, the speech coder is capable of selectively activating the codecs to maximize the overall quality of a reconstructed speech signal while maintaining the desired average bit rate. Other systems, methods, features and advantages of the invention will be or will become apparent to one with skill in the art upon examination of the following figures and detailed description. It is intended that all such additional systems, methods, features and advantages be included within this description, be within the scope of the invention, and be protected by the accompanying claims.

BRIEF DESCRIPTION OF DRAWINGS The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principals of the invention. Moreover, in the figures, like reference numerals designate corresponding parts throughout the different views.

FIG. I is a block diagram of one embodiment of a speech compression system.

FIG. 2 is an expanded block diagram of one embodiment of the encoding system illustrated in Fig. 1.

FIG. 3 is an expanded block diagram of one embodiment of the decoding system illustrated in Fig. 1.

FIG. 4 is a table illustrating the bit allocation of one embodiment of the full-rate codec.

FIG. 5 is a table illustrating the bit allocation of one embodiment of the half-rate codec.

FIG. 6 is a table illustrating the bit allocation of one embodiment of the quarter-rate codec.

FIG. 7 is a table illustrating the bit allocation of one embodiment of the eighth-rate codec.

FIG. 8 is an expanded block diagram of one embodiment of the pre-processing module illustrated in Fig.

2.

FIG. 9 is an expanded block diagram of one embodiment of the initial frame-processing module illustrated in Fig. 2 for the full and half-rate codecs.

FIG. 10 is an expanded block diagram of one embodiment of the first sub-frame processing module illustrated in Fig. 2 for the full and half-rate codecs.

FIG. 11 is an expanded block diagram of one embodiment of the first frame processing module, the second sub-frame processing module and the second frame processing module illustrated in Fig. 2 for the full and half-rate codecs.

FIG. 12 is an expanded block diagram of one embodiment of the decoding system illustrated in Fig. 3 for the full and half-rate codecs.

MODES FOR CARRYING OUT THE INVENTION The embodiments are discussed with reference to speech signals, however, processing of any other signal is possible. It will also be understood that the numerical values disclosed may be numerically represented by floating point, fixed point, decimal, or other similar numerical representation that may cause slight variation in the values but will not compromise functionality. Further, functional blocks identified as modules are not intended to represent discrete structures and may be combined or further sub-divided in various embodiments.

FIG. 1 is a block diagram of one embodiment of the speech compression system 10. The speech compression system 10 includes an encoding system 12, a communication medium 14 and a decoding system 16 that may be connected as illustrated. The speech compression system 10 may be any system capable of receiving and encoding a speech signal 18, and then decoding it to create post-processed synthesized speech 20. In a typical communication system, the wireless communication system is electrically connected with a public switched telephone network (PSTN) within the wireline-based communication system. Within the wireless communication system, a plurality of base stations are typically used to provide radio communication with mobile communication devices such as a cellular telephone or a portable radio transceiver.

The speech compression system 10 operates to receive the speech signal 18. The speech signal 18 emitted by a sender (not shown) can be, for example, captured by a microphone (not shown) and digitized by an analog-to-digital converter (not shown). The sender may be a human voice, a musical instrument or any other device capable of emitting analog signals. The speech signal 18 can represent any type of sound, such as, voice speech, unvoiced speech, background noise, silence, music etc.

The encoding system 12 operates to encode the speech signal 18. The encoding system 12 may be part of a mobile communication device, a base station or any other wireless or wireline communication device that is capable of receiving and encoding speech signals 18 digitized by an analog-to-digital converter. The wireline communication devices may include Voice over Internet Protocol (VoIP) devices and systems. The encoding system 12 segments the speech signal 18 into frames to generate a bitstream. One embodiment of the speech

compression system 10 uses frames that comprise 160 samples that, at a sampling rate of 8000 Hz, correspond to 20 milliseconds per frame. The frames represented by the bitstream may be provided to the communication medium 14.

The communication medium 14 may be any transmission mechanism, such as a communication channel, radio waves, microwave, wire transmissions, fiber optic transmissions, or any medium capable of carrying the bitstream generated by the encoding system 12. The communication medium 14 may also include transmitting devices and receiving devices used in the transmission of the bitstream. An example embodiment of the communication medium 14 can include communication channels, antennas and associated transceivers for radio communication in a wireless communication system. The communication medium 14 also can be a storage mechanism, such as, a memory device, a storage media or other device capable of storing and retrieving the bitstream generated by the encoding system 12. The communication medium 14 operates to transmit the bitstream generated by the encoding system 12 to the decoding system 16.

The decoding system 16 receives the bitstream from the communication medium 14. The decoding system 14 may be part of a mobile communication device, a base station or other wireless or wireline communication device that is capable of receiving the bitstream. The decoding system 16 operates to decode the bitstream and generate the post-processed synthesized speech 20 in the form of a digital signal. The post- processed synthesized speech 20 may then be converted to an analog signal by a digital-to-analog converter (not shown). The analog output of the digital-to-analog converter may be received by a receiver (not shown) that may be a human ear, a magnetic tape recorder, or any other device capable of receiving an analog signal.

Alternatively, a digital recording device, a speech recognition device, or any other device capable of receiving a digital signal may receive the post-processed synthesized speech 20.

One embodiment of the speech compression system 10 also includes a Mode line 21. The Mode line 21 carries a Mode signal that controls the speech compression system 10 by indicating the desired average bit rate for the bitstream. The Mode signal may be generated externally by, for example, a wireless communication system using a Mode signal generation module. The Mode signal generation module determines the Mode Signal based on a plurality of factors, such as, the desired quality of the post-processed synthesized speech 20, the available bandwidth, the services contracted by a user or any other relevant factor. The Mode signal is controlled and selected by the communication system that the speech compression system 10 is operating within. The Mode signal may be provided to the encoding system 12 to aid in the determination of which of a plurality of codecs may be activated within the encoding system 12.

The codecs comprise an encoder portion and a decoder portion that are located within the encoding system 12 and the decoding system 16, respectively. In one embodiment of the speech compression system 10 there are four codecs namely; a full-rate codec 22, a half-rate codec 24, a quarter-rate codec 26, and an eighth-rate codec 28. Each of the codecs 22,24,26, and 28 is operable to generate the bitstream. The size of the bitstream generated by each codec 22,24,26, and 28, and hence the bandwidth or capacity needed for transmission of the bitstream via the communication medium 14 is different.

In one embodiment, the full-rate codec 22, the half-rate codec 24, the quarter-rate codec 26 and the eighth-rate codec 28 generate 170 bits, 80 bits, 40 bits and 16 bits, respectively, per frame. The size of the

bitstream of each frame corresponds to a bit rate, namely, 8.5 Kbps for the full-rate codec 22,4.0 Kbps for the half-rate codec 24,2.0 Kbps for the quarter-rate codec 26, and 0.8 Kbps for the eighth-rate codec 28. However, fewer or more codees as well as other bit rates are possible in alternative embodiments. By processing the frames of the speech signal 18 with the various codecs, an average bit rate is achieved. The encoding system 12 determines which of the codecs 22,24,26, and 28 may be used to encode a particular frame based on characterization of the frame, and on the desired average bit rate provided by the Mode signal. Characterization of a frame is based on the portion of the speech signal 18 contained in the particular frame. For example, frames may be characterized as stationary voiced, non-stationary voiced, unvoiced, onset, background noise, silence etc.

The Mode signal on the Mode signal line 21 in one embodiment identifies a Mode 0, a Mode 1, and a Mode 2. Each of the three Modes provides a different desired average bit rate that can vary the percentage of usage of each of the codecs 22,24,26, and 28. Mode 0 may be referred to as a premium mode in which most of the frames may be coded with the full-rate codec 22; fewer of the frames may be coded with the half-rate codec 24; and frames comprising silence and background noise may be coded with the quarter-rate codec 26 and the eighth-rate codec 28. Mode 1 may be referred to as a standard mode in which frames with high information content, such as onset and some voiced frames, may be coded with the full-rate codec 22. In addition, other voiced and unvoiced frames may be coded with the half-rate codec 24, some unvoiced frames may be coded with the quarter-rate codec 26, and silence and stationary background noise frames may be coded with the eighth-rate codec 28.

Mode 2 may be referred to as an economy mode in which only a few frames of high information content may be coded with the full-rate codec 22. Most of the frames in Mode 2 may be coded with the half-rate codec 24 with the exception of some unvoiced frames that may be coded with the quarter-rate codec 26. Silence and stationary background noise frames may be coded with the eighth-rate codec 28 in Mode 2. Accordingly, by varying the selection of the codecs 22,24,26, and 28 the speech compression system 10 can deliver reconstructed speech at the desired average bit rate while attempting to maintain the highest possible quality. Additional Modes, such as, a Mode three operating in a super economy Mode or a half-rate max Mode in which the maximum codec activated is the half-rate codec 24 are possible in alternative embodiments.

Further control of the speech compression system 10 also may be provided by a half rate signal line 30.

The half rate signal line 30 provides a half rate signaling flag. The half rate signaling flag may be provided by an external source such as a wireless communication system. When activated, the half rate signaling flag directs the speech compression system 10 to use the half-rate codec 24 as the maximum rate. Determination of when to activate the half rate signaling flag is performed by the communication system that the speech compression system 10 is operating within. Similar to the Mode signal determination, a half rate-signaling module controls activation of the half rate signaling flag based on a plurality of factors that are determined by the communication system. In alternative embodiments, the half rate signaling flag could direct the speech compression system 10 to use one codec 22,24,26, and 28 in place of another or identify one or more of the codecs 22,24,26, and 28 as the maximum or minimum rate.

In one embodiment of the speech compression system 10, the full and half-rate codecs 22 and 24 may be based on an eX-CELP (extended CELP) approach and the quarter and eighth-rate codecs 26 and 28 may be based

on a perceptual matching approach. The eX-CELP approach extends the traditional balance between perceptual matching and waveform matching of traditional CELP. In particular, the eX-CELP approach categorizes the frames using a rate selection and a type classification that will be described later. Within the different categories of frames, different encoding approaches may be utilized that have different perceptual matching, different waveform matching, and different bit assignments. The perceptual matching approach of the quarter-rate codec 26 and the eighth-rate codec 28 do not use waveform matching and instead concentrate on the perceptual aspects when encoding frames.

The coding of each frame with either the eX-CELP approach or the perceptual matching approach may be based on further dividing the frame into a plurality of subframes. The subframes may be different in size and in number for each codec 22,24,26, and 28. In addition, with respect to the eX-CELP approach, the subframes may be different for each category. Within the subframes, speech parameters and waveforms may be coded with several predictive and non-predictive scalar and vector quantization techniques. In scalar quantization a speech parameter or element may be represented by an index location of the closest entry in a representative table of scalars. In vector quantization several speech parameters may be grouped to form a vector. The vector may be represented by an index location of the closest entry in a representative table of vectors.

In predictive coding, an element may be predicted from the past. The element may be a scalar or a vector. The prediction error may then be quantized, using a table of scalars (scalar quantization) or a table of vectors (vector quantization). The eX-CELP coding approach, similarly to traditional CELP, uses the powerful Analysis-by-Synthesis (ABS) scheme for choosing the best representation for several parameters. In particular, the parameters may be the adaptive codebook, the fixed codebook, and their corresponding gains. The ABS scheme uses inverse prediction filters and perceptual weighting measures for selecting the best codebook entries.

One implementation of an embodiment of the speech compression system 10 may be in a signal- processing device such as a Digital Signal Processing (DSP) chip, a mobile communication device or a radio transmission base station. The signal-processing device may be programmed with source code. The source code may be first translated into fixed point, and then translated into the programming language that is specific to the signal-processing device. The translated source code may then be downloaded and run in the signal-processing device. One example of source code is the C language computer program utilized by one embodiment of the speech compression system 10 that is included in the attached microfiche appendix as Appendix A and B.

FIG. 2 is a more detailed block diagram of the encoding system 12 illustrated in FIG. 1. One embodiment of the encoding system 12 includes a pre-processing module 34, a full-rate encoder 36, a half-rate encoder 38, a quarter-rate encoder 40 and an eighth-rate encoder 42 that may be connected as illustrated. The rate encoders 36,38,40, and 42 include an initial frame-processing module 44 and an excitation-processing module 54.

The speech signal 18 received by the encoding system 12 is processed on a frame level by the pre- processing module 34. The pre-processing module 34 is operable to provide initial processing of the speech signal 18. The initial processing can include filtering, signal enhancement, noise removal, amplification and other similar techniques capable of optimizing the speech signal 18 for subsequent encoding.

The full, half, quarter and eighth-rate encoders 36,38,40, and 42 are the encoding portion of the full, half, quarter and eighth-rate codecs 22,24,26, and 28, respectively. The initial frame-processing module 44 performs initial frame processing, speech parameter extraction and determines which of the rate encoders 36, 38, 40, and 42 will encode a particular frame. The initial frame-processing module 44 may be illustratively sub- divided into a plurality of initial frame processing modules, namely, an initial full frame processing module 46, an initial half frame-processing module 48, an initial quarter frame-processing module 50 and an initial eighth frame- . processing module 52. However, it should be noted that the initial frame-processing module 44 performs processing that is common to all the rate. encoders 36,40, and 42 and particular processing that is particular to each rate encoder 36,38,40, and 42. The sub-division of the initial frame-processing module 44 into the respective initial frame processing modules 46,48,50, and 52 corresponds to a respective rate encoder 36,38,40, and 42.

The initial frame-processing module 44 performs common processing to determine a rate selection that activates one of the rate encoders 36,38,40, and 42. In one embodiment, the rate selection is based on the characterization of the frame of the speech signal 18 and the Mode the speech compression system 10 is operating within. Activation of one of the rate encoders 36,38,40, and 42 correspondingly activates one of the initial frame-processing modules 46,48,50, and 52.

The particular initial frame-processing module 46,48,50, and 52 is activated to encode aspects of the speech signal 18 that are common to the entire frame. The encoding by the initial frame-processing module 44 quantizes parameters of the speech signal 18 contained in a frame. The quantized parameters result in generation of a portion of the bitstream. In general, the bitstream is the compressed representation of a frame of the speech signal 18 that has been processed by the encoding system 12 through one of the rate encoders 36,38,40, and 42.

In addition to the rate selection, the initial frame-processing module 44 also performs processing to determine a type classification for each frame that is processed by the full and half-rate encoders 36 and 38. The type classification of one embodiment classifies the speech signal 18 represented by a frame as a first type (i. e., a Type One) or as a second type (i. e., a Type Zero). The type classification of one embodiment is dependent on the nature and characteristics of the speech signal 18. In an alternate embodiment, additional type classifications and supporting processing may be provided.

Type One classification includes frames of the speech signal 18 that exhibit stationary behavior. Frames exhibiting stationary behavior include a harmonic structure and a formant structure that do not change rapidly.

All other frames may be classified with the Type Zero classification. In alternative embodiments, additional type classifications may classify frames into additional classification based on time-domain, frequency domain, etc.

The type classification optimizes encoding by the initial full-rate frame-processing module 46 and the initial half- rate frame-processing module 48, as will be later described. In addition, both the type classification and the rate selection may be used to optimize encoding by portions of the excitation-processing module 54 that correspond to the full and half-rate encoders 36 and 38.

One embodiment of the excitation-processing module 54 may be sub-divided into a full-rate module 56, a half-rate module 58, a quarter-rate module 60, and an eighth-rate module 62. The rate modules 56,58,60, and 62 correspond to the rate encoders 36,38,40, and 42 as illustrated in FIG. 2. The full and half-rate modules 56

and 58 of one embodiment both include a plurality of frame processing modules and a plurality of subframe processing modules that provide substantially different encoding as will be discussed.

The portion of the excitation processing module 54 for both the full and half-rate encoders 36 and 38 include type selector modules, first subframe processing modules, second subframe processing modules, first frame processing modules and second subframe processing modules. More specifically, the full-rate module 56 includes an F type selector module 68, an FO first subframe processing module 70, an F1 first frame-processing module 72, an F1 second subframe processing module 74 and an F1 second frame-processing module 76. The term"F"indicates full-rate, and"0"and"1"signify Type Zero and Type One, respectively. Similarly, the half- rate module 58 includes an H type selector module 78, an HO first subframe processing module 80, an HI first frame-processing module 82, an HI second subframe processing module 84, and an H1 second frame-processing module 86.

The F and H type selector modules 68,78 direct the processing of the speech signals 18 to further optimize the encoding process based on the type classification. Classification as Type One indicates the frame contains a harmonic structure and a formant structure that do not change rapidly, such as stationary voiced speech.

Accordingly, the bits used to represent a frame classified as Type One may be allocated to facilitate encoding that takes advantage of these aspects in representing the frame. Classification as Type Zero indicates the frame may exhibit non-stationary behavior, for example, a harmonic structure and a formant structure that changes rapidly or the frame may exhibit stationary unvoiced or noise-like characteristics. The bit allocation for frames classified as Type Zero may be consequently adjusted to better represent and account for this behavior.

For the full rate module 56, the FO first subframe-processing module 70 generates a portion of the bitstream when the frame being processed is classified as Type Zero. Type Zero classification of a frame activates the FO first subframe-processing module 70 to process the frame on a subframe basis. The Fl first frame-processing module 72, the F1 second subframe processing module 74, and the Fl second frame-processing modules 76 combine to generate a portion of the bitstream when the frame being processed is classified as Type One. Type One classification involves both subframe and frame processing within the full rate module 56.

Similarly, for the half rate module 58, the HO first subframe-processing module 80 generates a portion of the bitstream on a sub-frame basis when the frame being processed is classified as Type Zero. Further, the H1 first frame-processing module 82, the H1 second subframe processing module 84, and the H1 second frame- processing module 86 combine to generate a portion of the bitstream when the frame being processed is classified as Type One. As in the full rate module 56, the Type One classification involves both subframe and frame processing.

The quarter and eighth-rate modules 60 and 62 are part of the quarter and eighth-rate encoders 40 and 42, respectively, and do not include the type classification. The type classification is not included due to the nature of the frames that are processed. The quarter and eighth-rate modules 60 and 62 generate a portion of the bitstream on a subframe basis and a frame basis, respectively, when activated.

The rate modules 56,58,60, and 62 generate a portion of the bitstream that is assembled with a respective portion of the bitstream that is generated by the initial frame processing modules 46,48,50, and 52 to create a digital representation of a frame. For example, the portion of the bitstream generated by the initial full-

rate frame-processing module 46 and the full-rate module 56 may be assembled to form the bitstream generated when the full-rate encoder 36 is activated to encode a frame. The bitstreams from each of the encoders 36,38,40, and 42 may be further assembled to form a bitstream representing a plurality of frames of the speech signal 18.

The bitstream generated by the encoders 36,38,40, and 42 is decoded by the decoding system 16.

FIG. 3 is an expanded block diagram of the decoding system 16 illustrated in FIG. 1. One embodiment of the decoding system 16 includes a full-rate decoder 90, a half-rate decoder 92, a quarter-rate decoder 94, an eighth-rate decoder 96, a synthesis filter module 98 and aposFt-processing module 100. The full, half, quarter and eighth-rate decoders 90,92,94, and 96, the synthesis filter module 98 and the post-processing module 100 are the decoding portion of the full, half, quarter and eighth-rate codecs 22,24,26, and 28.

The decoders 90,92,94, and 96 receive the bitstream and decode the digital signal to reconstruct different parameters of the speech signal 18. The decoders 90,92,94, and 96 may be activated to decode each frame based on the rate selection. The rate selection may be provided from the encoding system 12 to the decoding system 16 by a separate information transmittal mechanism, such as a control channel in a wireless communication system. In this example embodiment, the rate selection may be provided to the mobile communication devices as part of broadcast beacon signals generated by the base stations within the wireless communications system. In general, the broadcast beacon signals are generated to provide identifying information used to establish communications between the base stations and the mobile communication devices.

The synthesis filter 98 and the post-processing module 100 are part of the decoding process for each of the decoders 90,92,94, and 96. Assembling the parameters of the speech signal 18 that are decoded by the decoders 90,92,94, and 96 using the synthesis filter 98, generates synthesized speech. The synthesized speech is passed through the post-processing module 100 to create the post-processed synthesized speech 20.

One embodiment of the full-rate decoder 90 includes an F type selector 102 and a plurality of excitation reconstruction modules. The excitation reconstruction modules comprise an FO excitation reconstruction module 104 and an FI excitation reconstruction module 106. In addition, the full-rate decoder 90 includes a linear prediction coefficient (LPC) reconstruction module 107. The LPC reconstruction module 107 comprises an FO LPC reconstruction module 108 and an F1 LPC reconstruction module 110.

Similarly, one embodiment of the half-rate decoder 92 includes an H type selector 112 and a plurality of excitation reconstruction modules. The excitation reconstruction modules comprise an HO excitation reconstruction module 114 and an H1 excitation reconstruction module 116. In addition, the half-rate decoder 92 comprises a linear prediction coefficient (LPC) reconstruction module that is an H LPC reconstruction module 118. Although similar in concept, the full and half-rate decoders 90 and 92 are designated to decode bitstreams from the corresponding full and half-rate encoders 36 and 38, respectively.

The F and H type selectors 102 and 112 selectively activate respective portions of the full and half-rate decoders 90 and 92 depending on the type classification. When the type classification is Type Zero, the FO or HO excitation reconstruction modules 104 or 114 are activated. Conversely, when the type classification is Type One, the F1 or H1 excitation reconstruction modules 106 or 116 are activated. The FO or FI LPC reconstruction modules 108 or 110 are activated by the Type Zero and Type One type classifications, respectively. The H LPC reconstruction module 118 is activated based solely on the rate selection.

The quarter-rate decoder 94 includes a Q excitation reconstruction module 120 and a Q LPC reconstruction module 122. Similarly, the eighth-rate decoder 96 includes an E excitation reconstruction module 124 and an E LPC reconstruction module 126. Both the respective Q or E excitation reconstruction modules 120 or 124 and the respective Q or E LPC reconstruction modules 122 or 126 are activated based solely on the rate selection.

Each of the excitation reconstruction modules is operable to provide the short-term excitation on a short- term excitation line 128 when activated. Similarly, eachofhe LPC reconstruction modules operate to generate the short-term prediction coefficients on a short-term prediction coefficients line 130. The short-term excitation and the short-term prediction coefficients are provided to the synthesis filter 98. In addition, in one embodiment, the short-term prediction coefficients are provided to the post-processing module 100 as illustrated in FIG. 3.

The post-processing module 100 can include filtering, signal enhancement, noise modification, amplification, tilt correction and other similar techniques capable of improving the perceptual quality of the synthesized speech. The post-processing module 100 is operable to decrease the audible noise without degrading the synthesized speech. Decreasing the audible noise may be accomplished by emphasizing the formant structure of the synthesized speech or by suppressing only the noise in the frequency regions that are perceptually not relevant for the synthesized speech. Since audible noise becomes more noticeable at lower bit rates, one embodiment of the post-processing module 100 may be activated to provide post-processing of the synthesized speech differently depending on the rate selection. Another embodiment of the post-processing module 100 may be operable to provide different post-processing to different groups of the decoders 90,92,94, and 96 based on the rate selection.

During operation, the initial frame-processing module 44 illustrated in FIG. 2 analyzes the speech signal 18 to determine the rate selection and activate one of the codecs 22,24,26, and 28. If for example, the full-rate codec 22 is activated to process a frame based on the rate selection, the initial full-rate frame-processing module 46 determines the type classification for the frame and generates a portion of the bitstream. The full-rate module 56, based on the type classification, generates the remainder of the bitstream for the frame.

The bitstream may be received and decoded by the full-rate decoder 90 based on the rate selection. The full-rate decoder 90 decodes the bitstream utilizing the type classification that was determined during encoding.

The synthesis filter 98 and the post-processing module 100 use the parameters decoded from the bitstream to generate the post-processed synthesized speech 20. The bitstream that is generated by each of the codecs 22,24, 26, and 28 contains significantly different bit allocations to emphasize different parameters and/or characteristics of the speech signal 18 within a frame.

1.0 BIT ALLOCATION FIGS. 4,5,6 and 7 are tables illustrating one embodiment of the bit-allocation for the full-rate codec 22, the half-rate codec 24, the quarter-rate codec 26, and the eighth-rate codec 28, respectively. The bit-allocation designates the portion of the bitstream generated by the initial frame-processing module 44, and the portion of the bitstream generated by the excitation-processing module 54 within a respective encoder 36,38,40, and 42. In addition the bit-allocation designates the number of bits in the bitstream that represent a frame. Accordingly, the

bit rate varies depending on the codec 22,24,26, and 28 that is activated. The bitstream may be classified into a first portion and a second portion depending on whether the representative bits are generated on a frame basis or on a subframe basis, respectively, by the encoding system 12. As will be described later, the first portion aad the second portion of the bitstream vary depending on the codec 22,24,26, and 28 selected to encode and decode a frame of the speech signal 18.

1. 1 Bit Allocation for the Full-Rate Codec Referring now to FIGS. 2,3, and 4, the full-rate bitstream of the full-rate codec 22 will be described.

Referring now to FIG. 4, the bit allocation for the full-rate codec 22 includes a line spectrum frequency (LSF) component 140, a type component 142, an adaptive codebook component 144, a fixed codebook component 146 and a gain component 147. The gain component 147 comprises an adaptive codebook gain component 148 and a fixed codebook gain component 150. The bitstream allocation is further defined by a Type Zero column 152 and a Type One column 154. The Type Zero and Type One columns 152 and 154 designate the allocation of the bits in the bitstream based on the type classification of the speech signal 18 as previously discussed. In one embodiment, the Type Zero column 152 and the Type One column 154 both use 4 subframes of 5 milliseconds each to process the speech signals 18.

The initial full frame-processing module 46, illustrated in FIG. 2, generates the LSF component 140.

The LSF component 140 is generated based on the short-term predictor parameters. The short-term predictor parameters are converted to a plurality of line spectrum frequencies (LSFs). The LSFs represent the spectral envelope of a frame. In addition, a plurality of predicted LSFs from the LSFs of previous frames are determined.

The predicted LSFs are subtracted from the LSFs to create an LSFs prediction error. In one embodiment, the LSFs prediction error comprises a vector of 10 parameters. The LSF prediction error is combined with the predicted LSFs to generate a plurality of quantized LSFs. The quantized LSFs are interpolated and converted to form a plurality of quantized LPC coefficients Aq (z) for each subframe as will be discussed in detail later. In addition, the LSFs prediction error is quantized to generate the LSF component 140 that is transmitted to the decoding system 16.

When the bitstream is received at the decoding system 16, the LSF component 140 is used to locate a quantized vector representing a quantized LSFs prediction error. The quantized LSFs prediction error is added to the predicted LSFs to generate quantized LSFs. The predicted LSFs are determined from the LSFs of previous frames within the decoding system 16 similarly to the encoding system 12. The resulting quantized LSFs may be interpolated for each subframe using a predetermined weighting. The predetermined weighting defines an interpolation path that may be fixed or variable. The interpolation path is between the quantized LSFs of the previous frame and the quantized LSFs of the current frame. The interpolation path may be used to provide a spectral envelope representation for each subframe in the current frame.

For frames classified as Type Zero, one embodiment of the LSF component 140 is encoded utilizing a plurality of stages 156 and an interpolation element 158 as illustrated in FIG. 4. The stages 156 represent the LSFs prediction error used to code the LSF component 140 for a frame. The interpolation element 158 may be used to provide a plurality of interpolation paths between the quantized LSFs of the previous frame and the

quantized LSFs of the frame currently being processed. In general, the interpolation element 158 represents selectable adjustment in the contour of the line spectrum frequencies (LSFs) during decoding. Selectable adjustment may be used due to the non-stationary spectral nature of framesthat are classified as Type Zero. For frames classified as Type One, the LSF component 140 may be encoded using only the stages 156 and a predetermined linear interpolation path due to the stationary spectral nature of such frames.

One embodiment of the LSF component 140 includes 2 bits to encode the interpolation element 158 for frames classified as Type Zero. The bits identify the particular interpolation path. Each of the interpolation paths adjust the weighting of the previous quantized LSFs for each subframe and the weighting of the current quantized LSFs for each subframe. Selection of an interpolation path may be determined based on the degree of variations in the spectral envelope between subsequent subframes. For example, if there is substantial variation in the spectral envelope in the middle of the frame, the interpolation element 158 selects an interpolation path that decreases the influence of the quantized LSFs from the previous frame. One embodiment of the interpolation element 158 can represent any one of four different interpolation paths for each subframe.

The predicted LSFs may be generated using a plurality of moving average predictor coefficients. The predictor coefficients determine how much of the LSFs of past frames are used to predict the LSFs of the current frame. The predictor coefficients within the full-rate codec 22 use an LSF predictor coefficients table. The table may be generally illustrated by the following matrix : TABLE 1 In one embodiment, m equals 2 and n equals 10. Accordingly, the prediction order is two and there are two vectors of predictor coefficients, each comprising 10 elements. One embodiment of the LSF predictor coefficients table is titled"Float64 B_85k"and is included in Appendix B of the attached microfiche appendix.

Once the predicted LSFs have been determined, the LSFs prediction error may be calculated using the actual LSFs. The LSFs prediction error may be quantized using a full dimensional multi-stage quantizer. An LSF prediction error quantization table containing a plurality of quantization vectors represents each stage 156 that may be used with the multi-stage quantizer. The multistage quantizer determines a portion of the LSF component 140 for each stage 156. The determination of the portion of the LSF component 140 is based on a pruned search approach. The pruned search approach determines promising quantization vector candidates from each stage. At the conclusion of the determination of candidates for all the stages, a decision occurs simultaneously that selects the best quantization vectors for each stage.

In the first stage, the multistage quantizer determines a plurality of candidate first stage quantization errors. The candidate first stage quantization errors are the difference between the LSFs prediction error and the closest matching quantization vectors located in the first stage. The multistage quantizer then determines a

plurality of candidate second stage quantization errors by identifying the quantization vectors located in the second stage that best match the candidate first stage quantization errors. This iterative process is completed for each of the stages and promising candidates are kept from each stage. The final selection of thti best representative quantization vectors for each stage simultaneously occurs when the candidates have been determined for all the stages. The LSF component 140 includes index locations of the closest matching quantization vectors from each stage. One embodiment of the LSF component 140 includes 25 bits to encode the index locations within the stages 156. The LSF prediction error quantization table for the quantization approach may be illustrated generally by the following matrix: TABLE 2 One embodiment of the quantization table for both the Type Zero and the Type One classification uses four stages (j=4) in which each quantization vector is represented by 10 elements (n=10). The stages 156 of this embodiment include 128 quantization vectors (r=128) for one of the stages 156, and 64 quantization vectors (s=64) in the remaining stages 156. Accordingly, the index location of the quantization vectors within the stages 156 may be encoded using 7 bits for the one of the stages 156 that includes 128 quantization vectors. In addition, index locations for each of the stages 156 that include 64 quantization vectors may be encoded using 6 bits. One embodiment of the LSF prediction error quantization table used for both the Type Zero and Type One classification is titled"Float64 CBes_85k"and is included in Appendix B of the attached microfiche appendix.

Within the decoding system 16, the FO or Fl LPC reconstruction modules 108,110 in the full-rate decoder 90 obtain the LSF component 140 from the bitstream as illustrated in FIG. 3. The LSF component 140 may be used to reconstruct the quantized LSFs as previously discussed. The quantized LSFs may be interpolated and converted to form the linear prediction coding coefficients for each subframe of the current frame.

For Type Zero classification, reconstruction may be performed by the FO LPC reconstruction module 108. Reconstruction involves determining the predicted LSFs, decoding the quantized LSFs prediction error and reconstructing the quantized LSFs. In addition, the quantized LSFs may be interpolated using the identified interpolation path. As previously discussed, one of the four interpolation paths is identified to the FO LPC

reconstruction module 108 by the interpolation element 158 that forms a part of the LSF component 140.

Reconstruction of the Type One classification involves the use of the predetermined linear interpolation path and the LSF prediction error quantization table by the F1 LPC reconstruction module 110. The LSF component 140 forms part of the first portion of the bitstream since it is encoded on a frame basis in both the Type zero and the Type One classifications.

The type component 142 also forms part of the first portion of the bitstream. As illustrated in FIG. 2, the F type selector module 68 generates the type component 142 to represent the type classification of a particular frame. Referring now to FIG. 3, the F type selector module 102 in the full-rate decoder 90 receives the type component 142 from the bitstream.

One embodiment of the adaptive codebook component 144 may be an open loop adaptive codebook component 144a or a closed loop adaptive codebook component 144b. The open or closed loop adaptive codebook component 144a, 144b is generated by the initial full frame-processing module 46 or the FO first subframe-processing module 70, respectively, as illustrated in FIG. 2. The open loop adaptive codebook component 144a may be replaced by the closed loop adaptive codebook component 144b in the bitstream when the frame is classified as Type Zero. In general, the open loop designation refers to processing on a frame basis that does not involve analysis-by-synthesis (ABS). The closed loop processing is performed on a subframe basis and includes analysis-by-synthesis (ABS).

Encoding the pitch lag, which is based on the periodicity of the speech signal 18, generates the adaptive codebook component 144. The open loop adaptive codebook component 144a is generated for a frame; whereas the closed loop adaptive codebook component 144b is generated on a subframe basis. Accordingly, the open loop adaptive codebook component 144a is part of the first portion of the bitstream and the closed loop adaptive codebook component 144b is part of the second portion of the bitstream. In one embodiment, as illustrated in Fig.

4, the open loop adaptive codebook component 144a comprises 8 bits and the closed loop adaptive codebook component 144b comprises 26 bits. The open loop adaptive codebook component 144a and the closed loop adaptive codebook component 144b may be generated using an adaptive codebook vector that will be described later. Referring now to FIG. 3, the decoding system 16 receives the open or closed loop adaptive codebook component 144a or 144b. The open or closed loop adaptive codebook component 144a or 144b is decoded by the FO or F1 excitation reconstruction module 104 or 106, respectively.

One embodiment of the fixed codebook component 146 may be a Type Zero fixed codebook component 146a or a Type One fixed codebook component 146b. The Type Zero fixed codebook component 146a is generated by the FO first subframe-processing module 70 as illustrated in FIG. 2. The F1 subframe-processing module 72 generates the Type One fixed codebook component 146b. The Type Zero or Type One fixed codebook component 146a or 146b is generated using a fixed codebook vector and synthesis-by-analysis on a subframe basis that will be described later. The fixed codebook component 146 represents the long-term residual of a subframe using an n-pulse codebook, where n is the number of pulses in the codebook.

Referring now to Fig. 4, the Type Zero fixed codebook component 146a of one embodiment comprises 22 bits per subframe. The Type Zero fixed codebook component 146a includes identification of one of a plurality of n-pulse codebooks, pulse locations in the codebook, and the signs of representative pulses (quantity"n") that

correspond to the pulse locations. In an example embodiment, up to two bits designate which one of three n-pulse codebooks has been encoded. Specifically, the first of the two bits is set to"I"to designate the first of the three n- pulse codebooks is used. If the first bit is set to"0,"the second of the two bits designates whether the second or the third of the three n-pulse codebooks are used. Accordingly, in the example embodiment, the first of the three n-pulse codebooks has 21 bits to represent the pulse locations and signs, and the second and third of the three n- pulse codebooks have 20 bits available.

Each of the representative pulses within one of the. n-pulse codebooks includes a corresponding track.

The track is a list of sample locations in a subframe where each sample location in the list is one of the pulse locations. A subframe being encoded may be divided into a plurality of sample locations where each of the sample locations contains a sample value. The tracks of the corresponding representative pulses list only a portion of the sample locations from a subframe. Each of the representative pulses within one of the n-pulse codebooks may be represented by one of the pulse locations in the corresponding track.

During operation, each of the representative pulses is sequentially placed in each of the pulse locations in the corresponding track. The representative pulses are converted to a signal that may be compared to the sample values in the sample locations of the subframe using ABS. The representative pulses are compared to the sample values in those sample locations that are later in time than the sample location of the pulse location. The pulse location that minimizes the difference between the representative pulse and the sample values that are later in time forms a portion of the Type Zero fixed codebook component 146a. Each of the representative pulses in a selected n-pulse codebook may be represented by a corresponding pulse location that forms a portion of the Type Zero fixed codebook component 146a. The tracks are contained in track tables that can generally be represented by the following matrix: TABLE 3 One embodiment of the track tables is the tables entitled"static short track540,""static short track532," and"static short track 5 3-1"within the library titled"tracks. tab" that is included in Appendix B of the attached microfiche appendix.

In the example embodiment illustrated in Fig. 4, the n-pulse codebooks are three 5-pulse codebooks 160 where the first of the three 5-pulse codebooks 160 includes 5 representative pulses therefore n=5. A first representative pulse has a track that includes 16 (f=16) of the 40 sample locations in the subframe. The first representative pulse from the first of the three 5-pulse codebooks 160 are compared with the sample values in the sample locations. One of the sample locations present in the track associated with the first representative pulse is identified as the pulse location using 4 bits. The sample location that is identified in the track is the sample

location in the subframe that minimizes the difference between the first representative pulse and the sample values that are later in time as previously discussed. Identification of the pulse location in the track forms a portion of the Type Zero fixed codebook component 146a.

In this example embodiment, the second and fourth representative pulses have corresponding tracks with 16 sample locations (g and i = 16) and the third and fifth representative pulses have corresponding tracks with 8 sample locations (h and j = 8). Accordingly, the pulse locations for the second and fourth representative pulses are identified using 4 bits and the pulse locations of the thirdand fifth representative pulses are identified using 3 bits. As a result, the Type Zero fixed codebook component 146a for the first of the three 5-pulse codebooks 160 includes 18 bits for identifying the pulse locations.

The signs of the representative pulses in the identified pulse locations may also be identified in the Type Zero fixed codebook component 146a. In the example embodiment, one bit represents the sign for the first representative pulse, one bit represents a combined sign for both the second and fourth representative pulses and one bit represents the combined sign for the third and the fifth representative pulses. The combined sign uses the redundancy of the information in the pulse locations to transmit two distinct signs with a single bit. Accordingly, the Type Zero fixed codebook component 146a for the first of the three 5-pulse codebooks 160 includes three bits for the sign designation for a total of 21 bits.

In an example embodiment, the second and third of the three 5-pulse codebooks 160 also include 5 representative pulses (n=5) and the tracks in the track table each comprise 8 sample locations (f, g, h, i, j = 8).

Accordingly, the pulse locations for each of the representative pulses in the second and third of the three 5-pulse codebook 160 are identified using 3 bits. In addition, in this example embodiment, the signs for each of the pulse locations are identified using 1 bit.

For frames classified as Type One, in an example embodiment, the n-pulse codebook is an 8-pulse codebook 162 (n=8). The 8-pulse codebook 162 is encoded using 30 bits per subframe to create one embodiment of the Type One fixed codebook component 146b. The 30 bits includes 26 bits identifying pulse locations using tracks as in the Type Zero classification, and 4 bits identifying the signs. One embodiment of the track table is the table entitled"static INT16 track 8 4 0"within the library titled"tracks. tab" that is included in Appendix B of the attached microfiche appendix.

In the example embodiment, the tracks associated with the first and fifth representative pulses comprise 16 sample locations that are encoded using 4 bits. The tracks associated with the remaining representative pulses comprise 8 sample locations that are encoded using 3 bits. The first and fifth representative pulses, the second and sixth representative pulses, the third and seventh representative pulses, and the fourth and eighth representative pulses use the combined signs for both respective representative pulses. As illustrated in FIG. 3, when the bitstream is received by the decoding system 16, the FO or the F1 excitation reconstruction modules 104 or 106 decode the pulse locations of the tracks. The pulse locations of the tracks are decoded by the FO or the F1 excitation reconstruction modules 104 or 106 for one of the three 5-pulse codebooks 160 or the 8-pulse codebook 162, respectively. The fixed codebook component 146 is part of the second portion of the bitstream since it is generated on a subframe basis.

Referring again to FIG. 4, the gain component 147, in general, represents the adaptive and fixed codebook gains. For Type Zero classification, the gain component 147 is a Type Zero adaptive and fixed codebook gain component 148a, 150a representing both the adaptive and the fixed codebook gains. The ; Type Zero adaptive and fixed codebook gain component 148a, 150a is part of the second portion of the bitstream since it is encoded on a subframe basis. As illustrated in FIG. 2, the Type Zero adaptive and fixed codebook gain component 148a, 150a is generated by the FO first subframe-processing module 70.

For each subframe of a frame classified as Type. Zeo, the adaptive and fixed codebook gains are jointly coded by a two-dimensional vector quantizer (2D VQ) 164 to generate the Type Zero adaptive and fixed codebook gain component 148a, 150a. In one embodiment, quantization involves translating the fixed codebook gain into a fixed codebook energy in units of decibels (dB). In addition, a predicted fixed codebook energy may be generated from the quantized fixed codebook energy values of previous frames. The predicted fixed codebook energy may be derived using a plurality of fixed codebook predictor coefficients.

Similar to the LSFs predictor coefficients, the fixed codebook predictor coefficients determine how much of the fixed codebook energy of past frames may be used to predict the fixed codebook energy of the current frame. The predicted fixed codebook energy is subtracted from the fixed codebook energy to generate a prediction fixed codebook energy error. By adjusting the weighting of the previous frames and the current frames for each subframe, the predicted fixed codebook energy may be calculated to minimize the prediction fixed codebook error.

The prediction fixed codebook energy error is grouped with the adaptive codebook gain to form a two- dimensional vector. Following quantization of the prediction fixed codebook energy error and the adaptive codebook gain, as later described, the two-dimensional vector may be referred to as a quantized gain (gaz) The two-dimensional vector is compared to a plurality of predetermined vectors in a 2D gain quantization table.

An index location is identified that is the location in the 2D gain quantization table of the predetermined vector that best represents the two-dimensional vector. The index location is the adaptive and fixed codebook gain component 148a and 150a for the subframe. The adaptive and fixed codebook gain component 148a and 150a for the frame represents the indices identified for each of the subframes.

The predetermined vectors comprise 2 elements, one representing the adaptive codebook gain, and one representing the prediction fixed codebook energy error. The 2D gain quantization table may be generally represented by: TABLE 4 The two-dimensional vector quantizer (2D VQ) 164, of one embodiment, utilizes 7 bits per subframe to identify the index location of one of 128 quantization vectors (n=128). One embodiment of the 2D gain

quantization table is entitled"Float64 gainVQ_2_128_8_5"and is included in Appendix B of the attached microfiche appendix.

For frames classified as Type One, a Type One adaptive codebook gain component 148b is generated by the Fl first frame-processing module 72 as illustrated in FIG. 2. Similarly, the F1 second frame-processing module 76 generates a Type One fixed codebook gain. component 150b. The Type One adaptive codebook gain component 148b and the Type One fixed codebook gain component 150b are generated on a frame basis to form part of the first portion of the bitstream.

Referring again to FIG. 4, the Type One adaptive codebook gain component 148b is generated using a multi-dimensional vector quantizer that is a four-dimensional pre vector quantizer (4D pre VQ) 166 in one embodiment. The term"pre"is used to highlight that, in one embodiment, the adaptive codebook gains for all the subframes in a frame are quantized prior to the search in the fixed codebook for any of the subframes. In an alternative embodiment, the multi-dimensional quantizer is an n dimensional vector quantizer that quantizes vectors for n subframes where n may be any number of subframes.

The vector quantized by the four-dimensional pre vector quantizer (4D pre VQ) 166 is an adaptive codebook gain vector with elements that represent each of the adaptive codebook gains from each of the subframes. Following quantization, as will be later discussed, the adaptive codebook gain vector can also be referred to as a quantized pitch gain (gka) Quantization of the adaptive codebook gain vector to generate the adaptive codebook gain component 148b is performed by searching in a pre-gain quantization table. The pre-gain quantization table includes a plurality of predetermined vectors that may be searched to identify the predetermined vector that best represents the adaptive codebook gain vector. The index location of the identified predetermined vector within the pre-gain quantization table is the Type One adaptive codebook component 148b. The adaptive codebook gain component 148b of one embodiment comprises 6 bits.

In one embodiment, the predetermined vectors comprise 4 elements, 1 element for each subframe.

Accordingly, the pre-gain quantization table may be generally represented as: TABLE 5 One embodiment of the pre-gain quantization table includes 64 predetermined vectors (n=64). An embodiment of the pre-gain quantization table is entitled"Float64 gp4tab"and is included in Appendix B of the attached microfiche appendix.

The Type One fixed codebook gain component 150b may be similarly encoded using a multi- dimensional vector quantizer for n subframes. In one embodiment, the multi-dimensional vector quantizer is a four-dimensional delayed vector quantizer (4D delayed VQ) 168. The term"delayed"highlights that the quantization of the fixed codebook gains for the subframes occurs only after the search in the fixed codebook for

all the subframes. Referring again to FIG. 2, the Fl second frame-processing module 76 determines the fixed codebook gain for each of the subframes. The fixed codebook gain may be determined by first buffering parameters generated on a sub-frame basis until the entire frame has been processed. When the frame has been processed, the fixed codebook gains for all of the subframes are quantized using the buffered parameters to generate the Type One fixed codebook gain component 150b. In one embodiment, the Type One fixed codebook gain component 150b comprises 10 bits as illustrated in FIG. 4.

The Type One fixed codebook gain component 15S0b is generated by representing the fixed-codebook gains with a plurality of fixed codebook energies in units of decibels (dB). The fixed codebook energies are quantized to generate a plurality of quantized fixed codebook energies, which are then translated to create a plurality of quantized fixed-codebook gains. In addition, the fixed codebook energies are predicted from the quantized fixed codebook energy errors of the previous frames to generate a plurality of predicted fixed codebook energies. The difference between the predicted fixed codebook energies and the fixed codebook energies is a plurality of prediction fixed codebook energy errors. In one embodiment, different prediction coefficients may be used for each of 4 subframes to generate the predicted fixed codebook energies. In this example embodiment, the predicted fixed codebook energies of the first, the second, the third, and the fourth subframe are predicted from the 4 quantized fixed codebook energy errors of the previous frame. The prediction coefficients for the first, second, third, and fourth subframes of this example embodiment may be {0.7,0.6,0.4,0. {0. 4,0.2,0.1,0.

{0. 3,0.2,0.075,0. and {0. 2,0.075,0.025,0. respectively.

The prediction fixed codebook energy errors may be grouped to form a fixed codebook gain vector that, when quantized, may be referred to as a quantized fixed codebook gain (gkc) In one embodiment, the prediction fixed codebook energy error for each subframe represent the elements in the vector. The prediction fixed codebook energy errors are quantized using a plurality of predetermined vectors in a delayed gain quantization table. During quantization, a perceptual weighing measure may be incorporated to minimize the quantization error. An index location that identifies the predetermined vector in the delayed gain quantization table is the fixed codebook gain component 150b for the frame.

The predetermined vectors in the delayed gain quantization table of one embodiment includes 4 elements. Accordingly, the delayed gain quantization table may be represented by the previously discussed Table 5. One embodiment of the delayed gain quantization table includes 1024 predetermined vectors (n=1024). An embodiment of the delayed gain quantization table is entitled"Float64 gainVQ_4_1024"and is included in Appendix B of the attached microfiche appendix.

Referring again to FIG. 3, the fixed and adaptive codebook gain components 148 and 150 may be decoded by the full-rate decoder 90 within the decoding system 16 based on the type classification. The FO excitation reconstruction module 104 decodes the Type Zero adaptive and fixed codebook gain component 148a, 150a. Similarly, the Type One adaptive codebook gain component 148b and the Type One fixed gain component 150b are decoded by the Fl excitation reconstruction module 106.

Decoding of the fixed and adaptive codebook gain components 158 and 160 involves generation of the respective predicted gains, as previously discussed, by the full-rate decoder 90. The respective quantized vectors from the respective quantization tables are then located using the respective index locations. The respective

quantized vectors are then assembled with the respective predicted gains to generate respective quantized codebook gains. The quantized codebook gains generated from the Type Zero fixed and adaptive gain component 148a and 150a represent the values for both the fixed and adaptive codebook gains for a subframe. The quantized codebook gain generated from the Type One adaptive codebook gain component 148b and the Type One fixed codebook gain component 150b represents the values for the fixed and adaptive codebook gains, respectively, for each subframe in a frame.

1.2 Bit Allocation for the Half-Rate Codec Referring now to FIGS. 2,3 and 5, the half-rate bitstream of the half-rate codec 24 will be described.

The half-rate codec 24 is in many respects similar to the full-rate codec 22 but has a different bit allocation. As such, for purposes of brevity, the discussion will focus on the differences. Referring now to FIG. 5, the bitstream allocation of one embodiment of the half-rate codec 24 includes a line spectrum frequency (LSF) component 172, a type component 174, an adaptive codebook component 176, a fixed codebook component 178, and a gain component 179. The gain component 179 further comprises an adaptive codebook gain component 180 and a fixed codebook gain component 182. The bitstream of the half-rate codec 24 also is further defined by a Type Zero column 184 and a Type One column 186. In one embodiment, the Type Zero column 184 uses two subframes of 10 milliseconds each containing 80 samples. The Type One column 186, of one embodiment, uses three subframes where the first and second subframes contain 53 samples and the third subframe contains 54 samples.

Although generated similarly to the full-rate codec 22, the LSF component 172 includes a plurality of stages 188 and a predictor switch 190 for both the Type Zero and the Type One classifications. In addition, one embodiment of the LSF component 172 comprises 21 bits that form part of the first portion of the bitstream. The initial half frame-processing module 48 illustrated in FIG. 2, generates the LSF component 172 similarly to the full-rate codec 22. Referring again to FIG. 5, the half-rate codec 24 of one embodiment includes three stages 188, two with 128 vectors and one with 64 vectors. The three stages 188 of the half rate codec 24 operate similarly to the full-rate codec 22 for frames classified as Type One with the exception of the selection of a set of predictor coefficients as discussed later. The index location of each of the 128 vectors is identified with 7 bits and the index location of each of the 64 vectors is identified with 6 bits. One embodiment of the LSF prediction error quantization table for the half-rate codec 24 is titled"Float64 CBes40k"and is included in Appendix B of the attached microfiche appendix.

The half-rate codec 24 also differs from the full-rate codec 22 in selecting between sets of predictor coefficients. The predictor switch 190 of one embodiment identifies one of two possible sets of predictor coefficients using one bit. The selected set of predictor coefficients may be used to determine the predicted line spectrum frequencies (LSFs), similar to the full-rate codec 22. The predictor switch 190 determines and identifies which of the sets of predictor coefficients will best minimize the quantization error. The sets of predictor coefficients may be contained in an LSF predictor coefficient table that may be generally illustrated by the following matrix:

TABLE 6 In one embodiment there are four predictor coefficients (m=4) in each of two sets (j=2) that comprise 10 elements each (n=10). The LSF predictor coefficient table for the half-rate codec 24 in one embodiment is titled "Float64 B40k"and is included in Appendix B of the attached microfiche appendix. Referring again to FIG. 3, the LSF prediction error quantization table and the LSF predictor coefficient table are used by the H LPC reconstruction module 118 within the decoding system 16. The H LPC reconstruction module 118 receives and decodes the LSF component 172 from the bitstream to reconstruct the quantized frame LSFs. Similar to the full- rate codec 22, for frames classified as Type One, the half-rate codec 24 uses a predetermined linear interpolation path. However, the half-rate codec 24 uses the predetermined linear interpolation path for frames classified as both Type Zero and Type One.

The adaptive codebook component 176 in the half-rate codec 24 similarly models the pitch lag based on the periodicity of the speech signal 18. The adaptive codebook component 176 is encoded on a subframe basis for the Type Zero classification and a frame basis for the Type One classification. As illustrated in FIG. 2, the initial half frame-processing module 48 encodes an open loop adaptive codebook component 176a for frames with the Type One classification. For frames with the Type Zero classification, the HO first subframe-processing module 80 encodes a closed loop adaptive codebook component 176b.

Referring again to FIG. 5, one embodiment of the open loop adaptive codebook component 176a is encoded by 7 bits per frame and the closed loop adaptive codebook component 176b is encoded by 7 bits per subframe. Accordingly, the Type Zero adaptive codebook component 176a is part of the first portion of the bitstream, and the Type One adaptive codebook component 176b is part of the second portion of the bitstream.

As illustrated in FIG. 3, the decoding system 16 receives the closed loop adaptive codebook component 176b.

The closed loop adaptive codebook component 176b is decoded by the half-rate decoder 92 using the HO excitation reconstruction module 114. Similarly, the HI excitation reconstruction module 116 decodes the open loop adaptive codebook component 176a.

One embodiment of the fixed codebook component 178 for the half-rate codec 24 is dependent on the type classification to encode the long-term residual as in the full-rate codec 22. Referring again to FIG. 2, a Type Zero fixed codebook component 178a or a Type One fixed codebook component 178b is generated by the HO first subframe-processing module 80 or the H I second subframe-processing module 84, respectively. Accordingly, the Type Zero and Type One fixed codebook components 178a and 178b form a part of the second portion of the bitstream.

Referring again to FIG. 5, the Type Zero fixed codebook component 178a of an example embodiment is encoded using 15 bits per subframe with up to two bits identify the codebook to be used as in the full-rate codec 22. Encoding the Type Zero fixed codebook component 178a involves use of a plurality of n-pulse codebooks that are a 2-pulse codebook 192 and a 3-pulse codebook 194 in the example embodiment. In addition, in this example embodiment, a gaussian codebook 195 is used that includes entries that are random excitation. For the n- pulse codebooks, the half-rate codec 24 uses the track tables similarly to the full-rate codec 22. In one embodiment, the track table entitled"static INT16 track 2 7-1,""static INT16 track_1 3 0,"and"static INT16 track 3 2 0"included in the library entitled"tracks. tab" in Appendix B of the microfiche appendix are used.

In an example embodiment of the 2-pulse codebook 192, each track in the track table includes 80 sample locations for each representative pulse. The pulse locations for both the first and second representative pulses are encoded using 13 bits. Encoding 1 of the 80 possible pulse locations is accomplished in 13 bits by identifying the pulse location for the first representative pulse, multiplying the pulse location by 80 and adding the pulse location of the second representative pulse to the result. The end result is a value that can be encoded in 13 bits with an additional bit used to represent the signs of both representative pulses as in the full-rate codec 22.

In an example embodiment of the 3-pulse codebook 194, the pulse locations are generated by the combination of a general location, that may be one of 16 sample locations defined by 4 bits, and a relative displacement there from. The relative displacement may be 3 values representing each of the 3 representative pulses in the 3-pulse codebook 194. The values represent the location difference away from the general location and may be defined by 2 bits for each representative pulse. The signs for the three representative pulses may be each defined by one bit such that the total bits for the pulse location and the signs is 13 bits.

The gaussian codebook 195 generally represents noise type speech signals that may be encoded using two orthogonal basis random vectors. The Type Zero fixed codebook component 178a represents the two orthogonal based random vectors generated from the gaussian codebook 195. The Type Zero fixed codebook component 178a represents how to perturbate a plurality of orthogonal basis random vectors in a gaussian table to increase the number of orthogonal basis random vectors without increasing the storage requirements. In an example embodiment, the number of orthogonal basis random vectors is increased from 32 vectors to 45 vectors.

A gaussian table that includes 32 vectors with each vector comprising 40 elements represents the gaussian codebook of the example embodiment. In this example embodiment, the two orthogonal basis random vectors used for encoding are interleaved with each other to represent 80 samples in each subframe. The gaussian codebook may be generally represented by the following matrix:

TABLE 7 One embodiment of the gaussian codebook 195 is titled"double bv"and is included in Appendix B of the attached microfiche appendix. For the example embodiment of the gaussian codebook 195,11 bits identify the combined indices (location and perturbation) of both of the two orthogonal basis random vectors used for encoding, and 2 bits define the signs of the orthogonal basis random vectors.

Encoding the Type One fixed codebook component 178b involves use of a plurality of n-pulse codebooks that are a 2-pulse codebook 196 and a 3-pulse codebook 197 in the example embodiment. The 2-pulse codebook 196 and the 3-pulse codebook 197 function similarly to the 2-pulse codebook 192 and the 3-pulse codebook 194 of the Type Zero classification, however the structure is different. The Type One fixed codebook component 178b of an example embodiment is encoded using 13 bits per subframe. Of the 13 bits, 1 bit identifies the 2-pulse codebook 196 or the 3-pulse codebook 197 and 12 bits represent the respective pulse locations and the signs of the representative pulses. In the 2-pulse codebook 196 of the example embodiment, the tracks include 32 sample locations for each representative pulse that are encoded using 5 bits with the remaining 2 bits used for the sign of each representative pulse. In the 3-pulse codebook 197, the general location includes 8 sample locations that are encoded using 4 bits. The relative displacement is encoded by 2 bits and the signs for the representative pulses are encoded in 3 bits similar to the frames classified as Type Zero.

Referring again to FIG. 3, the decoding system 16 receives the Type Zero or Type One fixed codebook components 178a and 178b. The Type Zero or Type One fixed codebook components 178a and 178b are decoded by the HO excitation reconstruction module 114 or the H1 reconstruction module 116, respectively. Decoding of the Type Zero fixed codebook component 178a occurs using an embodiment of the 2-pulse codebook 192, the 3- pulse codebook 194, or the gaussian codebook 195. The Type One fixed codebook component 178b is decoded using the 2-pulse codebook 196 or the 3-pulse codebook 197.

Referring again to FIG. 5, one embodiment of the gain component 179 comprises a Type Zero adaptive and fixed codebook gain component 180a and 182a. The Type Zero adaptive and fixed codebook gain component 180a and 182a may be quantized using the two-dimensional vector quantizer (2D VQ) 164 and the 2D gain quantization table (Table 4), used for the full-rate codec 22. In one embodiment, the 2D gain quantization table is entitled"Float64 gainVQ_3_128", and is included in Appendix B of the attached microfiche appendix.

Type One adaptive and fixed codebook gain components 180b and 182b may also be generated similarly to the full-rate codec 22 using multi-dimensional vector quantizers. In one embodiment, a three-dimensional pre vector quantizer (3D preVQ) 198 and a three-dimensional delayed vector quantizer (3D delayed VQ) 200 are used for the adaptive and fixed gain components 180b and 182b, respectively. The vector quantizers 198 and 200

perform quantization using respective gain quantization tables. In one embodiment, the gain quantization tables are a pre-gain quantization table and a delayed gain quantization table for the adaptive and fixed codebook gains, respectively. The multi-dimensional gain tables may be similarly structured and include a plurality of predetennined vectors. Each multi-dimensional gain table in one embodiment comprises 3 elements for each subframe of a frame classified as Type One.

Similar to the full-rate codec 22, the three-dimensional pre vector quantizer (3D preVQ) 198 for the adaptive gain component 180b may quantize directly the adaptive gains. In addition, the three-dimensional delayed vector quantizer (3D delayed VQ) 200 for the fixed gain component 182b may quantize the fixed codebook energy prediction error. Different prediction coefficients may be used to predict the fixed codebook energy for each subframe. In one preferred embodiment, the predicted fixed codebook energies of the first, the second, and the third subframes are predicted from the 3 quantized fixed codebook energy errors of the previous frame. In this example embodiment, the predicted fixed codebook energies of the first, the second, and the third subframes are predicted using the set of coefficients {0. 6,0.3,0. {0.4,0.25, and {0. 3,0.15,0. respectively.

The gain quantization tables for the half-rate codec 24 may be generally represented as: TABLE 8 One embodiment of the pre-gain quantization table used by the three-dimensional pre vector quantizer (3D preVQ) 198 includes 16 vectors (n=16). The three-dimensional delayed vector quantizer (3D delayed VQ) 200 uses one embodiment of the delayed gain quantization table that includes 256 vectors (n=256). The gain quantization tables for the pre vector quantizer (3D preVQ) 198 and the delayed vector quantizer (3D delayed VQ) 200 of one embodiment are entitled"Float64 gp3_tab"and"Float64 gainVQ_3_256", respectively, and are included in Appendix B of the attached microfiche appendix.

Referring again to FIG. 2, the Type Zero adaptive and fixed codebook gain component 180a and 182a is generated by the HO first subframe-processing module 80. The H 1 first frame-processing module 82 generates the Type One adaptive codebook gain component 180b. Similarly, the Type One fixed codebook gain component 182b is generated by the H I second frame-processing module 86. Referring again to FIG. 3, the decoding system 16 receives the Type Zero adaptive and fixed codebook gain component 180a and 182a. The Type Zero adaptive and fixed codebook gain component 180a and 182a is decoded by the HO excitation reconstruction module 114 based on the type classification. Similarly, the H1 excitation reconstruction module 116 decodes the Type One adaptive gain component 180b and the Type One fixed codebook gain component 182b.

1.3 Bit Allocation for the Quarter-Rate Codec Referring now to FIGS. 2,3 and 6, the quarter-rate bitstream of the quarter-rate codec 26 will now be explained. The illustrated embodiment of the quarter-rate codec 26 operates on both a frame basis and a subframe basis but does not include the type classification as part of the encoding process as in the full and half-rate codecs 22 and 24. Referring now to FIG. 6, the bitstream generated by quarter-rate codec 26 includes an LSF component 202 and an energy component 204. One embodiment of the quarter-rate codec 26 operates using two subframes of 10 milliseconds each to process frames using 39 bits per frame.

The LSF component 202 is encoded on a frame basis using a similar LSF quantization scheme as the full-rate codec 22 when the frame is classified as Type Zero. The quarter-rate codec 26 utilizes an interpolation element 206 and a plurality of stages 208 to encode the LSFs to represent the spectral envelope of a frame. One embodiment of the LSF component 202 is encoded using 27 bits. The 27 bits represent the interpolation element 206 that is encoded in 2 bits and four of the stages 208 that are encoded in 25 bits. The stages 208 include one stage encoded using 7 bits and three stages encoded using 6 bits. In one embodiment, the quarter rate codec 26 uses the exact quantization table and predictor coefficients table used by the full rated codec 22. The quantization table and the predictor coefficients table of one embodiment are titled"Float64 CBes_85k"and"Float64 B_85k", respectively, and are included in Appendix B of the attached microfiche appendix.

The energy component 204 represents an energy gain that may be multiplied by a vector of similar yet random numbers that may be generated by both the encoding system 12 and the decoding system 16. In one embodiment, the energy component 204 is encoded using 6 bits per subframe. The energy component 204 is generated by first determining the energy gain for the subframe based on the random numbers. In addition, a predicted energy gain is determined for the subframe based on the energy gain of past frames.

The predicted energy gain is subtracted from the energy gain to determine an energy gain prediction error. The energy gain prediction error is quantized using an energy gain quantizer and a plurality of predetermined scalars in an energy gain quantization table. Index locations of the predetermined scalars for each subframe may be represented by the energy component 204 for the frame.

The energy gain quantization table may be generally represented by the following matrix: TABLE 9 In one embodiment, the energy gain quantization table contains 64 (n=64) of the predetermined scalars. An embodiment of the energy gain quantization table is entitled"Float64 gainSQ_1_64"and is included in Appendix B of the attached microfiche appendix.

In FIG. 2, the LSF component 202 is encoded on a frame basis by the initial quarter frame-processing module 50. Similarly, the energy component 204 is encoded by the quarter rate module 60 on a subframe basis.

Referring now to FIG. 3, the decoding system 16 receives the LSF component 202. The LSF component 202 is decoded by the Q LPC reconstruction module 122 and the energy component 204 is decoded by the Q excitation reconstruction module 120. Decoding the LSF component 202 is similar to the decoding methods for the full-rate codec 22 for frames classified as Type One. The energy component 204 is decoded to determine the energy gain.

A vector of similar yet random numbers generated within the decoding system 16 may be multiplied by the energy gain to generate the short-term excitation.

1.4 Bit Allocation for the Eighth-Rate Codec In FIGS. 2,3, and 7, the eighth-rate bitstream of the eighth-rate codec 28 may not include the type classification as part of the encoding process and may operate on a frame basis only. Referring now to Fig. 7, similar to the quarter rate codec 26, the bitstream of the eighth-rate codec 28 includes an LSF component 240 and an energy component 242. The LSF component 240 may be encoded using a similar LSF quantization scheme as the full-rate codec 22, when the frame is classified as Type One. The eighth-rate codec 28 utilizes a plurality of stages 244 to encode the short-term predictor or spectral representation of a frame. One embodiment of the LSF component 240 is encoded using 11 bits per frame in three stages 244. Two of the three stages 244 are encoded in 4 bits and the last of the three stages 244 is encoded in 3 bits.

The quantization approach to generate the LSF component 240 for the eighth-rate codec 28 involves an LSF prediction error quantization table and a predictor coefficients table similar to the full-rate codec 22. The LSF prediction error quantization table and the LSF predictor coefficients table can be generally represented by the previously discussed Tables I and 2. In an example embodiment, the LSF quantization table for the eighth- rate codec 28 includes 3 stages (j=3) with 16 quantization vectors in two stages (r=16) and 8 quantization vectors in one stage (s =8) each having 10 elements (n=10). The predictor coefficient table of one embodiment includes 4 vectors (m=4) of 10 elements each (n=10). The quantization table and the predictor coefficients table of one embodiment are titled"Float64 CBes 08k"and"Float64 B_08k,"respectively, and are included in Appendix B of the attached microfiche appendix.

In FIG. 2, the LSF component 240 is encoded on a frame basis by the initial eighth frame-processing module 52. The energy component 242 also is encoded on a frame basis by the eighth-rate module 62. The energy component 242 represents an energy gain that can be determined and coded similarly to the quarter rate codec 26. One embodiment of the energy component 242 is represent by 5 bits per frame as illustrated in Fig. 7.

Similar to the quarter rate codec 26, the energy gain and the predicted energy gain may be used to determine an energy prediction error. The energy prediction error is quantized using an energy gain quantizer and a plurality of predetermined scalars in an energy gain quantization table. The energy gain quantization table may be generally represented by Table 9 as previously discussed. The energy gain quantizer of one embodiment uses an energy gain quantization table containing 32 vectors (n=32) that is entitled"Float64 gainSQ_1 32"and is included in Appendix B of the attached microfiche appendix.

In FIG. 3, the LSF component 240 and the energy component 242 may be decoded following receipt by the decoding system 16. The LSF component 240 and the energy component 242 are decoded by the E LPC reconstruction module 126 and the E excitation reconstruction module 124, respectively. Decoding of the LSF

component 240 is similar to the full-rate codec 22 for frames classified as Type One. The energy component 242 may be decoded by applying the decoded energy gain to a vector of similar yet random numbers as in the quarter rate codec 26.

An embodiment of the speech compression system 10 is capable of creating and then decoding a bitstream using one of the four codecs 22,24,26 and 28. The bitstream generated by a particular codec 22,24,26 and 28 may be encoded emphasizing different parameters of the speech signal 18 within a frame depending on the rate selection and the type classification. Accordingly, perceptual quality of the post-processed synthesized speech 20 decoded from the bitstream may be optimized while maintaining the desired average bit rate.

A detailed discussion of the configuration and operation of the speech compression system modules illustrated in the embodiments of FIGS. 2 and 3 is now provided. The reader is encouraged to review the source code included in Appendix A of the attached microfiche appendix in conjunction with the discussion to further enhance understanding.

2.0 PRE-PROCESSING MODULE Referring now to Fig. 8, an expanded block diagram of the pre-processing module 34 illustrated in Fig. 2 is provided. One embodiment of the pre-processing module 34 includes a silence enhancement module 302, a high-pass filter module 304, and a noise suppression module 306. The pre-processing module 34 receives the speech signal 18 and provides a pre-processed speech signal 308.

The silence enhancement module 302 receives the speech signal 18 and functions to track the minimum noise resolution. The silence enhancement function adaptively tracks the minimum resolution and levels of the speech signal 18 around zero, and detects whether the current frame may be"silence noise."If a frame of "silence noise"is detected, the speech signal 18 may be ramped to the zero-level. Otherwise, the speech signal 18 may not be modified. For example, the A-law coding scheme can transform such an inaudible"silence noise" into a clearly audible noise. A-law encoding and decoding of the speech signal 18 prior to the pre-processing module 34 can amplify sample values that are nearly 0 to values of about + 8 or-8 thereby transforming a nearly inaudible noise into an audible noise. After processing by the silence enhancement module 302, the speech signal 18 may be provided to the high-pass filter module 304.

The high-pass filter module 304 may be a 2nd order pole-zero filter, and may be given by the following transfer function H (z): <BR> <BR> <BR> <BR> H 0.92727435-1.854494lz''+0.92727435z"'<BR> <BR> <BR> <BR> 1-1. 9059465z-' + 0. 9114024z-2 The input may be scaled down by a factor of 2 during the high-pass filtering by dividing the coefficients of the numerator by 2.

Following processing by the high-pass filter, the speech signal 18 may be passed to the noise suppression module 306. The noise suppression module 306 employs noise subtraction in the frequency domain and may be one of the many well-known techniques for suppressing noise. The noise suppression module 306 may include a Fourier transform program used by a noise suppression algorithm as described in section 4.1.2 of the TIA/EIA IS-

127 standard entitled"Enhanced Variable Rate Codec, Speech Service Option 3 for Wideband Spread Spectrum Digital Systems." The noise suppression module 306 of one embodiment transforms each frame of the speech signal 18 to the frequency domain where the spectral amplitudes may be separated from the spectral phases. The spectral amplitudes may be grouped into bands, which follow the human auditory channel bands. An attenuation gain may be calculated for each band. The attenuation gains may be calculated with less emphasis on the spectral regions that are likely to have harmonic structure. In such regions,, the background noise may be masked by the strong voiced speech. Accordingly, any attenuation of the speech can distort the quality of the original speech, without any perceptual improvement in the reduction of the noise.

Following calculation of the attenuation gain, the spectral amplitudes in each band may be multiplied by the attenuation gain. The spectral amplitudes may then be combined with the original spectral phases, and the speech signal 18 may be transformed back to the time domain. The time-domain signal may be overlapped-and- added to generate the pre-processed speech signal 308. The pre-processed speech signal 308 may be provided to the initial frame-processing module 44.

3.0 INITIAL FRAME PROCESSING MODULE FIG. 9 is a block diagram of the initial frame-processing module 44, illustrated in FIG. 2. One embodiment of the initial frame-processing module 44 includes an LSF generation section 312, a perceptual weighting filter module 314, an open loop pitch estimation module 316, a characterization section 318, a rate selection module 320, a pitch pre-processing module 322, and a type classification module 324. The characterization section 318 further comprises a voice activity detection (VAD) module 326 and a characterization module 328. The LSF generation section 312 comprises an LPC analysis module 330, an LSF smoothing module 332, and an LSF quantization module 334. In addition, within the full-rate encoder 36, the LSF generation section 312 includes an interpolation module 338 and within the half-rate encoder 38, the LSF generation section includes a predictor switch module 336.

Referring to FIG. 2, the initial frame-processing module 44 operates to generate the LSF components 140,172,202 and 240, as well as determine the rate selection and the type classification. The rate selection and type classification control the processing by the excitation-processing module 54. The initial frame-processing module 44 illustrated in Fig. 9 is illustrative of one embodiment of the initial full frame-processing module 46 and the initial half frame-processing module 48. Embodiments of the initial quarter frame-processing module 50 and the initial eighth frame-processing module 52 differ to some degree.

As previously discussed, in one embodiment, type classification does not occur for the initial quarter-rate frame-processing module 50 and the initial eighth-rate frame-processing module 52. In addition, the long-term predictor and the long-term predictor residual are not processed separately to represent the energy component 204 and 242 illustrated in FIGS. 6 and 7. Accordingly, only the LSF section 312, the characterization section 318 and the rate selection module 320 illustrated in Fig. 9 are operable within the initial quarter-rate frame-processing module 50 and the initial eighth-rate frame-processing module 52.

To facilitate understanding of the initial frame-processing module 44, a general overview of the operation will first be discussed followed by a detailed discussion. Referring now to FIG. 9, the pre-processed speech signal 308 initially is provided to the LSF generation section 312, the perceptual weighting filter module 314 and the characterization section 318. However, some of the processing within the characterization section 318 is dependent on the processing that occurs within the open loop pitch estimation module 316. The LSF generation section 312 estimates and encodes the spectral representation of the pre-processed speech signal 308.

The perceptual weighting filter module 314 operates to, pravide perceptual weighting during coding of the pre- processed speech signal 308 according to the natural masking that occurs during processing by the human auditory system. The open loop pitch estimation module 316 determines the open loop pitch lag for each frame.

The characterization section 318 analyzes the frame of the pre-processed speech signal 308 and characterizes the frame to optimize subsequent processing.

During, and following, the processing by the characterization section 318, the resulting characterizations of the frame may be used by the pitch pre-processing module 322 to generate parameters used in generation of the closed loop pitch lag. In addition, the characterization of the frame is used by the rate selection module 320 to determine the rate selection. Based on parameters of the pitch lag determined by the pitch pre-processing module 322 and the characterizations, the type classification is determined by the type classification module 324.

3.1 LPC Analysis Module The pre-processed speech signal 308 is received by the LPC analysis module 330 within the LSF generation section 312. The LPC analysis module 330 determines the short-term prediction parameters used to generate the LSF component 312. Within one embodiment of the LPC analysis module 330, there are three 10"' order LPC analyses performed for a frame of the pre-processed speech signal 308. The analyses may be centered within the second quarter of the frame, the fourth quarter of the frame, and a lookahead. The lookahead is a speech segment that overhangs into the next frame to reduce transitional effects. The analysis within the lookahead includes samples from the current frame and from the next frame of the pre-processed speech signal 308.

Different windows may be used for each LPC analysis within a frame to calculate the linear prediction coefficients. The LPC analyses in one embodiment are performed using the autocorrelation method to calculate autocorrelation coefficients. The autocorrelation coefficients may be calculated from a plurality of data samples within each window. During the LPC analysis, bandwidth expansion of 60Hz and a white noise correction factor of 1. 0001 may be applied to the autocorrelation coefficients. The bandwidth expansion provides additional robustness against signal and round-off errors during subsequent encoding. The white noise correction factor effectively adds a noise floor of-40dB to reduce the spectral dynamic range and further mitigate errors during subsequent encoding.

A plurality of reflection coefficients may be calculated using a Leroux-Gueguen algorithm from the autocorrelation coefficients. The reflection coefficients may then be converted to the linear prediction coefficients. The linear prediction coefficients may be further converted to the LSFs (Line Spectrum Frequencies), as previously discussed. The LSFs calculated within the fourth quarter may be quantized and sent

to the decoding system 16 as the LSF component 140,172,202,240. The LSFs calculated within the second quarter may be used to determine the interpolation path for the full-rate encoder 36 for frames classified as Type Zero. The interpolation path is selectable and may be identified with the interpolation element 158. In addition, the LSFs calculated within the second quarter and the lookahead may be used in the encoding system 12 to generate the short term residual and a weighted speech that will be described later.

3.2 LSF Smoothing Module During stationary background noise, the LSFs calculated within the fourth quarter of the frame may be smoothed by the LSF smoothing module 332 prior to quantizing the LSFs. The LSFs are smoothed to better preserve the perceptual characteristic of the background noise. The smoothing is controlled by a voice activity determination provided by the VAD module 326 that will be later described and an analysis of the evolution of the spectral representation of the frame. An LSF smoothing factor is denoted รŸl5f. In an example embodiment: 1. At the beginning of"smooth"background noise segments, the smoothing factor may be ramped quadratically from 0 to 0.9 over 5 frames.

2. During"smooth"background noise segments the smoothing factor may be 0.9.

3. At the end of "smooth" background noise segments the smoothing factor may be reduced to 0 instantaneously.

4. During non-"smooth"background noise segments the smoothing factor may be 0.

According to the LSF smoothing factor the LSFs for the quantization may be calculated as: Isfn (k)=รŸlsf#lsfn-1(k)+(1-รŸlsf)#lsf2(k), k=1,2,..., 10 (Equation 2) where Isfn (k) and lsf n., (k) represents the smoothed LSFs of the current and previous frame, respectively, and Isf, (k) represents the LSFs of the LPC analysis centered at the last quarter of the current frame.

3.3 LSF Quantization Module The 10'"corder LPC model given by the smoothed LSFs (Equation 2) may be quantized in the LSF domain by the LSF quantization module 334. The quantized value is a plurality of quantized LPC coefficients Aq (z) 342. The quantization scheme uses an n Ih order moving average predictor. In one embodiment, the quantization scheme uses a 2nd order moving average predictor for the full-rate codec 22 and the quarter rate codec 26. For the half-rate codec 24, a 4th order moving average switched predictor may be used. For the eighth rate codec 28, a 4'h order moving average predictor may be used. The quantization of the LSF prediction error may be performed by multi-stage codebooks, in the respective codecs as previously discussed.

The error criterion for the LSFs quantization is a weighted mean squared error measure. The weighting for the weighted mean square error is a function of the LPC magnitude spectrum. Accordingly, the objective of the quantization may be given by: (Equation 3)

where the weighting may be: w, (!sf,,(',(Equation4) and-P ()is the LPC power spectrum at frequency f (the index n denotes the frame number). In the example embodiment, there are 10 coefficients.

In one embodiment, the ordering property of the quantized LPC coefficients Aq (z) 342 is checked. If one LSF pair is flipped they may be re-ordered. When two br more LSF pairs are flipped, the quantized LPC coefficients Aq (z) 342 may be declared erased and may be reconstructed using the frame erasure concealment of the decoding system 16 that will be discussed later. In one embodiment, a minimum spacing of 50Hz between adjacent coefficients of the quantized LPC coefficients Aq (z) 342 may be enforced.

3.4 Predictor Switch Module The predictor switch module 336 is operable within the half-rate codec 24. The predicted LSFs may be generated using moving average predictor coefficients as previously discussed. The predictor coefficients determine how much of the LSFs of past frames are used to predict the LSFs of the current frame. The predictor switch module 336 is coupled with the LSFs quantization module 334 to provide the predictor coefficients that minimize the quantization error as previously discussed.

3.5 LSF Interpolation Module The quantized and unquantized LSFs may also be interpolated for each subframe within the full-rate codec 22. The quantized and unquantized LSFs are interpolated to provide quantized and unquantized linear prediction parameters for each subframe. The LSF interpolation module 338 chooses an interpolation path for frames of the full-rate codec 22 with the Type Zero classification, as previously discussed. For all other frames, a predetennined linear interpolation path may be used.

The LSF interpolation module 338 analyzes the LSFs of the current frame with respect to the LSFs of previous frames and the LSFs that were calculated at the second quarter of the frame. An interpolation path may be chosen based on the degree of variations in the spectral envelope between the subframes. The different interpolation paths adjust the weighting of the LSFs of the previous frame and the weighting of the LSFs of the current frame for the current subframe as previously discussed. Following adjustment by the LSF interpolation module 338, the interpolated LSFs may be converted to predictor coefficients for each subframe.

For Type One classification within the full-rate codec 22, as well as for the half-rate codec 24, the quarter-rate codec 26, and the eighth-rate codec 28, the predetermined linear interpolation path may be used to adjust the weighting. The interpolated LSFs may be similarly converted to predictor coefficients following interpolation. In addition, the predictor coefficients may be further weighted to create the coefficients that are used by perceptual weighting filter module 314.

3.6 Perceptual Weighting Filter Module The perceptual weighting filter module 314 is operable to receive and filter the pre-processed speech signal 308. Filtering by the perceptual weighting filter module 314 may be performed by emphasizing theRvalley areas and de-emphasizing the peak areas of the pre-processed speech signal 308. One embodiment of the perceptual weighting filter module 314 has two parts. The first part may be the traditional pole-zero filter given by: (Equation 5) where A (z/yl) and I/A (z/y2) are a zeros-filter and a poles-filter, respectively. The prediction coefficients for the zeros-filter and the poles-filter may be obtained from the interpolated LSFs for each subframe and weighted by y, and Y2, respectively. In an example embodiment of the perceptual weighting filter module 314, the weighting is xi = 0.9 and Y2 =0. The second part of the perceptual weighting filter module 314 may be an adaptive low- pass filter given by: <BR> <BR> <BR> W2 (z) = l 1 (Equation 6)<BR> <BR> <BR> 1-ruz where Q is a function of stationary long-term spectral characteristics that will be later discussed. In one embodiment, if the stationary long-term spectral characteristics have the typical tilt associated with public switched telephone network (PSTN), then 17 = 0. 2, otherwise, 77 = 0. 0. The typical tilt is commonly referred to as a modified IRS characteristic or spectral tilt : Following processing by the perceptual weighting filter module 314, the pre-processed speech signal 308 may be described as a weighted speech 344. The weighted speech 344 is provided to the open loop pitch estimation module 316.

3.7 Open Loop Pitch Estimation Module The open loop pitch estimation module 316 generates the open loop pitch lag for a frame. In one embodiment, the open loop pitch lag actually comprises three open loop pitch lags, namely, a first pitch lag for the first half of the frame, a second pitch lag for the second half of the frame, and a third pitch lag for the lookahead portion of the frame.

For every frame, the second and third pitch lags are estimated by the open loop pitch estimation module 316 based on the current frame. The first open loop pitch lag is the third open loop pitch lag (the lookahead) from the previous frame that may be further adjusted. The three open loop pitch lags are smoothed to provide a continuous pitch contour. The smoothing of the open loop pitch lags employs a set of heuristic and ad-hoc decision rules to preserve the optimal pitch contour of the frame. The open-loop pitch estimation is based on the weighted speech 344 denoted by sW (n). The values estimated by the open loop pitch estimation module 316 in one embodiment are lags that range from 17 to 148.

The first, second and third open loop pitch lags may be determined using a normalized correlation, R (k) that may be calculated according to

(Equation 7)

Where n=79 in the example embodiment to represent the number of samples in the subframe. The maximum normalized correlation R (k) for each of a plurality of regions is determined. The regions may be four regions that represent four sub-ranges within the range of possible lags., For example, a first region from 17-33 lags, a second region from 34-67 lags, a third region from 68-137 lags, and a fourth region from 138-148 lags. One open loop pitch lag corresponding to the lag that maximizes the normalized correlation values R (k) from each region are the initial pitch lag candidates. A best candidate from the initial pitch lag candidates is selected based on the normalized correlation, characterization information, and the history of the open loop pitch lag. This procedure may be performed for the second pitch lag and for the third pitch lag.

Finally, the first, second, and third open loop pitch lags may be adjusted for an optimal fitting to the overall pitch contour and form the open loop pitch lag for the frame. The open loop pitch lag is provided to the pitch pre-processing module 322 for further processing that will be described later. The open loop pitch estimation module 316 also provides the pitch lag and normalized correlation values at the pitch lag. The normalized correlation values at the pitch lag are called a pitch correlation and are notated as Rp. The pitch correlation Rp is used in characterizing the frame within the characterization section 318.

3.8 Characterization Section The characterization section 318 is operable to analyze and characterize each frame of the pre-processed speech signal 308. The characterization information is utilized by a plurality of modules within the initial frame- processing module 44 as well by the excitation-processing module 54. Specifically, the characterization information is used in the rate selection module 320 and the type classification module 324. In addition, the characterization information may be used during quantization and coding, particularly in emphasizing the perceptually important features of the speech using a class-dependent weighting approach that will be described later.

Characterization of the pre-processed speech signal 308 by the characterization section 318 occurs for each frame. Operation of one embodiment of the characterization section 318 may be generally described as six categories of analysis of the pre-processed speech signal 308. The six categories are: voice activity determination, the identification of unvoiced noise-like speech, a 6-class signal characterization, derivation of a noise-to-signal ratio, a 4-grade characterization, and a characterization of a stationary long term spectral characteristic.

3.9 Voice Activity Detection (VAD) Module The voice activity detection (VAD) module 326 performs voice activity determination as the first step in characterization. The VAD module 326 operates to determine if the pre-processed speech signal 308 is some form of speech or if it is merely silence or background noise. One embodiment of the VAD module 326 detects voice activity by tracking the behavior of the background noise. The VAD module 326 monitors the difference

between parameters of the current frame and parameters representing the background noise. Using a set of predetermined threshold values, the frame may be classified as a speech frame or as a background noise frame.

The VAD module 326 operates to determine the voice activity based on monitoring a plurality of parameters, such as, the maximum of the absolute value of the samples in the frame, as well as the reflection coefficients, the prediction error, the LSFs and the 10"'order autocorrelation coefficients provided by the LPC analysis module 330. In addition, an example embodiment of the VAD module 326 uses the parameters of the pitch lag and the adaptive codebook gain from recent frames. The pitch lags and the adaptive codebook gains used by the VAD module 326 are from the previous frames since pitch lags and adaptive codebook gains of the current frame are not yet available. The voice activity determination performed by the VAD module 326 may be used to control several aspects of the encoding system 12, as well as forming part of a final class characterization decision by the characterization module 328.

3.10 Characterization Module Following the voice activity determination by the VAD module 326, the characterization module 328 is activated. The characterization module 328 performs the second, third, fourth and fifth categories of analysis of the pre-processed speech signal 308 as previously discussed. The second category is the detection of unvoiced noise-like speech frames.

3. 10. 1 Unvoiced Noise-Like Speech Detection In general, unvoiced noise-like speech frames do not include a harmonic structure, whereas voiced frames do. The detection of an unvoiced noise-like speech frame, in one embodiment, is based on the pre- processed speech signal 308, and a weighted residual signal Rw (z) given by: (Equation 8) Where A (z/y) represents a weighted zeros-filter with the weighting y, and S (z) is the pre-processed speech signal 308. A plurality of parameters, such as the following six parameters may be used to determine if the current frame is unvoiced noise-like speech : 1. The energy of the pre-processed speech signal 308 over the first % of the frame.

2. A count of the speech samples within the frame that are under a predetennined threshold.

3. A residual sharpness determined using a weighted residual signal and the frame size. The sharpness is given by the ratio of the average of the absolute values of the samples to the maximum of the absolute values of the samples. The weighted residual signal may be determined from Equation 8.

4. A first reflection coefficient representing the tilt of the magnitude spectrum of the pre-process speech signal 308.

5. The zero crossing rate of the pre-processed speech signal 308.

6. A prediction measurement between the pre-processed speech signal 308 and the weighted residual signal.

In one embodiment, a set of predetennined threshold values are compared to the above listed parameters in making the determination of whether a frame is unvoiced noise-like speech. The resulting determination may

be used in controlling the pitch pre-processing module 322, and in the fixed codebook search, both of which will be described later. In addition, the unvoiced noise-like speech determination is used in determining the 6-class signal characterization of the pre-processed speech signal 308.

3. 10. 2 6-Class Signal Characterization The characterization module 328 may also perform the third category of analysis that is the 6-class signal characterization. The 6-class signal characterization is performed by characterizing the frame into one of 6 classes according to the dominant features of the frame. In one embodiment, the 6 classes may be described as: 0. Silence/Background Noise 1. Stationary Noise-Like Unvoiced Speech 2. Non-Stationary Unvoiced 3. Onset 4. Non-Stationary Voiced 5. Stationary Voiced In an alternative embodiment, other classes are also included such as frames characterized as plosive.

Initially, the characterization module 328 distinguishes between silence/background noise frames (class 0), non- stationary unvoiced frames (class 2), onset frames (class 3), and voiced frames represented by class 4 and 5.

Characterization of voiced frames as Non-Stationary (class 4) and Stationary (class 5) may be performed during activation of the pitch pre-processing module 322. Furthermore, the characterization module 328 may not initially distinguish between stationary noise-like unvoiced frames (class 1) and non-stationary unvoiced frames (class 2).

This characterization class may also be identified during processing by the pitch pre-processing module 322 using the determination by the unvoiced noise-like speech algorithm previously discussed.

The characterization module 328 performs characterization using, for example, the pre-processed speech signal 308 and the voice activity detection by the VAD module 326. In addition, the characterization module 328 may utilize the open loop pitch lag for the frame and the normalized correlation Rp corresponding to the second open loop pitch lag.

A plurality of spectral tilts and a plurality of absolute maximums may be derived from the pre-processed speech signal 308 by the characterization module 328. In an example embodiment, the spectral tilts for 4 overlapped segments comprising 80 samples each are calculated. The 4 overlapped segments may be weighted by a Hamming window of 80 samples. The absolute maximums of an example embodiment are derived from 8 overlapped segments of the pre-processed speech signal 308. In general, the length of each of the 8 overlapped segments is about 1.5 times the period of the open loop pitch lag. The absolute maximums may be used to create a smoothed contour of the amplitude envelope.

The spectral tilt, the absolute maximum, and the pitch correlation Rp parameters may be updated or interpolated multiple times per frame. Average values for these parameters may also be calculated several times for frames characterized as background noise by the VAD module 326. In an example embodiment, 8 updated estimates of each parameter are obtained using 8 segments of 20 samples each. The estimates of the parameters

for the background noise may be subtracted from the estimates of parameters for subsequent frames not characterized as background noise to create a set of"noise cleaned"parameters.

A set of statistically based decision parameters may be calculated from the"noise clean"parametUrs and the open loop pitch lag. Each of the statistically based decision parameters represents a statistical property of the original parameters, such as, averaging, deviation, evolution, maximum, or minimums. Using a set of predetennined threshhold parameters, initial characterization decisions may be made for the current frame based on the statistical decision parameters. Based on the initial characterization decision, past characterization decisions, and the voice activity decision of the VAD module 326, an initial class decision may be made for the frame. The initial class decision characterizes the frame as one of the classes 0,2,3, or as a voiced frame represented by classes 4 and 5.

3. 10. 3 Noise-to-Signal Ratio Derivation In addition to the frame characterization, the characterization module 328 of one embodiment also performs the fourth category of analysis by deriving a noise-to-signal ratio (NSR). The NSR is a traditional distortion criterion that may be calculated as the ratio between an estimate of the background noise energy and the frame energy of a frame. One embodiment of the NSR calculation ensures that only true background noise is included in the ratio by using a modified voice activity decision. The modified voice activity decision is derived using the initial voice activity decision by the VAD module 326, the energy of the frame of the pre-processed speech signal 308 and the LSFs calculated for the lookahead portion. If the modified voice activity decision indicates that the frame is baokground noise, the energy of the background noise is updated.

The background noise is updated from the frame energy using, for example, moving average. If the energy level of the background noise is larger than the energy level of the frame energy, it is replaced by the frame energy. Replacement by the frame energy can involve shifting the energy level of the background noise lower and truncating the result. The result represents the estimate of the background noise energy that may be used in the calculation of the NSR.

Following calculation of the NSR, the characterization module 328 performs correction of the initial class decision to a modified class decision. The correction may be performed using the initial class decision, the voice activity determination and the unvoiced noise-like speech determination. In addition, previously calculated parameters representing, for example, the spectrum expressed by the reflection coefficients, the pitch correlation Rp, the NSR, the energy of the frame, the energy of the previous frames, the residual sharpness and a sharpness of the weighted speech may also be used. The correction of the initial class decision is called characterization tuning. Characterization tuning can change the initial class decision, as well as set an onset condition flag and a noisy voiced flag if these conditions are identified. In addition, tuning can also trigger a change in the voice activity decision by the VAD module 326.

3. Characterization The characterization module 328 can also generate the fifth category of characterization, namely, the 4- grade characterization. The 4-grade characterization is a parameter that controls the pitch pre-processing module

322. One embodiment of the 4-grade characterization distinguishes between 4 categories. The categories may be labeled numerically from 1 to 4. The category labeled I is used to reset the pitch pre-processing module 322 in order to prevent accumulated delay that exceeds a delay budget during pitch pre-processing. In general, the remaining categories indicate increasing voicing strength. Increasing voicing strength is a measure of the periodicity of the speech. In an alternative embodiment, more or less categories could be included to indicate the levels of voicing strength.

3. 10. 5 Stationary Long-Term Spectral Characteristics The characterization module 328 may also performs the sixth category of analysis by determining the stationary long-term spectral characteristics of the pre-processed speech signal 308. The stationary long-term spectral characteristic is determined over a plurality of frames using, for example, spectral information such as the LSFs, the 6-class signal characterization and the open loop pitch gain. The determination is based on long-term averages of these parameters.

3.11 Rate Selection Module Following the modified class decision by the characterization module 328, the rate selection module 320 can make an initial rate selection called an open loop rate selection. The rate-selection module 320 can use, for example, the modified class decision, the NSR, the onset flag, the residual energy, the sharpness, the pitch correlation Rp, and spectral parameters such as the reflection coefficients in determining the open-loop rate selection. The open loop rate selection may also be selected based on the Mode that the speech compression system 10 is operating within. The rate selection module 320 is tuned to provide the desired average bit rate as indicated by each of the Modes. The initial rate selection may be modified following processing by the pitch pre- processing module 322 that will be described later.

3.12 Pitch Pre-Processing Module The pitch pre-processing module 322 operates on a frame basis to perform analysis and modification of the weighted speech 344. The pitch pre-processing module 322 may, for example, uses compression or dilation techniques on pitch cycles of the weighted speech 344 in order to improve the encoding process. The open loop pitch lag is quantized by the pitch pre-processing module 322 to generate the open loop adaptive codebook component 144a or 176a, as previously discussed with reference to FIGS. 2,4 and 5. If the final type classification of the frame is Type One, this quantization represents the pitch lag for the frame. However, if the type classification is changed following processing by the pitch pre-processing module 322, the pitch lag quantization also is changed to represent the closed loop adaptive codebook component 144b or 176b, as previously discussed with reference to FIGS. 2,4 and 5.

The open loop pitch lag for the frame that was generated by the open loop pitch estimation module 316 is quantized and interpolated, to create a pitch track 348. In general, the pitch pre-processing module 322 attempts to modify the weighted speech 344 to fit the pitch track 348. If the modification is successful, the final type

classification of the frame is Type One. If the modification is unsuccessful the final type classification of the frame is Type Zero.

As further detailed later, the pitch pre-processing modification procedure can perform continuous time warping of the weighted speech 344. The warping introduces a variable delay. In one example embodiment, the maximum variable delay within the encoding system 12 is 20 samples (2.5 ms). The weighted speech 344 may be modified on a pitch cycle-by-pitch cycle basis, with certain overlap between adjacent pitch cycles to avoid discontinuities between the reconstructed/modified segments. The weighted speech 344 may be modified according to the pitch track 348 to generate a modified weighted speech 350. In addition, a plurality of unquantized pitch gains 352 are generated by the pitch pre-processing module 322. If the type classification of the frame is Type One, the unquantized pitch gains 352 are used to generate the Type One adaptive codebook gain component 148b (for full rate codec 22) or 180b (for half-rate codec 24). The pitch track 348, the modified weighted speech 350 and the unquantized pitch gains 352 are provided to the excitation-processing module 54.

As previously discussed, the 4-grade characterization by the characterization module 328 controls the pitch pre-processing. In one embodiment, if the frame is predominantly background noise or unvoiced with low pitch correlation, such as, category 1, the frame remains unchanged and the accumulated delay of the pitch pre- processing is reset to zero. If the frame is pre-dominantly pulse-like unvoiced, such as, category 2, the accumulated delay may be maintained without any warping of the signal except for a simple time shift. The time shift may be determined according to the accumulated delay of the input speech signal 18. For frames with the remaining 4-grade characterizations, the core of the pitch pre-processing algorithm may be executed in order to optimally warp the signal.

In general, the core of the pitch pre-processing module 322 in one embodiment performs three main tasks. First, the weighted speech 344 is modified in an attempt to match the pitch track 348. Second, a pitch gain and a pitch correlation for the signal are estimated. Finally, the characterization of the speech signal 18 and the rate selection is refined based on the additional signal information obtained during the pitch pre-processing analysis. In another embodiment, additional pitch pre-processing may be included, such as, waveform interpolation. In general, waveform interpolation may be used to modify certain irregular transition segments using forward-backward waveform interpolation techniques to enhance the regularities and suppress the irregularities of the weighted speech 344.

3. 12. 1 Modification Modification of the weighted speech 344 provides a more accurate fit of the weighted speech 344 into a pitch-coding model that is similar to the Relaxed Code Excited Linear Prediction (RCELP) speech coding approach. An example of an implementation of RCELP speech coding is provided in the TIA (Telecommunications Industry Association) IS-127 standard. Performance of the modification without any loss of perceptual quality can include a fine pitch search, estimation of a segment size, target signal warping, and signal warping. The fine pitch search may be performed on a frame level basis while the estimation of a segment size, the target signal warping, and the signal warping may be executed for each pitch cycle.

3. 12. 1. 1 Fine Pitch Search The fine pitch search may be performed on the weighted speech 344, based on the previously determined second and third pitch lags, the rate selection, and the accumulated pitch pre-processing delay. The fine pitch search searches for fractional pitch lags. The fractional pitch lags are non-integer pitch lags that combine with the quantization of the lags. The combination is derived by searching the quantization tables of the lags used to quantize the open loop pitch lags and finding lags that maximize the pitch correlation of the weighted speech 344.

In one embodiment, the search is performed differently for each codec due to the different quantization techniques associated with the different rate selections. The search is performed in a search area that is identified by the open loop pitch lag and is controlled by the accumulated delay.

3. 12. 1. 2 Estimate segment size The segment size follows the pitch period, with some minor adjustments. In general, the pitch complex (the main pulses) of the pitch cycle are located towards the end of a segment in order to allow for maximum accuracy of the warping on the perceptual most important part, the pitch complex. For a given segment the starting point is fixed and the end point may be moved to obtain the best model fit. Movement of the end point effectively stretches or compresses the time scale. Consequently, the samples at the beginning of the segment are hardly shifted, and the greatest shift will occur towards the end of the segment.

3. 12. 1. 3 Target signalfor warping One embodiment of the target signal for time warping is a synthesis of the current segment derived from the modified weighted speech 350 that is represented by s' (n) and the pitch track 348 represented byLp (n).

According to the pitch track 348, Lp (n), each sample value of the target signal s' (n), n=O,..., Ns-1 may be obtained by interpolation of the modified weighted speech 350 using a 215'order Hamming weighted Sinc window, (Equation 9) where i (Lp (n)) and f (Lp (n)) are the integer and fractional parts of the pitch lag, respectively; ws (f, i) is the Hamming weighted Sinc window, and N, is the length of the segment. A weighted target, s't (n), is given by s'v' (n) = we (n) sw (n). The weighting function, we (n), may be a two-piece linear function, which emphasizes the pitch complex and de-emphasizes the"noise"in between pitch complexes. The weighting may be adapted according to the 4-grade classification, by increasing the emphasis on the pitch complex for segments of higher periodicity.

The integer shift that maximizes the normalized cross correlation between the weighted target Swwt(n) and the weighted speech 344 is s, t, (n + where s,,, (n + is the weighted speech 344 shifted according to an accumulated delay raCc may be found by maximizing (Equation 10) A refined (fractional) shift may be determined by searching an upsampled version of R (rsnft) in the vicinity of #shift This may result in a final optimal shift T,, pt and the corresponding normalized cross correlation R, (coup, 3. 12. 1. 4 Signal Warping The modified weighted speech 350 for the segment may be reconstructed according to the mapping given by [Sw(n+#acc),Sw(n+#acc+#c+#opt)]#[Sw'(n),Sw'(n+#c-1)], (Equation 11) and [Sw(n+#acc+#c+#opt),Sw(n+#acc+#opt+Ns-1)]#[Sw'(n+#c),Sw'(n+N s-1)] (Equation 12) where rc is a parameter defining the warping function. In general, rc specifies the beginning of the pitch complex. The mapping given by Equation 11 specifies a time warping, and the mapping given by Equation 12 specifies a time shift (no warping). Both may be carried out using a Hamming weighted Sinc window function.

3.12.2 Pitch Gain and Pitch Correlation Estimation The pitch gain and pitch correlation may be estimated on a pitch cycle basis and are defined by Equations 11 and 12, respectively. The pitch gain is estimated in order to minimize the mean squared error between the target si, (n), defined by Equation 9, and the final modified signal sw (n), defined by Equations 11 and 12, and may be given by (Equation 13) The pitch gain is provided to the excitation-processing module 54 as the unquantized pitch gains 352. The pitch correlation may be given by (Equation 14)

Both parameters are available on a pitch cycle basis and may be linearly interpolated.

3. Refined Classification and Refined Rate Selection Following pitch pre-processing by the pitch pre-processing module 322, the average pitch correlation and the pitch gains are provided to the characterization module 328 and the rate selection module 320. The characterization module 328 and the rate selection module 320 create a final characterization class and a final rate selection, respectively, using the pitch correlation and the pitch gains. The final characterization class and the final rate selection may be determined by refining the 6-class signal characterization and the open loop rate selection of the frame.

Specifically, the characterization module 328 determines whether a frame with a characterization as a voiced frame should be characterized as class 4-"Non-Stationary Voiced", or class 5-"Stationary Voiced."In addition, a final determination that a particular frame is stationary noise-like unvoiced speech may occur based on the previous determination that the particular frame is modified unvoiced noise-like speech. Frames confirmed to be noise-like unvoiced speech may be characterized as class 1,"Stationary Noise-Like Unvoiced Speech." Based on the final characterization class, the open loop rate selection by the rate selection module 320 and the half rate signaling flag on the half rate signal line 30 (FIG. 1), a final rate selection may be determined.

The final ratetselection is provided to the excitation-processing module 54 as a rate selection indicator 354. In addition, the final characterization class for the frame is provided to the excitation-processing module 54 as control information 356.

3.13 Type Classification Module For the full rate codec 22 and the half rate codec 24, the final characterization class may also be used by the type classification module 324. A frame with a final characterization class of class 0 to 4 is determined to be a Type Zero frame, and a frame of class 5 is determined to be a Type One frame. The type classification is provided to the excitation-processing module 54 as a type indicator 358.

4.0 EXCITATION PROCESSING MODULE The type indicator 358 from the type classification module 324 selectively activates either the full-rate module 54 or the half-rate module 56, as illustrated in FIG. 2, depending on the rate selection. FIG. 10 is a block diagram representing the FO or HO first subframe-processing module 70 or 80 illustrated in FIG. 2 that is activated for the Type Zero classification. Similarly, FIG. 11 is a block diagram representing the F1 or HI first frame processing module 72 or 82, the F1 or H1 second subframe processing module 74 or 84 and the FI or H1 second

frame processing module 76 or 86 that are activated for Type One classification. As previously discussed, the"F" and"H"represent the full-rate codec 22 and the half-rate codec 24, respectively.

Activation of the quarter-rate module 60 and the eighth-rate module 62 illustrated in FIG. 2 may be based on the rate selection. In one embodiment, a pseudo-random sequence is generated and scaled to represent the short-term excitation. The energy component 204 and 242 (FIG. 2) represents the scaling of the pseudo- random sequence, as previously discussed. In one embodiment, the"seed"used for generating the pseudo-random sequence is extracted from the bitstream, thereby providing synchronicity between the encoding system 12 and the decoding system 16.

As previously discussed, the excitation processing module 54 also receives the modified weighted speech 350, the unquantized pitch gains 352, the rate indicator 354 and the control information 356. The quarter and eighth rate codecs 26 and 28 do not utilize these signals during processing. However, these parameters may be used to further process frames of the speech signal 18 within the full-rate codec 22 and the half-rate codec 24.

Use of these parameters by the full-rate codec 22 and the half-rate codec 24, as described later, depends on the type classification of the frame as Type Zero or Type One.

4.1 Excitation Processing Module For Type Zero Frames Of The Full-Rate Codec And The Half-Rate Codec Referring now to FIG. 10, one embodiment of the FO or HO first subframe-processing module 70,80 comprises an adaptive codebook section 362, a fixed codebook section 364 and a gain quantization section 366.

The processing and coding for frames of Type Zero is somewhat similar to the traditional CELP encoding, for example, of TIA (Telecommunications Industry Association) standard IS-127. For the full-rate codec 22, the frame may be divided into four subframes, while for the half-rate codec 24, the frame may be divided into two subframes, as previously discussed. The functions represented in FIG. 10 are executed on a subframe basis.

The FO or HO first subframe-processing module 70 and 80 (FIG. 2) operate to determine the closed loop pitch lag and the corresponding adaptive codebook gain for the adaptive codebook. In addition, the long-term residual is quantized using the fixed codebook, and the corresponding fixed codebook gain is also determined.

Quantization of the closed loop pitch lag and joint quantization of the adaptive codebook gain and the fixed codebook gain are also performed.

4. 1. 1 Adaptive Codebook Section The adaptive codebook section 362 includes an adaptive codebook 368, a first multiplier 370, a first synthesis filter 372, a first perceptual weighting filter 374, a first subtractor 376 and a first minimization module 378. The adaptive codebook section 362 performs a search for the best closed loop pitch lag from the adaptive codebook 368 using the analysis-by-synthesis (ABS) approach.

A segment from the adaptive codebook 368 corresponding to the closed loop pitch lag may be referred to as an adaptive codebook vector (va) 382. The pitch track 348 from the pitch pre-processing module 322 of FIG. 9 may be used to identify an area in the adaptive codebook 368 to search for vectors for the adaptive codebook vector (vn) 382. The first multiplier 370 multiplies the selected adaptive codebook vector (va) 382 by a gain (ga)

384. The gain (gj 384 is unquantized and represents an initial adaptive codebook gain that is calculated as will be described later. The resulting signal is passed to the first synthesis filter 372 that performs a function that is the inverse of the LPC analysis previously discussed. The first synthesis filter 372 receives the quantized LPC coefficients Aq (z) 342 from the LSF quantization module 334 and together with the first perceptual weighting filter module 374, creates a first resynthesized speech signal 386. The first subtractor 376 subtracts the first resynthesized speech signal 386 from the modified weighted speech 350 to generate a long-term error signal 388.

The modified weighted speech 350 is the target signal for the, search in the adaptive codebook 368.

The first minimization module 378 receives the long-term error signal 388 that is a vector representing the error in quantizing the closed loop pitch lag. The first minimization module 378 performs calculation of the energy of the vector and determination of the corresponding weighted mean squared error. In addition, the first minimization module 378 controls the search and selection of vectors from the adaptive codebook 368 for the adaptive codebook vector (va) 382 in order to reduce the energy of the long-term error signal 388.

The search process repeats until the first minimization module 378 has selected the best vector for the adaptive codebook vector (va) 382 from the adaptive codebook 368 for each subframe. The index location of the best vector for the adaptive codebook vector (va) 382 within the adaptive codebook 368 forms part of the closed loop adaptive codebook component 144b, 176b (FIG. 2). This search process effectively minimizes the energy of the long-term error signal 388. The best closed loop pitch lag is selected by selecting the best adaptive codebook vector (va) 382 from the adaptive codebook 368. The resulting long-term error signal 388 is the modified weighted speech signal 350 less the filtered best vector for the adaptive codebook vector (va) 382.

4. 1. 1. 1 Closed-Loop Adaptive Codebook Search for the Ful !-Rate Codec The closed loop pitch lag for the full-rate codec 22 is represented in the bitstream by the closed loop adaptive codebook component 144b. For one embodiment of the full-rate codec 22, the closed loop pitch lags for the first and the third subframes are represented with 8 bits, and the closed loop pitch lags for the second and the fourth subframes are represented with 5 bits, as previously discussed. In one embodiment, the lag is in a range of 17 to 148 lags. The 8 bits and the 5 bits may represent the same pitch resolution. However, the 8 bits may also represent the full range of the closed loop pitch lag for a subframe and the 5 bits may represent a limited value of closed loop pitch lags around the previous subframe closed loop pitch lag. In an example embodiment, the closed loop pitch lag resolution is 0.2, uniformly, between lag 17 and lag 33. From lag 33 to lag 91 of the example embodiment, the resolution is gradually increased from 0.2 to 0.5, and the resolution from lag 91 to lag 148 is 1.0, uniformly.

The adaptive codebook section 362 performs an integer lag search for closed loop integer pitch lags. For the first and the third subframes (i. e. those represented with 8 bits), the integer lag search may be performed on the range of [L-3,..., Lp +3]. Where Lp is the subframe pitch lag. The subframe pitch lag is obtained from the pitch track 348, which is used to identify a vector in the adaptive codebook 368. The cross-correlation function, R (l), for the integer lag search range may be calculated according to (Equation 15) where t (n) is the target signal that is the modified weighted speech 350, e (n) is the adaptive codebook contribution represented by the adaptive codebook vector (va) 382, h (n) is the combined response of the first synthesis filter 372 and the perceptual weighting filter 374. In the example embodiment, there are 40 samples in a subframe, although more or less samples could be used.

The closed loop integer pitch lag that maximizes R (l) may be choosen as a refined integer lag. The best vector from the adaptive codebook 368 for the adaptive codebook vector (va) 382 may be determined by upsampling the cross-correlation function R (l) using a 9th order Hamming weighted Sine. Upsampling is followed by a search of the vectors within the adaptive codebook 368 that correspond to closed loop pitch lags that are within 1 sample of the refined integer lag. The index location within the adaptive codebook 368 of the best vector for the adaptive codebook vector (va) 382 for each subframe is represented by the closed loop adaptive codebook component 144b in the bitstream.

The initial adaptive codebook gain may be estimated according to: (Equation 16) where L p represents the lag of the best vector for the adaptive codebook vector (va) 382 and e (n-LpยฐPt) represents the best vector for the adaptive codebook vector (va) 382. In addition, in this example embodiment, the estimate is bounded by 0.0 # g # 1.2, and n represents 40 samples in a subframe. A normalized adaptive codebook correlation is given by R (l) when l=LpยฐP'. The initial adaptive codebook gain may be further normalized according to the normalized adaptive codebook correlation, the initial class decision and the sharpness of the adaptive codebook contribution. The normalization results in the gain (ga) 384. The gain (ga) 384 is unquantized and represents the initial adaptive codebook gain for the closed loop pitch lag.

4. 1. 1. 2 Closed-Loop Adaptive Codebook Search for Half-Rate Coding The closed loop pitch lag for the half-rate codec 24 is represented by the closed loop adaptive codebook component 176b (FIG. 2). For the half-rate codec 24 of one embodiment, the closed loop pitch lags for each of the two subframes are encoded in 7 bits each with each representing a lag in the range of 17 to 127 lags. The integer lag search may be performed on the range of [L-3,..., L +3] as opposed to the fractional search performed in the full-rate codec 22. The cross-correlation function R (l) may be calculated as in Equation 15, where the summation is performed on an example embodiment subframe size of 80 samples. The closed loop pitch lag that maximizes R (l) is choosen as the refined integer lag. The index location within the adaptive codebook 368 of the

best vector for the adaptive codebook vector (va) 382 for each subframe is represented by the closed loop adaptive codebook component 176b in the bitstream.

The initial value for the adaptive codebook gain may be calculated according to Equation 16, where the summation is performed on an example embodiment subframe size of 80 samples. The normalization procedures as previously discussed may then be applied resulting in the gain (ga) 384 that is unquantized.

The long-term error signal 388 generated by either the full-rate codec 22 or the half-rate codec 24 is used during the search by the fixed codebook section 364. Prior to the fixed codebook search, the voice activity decision from the VAD module 326 of FIG. 9 that is applicable to the frame is obtained. The voice activity decision for the frame may be sub-divided into a subframe voice activity decision for each subframe. The subframe voice activity decision may be used to improve perceptual selection of the fixed-codebook contribution.

4. 1. 2 Fixed CodebookSection The fixed codebook section 364 includes a fixed codebook 390, a second multiplier 392, a second synthesis filter 394, a second perceptual weighting filter 396, a second subtractor 398, and a second minimization module 400. The search for the fixed codebook contribution by the fixed codebook section 364 is similar to the search within the adaptive codebook section 362.

A fixed codebook vector (vj 402 representing the long-tenn residual for a subframe is provided from the fixed codebook 390. The second multiplier 392 multiplies the fixed codebook vector (vc) 402 by a gain (gc) 404.

The gain (gc) 404 is unquantized and is a representation of the initial value of the fixed codebook gain that may be calculated as later described. The resulting signal is provided to the second synthesis filter 394. The second synthesis filter 394 receives the quantized LPC coefficients Aq (z) 342 from the LSF quantization module 334 and together with the second perceptual weighting filter 396, creates a second resynthesized speech signal 406. The second subtractor 398 subtracts the resynthesized speech signal 406 from the long-term error signal 388 to generate a vector that is a fixed codebook error signal 408.

The second minimization module 400 receives the fixed codebook error signal 408 that represents the error in quantizing the long-term residual by the fixed codebook 390. The second minimization module 400 uses the energy of the fixed codebook error signal 408 to control the selection of vectors for the fixed codebook vector (v, 402 from the fixed codebook 292 in order to reduce the energy of the fixed codebook error signal 408. The second minimization module 400 also receives the control information 356 from the characterization module 328 of FIG. 9.

The final characterization class contained in the control information 356 controls how the second minimization module 400 selects vectors for the fixed codebook vector (vc) 402 from the fixed codebook 390.

The process repeats until the search by the second minimization module 400 has selected the best vector for the fixed codebook vector (vj 402 from the fixed codebook 390 for each subframe. The best vector for the fixed codebook vector (vj 402 minimizes the error in the second resynthesized speech signal 406 with respect to the long-term error signal 388. The indices identify the best vector for the fixed codebook vector (vc) 402 and, as previously discussed, may be used to form the fixed codebook component 146a and 178a.

4. 1. 2. Foced Codebook Search for the Full-Rate Codec As previously discussed with reference to FIGs. 2 and 4, the fixed codebook component 146a for frames of Type Zero classification may represent each of four subframes of the full-rate codec 22 using the three 9-pulse codebooks 160. When the search is initiated, vectors for the fixed codebook vector (vj 402 within the fixed codebook 390 may be determined using the long-term error signal 388 that is represented by: t' (n) = t (n)-ga (e (n-tยฐpt) * h (n)) (Equation 17) Pitch enhancement may be applied to the three 5-pulse codebooks 160 (illustrated in Fig. 4) within the fixed codebook 390 in the forward direction during the search. The search is an iterative, controlled complexity search for the best vector for the fixed codebook vector (vc) 402. An initial value for fixed codebook gain represented by the gain (gc) 404 may be found simultaneously with the search for the best vector for the fixed codebook vector (vc) 402.

In an example embodiment, the search for the best vector for the fixed codebook vector (vc) 402 is completed in each of the three 5-pulse codebooks 160. At the conclusion of the search process within each of the three 5-pulse codebooks 160, candidate best vectors for the fixed codebook vector (vj 402 have been identified.

Selection of one of the three 5-pulse codebooks 160 and which of the corresponding candidate best vectors will be used may be determined using the corresponding fixed codebook error signal 408 for each of the candidate best vectors. Determination of the weighted mean squared error (WMSE) for each of the corresponding fixed codebook error signals 408 by the second minimization module 400 is first performed. For purposes of this discussion, the weighted mean squared errors (WMSEs) for each of the candidate best vectors from each of the three 5-pulse codebooks 160 will be referred to as first, second and third fixed codebook WMSEs.

The first, second, and third fixed codebook WMSEs may be first weighted. Within the full-rate codec 22, for frames classified as Type Zero, the first, second, and third fixed codebook WMSEs may be weighted by the subframe voice activity decision. In addition, the weighting may be provided by a sharpness measure of each of the first, second, and third fixed codebook WMSEs and the NSR from the characterization module 328 of FIG.

9. Based on the weighting, one of the three 5-pulse fixed codebooks 160 and the best candidate vector in that codebook may be selected.

The selected 5-pulse codebook 160 may then be fine searched for a final decision of the best vector for the fixed codebook vector (vj 402. The fine search is performed on the vectors in the selected one of the three 5- pulse codebook 160 that are in the vicinity of the best candidate vector chosen. The indices that identify the best vector for the fixed codebook vector (vc) 402 within the selected one of the three 5-pulse codebook 160 are part of the fixed codebook component 178a in the bitstream.

4. 1. 2.

For frames of Type Zero classification, the fixed codebook component 178a represents each of the two subframes of the half-rate codec 24. As previously discussed, with reference to FIG. 5, the representation may be based on the pulse codebooks 192,194 and the gaussian codebook 195. The initial target for the fixed codebook gain represented by the gain (gc) 404 may be determined similarly to the full-rate codec 22. In addition, the search for the fixed codebook vector (vc) 402 within the fixed codebook 390 may be weighted similarly to the

full-rate codec 22. In the half-rate codec 24, the weighting may be applied to the best candidate vectors from each of the pulse codebooks 192 and 194 as well as the gaussian codebook 195. The weighting is applied to determine the most suitable fixed codebook vector (vc) 402 from a perceptual point of view. In addition, the weighting of the weighted mean squared error (WMSE) in the half-rate codec 24 may be further enhanced to emphasize the perceptual point of view. Further enhancement may be accomplished by including additional parameters in the weighting. The additional factors may be the closed loop pitch lag and the normalized adaptive codebook correlation.

In addition to the enhanced weighting, prior to the search of the codebooks 192,194,195 for the best candidate vectors, some characteristics may be built into the entries of the pulse codebooks 192,194. These characteristics can provide further enhancement to the perceptual quality. In one embodiment, enhanced perceptual quality during the searches may be achieved by modifying the filter response of the second synthesis filter 394 using three enhancements. The first enhancement may be accomplished by injecting high frequency noise into the fixed codebook, which modifies the high-frequency band. The injection of high frequency noise may be incorporated into the response of the second synthesis filter 394 by convolving the high frequency noise impulse response with the impulse response of the second synthesis filter 394.

The second enhancement may be used to incorporate additional pulses in locations that can be determined by high correlations in the previously quantized subframe. The amplitude of the additional pulses may be adjusted according to the correlation strength, thereby allowing the decoding system 16 to perform the same operation without the necessity of additional information from the encoding system 12. The contribution from these additional pulses also may be incorporated into the impulse response of the second synthesis filter 394.

The third enhancement filters the fixed codebook 390 with a weak short-term spectral filter to compensate for the reduction in the formant sharpness resulting from bandwidth expansion and the quantization of the LSFs.

The search for the best vector for the fixed codebook vector (vc) 402 is based on minimizing the energy of the fixed codebook error signal 408, as previously discussed. The search may first be performed on the 2-pulse codebook 192. The 3-pulse codebook 194 may be searched next, in two steps. The first step can determine a center for the second step that may be referred to as a focused search. Backward and forward weighted pitch enhancement may be applied for the search in both pulse codebooks 192 and 194. The gaussian codebook 195 may be searched last, using a fast search routine that is used to determine the two orthogonal basis vectors for encoding as previously discussed.

The selection of one of the codebooks 192,194 and 195 and the best vector for the fixed codebook vector (vj 402 may be performed similarly to the full-rate codec 22. The indices that identify the best vector for the fixed codebook vector (vc) 402 within the selected codebook are part of the fixed codebook component 178a in the bitstream.

At this point, the best vectors for the adaptive codebook vector (va) 382 and the fixed codebook vector (vc) 402 have been found within the adaptive and fixed codebooks 368,390, respectively. The unquantized initial values for the gain (gj 384 and the gain (gc) 404 now may be replaced by the best gain values. The best gain values may be determined based on the best vectors for the adaptive codebook vector (va) 382 and the fixed

codebook vector (vc) 402 previously determined. Following determination of the best gains, they are jointly quantized. Determination and quantization of the gains occurs within the gain quantization section 366.

4. 1. 3 Gain Quantization Section The gain quantization section 366 of one embodiment includes a 2D VQ gain codebook 412, a third multiplier 414, a fourth multiplier 416, an adder 418, a third synthesis filter 420, a third perceptual weighting filter 422, a third subtractor 424, a third minimization module 426, and an energy modification section 428. The energy modification section 428 of one embodiment includes an energy analysis module 430 and an energy adjustment module 432. Determination and quantization of the fixed and adaptive codebook gains may be performed within the gain quantization section 366. In addition, further modification of the modified weighted speech 350 occurs in the energy modification section 428, as will be discussed, to form a modified target signal 434 that may be used for the quantization.

Determination and quantization involves searching to determine a quantized gain vector (Qac) 433 that represents the joint quantization of the adaptive codebook gain and the fixed codebook gain. The adaptive and fixed codebook gains, for the search, may be obtained by minimizing the weighted mean square error according to: (Equation 18) Where v (n) is the best vector for the adaptive codebook vector (va) 382, and vu (n) is the best vector for the fixed codebook vector (vc) 402 as previously discussed. In the example embodiment, the summation is based on a frame that contains 80 samples, such as, in one embodiment of the half-rate codec 24. The minimization may be obtained jointly (obtaining g,, and gc concurrently) or sequentially (obtaining gu first and then g,), depending on a threshold value of the normalized adaptive codebook correlation. The gains may then be modified in part, to smooth the fluctuations of the reconstructed speech in the presence of background noise. The modified gains are denoted g,, and g'(. The modified target signal 434 may be generated using the modified gains by: t (n) = guvQ (n) * h (n) + gv (n) * h (n) (Equation 19) A search for the best vector for the quantized gain vector (gac) 433 is performed within the 2D VQ gain codebook 412. The 2D VQ gain codebook 412 may be the previously discussed 2D gain quantization table illustrated as Table 4. The 2D VQ gain codebook 412 is searched for vectors for the quantized gain vector (gazez 433 that minimize the mean square error, i. e., minimizing (Equation 20) where a quantized fixed codebook gain (ga) 435 and a quantized adaptive codebook gain (gc) 436 may be derived from the 2D VQ gain codebook 412. In the example embodiment, the summation is based on a frame that contains 80 samples, such as, in one embodiment of the half-rate codec 24. The quantized vectors in the 2D VQ

gain codebook 412 actually represent the adaptive codebook gain and a correction factor for the fixed codebook gain as previously discussed.

Following determination of the modified target signal 434, the quantized gain vector (gaz) 433 is/passed to multipliers 414,416. The third multiplier 414 multiplies the best vector for the adaptive codebook vector (va) 382 from the adaptive codebook 368 with the quantized adaptive codebook gain (ga) 435. The output from the third multiplier 414 is provided to the adder 418. Similarly, the fourth multiplier 416 multiplies the quantized fixed codebook gain (gc) 436 with the best vector for the, fixed codebook vector (vc) 402 from the fixed codebook 390. The output from the fourth multiplier 416 is also provided to the adder 418. The adder 418 adds the outputs from the multipliers 414,416 and provides the resulting signal to the third synthesis filter 420.

The combination of the third synthesis filter 420 and the perceptual weighting filter 422 generates a third resynthesized speech signal 438. As with the first and second synthesis filters 372 and 394, the third synthesis filter 420 receives the quantized LPC coefficients Aq (z) 342. The third subtractor 424 subtracts the third resynthesized speech signal 438 from the modified target signal 434 to generate a third error signal 442. The third minimization module 426 receives the third error signal 442 that represents the error resulting from joint quantization of the fixed codebook gain and the adaptive codebook gain by the 2D VQ gain codebook 412. The third minimization module 426 uses the energy of the third error signal 442 to control the search and selection of vectors from the 2D VQ gain codebook 412 in order to reduce the energy of the third error signal 442.

The process repeats until the third minimization module 426 has selected the best vector from the 2D VQ gain codebook 412 for each subframe that minimizes the energy of the third error signal 442. Once the energy of the third error signal 442 has been minimized for each subframe, the index locations of the jointly quantized gains (git) and (gc) 435 and 436 are used to generate the gain component 147,179 for the frame. For the full-rate codec 22, the gain component 147 is the fixed and adaptive gain component 148a, 150a and for the half-rate codec 24, the gain component 179 is the adaptive and fixed gain component 180a and 182a.

The synthesis filters 372,394 and 420, the perceptual weighting filters 374,396 and 422, the minimization modules 378,400 and 426, the multipliers 370,392,414 and 416, the adder 418, and the s ubtractors 376,398 and 424 (as well as any other filter, minimization module, multiplier, adder, and subtractor described in this application) may be replaced by any other device, or modified in a manner known to those of ordinary skill in the art, that may be appropriate for the particular application.

4.2 Excitation Processing Module For Type One Frames Of The Full-Rate Codec And The Half-Rate Codec In Fig. 11, the Fl, Hl first frame processing modules 72 and 82 includes a 3D/4D open loop VQ module 454. The Fl, HI second sub-frame processing modules 74 and 84 of one embodiment include the adaptive codebook 368, the fixed codebook 390, a first multiplier 456, a second multiplier 458, a first synthesis filter 460, and a second synthesis filter 462. In addition, the F 1, H 1 second sub-frame processing modules 74 and 84 include a first perceptual weighting filter 464, a second perceptual weighting filter 466, a first subtractor 468, a second subtractor 470, a first minimization module 472, and an energy adjustment module 474. The Fl, H1 second frame processing modules 76 and 86 include a third multiplier 476, a fourth multiplier 478, an adder 480, a third

synthesis filter 482, a third perceptual weighting filter 484, a third subtractor 486, a buffering module 488, a second minimization module 490 and a 3D/4D VQ gain codebook 492.

The processing of frames classified as Type One within the excitation-processing module 54 ptbvides processing on both a frame basis and a sub-frame basis, as previously discussed. For purposes of brevity, the following discussion will refer to the modules within the full rate codec 22. The modules in the half rate codec 24 may be considered to function similarly, unless otherwise noted. Quantization of the adaptive codebook gain by the F1 first frame-processing module 72 generates the adaptive gain component 148b. The Fl second subframe processing module 74 and the Fl second frame processing module 76 operate to determine the fixed codebook vector and the corresponding fixed codebook gain, respectively as previously set forth. The Fl second subframe- processing module 74 uses the track tables, as previously discussed, to generate the fixed codebook component 146b as illustrated in FIG. 2.

The F I second frame-processing module 76 quantizes the fixed codebook gain to generate the fixed gain component 150b. In one embodiment, the full-rate codec 22 uses 10 bits for the quantization of 4 fixed codebook gains, and the half-rate codec 24 uses 8 bits for the quantization of the 3 fixed codebook gains. The quantization may be performed using moving average prediction. In general, before the prediction and the quantization are perfonned, the prediction states are converted to a suitable dimension.

4. 2. First Frame Processing Module One embodiment of the 3D/4D open loop VQ module 454 may be the previously discussed four- dimensional pre vector quantizer (4D pre VQ) 166 and associated pre-gain quantization table for the full-rate codec 22. Another embodiment of the 3D/4D open loop VQ module 454 may be the previously discussed three- dimensional pre vector quantizer (3D pre VQ) 198 and associated pre-gain quantization table for the half-rate codec 24. The 3D/4D open loop VQ module 454 receives the unquantized pitch gains 352 from the pitch pre- processing module 322. The unquantized pitch gains 352 represent the adaptive codebook gain for the open loop pitch lag, as previously discussed.

The 3D/4D open loop VQ module 454 quantizes the unquantized pitch gains 352 to generate a quantized pitch gain (gka) 496 representing the best quantized pitch gains for each subframe where k is the number of subframes. In one embodiment, there are four subframes for the full-rate codec 22 and three subframes for the half-rate codec 24 which correspond to four quantized gains (g'a, g2a, g3a, g4) and three quantized gains (gela, g2a, g3a) of each subframe, respectively. The index location of the quantized pitch gain (gka) 496 within the pre-gain quantization table represents the adaptive gain component 148b for the full-rate codec 22 or the adaptive gain component 180b for the half-rate codec 24. The quantized pitch gain (gka) 496 is provided to the Fl second subframe-processing module 74 or the HI second subframe-processing module 84.

4. 2.2 Second Sub-Frame Processing Module The Fl or H I second subframe-processing module 74 or 84 uses the pitch track 348 provided by the pitch pre-processing module 322 to identify an adaptive codebook vector (vka) 498. The adaptive codebook vector (vka) 498 represents the adaptive codebook contribution for each subframe where k equals the subframe number.

In one embodiment, there are four subframes for the full-rate codec 22 and three subframes for the half-rate codec 24 which correspond to four vectors (via, v2a, v3a, v4a) and three vectors (v1a, v2a, v3a) for the adaptive codebook contribution for each subframe, respectively.

The vector selected for the adaptive codebook vector (vka) 498 may be derived from past vectors located in the adaptive codebook 368 and the pitch track 348. Where the pitch track 348 may be interpolated and is represented by Lp (n). Accordingly, no search is required. The adaptive codebook vector (va) 498 may be obtained by interpolating the past adaptive codebook vectors (vka) 498 in the adaptive codebook with a 215'order Hamming weighted Sinc window by: (Equation 21) where e (n) is the past excitation, i (Lp (n)) and f (Lp (n)) are the integer and fractional part of the pitch lag, respectively, and w5 (f, i) is the Hamming weighted Sinc window.

The adaptive codebook vector (vka) 498 and the quantized pitch gain (gka) 496 are multiplied by the first multiplier 456. The first multiplier 456 generates a signal that is processed by the first synthesis filter 460 and the first perceptual weighting filter module 464 to provide a first resynthesized speech signal 500. The first synthesis filter 460 receives the quantized LPC coefficients Aq (z) 342 from the LSF quantization module 334 as part of the processing. The first subtractor 468 subtracts the first resynthesized speech signal 500 from the modified weighted speech 350 provided by the pitch pre-processing module 322 to generate a long-term error signal 502.

The Fl or HI second subframe-processing module 74 or 84 also performs a search for the fixed codebook contribution that is similar to that performed by the FO or HO first subframe-processing module 70 and 80, previously discussed. Vectors for a fixed codebook vector (vkc) 504 that represents the long-tenn residual for a subframe are selected from the fixed codebook 390 during the search. The second multiplier 458 multiplies the fixed codebook vector (vkc) 504 by a gain (gkc) 506 where k is the subframe number. The gain (gkc) 506 is unquantized and represents the fixed codebook gain for each subframe. The resulting signal is processed by the second synthesis filter 462 and the second perceptual weighting filter 466 to generate a second resynthesized speech signal 508. The second resynthesized speech signal 508 is subtracted from the long-term error signal 502 by the second subtractor 470 to produce a fixed codebook error signal 510.

The fixed codebook error signal 510 is received by the first minimization module 472 along with the control information 356. The first minimization module 472 operates the same as the previously discussed second minimization module 400 illustrated in FIG. 10. The search process repeats until the first minimization module 472 has selected the best vector for the fixed codebook vector (v) 504 from the fixed codebook 390 for each subframe. The best vector for the fixed codebook vector (vu,) 504 minimizes the energy of the fixed codebook error signal 510. The indices identify the best vector for the fixed codebook vector (v) 504, as previously discussed, and form the fixed codebook component 146b and 178b.

4. 2.2. Fixed Codebook Searchfor Full-Rate Codec In one embodiment, the 8-pulse codebook 162, illustrated in FIG. 4, is used for each of the four subframes for frames of type I by the full-rate codec 22, as previously discussed. The target for thรฉ fixed codebook vector (vkc) 504 is the long-term error signal 502, as previously described. The long-term error signal 502, represented by t' (n), is determined based on the modified weighted speech 350, represented by t (n), with the adaptive codebook contribution from the initial frame processing module 44 removed according to: t' (n) = t (n)-g-vQ (n) * h (nez (Equation 22) During the search for the best vector for the fixed codebook vector (v 504, pitch enhancement may be applied in the forward direction. In addition, the search procedure minimizes the fixed codebook residual 508 using an iterative search procedure with controlled complexity to determine the best vector for the fixed codebook vector vkc 504. An initial fixed codebook gain represented by the gain (gkc) 506 is determined during the search.

The indices identify the best vector for the fixed codebook vector (vkc) 504 and form the fixed codebook component 146b as previously discussed.

4.2.2.

In one embodiment, the long-term residual is represented with 13 bits for each of the three subframes for frames classified as Type One for the half-rate codec 24, as previously discussed. The long-term residual may be determined in a similar manner to the fixed codebook search in the full-rate codec 22. Similar to the fixed- codebook search for the half-rate codec 24 for frames of Type Zero, the high-frequency noise injection, the additional pulses that are determined by high correlation in the previous subframe, and the weak short-term spectral filter may be introduced into the impulse response of the second synthesis filter 462. In addition, forward pitch enhancement also may be introduced into the impulse response of the second synthesis filter 462.

In one embodiment, a full search is performed for the 2-pulse code book 196 and the 3-pulse codebook 197 as illustrated in FIG. 5. The pulse codebook 196,197 and the best vector for the fixed codebook vector (vu,) 504 that minimizes the fixed codebook error signal 510 are selected for the representation of the long term residual for each subframe. In addition, an initial fixed codebook gain represented by the gain (gkc) 506 may be determined during the search similar to the full-rate codec 22. The indices identify the best vector for the fixed codebook vector (vkc) 504 and form the fixed codebook component 178b.

As previously discussed, the Fl or HI second subframe-processing module 74 or 84 operates on a subframe basis. However, the F1 or HI second frame-processing module 76 or 86 operates on a frame basis.

Accordingly, parameters determined by the Fl or HI second subframe-processing module 74 or 84 may be stored in the buffering module 488 for later use on a frame basis. In one embodiment, the parameters stored are the best vector for the adaptive codebook vector (v\) 498 and the best vector for the fixed codebook vector (vu,) 504. In addition, a modified target signal 512 and the gains (gka), (gkc) 496 and 506 representing the initial adaptive and fixed codebook gains may be stored. Generation of the modified target signal 512 will be described later.

At this time, the best vector for the adaptive codebook vector (vue) 498, the best vector for the fixed codebook vector (vkc) 504, and the best pitch gains for the quantized pitch gain (gka) 496 have been identified.

Using these best vectors and best pitch gains, the best fixed codebook gains for the gain (gkc) 506 will be

determined. The best fixed codebook gains for the gain (gk) 506 will replace the unquantized initial fixed codebook gains determined previously for the gain (gk) 506. To determine the best fixed codebook gains, a joint delayed quantization of the fixed-codebook gains for each subframe is performed by the second frame-processing module 76 and 86.

4. 2. Second Frame Processing Module The second frame processing module 76 and. 86Fis operable on a frame basis to generate the fixed codebook gain represented by the fixed gain component 150b and 182b. The modified target 512 is first determined in a manner similar to the gain determination and quantization of the frames classified as Type Zero.

The modified target 512 is determined for each subframe and is represented by t" (n). The modified target may be derived using the best vectors for the adaptive codebook vector (vka) 498 and the fixed codebook vector (vkc) 504, as well as the adaptive codebook gain and the initial value of the fixed codebook gain derived from Equation 18 by: t" (n) = gaVa (n) * h (n) + gv (n) * h (n). (Equation 23) An initial value for the fixed codebook gain for each subframe to be used in the search may be obtained by minimizing: (Equation 24) Where va (n) is the adaptive-codebook contribution for a particular subframe and v (n) is the fixed-codebook contribution for a particular subframe. In addition, ga is the quantized and normalized adaptive-codebook gain for a particular subframe that is one of the elements a quantized fixed codebook gain (#ck) 513. The calculated fixed codebook gain gc is further normalized and corrected, to provide the best energy match between the third resynthesized speech signal and the modified target signal 512 that has been buffered. Unquantized fixed- codebook gains from the previous subframes may be used to generate the adaptive codebook vector (va) 498 for the processing of the next subframe according to Equation 21.

The search for vectors for the quantized fixed codebook gain (g\) 513 is performed within the 3D/4D VQ gain codebook 492. The 3D/4D VQ gain codebook 492 may be the previously discussed multi-dimensional gain quantizer and associated gain quantization table. In one embodiment, the 3D/4D VQ gain codebook 492 may be the previously discussed 4D delayed VQ gain quantizer 168 for the full-rate codec 22. As previously discussed, the 4D delayed VQ gain quantizer 168 may be operable using the associated delayed gain quantization table illustrated as Table 5. In another embodiment, the 3D/4D VQ gain codebook 492 may be the previously discussed 3D delayed VQ gain quantizer 200 for the half-rate codec 24. The 3D delayed VQ gain quantizer 200 may be operable using the delayed gain quantization table illustrated as the previously discussed Table 8.

The 3D/4D VQ gain codebook 492 may be searched for vectors for the quantized fixed codebook gain ) 513 that minimize the energy similar to the previously discussed 2D VQ gain codebook 412 of FIG. 10. The quantized vectors in the 3D/4D VQ gain codebook 492 actually represent a correction factor for the predicted fixed codebook gain as previously discussed. During the search, the third multiplier 476 multiplies the adaptive

codebook vector (vka) 498 by the quantized pitch gain (g\) 496 following determination of the modified target 512. In addition, the fourth multiplier 478 multiplies the fixed codebook vector (v C) 504 by the quantized fixed codebook gain (gkc) 513. The adder 480 adds the resulting signals from the multipliers 476 and 478.

The resulting signal from the adder 480 is passed through the third synthesis filter 482 and the perceptual weighting filter module 484 to generate a third resynthesized speech signal 514. As with the first and second synthesis filters 460,462, the third synthesis filter 482 receives the quantized LPC coefficients Aq (z) 342 from the LSF quantization module 334 as part of the processing. Th third subtractor 486 subtracts the third resynthesized speech signal 514 from the modified target signal 512 that was previously stored in the buffering module 488.

The resulting signal is the weighted mean squared error referred to as a third error signal 516.

The third minimization module 490 receives the third error signal 516 that represents the error resulting from quantization of the fixed codebook gain by the 3D/4D VQ gain codebook 492. The third minimization module 490 uses the third error signal 516 to control the search and selection of vectors from the 3D/4D VQ gain codebook 492 in order to reduce the energy of the third error signal 516. The search process repeats until the third minimization module 490 has selected the best vector from the 3D/4D VQ gain codebook 492 for each subframe that minimizes the error in the third error signal 516. Once the energy of the third error signal 516 has been minimized, the index location of the quantized fixed codebook gain (g\) 513 in the 3D/4D VQ gain codebook 492 is used to generate the fixed codebook gain component 150b for the full-rate codec 22, and the fixed codebook gain component 182b for the half-rate codec 24.

4. 2. VQ Gain Codebook In one embodiment, when the 3D/4D VQ gain codebook 492 is a 4-dimensional codebook, it may be searched in order to minimize (Equation 25) where the quantized pitch gains {#a1,#a2,#a3,#a4} originate from the initial frame processing module 44, and ),),),)},f),),),)},and {(n),(M),M,M{may be buffered during the subframe processing as previously discussed. In an example embodiment, the fixed codebook gains {g gj, c I I are derived from a 10-bit codebook, where the entries of the codebook contain a 4-dimensional correction factor for the predicted fixed codebook gains as previously discussed. In addition, n=40 to represent 40 samples per frame.

In another embodiment, when the 3D/4D VQ gain codebook 492 is a 3-dimensional codebook, it may be searched in order to minimize

(Equation 26) where the quantized pitch gains {gi) g2 S ga3} originate tfrom the initial frame processing module 44, and {), (n), t2 (n), t3 (n)}, {vl (n), Va2 (n), Va3 (n)}, and Iv (n), v2 (n), V3 (n)} may be buffered during the subframe processing as previously discussed. In an example embodiment, the fixed codebook gains {glXgc2g3} are derived from an 8-bit codebook where the entries of the codebook contain a 3-dimensional correction factor for the predicted fixed codebook gains. The prediction of the fixed-codebook gains may be based on moving average prediction of the fixed codebook energy in the log domain.

5.0 DECODING SYSTEM Referring now to FIG. 12, an expanded block diagram representing the full and half-rate decoders 90 and 92 of FIG. 3 is illustrated. The full or half-rate decoders 90 or 92 include the excitation reconstruction modules 104, 106,114 and 116 and the linear prediction coefficient (LPC) reconstruction modules 107 and 118. One embodiment of each of the excitation reconstruction modules 104,106,114 and 116 includes the adaptive codebook 368, the fixed codebook 390, the 2D VQ gain codebook 412, the 3D/4D open loop VQ codebook 454, and the 3D/4D VQ gain codebook 492. The excitation reconstruction modules 104,106,114 and 116 also include a first multiplier 530, a second multiplier 532 and an adder 534. In one embodiment, the LPC reconstruction modules 107,118 include an LSF decoding module 536 and an LSF conversion module 538. In addition, the half-rate codec 24 includes the predictor switch module 336, and the full-rate codec 22 includes the interpolation module 338.

Also illustrated in FIG. 12 are the synthesis filter module 98 and the post-processing module 100. In one embodiment, the post-processing module 100 includes a short-term post filter module 540, a long-term filter module 542, a tilt compensation filter module 544, and an adaptive gain control module 546. According to the rate selection, the bit-stream may be decoded to generate the post-processed synthesized speech 20. The decoders 90 and 92 perform inverse mapping of the components of the bit-stream to algorithm parameters. The inverse mapping may be followed by a type classification dependent synthesis within the full and half-rate codecs 22 and 24.

The decoding for the quarter-rate codec 26 and the eighth-rate codec 28 are similar to the full and half- rate codecs 22 and 24. However, the quarter and eighth-rate codecs 26 and 28 use vectors of similar yet random numbers and the energy gain, as previously discussed, instead of the adaptive and the fixed codebooks 368 and 390 and associated gains. The random numbers and the energy gain may be used to reconstruct an excitation energy that represents the short-term excitation of a frame. The LPC reconstruction modules 122 and 126 also are

similar to the full and half-rate codec 22,24 with the exception of the predictor switch module 336 and the interpolation module 338.

5.1 Excitation Reconstruction Within the full and half rate decoders 90 and 92, operation of the excitation reconstruction modules 104, 106,114 and 116 is largely dependent on the type classification provided by the type component 142 and 174.

The adaptive codebook 368 receives the pitch track 348. The pitch track 348 is reconstructed by the decoding system 16 from the adaptive codebook component 144 and 176 provided in the bitstream by the encoding system 12. Depending on the type classification provided by the type component 142 and 174, the adaptive codebook 368 provides a quantized adaptive codebook vector (via) 550 to the multiplier 530. The multiplier 530 multiplies the quantized adaptive codebook vector (va) 550 with an adaptive codebook gain vector (gke) 552. The selection of the adaptive codebook gain vector (gka) 552 also depends on the type classification provided by the type component 142 and 174.

In an example embodiment, if the frame is classified as Type Zero in the full rate codec 22, the 2D VQ gain codebook 412 provides the adaptive codebook gain vector (gka) 552 to the multiplier 530. The adaptive codebook gain vector (gka) 552 is determined from the adaptive and fixed codebook gain component 148a and 150a. The adaptive codebook gain vector (gka) 552 is the same as part of the best vector for the quantized gain vector (gac) 433 determined by the gain and quantization section 366 of the FO first sub-frame processing module 70 as previously discussed. The quantized adaptive codebook vector (vka) 550 is determined from the closed loop adaptive codebook component 144b. Similarly, the quantized adaptive codebook vector (via) 550 is the same as the best vector for the adaptive codebook vector (va) 382 determined by the FO first sub-frame processing module 70.

The 2D VQ gain codebook 412 is two-dimensional and provides the adaptive codebook gain vector (gka) 552 to the multiplier'530 and a fixed codebook gain vector (gkc) 554 to the multiplier 532. The fixed codebook gain vector (gkc) 554 similarly is determined from the adaptive and fixed codebook gain component 148a and 150a and is part of the best vector for the quantized gain vector (gac) 433. Also based on the type classification, the fixed codebook 390 provides a quantized fixed codebook vector (vka) 556 to the multiplier 532. The quantized fixed codebook vector (vka) 556 is reconstructed from the codebook identification, the pulse locations (or the gaussian codebook 195 for the half-rate codec 24), and the pulse signs provided by the fixed codebook component 146a. The quantized fixed codebook vector (vka) 556 is the same as the best vector for the fixed codebook vector (vc) 402 determined by the FO first sub-frame processing module 70 as previously discussed. The multiplier 532 multiplies the quantized fixed codebook vector (vka) 556 by the fixed codebook gain vector (gkc) 554 If the type classification of the frame is Type One, a multi-dimensional vector quantizer provides the adaptive codebook gain vector (gka) 552 to the multiplier 530. Where the number of dimensions in the multi- dimensional vector quantizer is dependent on the number of subframes. In one embodiment, the multi- dimensional vector quantizer may be the 3D/4D open loop VQ 454. Similarly, a multi-dimensional vector quantizer provides the fixed codebook gain vector (g) 554 to the multiplier 532. The adaptive codebook gain vector (gka) 552 and the fixed codebook gain vector (g\) 554 are provided by the gain component 147 and 179

and are the same as the quantized pitch gain (gka) 496 and the quantized fixed codebook gain (g\) 513, respectively.

In frames classified as Type Zero or Type One, the output from the first multiplier 530 is received) by the adder 534 and is added to the output from the second multiplier 532. The output from the adder 534 is the short- term excitation. The short-term excitation is provided to the synthesis filter module 98 on the short-term excitation line 128.

5.2 LPC Reconstruction The generation of the short-term (LPC) prediction coefficients in the decoders 90 and 92 is similar to the processing in the encoding system 12. The LSF decoding module 536 reconstructs the quantized LSFs from the LSF component 140 and 172. The LSF decoding module 536 uses the same LSF prediction error quantization table and LSF predictor coefficients tables used by the encoding system 12. For the half-rate codec 24, the predictor switch module 336 selects one of the sets of predictor coefficients, to calculate the predicted LSFs as directed by the LSF component 140,172. Interpolation of the quantized LSFs occurs using the same linear interpolation path used in the encoding system 12. For the full-rate codec 22 for frames classified as Type Zero, the interpolation module 338, selects the one of the same interpolation paths used in the encoding system 12 as directed by the LSF component 140 and 172. The weighting of the quantized LSFs is followed by conversion to the quantized LPC coefficients Aq (z) 342 within the LSF conversion module 538. The quantized LPC coefficients Aq (z) 342 are the short-term prediction coefficients that are supplied to the synthesis filter 98 on the short-term prediction coefficients line 130.

5.3 Synthesis Filter The quantized LPC coefficients Aq (z) 342 may be used by the synthesis filter 98 to filter the short-term prediction coefficients. The synthesis filter 98 may be a short-term inverse prediction filter that generates synthesized speech prior to post-processing. The synthesized speech may then be passed through the post- processing module 100. The short-term prediction coefficients may also be provided to the post-processing module 100.

5.4 Post-Processing The post-processing module 100 processes the synthesized speech based on the rate selection and the short-term prediction coefficients. The short-term post filter module 540 may be first to process the synthesized speech. Filtering parameters within the short-term post filter module 540 may be adapted according to the rate selection and the long-term spectral characteristic determined by the characterization module 328 as previously discussed with reference to FIG. 9. The short-term post filter may be described by: (Equation 27)

where in an example embodiment, y, 75. 71',-r = 0. 75, and ro is determined based on the rate selection and the long-term spectral characteristic. Processing continues in the long term filter module 542.

' ; The long term filter module 542 preforms a fine tuning search for the pitch period in the synthesized speech. In one embodiment, the fine tuning search is performed using pitch correlation and rate-dependent gain controlled harmonic filtering. The harmonic filtering is disabled for the quarter-rate codec 26 and the eighth-rate codec 28. The tilt compensation filter module 544, in one embodiment is a first-order finite impulse response (FIR) filter. The FIR filter may be tuned according to the spectral tilt of the perceptual weighting filter module 314 previously discussed with reference to FIG. 9. The filter may also be tuned according to the long-term spectral characteristic determined by the characterization module 328 also discussed with reference to FIG. 9.

The post filtering may be concluded with an adaptive gain control module 546. The adaptive gain control module 546 brings the energy level of the synthesized speech that has been processed within the post- processing module 100 to the level of the synthesized speech prior to the post-processing. Level smoothing and adaptations may also be performed within the adaptive gain control module 546. The result of the processing by the post-processing module 100 is the post-processed synthesized speech 20.

In one embodiment of the decoding system 16, frames received by the decoding system 16 that have been erased due to, for example, loss of the signal during radio transmission, are identified by the decoding system 16. The decoding system 16 can subsequently perform a frame erasure concealment operation. The operation involves interpolating speech parameters for the erased frame from the previous frame. The extrapolated speech parameters may be used to synthesize the erased frame. In addition, parameter smoothing may be performed to ensure continuous speech for the frames that follow the erased frame. In another embodiment, the decoding system 16 also includes bad rate determination capabilities. Identification of a bad rate selection for a frame that is received by the decoding system 16 is accomplished by identifying illegal sequences of bits in the bitstream and declaring that the particular frame is erased.

The previously discussed embodiments of the speech compression system 10 perform variable rate speech compression using the full-rate codec 22, the half-rate codec 24, the quarter-rate codec 26, and the eighth- rate codec 28. The codecs 22,24,26 and 28 operate with different bit allocations and bit rates using different encoding approaches to encode frames of the speech signal 18. The encoding approach of the full and half-rate codecs 22 and 24 have different perceptual matching, different waveform matching and different bit allocations depending on the type classification of a frame. The quarter and eighth-rate codecs 26 and 28 encode frames using only parametric perceptual representations. A Mode signal identifies a desired average bit rate for the speech compression system 10. The speech compression system 10 selectively activates the codecs 22,24,26 and 28 to balance the desired average bit rate with optimization of the perceptual quality of the post-processed synthesized speech 20.

While various embodiments of the invention have been described, it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible that are within the scope of this invention. Accordingly, the invention is not to be restricted except in light of the attached claims and their equivalents.

MICROFICHE APPENDIX APPENDIX A

/*========================================================== =====================*/ l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*__________________________________________________________ _____*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*==================================================*/ /* FILE: const. li /*==================================================*/ /*------------------------------------------*/ /*====================== Coding Parameters =======================*/ <BR> <BR> <BR> l == l #define sqr (a) ( (a) * (a)) #define cube (a) ( (a) * (a) * (a)) #define MAX (a, b) ( (a) > (b)? (a): (b)) &num define ABS (a) (((a)<0)? -(a) : (a)) &num define MIN (a, b) ( ( (a) < (b))? (a) : (b)) &num define SIGN (a) (((a)>=0) ? (1) (-1)) #define ROUND (a) (INT64) ((a)>0 ? ( (a) +0.5): ( (a)-0. 5)) #define AVG (a, b, c) (INT16) ( ( (a) + (b) + (c))/ (3. 0) +0.5) #define MAXFLT 1.0e30 &num define MINFLT l. 0e-30 #define EPSI 0.00000000000000001 #define LPREV 60/* length of previous speech */ #define LFRM 160/* length of coding frame */ #define LSF 80/* maximun length of subframe */ #define LSF3 54/* length of subframe */ &num define L SF4 40/* length of */

&num define LSFO 53/* length of subframe */ #define NSFMAX 4/* maximun numberofsubframes */ #define NSF4 4/* number of subframes 8.5 k*/ #define NSF3 3/* number of subframes 4. mode 1*/ &num define NSF2 2/* number of subframes 4.0 k mode 0*/ &num define NP 10 &num define NP 10 &num define L LPC 240/* length of LPC */ #define LLPCLHD 80/* length of LPC lookahead */ Coding Parameters /*========================================================== =====================*/ #define FS 8000.0/* Sampling */ &num define RATE85K 8/* 8.5 */ &num define RATEZ 4/* 4.0 */ #define RATE2OK 2/* 2.0 */ #define RATEO8K 0/* 0.8 */ // /* Bit-rate including overhead for the four */ /*------------------------------------------*/ &num define RATE_1_1 9600/* 8.5 kbit/s source */ #define RATE1 2 4800/* 4.0 kbit/s source */ &num define RATE14 2400/* 2.0 kbit/s source */ #define RATE18 1200/* 0.8 kbit/s source */ #define NUM_SINC_WIN 21 /* Number of quantized Sinc interpolation */ /* */ <BR> <BR> <BR> /*========================================================== =====================*/ /*===================== SPEECH ENAHNCEMENT ===================*/

&num deflne ENHDELAY 24 /*========================================================== =====================*/ /*=========================== PRE AND POST PROCESSING=====================*/ &num define PPR_FLT_ORDER 2 #defineLP_FLT_ORDER 1 #define SEMEMSIZE 4 #define SEHISSIZE 5 #define SERAMPSIZE 40 #define DELTA_THRLD 48.0 /*======================= DEFINITIONS FOR ====================*/ #define MEMCLASS 140 #defineN_Lp 3 #defineMAX_N_SF 8 #define MAXLSF 20 #define LLPCSF 40/* SHOULD NOT BE CHANGED-HARDWIRED AT */ #define OVERLAP 20 #defineLPC_WIn1 (L_LPC_SF+2*OVERLAP) #define CLAMEMSIZE 4 #define SLOPE_MAX_SIZE 5 /*========================================================== =====================*/ DEFINITIONS FOR PERCEPTUAL WEIGHTING===================*/ /*========================================================== =====================*/ &num define GAMMA1 0.9

/*========================================================== =====================*/ <BR> <BR> <BR> <BR> FIXED COEDEBOOK SEARCH<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num define MAXPN 11 &num defineMAXFBPULSENUM 5 #define SEGNUMM1 8 #define SEGNUMMO 16 #define LHF 20 #define LCORR 80 #defineL_WSP (L_CORR+L_SF+10) #define PASTPGAINMAX2 0.8 Gaussian codebook sizes /*========================================================== =====================*/ #define N_GAUSS_13b 45 /* Entries 1. basis vector: 13 bit codebook */ #define NUM_PRESELECT 2 /*========================================================== =====================*/ <BR> <BR> <BR> <BR> /*============================ DEFINITIONS FOR LTP ==========================*/ #define SINC_LIMIT_E 10 #defineLEN_SINC_E (2*SINC_LIMIT_E+1) #define LENSINCTABE (NUMSINCWIN*LENSINCE) DEFINITIONS FOR PITCH PRE-PROCESSING /*========================================================== =====================*/ #define L_PP (L_PREV+L_FRM+L_LPCLHD) /* length of sig_ppr=260 */ #define SINC_LIMIT_PP 10 &num defineLENSINCPP (2*SINCLIMITPP+1)

#define LENSINCTABPP (NUMSINCWIN*LENSINCPP) #define HALFP 2 #define MAXPULSNUM 5 #define MAXDIFTAB 16 #define MAX_L_TG 180 /* Maximum length for LT preprocessing */ /* Note: it must to be >= L FRM and > L SF */ #define MAX DELAY 20 /*================= DEFINITIONS FOR OPEN LOOP PITCH =====================*/ <BR> <BR> <BR> <BR> /*========================================================== =====================*/ #define NUM_MAX_SRCH 4 #define SINC_LIMIT 4 #define LENSINC (2*SINCLIMIT+1) #define LENSINCTAB (NUMSINCWIN*LENSINC) &num define DELTF (1. 0/((double)NUM_SINC_WIN-1. 0))/* Precision of the */ /* interpolation */ #define MIN_LAG 17/* minimum pitch */ &num deftne MAXLAG (LFRM+SINCLIMITE+2)/* Maximum pitch lag /* Note: must to be > 170 */ /* >HI_LAG+11 */ #define LOLPIT (LFRM+LLPCLHD+MAXLAG)/* Open loop pitch */ #define HI_LAG 120 /* maximum pitch lag */ #define HI_LAG2 148 /* maximum pitch */ #define MIN_LAG2 (HI_LAG2-127) /* minimum pitch */ #define PITFMEM 3 /*==================== DEFINITIONS FOR CLOSED LOOP PITCH ================*/ /*========================================================== =====================*/

&num define LEN PITCH TAB SBIT 17 #define LENPITCHTAB7BIT 129 #defineLEN_PITCH_TAB_8BIT 257 #defineMAX_PIT_IDX_56 16 #defineMAX_PIT_IDX_7b 127 #define MAX_PIT_IDX_8b 255 &num define DELTF2 (1. <BR> <BR> <BR> <BR> <BR> <BR> <BR> <P>DEFINITIONS FOR GAIN MA-VQ /*========================================================== =====================*/ #define PAST_PGAIN_MIN 0. 2/* minimum value of the past */ /* pitch gain for the adaptive */ /* in the algebraic codebok */ #define PAST_PGAIN_MAX 1.0/* maximum value of the past */ /* pitch gain for the adaptive prefilter */ /* in the algebraic codebok */ #defineMSMAX_1_64 64 #defineMSMAX_1_32 32 #defineMSMAX_2_64 64 #defineMSMAX_2_128 128 #defineMSMAX_3_256 256 #defineMSMAX_4_1024 1024 #define GPBUFSIZE 8 #define BETABUFSIZE 4 #define GVQVEC SIZE-2D 2 #defineGVQ_VEC_SIZE_3D 3 #defineTAB_SIZE_GVQ_3D 16

#define GVQVECSIZE4D 4 #define TABSIZEGVQ4D 64 #define CORRSIZE 6 /*========================================================== =====================*/ /*====================== SMOOTHING ===========================*/ #define DSPBUFFSIZE 4 #define SMOBUFFSIZE 15 #define MAXGRPSIZE 5 #define HLCOUNTMAX 15 #define ADAPT_THRESHOLDS 1 #defineNMODESUBSTART-4 #define UPDATE_MAX 15 #define CONSEC_MAX 31 /*------------------------------------------*/ /* Smooth */ // #define BETAFRM 0.90 #define BETASUB 0.70 #define dSPl 0.0015 #define dSP2 0.0025 #define dSP intl 0.0024 #define Rllim 0.50 /*========================== DEFINITIONS FOR LSF MA-VQ ======================*/ /*========================================================== =====================*/ &num define MAX_CAND_LSFQ 10 /* the maximal number of condidate per stage */ #define N_LSFVQCDBK 5 /* number of LSF codebooks */ #define MAXLNp 10/* maximal order of */ &num define MAXLTT08k 3/* the maximal number of */ #define MAXLTT40k 3/* the maximal number of codebooks */

#define MAXLTT 85k 4/* the maximal number of codebooks */ #define LP_08k 1/* number of switch */ #define LPL 08k 1/* the number of delayed predictors */ #define LMS I 08k 16/* the number of entries for the 1 */ #define LMS2 08k 16/* the number of entries for the 2 */ #define LMS3_08k 8/* the number of entries for the 3 */ #define LMSMAX 08k 16 #define LQMA_08k 4 #define LP40k 2/* number of switch */ #define LPL40k 2/* the number of delayed */ #define LMS1_40k 128/* the number of entries for the 1 */ #define LMS240k 128/* the number of entries for the 2 */ #define LMS3_40k 64/* the number of entries for the 3 */ #define LMSMAX_40k 128 #define LQMA_40k 4 #define LP_85k 1/* number of switch */ &num define LPL_85k 1/* the number of delayed */ #define LMS I 85k 128/* the number of entries for the 1 */ #define LMS2 85k 64/* the number of entries for the 2 */ #define LMS385k 64/* the number of entries for the 3 code */ #define LMS485k 64/* the number of entries for the 4 */ &num define LMSMAX 85k 128 #define LQMA_85k 2 #define LTT08k 3/* the number of stages for */ #define LTT_40k 3/* the number of stages for */ #define LTT85k 4/* the number of stages for */ /*========================================================== =====================*/ <BR> <BR> <BR> <BR> DEFINITIONS FOR VAD<BR> <BR> <BR> <BR> <BR> /*========================================================== =====================*/ #define VOICE 1 #define NOISE 0 #define INIT FRAME 32

&num define INIT COUNT 10 #define VAD LPC ORDER 4 #define LTP_BUFF_SIZE 5 #define FLAGVADMEMSIZE 2 #define VAD_MEM_SIZE 3 #define VADMINMEMSIZE 8 #define MAX_ENERGY 1,0e30 #define MIN_LAG 17/* minimum pitch */ DEFINITIONS FOR BAD FRAME HANDLING /*========================================================== =====================*/ #define BFH_OH 1 /* LSF : bad frame handling */ #defineERNG_MEM_SIZE 3 #define MAXBFICOUNT 5 /*=================== ENCODER/DECODER INDEX STRUCTURE ==================*/ #define PACKWDSNUM 12/* the number of words to pack the SMV bits (1 for rate/erasure control, 11*16=171 for */ typedef struct { INT16 idx_lsf[N_LSFVQCDBK+1]; InT16 idx_SVS_deci; INT16 idx_ltp_deci[N_SF_MAX]; INT16 idx_pitch[N_SF_MAX]; INT16 idx-Gp VQ ; INT16 idx_Gc_VQ; INT16 idx_gain VQ[N_SF_MAX]; INT16 idx_subcpcb[N_SF_MAX][5]; INT16 idx_cpcbsign [N_SF_MAX] [20], INT16 idx_cpcb SF_MAX] MAX INT16 idx_center[N_SF_MAX];

INT16 fix rate ; INT16 idx_lpc_int ; INT16 idx vad ; INT16 idx_pitchgainQ [N_SF_MAX] ; INT16 ltp_mode; INT16 idxpitfrac [NSFMAX] ; INT16 idx_pit_int[N_SF_MAX]; INT16 idx_fcbpit_frac[N_SF_MAX][2]; INT16 idx_fcbpit_int[N_SF_MAX][2]; } PARAMETER ; /*========================================================== =====================*/

/*========================================================== =====================*/ l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE: decoder.c */ /*========================================================== =====================*/ /*--------------------------------INCLUDE------------------- ----------------*/ /*------------------- INCLUDE -----------------*/ /*------------------------------------------*/ &num include"typedef. h" #include "main.h" #include"const. h" <BR> <BR> <BR> <BR> &num include"mcutil. h"<BR> <BR> <BR> <BR> <BR> &num include"gputil. h" #include "ext_var.h" #include "lib_lpc.h" #include "lib_qlsf.h" #include "lib_geq.h" #include "lib_bit.h" &num include"lib_cla. h" #include"lib_pit. h" #include "lib_ltp.h" #include "lib_ppr.h" #include "lib_fcs.h" #include "lib_geb.h"

#include "lib_fit.h" #ifdef DIAG_SMV #include "lib_dia.h" #endif /___________________________________________________________ _________________*/ /*------------------- FUNCTIONS ----------------------*/ /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTION : decsmvframe (). */ /*------------------------------------------*/ /* PURPOSE: Performs processing on one */ /*------------------------------------------*/ /* ALGORITHM */ // /* INPUT */ /* _(INT16 []) serial: intput frame bitstream. */ /*OUTPUTARGUMENTS:*/ /* OUTPUT */ /* _ (FLOAT64 []) sigout: output decoded */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> None. void decsmv frame (INT16 PackedWords [], FLOAT64 *sigout, INT16 switch flag) // INT16 isf, is, ! sf, ij, nsf ; FLOAT64 x, y;

/*------------------------------------------*/ /* Parameters for bitstream */ <BR> <BR> <BR> // INT16 parm [3]; INT 16 shft-count ; INT16 PackWdsPtr [2] ; PARAMETERchannel; <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* Gain */ <BR> <BR> <BR> // FLOAT64 gainQ[N_SF_MAX]; /*------------------------------------------*/ <BR> <BR> <BR> <BR> /* LSF */<BR> <BR> <BR> <BR> <BR> /*/ INT16 exp_fig; FLOAT64lsfq_new_dec[NP], lpcgain_q; /*------------------------------------------*/ /* Bad Frame */ /*------------------------------------------*/ INT16 bfi; INT16update; FLOAT64enrg; FLOAT64 fec_refl [NP]; FLOAT64 temp_lagf; FLOAT64 ET_buf[N_SF_MAX]; /*------------------------------------------*/ FLOAT64 ForPitch dec [L_FRM] ; FLOAT64 ForPitchdecTEMP [L_FRM] ;

/*========================================================== =====================*/ <BR> /* #########################################*/<BR> /* ################## #################*/ /* DECODER * /* */ /* */ /* BFI MANAGEMENT */ /*========================================================== =====================*/ bfi=0 ; update = 0; /___________________________________________________________ ________*/ /* Initalizing bit un-packing */ /*------------------------------------------*/ PackWdsPtr [0] = 16; PackWdsPtr [l] = 1; switch (PackedWords [0]) case 0: nrerror ("Blank detected..."); break; case 1: channel. fiv-rate = RATEO8K ; if (bfh_oh > 0) { Nbfi=0 ; bfhoh- ; } break; case 2: channel. fiv rate = RATE2OK ; if (bfh_oh > 0) Nbfi=0 ;

bfhoh-; } break; case 3: channel. fiv-rate = RATE4OK ; if (bfh_oh > 0) { N_bfi=0; bfh_oh--; break; case 4: channel.fix_rate = RATEZ ; if (bflR_oh > 0) Nbfi=0 ; bfh-oh-- ; } break; case 14 : bfi = 1 ; Nbfi++ ; bfh_oh=BFH_OH+1; break; case 15: nrerror ("Full Rate Portable detected... ? \n") ; break; default: nrerror ("Illegal control word\n") ; break; } if(bfi == 1) nbfi count = 0; else if (nbficount < 5) nbficount++ ; if (nbfi_count>3) bfi_caution = 0;

if (bfi == 1) { frm-erasure++ ; channel. fix rate = fix rate mem ; channel.idx_SVS_deci = SVSdecimem ; } // /* Decode bit-stream if is a good frame */ /*------------------------------------------*/ if (bfi == 0) BIT bits to cdbk index (PackedWords, PackWdsPtr, &channel); if (channel. fiv rate == RATE2OK) { parm [0] = channel. idx_ls[0]; parm [l] = channel. idx_lsf [l] ; parm [2] = channel. idx tpcint ; seed_dec = 0x00000000 ; shftcount= 15; for (j=0 ; j <3 ; j++) { shft_count-=bitno0[j]; seeddec = seed_dec ^(((long) parm[j]) << shft_count) ; } } else { if (channel. fiv rate == RATEO8K) parm [0] = channel. idx_lsf[0] ; parm [l] = channel. idxIsffl] ; parm[2] = channel.idx_lsf[2]; seed dec = Ox00000000 ; shft_count = 11; for (j = 0 ; j < 3 ; j++)

shft_count -= bitno1[j]; seeddec = seed_dec^(((long)parm[j])<<shft_count) ; } } else { /*..---------------------*/ /* Save adaptive codebook */ // cpy_dvector (extdec, extdec mem, 0, MAXLAG-1) ; } /*========================================================== =====================*/ /* LSF INVERSE QUANTIZATION AND */ /*========================================================== =====================*/ /* Get the quantized Isf */ // LSF_Q_lsf_decode (bfi_caution, &exp_flg, lsfq_new_dec, channel.idx_lsf, bf, nbfi_count, channel.fix_rate); /*------------------------------------------*/ /* Interpolate the QUANTIZED Isf and calculate */ /* the LPC coefficients */ /*------------------------------------------*/ if (channel. fiv-rate == RATE4_0K) { if (channel. idx_SVS_deci== 1) LPC_interpolate_lpc_4to3 (lsq_new_dec, (FLOAT64 *) NULL,

Isfq_old_dec, pdcfq_dec, 1); else LPC_interpolate_lpc_4to2 (lsfq_new_dec, (FLOAT64 *) NULL, lsfq_old_dec, pdcfq_dec, 1); } else { if ((channel. fix rate == RATE2_0K) || ((channel.fix_rate == RATE8_5K) && (channel. idx_SVS_deci == 0))) #ifdef ALGOBUGFIX if (bfi==0) LPC_adptive_interp_dec(lsfq_new_dec, lsfq_old_dec, pdcfq_dec, channel. idx_lpc_int) ; } else LPCadptiveinterpdec (Isfqnewdec, lsfq_old_dec, pdcfq_dec, 0); #else LPC_adptive_interp_dec(lsfq_new_dec, lsfq_old_dec, pdcfq_dec, channel. idxtpcint) ; &num endif else LPC_adptive_interp_dec(lsfq_new_dec, lsfq_old_dec, pdcfq_dec, 0); } LPC_pred2refl (pdcfq_dec[0], fec_refl, NP); /*------------------------------------------*/ /* Determination of the flatness of the input */

/*------------------------------------------*/ CLAIdentifyInput (channel. idxSVSdeci, pdcfqdec [0], lsfqnewdec [0], pgain_past_dec, &lpcgain_q, channel.fix_rate,&FlatSp_Flag); /*------------------------------------------*/ /* Interpolation of Pitch */ /*------------------------------------------*/ if (channel. idx SVS deci == 1) Pnpitchtrackrecons (fixrate mem, bfi, pastbfi, ppastbfi, lag_f, SVS_deci_mem, qua_gainQ, channel, &pitchf,pitch-f mem, ForPitch decTEMP) ; PIT_PitchInterpolat (pitchf, pitch_f_mem, ForPitch_dec, 0); } if ((channel.idx_svs_deci == 0) && (channel. fix-rate == RATE8_5K)) temp_lagf = PitLagTab8b [channel. idx_pitch [0] 1 ; else if ((channel.idx_SVS_deci == 0) && (channel.fix_rate == RATE4_0K)) temp_lagf= PitLagTab7b [channel. idx_pitch [0]]; LTPadapcbkcorrection (fix rate mem, bfi, pastbfi, ppastbfi, qua_gainQ, gainQ, SVS_deci_mem, temp_lagf, &update, pitch f mem, lag, lag f, ForPitchdecTEMP, extdecmem, extdec, unfcod dec, channel); /*------------------------------------------*/ /* Gaussian excitation for very low bit */ /*------------------------------------------*/ if ((channel.fix rate == RATE2OK) (channel. fiv rate == RATEO8K)) { cpy_dvector (gp_buf+4, gp_buf,0,4-1); inidvector (gpbuf+4, 0,4-1,0.0); GCBgaussexcitdec (&seeddec, channel. fixrate, quaunfcod [l]) ;

if (channel. fix-rate == RATE2 OK) /_______________________________________________________*/ /* Decode the fixed codebook gain for */ /* # 1 and &num 3 coded with 6 + 6 */ /*------------------------------------------*/ if ((fix_rate_mem == RATE85K) (fixratemem-RATEO8K)) GEQ_update_mem_4d_to_2d(); else if ((fix_rate_mem == RATE4_0K) && (SVSdecimem ! = 0)) GEQ_update_mem_3d_to_2d(); GEQdec_gains_1 6 (0, channel. idx_gainVQ [0], qua_gainQ, qua_unfcod[1], N_bfi); GEQ_dec_gains_1_6 (2, channel,idx_gainVQ[1], qua_gainQ, qua_unfcod[1], N_bfi); qua_gainq[1][1] = qua_gainQ[1][0]; qua_gainQ [1] [3] = qua_gainQ [11 [2] ; } else { // /* Decode the fixed codebook gain for */ /* #1 coded with 6 bits */ /*------------------------------------------*/ if ((fix_rate_mem == RATE4_0K) || (fix_rate_mem == RATE2_0K)) { if (SVSdecimem == 0) GEQ_update_mem_2d_to_4d(); else GEQ_update_mem_3d_to_4d(); } GEQdec gains 1 5 (channel. idx_gainVQ [0], qua gainQ, quaunicod [l], N_bfi) ; for (i = 0; i < NSF4 ; i++) qua_gainQ [l] [i] = qua_gainQ [1] [0] ; } }

/*========================================================== =====================*/<BR> <BR> <BR> <BR> <BR> /* ############### SUB-FRAME PROCESSING ################*/ /*========================================================== =====================*/ /*------------------------------------------*/ /*--------------VARIABLE DESCRIPTION-------------*/ /*------------------------------------------*/ /* */ /* pdcfq_dec - quantized prediction coefficients */ /* unfcod_dec[0] - adaptive codebook (ACB) */ /* unfcoddec [l]-algebraic codebook (CDBK) */ /* gainQ [0]-ACB gain */ /* gainQ [l]-CDBK gain */ /* */ /* extdec-adaptive codebook */ /* lag [i_sp-integral lag of the current */ /* fractional lag of the current */ /* */ /*---------------------------------------*/ /*/ /* Set number of */ /*------------------------------------------*/ if (channel. fiv rate ! = RATE4_0K) n_sf=N_SF4; else if (channel. idxSVSdeci == 1) nsf=NSF3 ; else n_sf=N_SF2;

/*---------------------------------------*/ /*= First decoding loop for the decoder classification m*/ /*---------------------------------------*/ is=0 ; for (isf= 0; isf< nsf; isf++) { /*------------------------------------------*/ /* Set length of */ /*------------------------------------------*/ if (channel. fiv-rate ! = RATE4_0K) I_sf = L_SF4; else if (channel. idx_SVS_deci == 1) if (i_sf == N_SF3-1) I_sf= L_SF3; else l_sf == L_SF0; } else l_sf = L_SF; } /*------------------------------------------*/ /* Adaptive Codebook */ /*------------------------------------------*/ if ((channel.fix_rate == RATE85K) (channel. fix rate == RATE4 OK)) { if (channel. idx SVS deci == 1) { LTP_PP_pitch_ext_decod (ForPitch_dec+i_s, ext_dec, i_sf, unfcod_dec[0], lag, lag_f, l_sf);

cpy_dvector (unfcoddec [0], quaunfcod [0] +is, 0, l_sf-1); lag [i_sfl = (INT16) (ForPich_dec[l_sf/2+i_s] +0.5); } else { if (channel. fiv rate == RATE8_5K) LTP85kpitchdecod (bfi, extdec, isf, unfcod_dec[0], lag, lag_f, l_sf, channel.idx_pitch); else LTP_7b_pitch_decod (bfi, ext_dec, i_sf, unfcoddec [0], lag, tagf, tsf, channel. idx_pitch) ; cpy_dvector(unfcod_dec[0], qua_unfcod[0]+i_s, 0, l_sf-1); else gainQ [0] = 0.0; qua_gainQ [0] [i_sq = 0.0; ini_dvector(unfcod_dec[0], 0, l_sf-1, 0.0); inidvector (quaunfcod [0] +is, 0, l_sf-1, 0.0); /*------------------------------------------*/ /* Fixed Codebook Contribution */ // switch (channel.fix_rate) // /* RATE 8.5 */ /* RATE 8.5 kps */ /*------------------------------------------*/

case RATES 5K : if (channel.idx_SVS_deci == 1) { GEQDecPitchGam4D (Nbfi, isf, channeLidxGp VQ, if (bfi == 0) FCScdbkdecod30bsub40(unicoddec[l], l_sf, i_sf, lag[i_sf], gainQ [0], &channel); } else { if (bfi == 0) FCScdbkdecod22bsub40 (unfcoddec [l], l_sf, i_sf, lag[i_sf], pgain_past_dec, <BR> <BR> <BR> <BR> &channel);<BR> <BR> <BR> <BR> <BR> }<BR> break; break; /*------------------------------------------*/ /* RATE 4.0 kps */ /*------------------------------------------*/ case RATE4 OU : if (channel. idx SVS deci == 1) { GEQ_Dec_PitchGain_3D (N_bfi, i_sf, channel.idx_Gp_VQ, if (bfi == 0) FCS_cdbk_decod_13b_sub54(ext_dec, pdcfq_dec [i-sfl, unfcod_dec [l], I_sf, i_sf, lag [i_sfl, gainQ [0], fix_rate_mem, lpcgain_q, &channel); } else {

if(bfi == 0) FCScdbkdecod 15bsub80 (extdec, pdcfq_dec[i_sf], unfcod_dec[1], l_sf, i_sf, lag[i_sf], pgain_past_dec, fix_rate_mem, lpcgain_q, &channel); } break; /*------------------------------------------*/ /* RATE 2.0 kps */ // case RATE2OK : cpy_dvector (qua_unfcod[1]+i_s, unfcod_dec[1], 0, l_sf-1); gainQ[1] = qua_gainQ[1][i_sf]; break; /*------------------------------------------*/ /* RATE 0.8 */ /*------------------------------------------*/ case RATEO8K : break; default: nrerror ("Invalid ! !") ; break; /*------------------------------------------*/ if((bfi == 1) && ((channel.fix_rate == RATE8_5K) || (channel.fix_rate == RATE4_0K))) { for (i = 0; i < Isf ; i++) unfcod_dec [l] [i] = GCBgaussnoise (&seed bfiexc) ; }

/*------------------------------------------*/ /* Adaptive and Fixed Codebook */ /*------------------------------------------*/ if ((channel.fix_rate == RATE85K) (channel. fix rate == RATE4_OK)) { /___________________________________________________*/ /* RATE 8.5 kbps and 4.0 */ /*------------------------------------------*/ cpy_dvector(unfcod_dec[1], qua_unfcod[1]+i_s, 0, lsf-l) ; if (channel. idx_SVS_deci == 0) { if (channel. fiv rate == RATE8_5K) if ( ( (fix rate mem == rate4_0K) # (fix rate mem == RATE2OK)) && (isf-=0)) if (SVS_deci_mem == 0) GEQ_update_mem_2d_to_4d(); else GEQupdate_mem_3 d_to_4d0 ; } GEQdecgains27 (channel. fix_rate, lag [0], channel. idx_gainVQ [i_sfl, gainQ, N_bfi, unfcod_dec[1], i_sf,l_sf); if ((fec_refi[0] > 0.0) && (N_bfi > 0)) gainQ [0] = 0.4; } else if (((fix_rate_mem == RATE8 5K) 11 (fixratemem ==RATEO8K)) && (i_sf == 0)) { GEQupdatemem 4dto2d () ; else

if ((fix_rate_mem == RATE4OK) && (SVS deci mem ! = 0) && (i_sf == 0)) { GEQ_update_mem_3d_to_2d(); } GEQ_dec_gains_2_7(channel.fix_rate,lag[0], channel. idx_gainVQ [i sf], gainQ, N_bfi, unfcoddec [l], isf, l_sf); if ((fec_ref1[0] > 0.0) && (N_bfi > 0)) gainQ [0] = 0. 4; } else if (channel. fiv rate == RATE8_5K) { if (((fix_rate_mem == RATE4_0K) || (fix rate mem == RATE2_0K)) && (isf == 0)) { if (SVSdecimem == 0) GEQupdatemem2dto4d () ; else GEQ_update_mem_3d_to_4d(); } GEQ_dec_gc_4_10 (channel.idx_Gc_VQ, &(gainQ[1]),

Nbfi, unicoddec, isi) ; } else { if (((fix_rate_mem == RATE8_5K) || (fix_rate_mem == RATE0_8K)) && (i_sf == 0)) GEQ_update_mem_4d_to_3d(); else if (SVS_deci_mem == 0) GEQ_update_mem_2d_to_3d(); GEQ_dec_gc_3_8(channel.idx_Gc_VQ, &(gainQ[1]), N_bfi,unfcod_dec, i_sf); } #ifdef PROG_BUG_FIX qua_gainQ[1][i_sf] = gainQ[1]; #endif qua_gainQ [0] [i_sf] = gainQ [0] ; pgain_past_dec = gainQ [0] ; if (pgainpastdec < PAST_PGAIN_MIN) pgainpastdec = PASTPGAINMIN ; if (pgain_past_dec > PASTPGAINMAX) pgainpastdec = PASTPGAINMAX ; else /*------------------*/ /* RATE 2.0 kbps and 0.8 */ /*/ gainQ [0] = 0. 0; pgainjpastdec = 0.0; qua_gainQ [0] [i_sf]=0. 0; gainQ[1]=qua_gainQ[1][i_sf]; } /*/ /* Build the */

/*------------------------------------------*/ if (exp_flg == 1) wad dvector (qua_unfcod [0] +i_s, gainQ [0], quaunfcod [l] +is, 0.7*gainQ [l], ext_dec+MAX_LAG, 0, l_sf-1); else wad-dvector(qua_unfcod[0]+i_s, gainQ[0], qua_unfcod[1]+i_s, gainQ[1], extdec+MAXLAG, 0, l_sf-1); #ifdef PROGBUGFIX GEQenergy_extrapolation (i s, i sf, 1 sf, gainQ, qua_unfcod, bfi, lag, ext_dec, Prev_Beta_Pitch, ET_buf, ForPitch_dec, channel); #else GEQ_energy_extrapolation (i_s, i_sf, l_sf, gainQ, bfi, lag, extdec, Prev BetaPitch, ETbuf, channel); #endif /*-------------------*/ /* Temporary buffer */ /*------------------------------------------*/ cpy_dvector(ext_dec+MAX_LAG, sigout+i_s, 0, l_sf-1); /*------------------------------------------*/ /* Update the adaptive */ /*------------------------------------------*/ cpy_dvector (ext_dec+l_sf, ext_dec, 0, MAXLAG-1) ; i_s+=l_sf; /*========================================================== =====================*/

if((channel.fix_rate == RATE4_0K) && (channel.idx_SVS_deci == 1)) { cpy_dvector(gp_buf+4, gp_buf,0,4-1); gp_buf[4] = qua_galnQ[0][0]; gp_buf[5] = gpbufl6] = qua_gainQ [0] [1] ; gp_buf[7] = qua_gainQ[0][2]; else { if ((channel.fix_rate == RATE4OK) && (channel.idx_SVS_deci!=1)) { cpy_dvector (gp_buf+4,gp_buf, 0,4-1); if ((ET_buf[0] < 40.0) && (qua_gainQ [0] [0] > 0.7)) gp_buf[4] = gp_buf[5] = 0.4; else gp_buf[4] = gp_buf[5] = qua_gainQ [0] [0] ; if ((ET_buรญll] < 40.0) && (qua_gainQ [0] [1] > 0.7)) gp_buf[6] = gpbuf [7] = 0.4; else gp_bufl6] = gp_buf[7] = qua_gainQ[0][1] ; } else if (channel. fix rate == RATE8_5K) cpy_dvector(gp_buf+4, gp_buf,0,4-1); for (i = 0 ; i < 4; i++) { if ((ET_buf[i] < 40.0) && (qua_gainQ [0] [i] > 0.7) && (channel. idx_SVS_deci ! = 1)) gp_buf[i+4] = 0.4; else gp_buf[i+4] = qua_gainQ [0] [i]; } }

/*---------------------------------------*/ /* Second decoding m*/ /*---------------------------------------*/ is=0 ; for (isf= 0; i_sf<n_sf i_sf++) // /* Set the subframe */ /*------------------------------------------*/ if (channel. fix-rate! = RATE4_0K) l_sf=L_SF4; else if (channel.idx_SVS_deci==1) { if(i_sf==N_SF3-1) l_sf=L_SF3; else l_sf=L_SF0; } else l_sf=L_SF; } cpy_dvector (sigout+is, sigsyndec+NP, 0, l_sf-1) ; /*------------------------------------------*/ /* Synthesis */ /*------------------------------------------*/ FLT_allsyn (sigsyn_dec+NP, 1_sf, pdcfq_dec[i_sf], NP, sigsyn_dec+NP, synthmemdec) ;

/*------------------------------------------*/ /* Post processing */ /*------------------------------------------*/ switch (channel. fix rate) { case RATE85K : if (FlatSp_Flag == 0) x=0.65; y = 0. 4; } else { x=0.63; y=0.4; } break; case RATE4OK : x = 0.63; y=0.5; break; case RATE2OK : x = 0.63; y=0.0; break; case RATEO8K : x = 0.63; y = 0. 0; break; default: nrerror ("Invalid fix rate ! ! !") ; break; PPR_post_process (sigsyn_dec, pdcfq_dec[i_sf], x,y, lag_f[i_sf],1_sf,FlatSp_Flag, channel. fix rate) ; /*------------------------------------------*/

/* Update the synthesized speech */ /*------------------------------------------*/ cpy_dvector(sigsyn_dec+NP, sigout+i_s, 0, l_sf-1); /*------------------------------------------*/ i_s+=l_sf; } } dot dvector (sigout, sigout, &enrg, 0, LFRM-1) ; enrg_buff[0] = enrg_buff[1]; enrg_buff[1] = enrg_buff[2]; enrg_buff [2] = 10. 0*log10(enrg/L_FRM+EPSI) ; if ((enrg_buff[2] < 45.0) && (bfi == 1) && (channel. fix_rate == RATE8_5K) && (channel. idx_SVS_deci == 0)) ini_dvector(past_energyq_4d, 0, GVQVECSIZE4D-1,-30. 0); bfi_caution = 1; } else if ((enrg_buffl2] < 45.0) && (bfi == 1) && (channel. fix rate == RATE4_0K) && (channel. idx SVS deci == 0)) ini_dvector(past_energyq_2d, 0, GVQ_VEC_SIZE_2D-1, -30.0); bfi_caution = 1; } ppastbfi = past bfi ; past bfi = bfi; SVSdecimem = channel. idx SVS deci ; fix rate mem = channel. fiv rate ; #ifdef MEM_TEST

for (i = 0 ; i < 2 ; i++) inidvector (unfcoddec [i], 0, LSF-1,-1. 0); for (i=0 ; i<2 ; i++) ini dvector (qua_unfcod [i], 0, LFRM-1,-1. 0); for (i = 0; i < NSFMAX ; i++) ini_dvector(pdcfq_dec[i], 0, NP-1,-1.0); ini_dvector(ext_dec, MAX_LAG, MAX_LAG+L_SF-1, -1.0); ini_dvector(sigsyn_dec, NP, NP+LSF-1,-1. 0); ini dvector (Isfq_new dec, 0, NP-1,-1. 0); #endif #endif return ; /*------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> } /*---------------------END---------------------*/ /*========================================================== =====================*/

/*========================================================== =====================*/ /*====================================================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*/ /* Copyright (C) 2000 Conexant System */ /*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE : decoder.h */ /*===========================================.========*/ /*-------------------------------FUNCTIONS------------------ ----------------*/ /*------------------------------------------*/ void decsmvframe (INT16 [], FLOAT64 [], INT16); /*========================================================== =====================*/

l ==== l /*========================================================== =====================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =====================*/ /* FILE E: encoder. */ /*========================================================== =====================*/ &num inctude"typedef.h" /*--------------------INCLUDE--------------------*/ /*------------------------------------------*/ #include "typedef.h" &num include"main. h" #include"const. h" #include"gputil. h" &num include"mcutil. h" #include "ext_var.h" &num include"lib_qlsf. h" #include "lib_geq.h" &num include"lib_vad. h" #include "lib_lpc.h" #include "lib_cla.h" #include "lib_snr.h" #include "lib_pwf.h" #include "lib_bit.h" #include "lib-pit.h" #include "lib_smo.h" #include "lib_prc.h" #include "lib_flt.h"

#include "lib_fcs.h" #include "lib_ltp.h" #include "lib_ppr.h" &num include"lib_ppp. h" #include "lib_gcb.h" #ifdef DIAG_SMV #include "lib_dia.h" #endif &num ending /*-------------- FUNCTIONS -------------------*/ /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTION: enc smv frame (). */ /*------------------------------------------*/ /* PURPOSE: Performs processing on one */ // /* ALGORITHM */ // /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) sigpp : input */ /* _(INT16 ) smv_mode : selected SMV mode, */ /* _ (INT16) switch flag : switching mode */ (char signaling: signal */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (INT16 []) PackedWords : output frame bitstream. */ /* _ (FLOAT64 []) enc sigout : output processed */ /* (INT16 *) FlatSpFlag : flat input speech */ /* _(FLOAT64 *) avg_rate : average bit */ /* _(INT16 *) VoicingClass : Frame */ /*------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* None. */ /*------------------------------------------*/

/* RETURN */ /*None.*/ /*========================================================== =====================*/ void enc smv frame (FLOAT64 sigpp [], INT16 PackedWords [], FLOAT64 encsigout [], INT16 smv mode, INT16 switch flag, INT16 *FlatSpFlag, char signaling, FLOAT64 *avg_rate, INT16 *VoicingClass) { <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> /* Misc. */ /*------------------------------------------*/ FLOAT64 *px, *buf ; FLOAT64 gl, g2, vall, val2; INT16 i_sf, i,j,k,l,i_s,l_sf,n_sf; FLOAT64 x; #ifdef DIAG_SMV FLOAT64 y; #endif /*------------------------------------------*/ /* Variables for Voice Activity */ /*/ INT16 avg_lag ; /*------------------------------------------*/ /* Variables for */ /*------------------------------------------*/ INT16 NoisyV_flag, OnSetFlag; FLOAT64 FrmResEng, ResEng [N_SF2] ; FLOAT64 Ipcgain_q ; /*------------------------------------------*/ /* Variables for LPC */ /*------------------------------------------*/

FLOAT64 becta-frame betasub ; FLOAT64 refl0[N_SF_MAX]; /*------------------------------------------*/ /* Parameters for LPC */ /*------------------------------------------*/ FLOAT64 LPCF [NSFMAX+1], FLOAT64lsf_int [NP]; // /* Variables for */ /*------------------------------------------*/ INT16 excmode, speechmode ; FLOAT64 pitch_corr [2] ; // /* Parameters for LPC analysis and */ /*------------------------------------------*/ FLOAT64 Isf new2 [NP], Isf new3 [NP], lsfq_new [NP] ; /*------------------------------------------*/ /* Variables for Pitch */ /*------------------------------------------*/ FLOAT64 ForPitch [LFRM+LFRM/2] ; /*------------------------------------------*/ /* Parameters for pitch */ /*------------------------------------------*/ FLOAT64 gp_pp [N_SF_MAXl ; /*------------------------------------------*/ /* Parameters for pitch open loop */ /*------------------------------------------*/

INT16 pre lag ; /*------------------------------------------*/ /* Parameters for LTP */ <BR> <BR> <BR> // FLOAT64Rp; /*------------------------------------------*/ /* Parameters for Closed Loop */ /*------------------------------------------*/ FLOAT64 gainQ[N_SF_MAX]; FLOAT64hh[L_SF].hh_w[L_SF], hh_m[L_FRM]; FLOAT64 Tg [LSF], Tgs [LSF], Tgsm [LSF], FLOAT64 res2[L_SF]; FLOAT64 nsr = 0.0; FLOAT64Rp_Wn, ac_sharp, frm_sharp; FLOAT64 qua_Tg [L_FRM] ; /*------------------------------------------*/ /* Variables for Signal */ <BR> <BR> <BR> /*--......----.....---.--.-----..----*/ FLOAT64 sigsyn[L_SF+NP]; FLOAT64 qua_sigsyn[L_SF+NP]; <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* Parameters for bitstream */ <BR> <BR> <BR> /___________________________________________________________ ________*/ INT64 seed enc ; INT16 parm[3]; INT16shftcount ; INT16 PackWdsPtr [2] ;

PARAMETER channel; /*========================================================== =====================*/ <BR> <BR> <BR> /* */<BR> <BR> <BR> /*################# ####################*/<BR> <BR> <BR> <BR> /*############### ENCODER ################*/<BR> <BR> <BR> <BR> /* */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* ###################LPC ANALYSIS ##################*/ /*========================================================== =====================*/ /*------------------------------------------*/ /* Second subframe */ /___________________________________________________________ ________*/ LPC analysis (L LPC, sigpp, Ipc window, rxx, bwe factor, refl [l], &pderr, pdcf[1], lsf_new2, NP, &x, (*FlatSpFlag)) ; /*------------------------------------------*/ /* First subframe */ /*------------------------------------------*/ for (i = 0; i < NP; i++) refl [0] [i] = 0. 5* (refl [1] [i] + refl [N_SF4-l] [i]) ; for (i = 0; i < NP; i++) Isf int [i] = 0. 5* (lsf_new [i] + lsfnew2 [i]) ; LPC lsftop (lsf int, pdcf [0], NP) ; /*------------------------------------------*/ /* Fourth subframe LPC analysis, used for LSF */ /*------------------------------------------*/

LPC_analysis(L_LPC, sigpp+L_PP-L_LPC, lpc_window1, rxx, bwe_factor, refl [N_SF4-1], &pderr, pdcftNSF4-l], tsnew, NP, &Ipcgain, (*FlatSpFlag)) ; /*------------------------------------------*/ /* VAD based on the fourth subframe LPC */ /*------------------------------------------*/ flag_vad_mem [1] = flag_vad_mem [0]; flag_vad_mem [0] = Vad; px = sigpp + LPP-LFRM-LLPCLHD ; VAD voice detection (px, refl [N_SF4-1], pderr, lag_buf, pgain_buf, Isf new, rxx, frm_count, &Vad, flag_vad_mem) ; /*------------------------------------------*/ /* Third subframe */ // for (i = 0 ; i < NP; i++) refl [2] [i] = 0. 5* (refl [1][i] + refl [N_SF4-1] [i]); for (i = 0; i < NP; i++) Isf int [i] = 0.5* (lsf_new[i]+lsf_new2 [i]); LPC lsftop (isf int, pdcf [2], NP); /*------------------------------------------*/ /* LPC analysis for */ /*------------------------------------------*/ energy_m = energy; LPC analysis (L LPC, sigpp+L_PP-L LPC, Ipc window2, rxx, bwe factor, refl [N_SF4], &pderr, pdcf SF4], Isf new3, NP, &x, (*FlatSpFlag)) ; energy = rxx [0] ;

/*========================================================== =====================*/ /* WEIGHTING SPEECH AND CLASSIFICATION */ /*========================================================== =====================*/ #ifndef MEM_TEST /*------------------------------------------*/ /* Update the weighted speech buffer */ /*------------------------------------------*/ cpy_dvector (wspeech+LFRM, wspeech, 0, LOLPIT-LFRM-LLPCLHD-1) ; #endif /*/ Generate the residual /*------------------------------------------*/ PWFspeechtoresidu (sigpp, wspeech, pdcf, wpdcf zero, GAMMA1) ; /*------------------------------------------*/ /* Temporal noise-like unvoied speech */ /*------------------------------------------*/ VUV=3 ; 1 = L FRM + L_LPCLHD; CLA_NoisUnvoiceDetect (wspeech+ L OLPIT-1, sigpp+L PP-1, &VLN, ResEng, &frm_sharp, L_FRM); FrmResEng = ResEng [0] + ResEng [l] ; /*------------------------------------------*/ /* Generate the weighted */ /*------------------------------------------*/ PWF_residu_to_wspeech((*FlatSpFlag), wspeech, wspeech, refl, pdcf, wpdcfoie, LPCF, wspeechmem, &Z1 wsl) ; /*========================================================== =====================*/

/* OPEN-LOOP INTER PITCH LAG SEARCH*/ pre_lag = ol_lag[1]; PIT_ol_2pitchs(wspeech, L_OLPIT, ol_lag, Rp_sub, frame_class, HI_LAG2); for (i=0 ; i<3 ; i++) lag_buf[i] = lag bufli+2] ; #ifndef COMPLEXITYREDUC avg_lag = AVG (lag_buf[0], lag_buf[1], lag_buf[2]) ; if (abs ((short) (ol_lag[0]/2.0) - avg_lag) <=2) lag_buf[3] = (INT16)(ol_lag[0]/2.0); else { if (abs ((INT16)(ol_lag[0]/3.0)-avg_lag) <= 2) lagbufl3] = (INT16) (ol_lag[0]/3. 0); else lag_buf[3] = ol_lag[0]; } if (abs ((INT16) (ol_lag [l]/2. 0)-avg_lag) <=2) lag_buf[4] = (short) (ol_lag [l]/2. 0); else { if (abs ((INT16)(ol_lag[1]/3.0) - avg_lag) <= 2) lag_buf[4] = (short) (ol_lag [l]/3. 0); else lag_buf[4] = ol_lag [l] ; } #else lag_buf[3] = ol_lag[0]; lag_buf[4] = ol_lag[1]; #endif /*========================================================== =====================*/ /* ###################CLASSIFICATION ##################/

frame_class_m = frame class ; frame class = CLA signal classifier (sigpp + LPP-LFRM-L LPCLHD, Rp_sub[1], (double)(ol_lag[1]), Vad); /*------------------------------------------*/ /* Background Noise */ /*------------------------------------------*/ SNR Calc_NSR_enc (sigpp+L_PP-L_FRM, lsf new3, Vad, frame class, &nsr, LFRM) ; /*------------------------------------------*/ /* Class */ /*------------------------------------------*/ CLA_Class_Correct (&frame_class, &frame_class_pp, &Vad, &VUV, &OnSetFlag, frame class m, Rp sub, nsr, refl, frm_sharp, smv_mode, energy_m, energy, FrmResEng, lpcgain, &NoisyV_flag); /* CODEC BIT-RATE SELECTION */ /*========================================================== =====================*/ /*------------------------------------------*/ /* Fixed rate */ /*------------------------------------------*/ fix rate mem = fiv rate ; if (smv_mode <=1) fiv rate = RATE85K ; else fix-rate = RATE4OK ; if (switch-flag) {

CLA_Rate_Select (smv_mode, frame_class, frame_class_m, OnSetFlag, Rp_sub, nsr, frm_sharp, refl [2] [0], FrmResEng, &fixrate) ; if ( (signaling == (char)!) && (fix_rate == RATE85K)) fiv rate = RATE4OK ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FINE PITCH AND */ <BR> <BR> <BR> <BR> /*========================================================== =====================*/ if ((fix_rate == RATE4_0K) && (ol_lag[1]>HI_LAG) && (frame_class_pp>0)) framec ! asspp = 0 ; /*------------------------------------------*/ /* Forwardfinepitch */ /*------------------------------------------*/ if (frame c! asspp > 0) { low_pit = MAX (min_pit, ol_lag [l]-5) ; if (fix rate == RATE8 5K) high_pit = MIN (HI_LAG2, ol_lag[1] + 5); else high_pit = MIN(HI_LAG, ol_lag[1] + 5); prepitchindex = pitchindex; pitch_f_mem [1] = pitch_f_mem [0]; pitch_f_mem [0] = pitchf; 1 = L_OLPIT-L_LPCLHD; lagl = PITFinePitch (fixrate, lowpit, highpit, wspeech, 1, Delay pp, &Rp, &pitchf, &pitch index); channel. idxpitch [0] = pitch index ;

/*------------------------------------------*/ /* Pitch interpolation and modify pitch index to avoid */ large delay /*------------------------------------------*/ if ((fixratemem == RATE2OK) (fix ratemem == RATEO8K)) { pitch_f_mem [1] = pitchf; pitch_f_mem [0] = pitchf; } else if (frame class m < 6) { if (fix rate mem ! = RATE8_5K) pitch_f_mem [1] = lag_f[N_SF2-1]; pitch_f_mem [0] = lag_f[N_SF2-1]; } else pitch_f_mem [1] = lag_f[N_SF4-1]; pitch_f_mem [0] = lag_f[N_SF4-1]; } PIT PitchInterpolat (pitchf, pitch f mem, ForPitch, 1); <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> /* ################## LT PROCESSING #################### */<BR> <BR> <BR> <BR> = cpy_dvector (NewTg+L_FRM, NewTg, 0, NP-1); PPP_pitch_preproc (smv_mode, fix rate, (*FlatSpFlag), nsr, wspeech, NewTg+NP, ForPitch, &Delay_pp, frameciasspp, &frame class, &VUV, gp_pp) ; /*------------------------------------------*/

frame-class */ /*------------------------------------------*/ if ( (VUV == 2) && (frame_class > 1) && (OnSetFlag ! = 1)) fram_class=1; if ((frame_class == 6) && ((fix_rate_mem == RATE2_0K) || (fix rate mem == RATEO8K)(fixrate-RATE2OK) (fix_rate == RATE0_8K)) frame_class = 5; if ((frame_class = 6) && (frame_class_m < 3) && (switch_flag ! = 0)) frame class = 5; /___________________________________________________________ ________*/ /* Rate modification because of the complexity */ /*------------------------------------------*/ if (switch_flag) if (switchaflag) if ((smv_mode >= 1) && (fix rate == RATE85K) && (frame class == 1)) fiv rate = RATE4OK ; if ((frame_class_pp > 0) && (frame_class < 6) && (fix rate == RATE4_0K) && ((ol_lag[0] < 30) (ol_lag [l] < 30))) fixrate = RATE85K; &num ifdefPROGBUGFIX if ((signaling == (char) 1) && fiv rate == RATE8 5K) { fiv rate = RATE4_0K ; if (frame class == 6) frame class = 5; if (framec ! asspp > 0) if (ol_lag [0] < 30)

ol_lag[0] *=2; if (ol_lag[1] < 30) ol_lag[1] *=2; } } #else if ((signaling == (char) 1) && (fix_rate == RATE8 5K)) { fiv rate = RATE4_0K ; if (frame class == 6) frame class = 5; if ((frame_class_pp > 0) && ((ol_lag[0] < 30) ! (ol lag [l] < 30))) ol_lag [0] *= 2 ; } #endif PRC_average_rate (fix_rate, avg_rate); } channel. fiv rate = fix_rate ; /*------------------------------------------*/ /* Reset open-loop */ /*------------------------------------------*/ if (fixrate == RATE8_5K) { for (i = 0; i < 2; i++) lag [i] = ol_lag[0]; for (i = 2; i < NSF4 ; i++) lag [i] = ol_lag[1]; } else lag [0] = ol_lag[0] ;

lag [1] = ol_lag[1] ; } if (frame class-pp > 0) { if(fix_rate == RATE8_5K) lag [N_SF4-1] = lagl ; else if (lagl >= 30) lag[N_SF2-1] = lagl ; /*------------------------------------------*/ /* Quantize 3 stable LTP gains with */ /*------------------------------------------*/ if ((frame_class == 6) && (fia rate ! = RATE2OK) && (fixrate ! = RATEO8K)) channel. idxSVSdeci = 1; if (NoisyV_flag == 1) for (i = 0 ; i < NSF4 ; i++) gp_pp [i] *= 0.95; else if (NoisyV_flag == 2) for (i = 0 ; i < NSF4 ; i++) gp_pp[i] *=0.92; if ( (*FlatSpFlag) == 0) { if (smv_mode == 0) { for (i = 0; i < NSF4 ; i++) gp_pp[i] [i] *= 0. 95; } else for (i = 0; i < NSF4 ; i++) gp_pp[i] *=0.97; } if(fix_rate !=RATE8_5K)

/*------------------------------------------*/ /* 4 bits to quantize 3 */ /*------------------------------------------*/ GEQQuantPitchGain3D (gppp, & (channel.idx_Gp_VQ)) ; else /*------------------------------------------*/ /* 6 bits to quantize 4 */ /*------------------------------------------*/ GEQQuantPitchGain4D (gppp, & (channel.idx_Gp_VQ)) ; } } else channel. idx SVS deci = 0; /*------------------------------------------*/ /* Back to speech */ // PWFwspeechtospeech (NewTg+NP, wpdcf zero, wpdcf_pole, LP CF, &Z1 ws 2) ; /*========================================================== =====================*/ /* ############# LPC QUANTIZATION AND INTERPOLATION ############### */ /*========================================================== =====================*/ /* Estimate frame based and initial subframe based */ /*------------------------------------------*/ SMO lsf smooth est (Vad, flag_vad_mem [0], refl [l] [0], Isf_new, &beta frm) ; /*------------------------------------------*/ /* Smooth LSF, smoothing not active for coder mode >= */ /*------------------------------------------*/

for (i = 0; i < NP; i++) lsf_smooth [i] = beta_frm*lsf smooth [i] + (1. 0-beta frm) *lsf new [i]; /*------------------------------------------*/ /* LSF */ /*------------------------------------------*/ LSF_Q_lsfqnt(lsf_smooth, lsfq_new, channel.idx_lsf, fix_rate); /*------------------------------------------*/ /* Interpolation of LSF and weighting filter coefficients */ /*------------------------------------------*/ if ( (*FlatSpFlag) == 0) { if (NoisyV_flag > 0) x = 0. 55; else x = 0.6; else x = 0. 5; r_pole_ws = 0. + 0.75*x; /*------------------------------------------*/ if ((fix_rate == RATE8_5K) 11 (fix_rate == RATE2_0K) || (rate == RATE0_8K)) /___________________ ________________________________________*/ /* Interpolate the QUANTIZED Isf and get the LPC coefficients */ /*------------------------------------------*/ if((fix_rate == RATE2_0K) || ( (rate == RATE8_5K) && (frame_class ! = 6))) LPC_adptive_interp(lsfq_new, lsf_new2, lsfq_old, pdcfq,

& (channel. idx-lpc int)) ; else LPCadptiveinterpdec ()sfqnew,tsfqotd, pdcfq, 0); /*------------------------------------------*/ for (i = 0 ; i < NSF4 ; i++) <BR> <BR> <BR> refl0 [i] = refl [i] [0] ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* Perceptual weighting filter coefficients */ /*------------------------------------------*/ for (i = 0; i < NSF4 ; i++) vall 1. 0; for (j = 0 ; j<NP ; j++) { vall *= r_pole_ws ; wpdcf_pole[i][j] = pdcf[i][j]*vall; } } } else if (frame class==6) { /_______________________________________________________*/ /* Interpolate the QUANTIZED Isf and get the */ /* coefficients */ /*--------------.--..---*/ LPC_interpolate_lpc_4to3 (lsfq_new, (FLOAT64 *) NULL, tsfqotd, pdcfq, 1); /*------------------------------------------*/ /* Interpolate the UNQUANTIZED Isf and get the */

/* coefficients */ /*------------------------------------------*/ LPC_interpolate_lpc_4to3 (lsf_new, lsf_new2, lsf_old, pdcf, 0); /*------------------------------------------*/ x=6. 5/40; refl0 [0] = (1-x) *refl [0] [0] + x*refl [l] [0] ; refloll] = 0. 5* (refl [1] [0] + refl [2] [0]) ; reflO [2] = (1-x) *refl [3] [0] + x*refl [2] [0] ; /*------------------------------------------*/ /* Perceptual weighting filter coefficients */ /*------------------------------------------*/ for (i = 0 ; i < N SF3 ; i++) { vall = 1.0; val2 = 1.0; for (j = 0 ; j < NP ; j++) vall *= GAMMA1 ; val2 *= r_pol_ws; wpdcf_zero[i][j] = pdcf[i][j]*vall; wpdcfpote [i] [j] = pdcfli] [j] *val2 ; } } } else { /*------------------------------------------*/ /* Interpolate the QUANTIZED lsf and get the */ coefficients /*------------------------------------------*/ LPC interpolate lpc_4to2 (Isfq_new, (FLOAT64 *) NULL,

Isfq_old, pdcfq, 1); /*------------------------------------------*/ /* Interpolate the UNQUANTIZED lsf and get the */ /* coefficients */ /*------------------------------------------*/ LPC_interpolate_lpc_4to2 (lsf_new, lsf_new2, lsf_old, pdcf, 0); /*--------------------*/ refl0 [0] = 0.5* (refl [0] [0] + refl [l] [0]); refl0 [l] = 0.5* (refl [2] [0] + refl [3] [0]) ; /*------------------------------------------*/ /* Perceptual weighting filter coefficients */ /*------------------------------------------*/ for (i = 0 ; i < NSF2 ; i++) { vall= 1.0; val2 = 1.0; for (j = 0 ; j < NP ; j++) vall *= GAMMAl ; val2 *= r_pole_ws ; wpdcf_zero[i][j] = pdcf[i][j]*vall; wpdcf_pole [i] [j] = pdcfLi] [j] *val2 ; } } } } /___________________________________________________________ ________*/ /* Flat input speech */ /*------------------------------------------*/ CLA_Identify_Input (channel.idx_SVS_deci, pdcfq[0], lsfq_new[0],

pgain_past, &Ipcgain_q, fix rate, FlatSpFlag) ; if (fix rate == RATE2_0K) pann [0] = channel. idx_lsf[0] ; parm [l] = channel. idx_lsf[1]; parm [2] = channel. idx_lpc_int ; seed enc = 0x00000000 ; shft_count = 15; for (j=0 ; j < 3 ; j++) { shft_count -= bitno0[j]; seed enc = seed_enc^(((long)parm[j])<<shft_count) ; } else if (fix_rate == RATE0_8K) { parm[0] = channel.idx_lsf[0]; parm[1] = channel.idx_lsf[1]; pann [2] = channel. idx_lsf[2] ; seed enc = Ox00000000 ; sliftcount= 11; for (j=0 ; j < 3 ; j++) { shft-count-= bitnol [j] ; seed_enc = seed_enc ^(((long) parm[j]) <<shft_count); } } // /* Gaussian excitation for very low bit */ /*------------------------------------------*/ if (nsr > 0. 125) x= 1.0-0.6*nsr; else x= 1. 0; if ((fix_rate == RATE0_8K0 && (nsr > 0.125))

x = 0. 4; if (frame class == 6) x1.0; NoiseGainFactor = 0.5*NoiseGainFactor + 0.5*x; if ((fix_rate == RATE2_0K) || (fix_rate == RATe0_8K)) { GCB_gauss_excit (&seed_enc, fix_rate, fix_rate_mem, nsr, ResEng, qua unfcod [l], qua_gainQ [1]) ; qua_gainQ [1] [0] *= NoiseGainFactor; if (fix rate == RATE2OK) <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> // /* Quantize 'que_gainQ[1][0]' and 'qua_gainQ[1][2]' */ /* with 6 + 6 */ /*------------------------------------------*/ if ((fix_rate_mem == RATE8_5K) || (fix_rate_mem == RATE0_8K)) GEQupdatemem4dto2dO ; else if ((fix_rate_mem == RATE4OK) && (frame class m == 6)) GEQ_update_mem_3d_to_2d(); qua_gainQ[1] [2] *= NoiseGainFactor; GEQ_gainNSQMA_1_6 (0, qua_unfcod[1], qua_gainQ, & (channel. idx_gainVQ [0])) ; GEQgainNSQMA 16 (2, quaunfcod [l], quagainQ, & (channel. idx_gainVQ [1])) ; qua_gainQ[1][1] = qua_gainQ[1][0]; qua_gainQ[1][3] = qua_gainQ[1][2]; } else { <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> <BR> /* Quantize'qua_gainQ [1] [0]'5bits */ /*------------------------------------------*/

if ((fix_rate_mem == ATE4_0K) || (fix_rate_mem == RATE2_0K)) { if (frame_class_m ! = 6) GEQ_update_mem_2d_to_4d(); else GEQupdatemem 3dto4d0 ; } GEQ_gainNSQMA_1_5(qua_unfcod[1], qua_gainQ, & (channel. idx_gainVQ [0])) ; for (i = 1 ; i<NSF4 ; i++) qua_gainQ [1] [i] = qua_gainQ [1] [0] ; } } (*VoicingClass) = frame class ; #ifdef MEM_TEST /*__________________________________________________________ __________*/ /* Update the weighted speech */ /*------------------------------------------*/ cpy_dvector (wspeech+L_FRM, wspeech, 0, L_OLPIT-L_FRM-L_LPCLHD-1); #endif /*========================================================== =====================*/ /* ###########################################*/ /* mu SUB-FRAME */ /* */ /*========================================================== =====================*/ /*---------------------------------------------*/ /*--------------VARIABLE DESCRIPTION ----------------*/ /*------------------------------------------*/ l* *l

/* pdcfq-quantized prediction */ /* wpdcfpole-poles of the perceptual weighting */ /* wpdcf zero-zeros of the perceptual weighting filter */ /* */ /* Tgs - target signal */ /* Tg-target signal for codebook */ /* (no pitch */ /* hh-impulse response of the combined synthesis */ /* perceptual weighting */ /* unfcod[0] - adaptive codebook (ACB) */ /* unfcod [l]-algebraiccodebook (CDBK) */ /* fcod [0]-filtered ACB */ /* fcod filtered CDBK vector <BR> <BR> <BR> /* gainQ [0]-ACB */<BR> <BR> <BR> <BR> <BR> /* gainQ [l]-CDBK gain */<BR> <BR> <BR> <BR> <BR> /* gainQ [2]-CDBK gain */ /* */ /* ext - adaptive codebook */ /* lag[i_sf] - integral lag of the current */ /* lagf[i_sf] - fractional lag of the current subframe */ /*------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> /*############## First Loop With Unquantized Fixed CB m */ /*------------------------------------------*/ if(fix_rate != RATE4_0K) nsf=NSF4 ; else { if (frame class == 6) nsf=NSF3 ; else n_sf=N_SF2; i = 0 ; for (isf= 0; i_sf<n_sf i_sf++)

/*------------------------------------------*/ /* Set-up of the sub-frame */ /*---------------------*/ if (fixrate ! = RATE4_0K) l_sf=L_SF4; else if (frame class == 6) { if (i_sf == N_SF3-1) Isf=LSF3 ; else l_sf=L_SF0; } else l_sf=L_SF; } /* The impulse response with the all pole synthesis */ <BR> <BR> <BR> and the percerptual weighting filter<BR> <BR> <BR> <BR> // LPC_ImpulseResponse (hh, wpdcf_zero [i_sf], wpdcf_pole[i_sf], pdcfq [i_sf], l_sf); cpy dvector (hh, hh m+i_s, 0, l_sf-1) ; /*------------------------------------------*/ /* Target */ /*------------------------------------------*/ PRC_TargetSignal (wpdcf zero [i_sfl, wpdcf-pole [i_sfl, pdcfq[i_sf], NewTg+i_s, ext+MAX_LAG, Tgs, dif_mem, target_mem, l_sf); if(i_sf == 0) cpy_dvector (Tgs, Tgs m, 0, l_sf-1) ;

/*------------------------------------------*/ /* Ideal */ // PRC Ideal Excit (Tgs, pdcfq [i_sfl, wpdcf_pole [i_sfl, wpdcf_zero[i_sf], res2,; /*------------------------------------------*/ <BR> <BR> <BR> <BR> /* LTP */<BR> <BR> <BR> <BR> <BR> // if ( (fix rate == RATE8_5K) || (fix_rate == RATE4_0K)) { if (frame_class == 6) { // /* Pitch lag interpolation */ /*------------------------------------------*/ LTP_PP_pitch_ext (ForPitch+i_s, Tgs, ext, hh, isf, unfcod [0], fcod [0], lag, lag f, &Rp_Wn, l_sf); /*------------------------------------------*/ /* Pitch */ /*------------------------------------------*/ gainQ [0] = gppp [isf) ; if (NoisyV_flag < 2) gainQ [0] *= 0. + 0.75; } else { /*------------------------------------------*/ /* Close-loop */ /*------------------------------------------*/ if (fix_rate == RATE8_5K)

LTPciose85kpitch (Tgs, ext, hh, isf, unfcod [0], fcod [0], lag, lag_f, & (gainQ [0]), &Rp_Wn, l_sf, framectasspp, channet. idxpitch) ; else LTP pitch (Tgs, ext, hh, i_sf, unfcod[0], fcod [0], lag, lag f, & (gainQ [0]), &Rp_Wn, l_sf, frame_class_pp, channel. idx-pitch) ; /*------------------------------------------*/ /* Modify the gainQ [0] to de-emphasize the */ /* contribution in the cdbk */ /*------------------------------------------*/ gppp [isf) = gainQ [0] ; ac_sharp = pPP_sharpness(l_sf, unfcod[0]); if ((frame_class > 1) && (ac_sharp < 0.25)) { x = MAX (MIN (5*acsharp-0. 25,1.0), 0. gainQ [0] *= (1-x) *Rp_Wn + x; /*------------------------------------------*/ /* Save the results for the second */ /*------------------------------------------*/ cpy_dvector (unfcod [0], qua_unfcod [0]+i_s, 0, lsf-l) ; cpydvector (fcod [0], qua_fcod[0]+i_s, 0, lsf-l) ; else { gainQ [0] = 0.0; gp_pp [i_sf] = 0. 0 ; Rp_Wn = 0.0; lag_f [i_sfl = lag [i_sfl ; inidvector (unfcod [0], 0, l_sf-1, 0.0); ini_dvector(qua_unfcod[0]+i_s, 0, 1_sf-1, 0.0); inidvector (fcod [0], 0, l_sf-1, 0.0);

inidvector (quafcod [0], 0, l_sf-1, 0.0); /*------------------------------------------*/ /* Classify the speech subframe, used for */ /* preselection */ /*------------------------------------------*/ SMO_initial_analysis (NewTg+i_s+NP, Vad, lag_f[i_sf], reflO [isf), &speechmode, pitchcorr, Isf) ; /*------------------------------------------*/ /* Calculate the Target for codebook */ /*------------------------------------------*/ for (i = 0; i < tsf ; i++) { Tg [i] = Tgs [i]-gainQ [0] *fcod [0] [i] ; res2 [i]-= gainQ [0] *unfcod [0] [i] ; } /*/ /* Mode selection of fixed excitation */ /* mixed search vs pure */ /*------------------------------------------*/ SMO_refined_analysis (res2, speech_mode, pitch_corr, &exc_mode, &betasub, i sf) ; /*------------------------------------------*/ /* Fixed Codebook */ // k = excmode*frameclass ; if (NoisyV_flag == 1) k=2 ; if (NoisyV_flag == 2) k= 1 ;

switch (fix rate) { case RATE85K : if (frame class == 6) FCScdbksearch30bsub40 (ext, pdcfq [i_sf], Tg, res2, hh, unfcod [l], l_sf, i_sf, lag [i_sfl, k, gp_pp[i_sf], nsr, Rp Wn, &channel); } else { FCScdbksearch22bsub40 (ext, pdcfq [i_sf], Tg, res2, hh, unfcod [l], l_sf, i_sf, lag [i_sfl, k, pgainpast, nsr, Rp_Wn, &channel); } break; case RATE4OK : if (frame_class == 6) { FCS_cdbk_search_13b_sub54(ext,pdcfq[i_sf], Tg, res2, hh, unfcod [l], lsf, isf, Iag [isf), k, gp [i_sfl, nsr, Rp Wn, fix rate mem, Ipcgain_q, &channel) ; else { #ifdef MEM_TEST inidvector (&sigsyn [NP], 0, LSF-1,-1. 0); ini_dvector(&qua_sigsyn[NP], 0, L_SF-1, -1.0); ini dvector (dif mem, 0, LSF+NP-1,-1. 0); ini-dvector (qua dif mem, 0, LSF+NP-1,-1. 0); px = &wspeech [L_OLPIT-L_FRM-L_LPCLHD] ;

ini dvector (px, 0, LFRM+LLPCLHD-1,-1. 0); inidvector (hhw, 0, L_SF-1, -1. 0); inidvector (ForPitch, 0, LFRM+LFRM/2-1,-1. 0); px = &qua_unfcod [0] [0] ; ini_dvector(px, i_s, L_FRM-1, -1.0); px = &qua_unfcod [1] [0] ; inidvector (px, is, LFRM-1,-1. 0); px=&quajcod [0] [0] ; inidvector (px, i_s, L_FRM-1, -1. 0); px = &qua_fcod[1][0]; inidvector (px, i_s, L_FRM-1, -1. 0); inidvector (quaext, 0, MAXLAG+LSF-1,-1. 0); ini_dvector(qua_Tg, 0, LSF-1,-1. 0); inidvector (rxx, 0, NP,-1.0); ini_dvector(refl0, 0, NSFMAX-1,-1. 0); for (i=0 ; i<NSFMAX+l ; i++) { px = &pdcf[i][0]; inidvector (px, 0, NP-1,-1.0); ini_dvector(lsfq_new, 0, NP-1,-1.0); ini dvector (lsf new2, 0, NP-1,-1.0); ini_dvector(lsf_new3, 0, NP-1,-1.0); ini dvector (Isf int, 0, NP-1,-1.0); imdvector (sigpp, i_s, L_FRM-1, -1. 0); #endif FCS cdbk search_15b sub80 (ext, pdcfq [i_sf], Tg, res2, hh, unfcod [l], tsf, isf,

lag[i_sf], k, pgain_past, nsr, Rp_Wn, fix_rate_mem, Ipcgain_q, &channel) ; } break; case RATE2OK : case RATEO8K : cpy_dvector (qua_unfeod [l] +i_s, unEeod [l], 0, tsf-l) ; gainQ[1] = qua_gainQ[1][i_sf]; break; default: nrerror ("Invalid fiv rate !! \n"); break; /*------------------------------------------*/ /* Filter the selected excitation */ // buf=dvector (0, l_sf-1); filterAZ (hh, unfcod [l], fcod [l], buf, (INT16)(l_sf-1), l_sf) ; free dvector (buf, 0, l_sf-1) ; /*------------------------------------------*/ Gains // if ((fix_rate == RATE8_5K) || (fix_rate == RATE4_0K)) // /* Unquantized */ /*------------------------------------------*/ GainModiDeci = 1;

if ( (frame class < 6) && (frame_class > 1)) GEQ_gain_reopt_2 (fcod[0], fcod[1], Tgs, gainQ, gainQ+1, l_sf); else { gainQ[0] = gp_pp[i_sf]; for (i = 0; i < tsf ; i++) Tg [i] = Tgs [i]-gainQ [0] *fcod [0] [i] ; dot dvector (Tg, fcod [l], &gainQ [1], 0, l_sf-1) ; dot dvector (fcod [l], fcod [l], &vall, 0, l_sf-1) ; gainQ [l]/= MAX (vall, 0.01); } /*------------------------------------------*/ /* Gain */ // if (frame class < 6) { if (GainNormDeci == 0) betasub = 0.0; GainNormDeci = 0; if ( (nsr > 0.125) 11 (frame class <= 1) 11 ((fix_rate == RATE4_0K) && (Rp_Wn < 0.5))) GainNormDeci= 1; if (fix rate == RATE8 5K) x = ResEng [(short) (i_sf/2)] ; else x = ResEng [i sf] ; PRCGainsNorm GcGp (nsr, x, ext+MAXLAG, gainQ, unfcod, fcod, Tgs, Vad*excmode, beta_sub, l_sf); }

gainQ [0] *= NoiseGainFactor ; gainQ [l] *= NoiseGainFactor ; } else { if (nsr > 0. 25) PRCGainNormGc (ext+MAXLAG, gainQ, unfcod, fcod, Tg, l_sf) ; #ifdef PROG BUG FIX GainNormDeci = 0; #endif } /* Gain */ /*------------------------------------------*/ // /* Limit pitch */ /*------------------------------------------*/ if (gainQ [0] < 0. 0) gainQ [0] = 0.0; if (gainQ [0] > 1.2) gainQ [0] = 1.2; for (i = 0 ; i < LTP_BUFF_SIZE-1; i++) pgain [i] = pgain_buf[i+1] ; pgain_buf[LTP_BUFF_SIZE-1] = gainQ [0] ; if (gainQ [1] < 0. 0) FCSChangeSign (&channel, i_sf, l_sf, unfcod[1], fcod [l], gainQ+1) ; /*------------------------------------------*/

#ifdef MEM_TEST cpy_dvector (unfcod[0], qua_unfcod[0]+i_s, 0, I sf 1) ; cpy_dvector (fcod[0], qua_fcod[0]+i_s, 0, l_sf-1); #endif cpy_dvector (unfcod[1], qua_unfcod[1]+i_s, 0, l_sf-1); cpy_dvector (fcod[1], qua_fcod[1]+i_s, 0, l_sf-1); if (GainModiDeci == 0) cpydvector (Tgs, Tg, 0, l_sf-1) ; else wad dvector (fcod [0], gainQ [0], fcod [l], gainQ [l], Tg, 0, l_sf-1) ; cpy_dvector (Tg, &qua_Tg[i_s], 0, l_sf-1); /*------------------------------------------*/ if (frame class ! = 6) { if (fix rate ! = RATE85K) if (((fix_ratre_mem == RATE8_5K) || (fix_rate_mem == RATE0_8K)) && (isf== 0)) GEQupdatemem4dto2d () ; else if ((fix_rate_mem == RATE4_0K) && (frame_class_m == 6) && (i_sf == 0)) GEQupdate mem 3dto2d () ; GEQ_gainVQMA_2 (Tg, unfcod, fcod, gainQ, &(channel.idx_gainVQ[i_sf]), l_sf, fix_rate); else if(((fix_rate_mem == RATE4_0K) || (fix rate mem == RATE2OK)) && (isf== 0)) {

if (frame class m ! = 6) GEQ_update_mem_2d_to_4d(); else GEQ_update_mem_3d_to_4d(); } GEQgainVQMA_2 (Tg, unfcod, fcod, gainQ, & (channel. idx gainVQ [i sfl), isf, Hxrate) ; } /*------------------------------------------*/ /* Update the past quantized pitch gain for cdbk */ /*------------------------------------------*/ pgain_past = gainQ [0] ; if (pgain_past < PAST_PGAIN_MIN) pgain_past = PAST PGAINMIN ; if (pgain_past > PAST_PGAIN_MAX) pgain_past = PAST_PGAIN_MAX; qua_gainQ[0][i_sf] = gainQ [0] ; qua_gainQ [l] [i_sfl = gainQ [1]; else /*------------------------------------------*/ /* fix_rate==RATE2_0K || fix_rate==RATE0_8K */ // GainNonnDeci = 0 ; gainQ [0] = 0.0; pgain_past = gainQ [0] ; qua_gainQ[0][i_sf]=0; gainQ[1]=qua_gainQ[1][i_sf]; cpy_dvector(fcod[1], qua_fcod[1]+i_s, 0, 1_sf-1); }

/* Build the excitation and synthesized */ /*------------------------------------------*/ wad dvector (unfcod [0], gainQ [0], unfcod [l], gainQ [l], ext+MAX_LAG, 0, l_sf-1); /*------------------------------------------*/ /* Update */ /*------------------------------------------*/ FLT_allsyn (ext+MAX_LAG, l_sf, pdcfq [i_sf], NP, sigsyn+NP, synth_mem) ; for (i = I_sf-NP, j=0 ; i < l_sf; i++j++) { dif_mem[j] = NewTg[i_s+NP+i]-sigsyn[i+NP]; target_memlj] = Tgs [i]-gainQ [0] *fcod [0] [i] - gainQ[1]*fcod[1][i]; } /___________________________________________________________ _*/ /* Update the adaptive */ /*/ cpy_dvector (ext+l_sf, ext, 0, MAX_LAG-1) ; /*------------------------------------------*/ is += lsf ; /*========================================================== =====================*/ /*############### Second Loop With Quantized Fixed CB */ /*========================================================== =====================*/ if ( (frame class == 6) && (fix_rate !=RATE2_0K) && (fix_rate != RATE0_8K)) {

/*------------------------------------------*/ /* Quantize 3 fixed CB */ /*------------------------------------------*/ if (fix_rate !=RATE8_5K) if ( ((fix_rate_mem == RATE85K) (fixratemem == RATEO8K))) GEQupdatemem4dto3dO ; else if (frame_class_m != 6) GEQ_update_mem_2d_to_3d(); GEQgainVQMA_3 (qua Tg, qua unfcod, qua fcod, qua_gainQ, &(channel,idx_Gc_VQ)); else { if(((fix_rate_mem == RATE4_0K) || (fix_rate_mem == RATE2_0K))) if (frame_class_m ! = 6) GEQ_update_mem_2d_to_4d(); else GEQ_update_mem_3d_to_4d(); GEQgainVQMA 4 (quaTg, quaunfcod, quafcod, quagainQ, & (channel. idx_Gc_VQ)) ; /*------------------------------------------*/ i = 0 ; for (isf= 0; i_sf < n_sf; i_sf++) { if (fix_rate == RATE8_5K) l_sf=L_SF4; else { if (i_sf==N_SF3-1)

l_sf=L_SF3; else l_sf=L_SF0; } /*------------------------------------------*/ /* Target signal */ /*------------------------------------------*/ if (i_sf > 0) PRC_TargetSignal (wpdcf_zero[i_sf], wpdcf_pole[i_sf], pdcfq [i_sfl, NewTg+i_s, ext+MAX_LAG, Tgs, qua difmem, qua targetmem, lsf) ; else cpy_dvector (Tgs m, Tgs, 0, l_sf-1) ; /*------------------------------------------*/ /* Re-build adaptive CB */ // if (i_sf > 0) { LTP_PP_ptich_ext_decod (ForPitch+i_s, qua_ext, i_sf, qua_unfcod[0]+i_s, lag, lag_f, l_sf); /*------------------------------------------*/ buf = dvector (0, l_sf-1) ; filterAZ (hh_m+i_s, qua_unfcod[0]+i_s, qua_fcod[0]+i_s, buf, (INT16)(l_sf-1), l_sf); <BR> <BR> <BR> <BR> <BR> free dvector (buf, 0, tsf-l) ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________*/

/*------------------------------------------*/ /* Build the excitation and synthesized */ /*------------------------------------------*/ wad_dvector (qua_unfcod[0]+i_s, qua_gainQ[0][i_st], qua_unfcod[1]+i_s, qua_gainQ[1][i_sf], qua_ext+MAX_LAG, 0, l_sf-1); /*------------------------------------------*/ /* Update */ // FLT_allsyn (qua_ext+MAX_LAG, l_sf, pdcfq[i_sf], NP, qua_sigsyn+NP, qua_synth_mem); g1 = qua_gainQ[0][i_sf]; g2 = qua_gainQ[1][i_sf]; for (i = I_sf-NP, j = 0; i < lsf ; i++, j++) qua_dif memlj] = NewTg [is+NP+i]-quasigsyn [i+NP], qua_target_mem[j] = Tgs [i]-gl * qua fcod [0] [i+is] - g2 * qua_fcod[1][i+i_s]; // /* Update the adaptive */ /*------------------------------------------*/ cpy_dvector (qua_ext+l_sf, qua_ext, 0, MAX_LAG-1); <BR> <BR> <BR> i s += I sf ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } }

/* Modify the memorys for next */ // cpy_dvector (quasynthmem, synthmem, 0, NP-1); cpy_dvector (qua_dif_mem, dif_mem, 0, NP-1); cpy dvector (quatargetmem, targetmem, 0, NP-1); cpy_dvector (quaext, ext, 0, MAX-LAG-1) ; /*========================================================== =====================*/ <BR> <BR> <BR> <BR> <BR> <BR> else<BR> <BR> <BR> <BR> {<BR> <BR> <BR> /___________________________________________________________ */ /* Modify the memorys for next */ /___________________________________________________________ */ cpy_dvector (synth_mem, qua_synth_mem, 0, NP-1); cpy_dvector (difmem, quadifmem, 0, NP-1); cpy_dvector (target_mem, qua_target_mem, 0, NP-1); cpy_dvector (ext, qua_ext, 0, MAX_LAG-1); } /___________________________________________________________ ________*/ /* Index to bitstream */ // BIT_cdbk_index_to_bits(&channel, PackedWords, PackWdsPtr); #ifdef DIAG_SMV /*========================================================== =====================*/ <BR> <BR> <BR> <BR> <BR> <BR> /* */<BR> <BR> <BR> /* ################## DECODER ################# */<BR> <BR> <BR> <BR> /* ##################### #################### */<BR> <BR> <BR> <BR> /* ##################################################### */ /*========================================================== =====================*/

i-s = 0; for (isf= 0; isf< nsf; isf++) if (fix_rate !=RATE4_0K) l_sf=L_SF4; else { if (frame class == 6) if (i_sf==N_SF3-1) I_sf= L_SF3; else I_sf = L_SFO; } else l_sf=L_SF; } /*------------------------------------------*/ cpy_dvector (quaunfcod [0] +is, unfcod [O], 0, l_sf-1) ; cpy_dvector (qua_unfcod[1]+i_s, unfcod [l], 0, tsf-l) ; wad_dvector (unfcod[0], qua_gainQ[0][i_sf], unfcod[1], qua_gainQ[1][i_sf], qua_sigsyn+NP, 0, l_sf-1); FLT_allsyn (qua_sigsyn+NP, l_sf, pdcfq[i_sf], NP, qua_sigsyn+NP, synth_mem_dec); /*------------------------------------------*/ /* Post */ /*------------------------------------------*/ switch (fix rate) { case RATE85K : if ( (*FlatSpFlag) == 0) { x=0.65; y = 0.4;

} else x = 0. 63; y = 0. 4; } break; case RATE4OK : x = 0. 63; y = 0. 5; break; caseRATE2OK : x=0. 63; y = 0. 0; break; caseRATEO8K : x = 0. 63; y = 0. 0; break; default: nrerror ("Invalid fix rate ! !") ; break; } PPR_post_process (qua sigsyn, pdcfq [i_sfJ, x, y, lag_f[i_sf], l_sf, (*FlatSpFlag0, fix_rate); /*------------------------------------------*/ /* Update the synthesized speech */ // cpy_dvector (quasigsyn+NP, encsigout+is, 0, l_sf-1) ; /*------------------------------------------*/ i_s+=l_sf; } #endif

#ifdef DIAG_SMV DIA_trace_data ((FLOAT64) Vad, LFRM, 10000.0, fdia_vad) ; #endif &num ยฌendif return ; /*------------------------------------------*/ <BR> <BR> <BR> } /*========================================================== =====================*/

/*========================================================== =====================*/ /*=====================================================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE: encoder. */ /*=====================================================*/ /*------------------------------------------*/ /*------------ FUNCTIONS ------------- */ /___________________________________________________________ _________________*/ void enc smv frame (FLOAT64 sigpp [], INT16 PackedWords [], FLOAT64 en-sigout INT16 smv_mode, INT16 switch flag, INT16 *FlatSpFlag, char signaling, FLOAT64 *art, INT16 *VoicingClass); /*========================================================== =====================*/

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ // /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*=====================================================*/ /* FILE : ext var. h */ /*=====================================================*/ #ifdef DIAG_SMV DIAGNOSTICS FILE ================*/ /*========================================================== =====================*/ /* Encoder unquantized */ /* Encoder unquantized */ /*------------------------------------------*/ extern FILE *fdia_vad; /*------------------------------------------*/ /* Encoder */ /*------------------------------------------*/ extern FILE *fdia_sp_enc ; /*------------------------------------------*/ /* Floating point parameter */ /*------------------------------------------*/

/*------------------------------------------*/ /* Decoder */ /*------------------------------------------*/ #endif /*========================================================== =====================*/ <BR> <BR> <BR> /*==================== FRAME COUNTERS =========================*/ /*========================================================== =====================*/ extern INT64 frm_count; extern INT64 fnnerasure ; /*========================================================== =====================*/ /*==================== SMV CONTROL ============================*/ <BR> <BR> <BR> /*========================================================== =====================*/ extern INT16 smv_mode; extern INT16 fix_rate, fix_rate_mem; <BR> <BR> <BR> <BR> <BR> <BR> NOISE SUPRESSION extern FLOAT64 MIN_GAIN ; /*========================================================== =====================*/ PRE AND POST PROCESSING extern FLOAT64 *pre_fit_num ; extern FLOAT64 *pre_flt_den ; extern FLOAT64 *pre_flt_buf z ; extern FLOAT64 *pre_flt_buf_p ; extern FLOAT64 pre_gain ; extern FLOAT64 *lp_flt_num ;

extern FLOAT64 *lp_fit_buf; /*------------------------------------------*/ extern INT16 *zeroed; extern FLOAT64 *zero rate ; extern FLOAT64 *low rate ; extern FLOAT64 *high_rate ; extern FLOAT64 *low_neg ; extern FLOAT64 *low_pos ; extern INT32 min-delta ; extern FLOAT64 zero_level ; extern FLOAT6412_neg, 11_neg, 11_pos, 12_pos ; /*------------------------------------------*/ extern FLOAT64 tc_mem_dec ; extern FLOAT64 tc_coeff ; extern FLOAT64 tc_gain ; extern FLOAT64 *tcbuffexc ; /*------------------------------------------*/ extern FLOAT64 *buff LTpost ; extern FLOAT64 *PFmemsyn ; extern FLOAT64 r zero, rpole ; extern FLOAT64 pst scale ; extern FLOAT64 pst hp mem ; /*------------------------------------------*/ extern FLOAT64 *pst_flt_mum ; extern FLOAT64 *pstfltden ; extern FLOAT64 *pst_flt_buf_z ; extern FLOAT64 *pst_flt_buf_p; extern FLOAT64 pstgain ;

/*========================================================== =====================*/ extern FLOAT64 *siglpc ; /*------------------------------------------*/ /*'LPC analysis */ // extern FLOAT64 *Ipc_window ; extern FLOAT64 *Ipc_windowl ; extern FLOAT64 *Ipc_window2 ; // /* Tilt analysis */ /*------------------------------------------*/ extern FLOAT64 *tilt window ; /*------------------------------------------*/ /* Bandwidth expansion */ /*------------------------------------------*/ extern FLOAT64 *bwefactor ; /*------------------------------------------*/ /* LPC parameters */ /*/ extern FLOAT64 pderr; extern FLOAT64 *rxx, **refl, **pdcf, **pdcfq, **pdcfq_dec ; extern FLOAT64 *Isf new, *Isf old, *Isf mid ; /*------------------------------------------*/ extern FLOAT64 erg, Ipcgain ;

extern FLOAT64 sub ! pcg ; /*------------------------------------------*/ extern FI. OATG4 *IntLSF C ; /*==================== Weighted Speech ===================*/ /*========================================================== =====================*/ extern FLOAT64 r_pole_ws; extern FLOAT64 **wpdcf_zero, **wpdcf_pole ; extern FLOAT64 *wspeech, *wspeechmem ; extern FLOAT64 Z1_ws_1, Z1_ws_2 ; extern FLOAT64 *ModiSig_m, *tmp_ws_m ; /*========================================================== =====================*/ extern FLOAT64 **fcod, **unfcod ; extern FLOAT64 **quafcod, **quaunfcod ; /*======================== Residual and target signal ==================*/ /*============================ Gain VQ =======================*/ extern INT16 GainNormDeci, GainModiDeci; extern FLOAT64 pgain_past ; extern FLOAT64 pgainpastdec ; extern FLOAT64 **qua_gainQ ; extern FLOAT64 *pastenergyq2d,

extern FLOAT64 *pastenergyq3d ; extern FLOAT64 *pastenergyq4d ; extern FLOAT64 *gp_buf; extern FLOAT64 past fixed energy ; extern FLOAT64 *PrevBetaPitch ; extern FLOAT64 *energypredcoeffl ; extern FLOAT64 *energypredcoeff2 ; extern FLOAT64 *energy_pred_coeff_3 ; extern FLOAT64 *energypredcoeff4dl ; extern FLOAT64 *energy_pred_coeff4d_2; extern FLOAT64 *energy_pred_coeff4d_3 ; extern FLOAT64 *energy_pred_coeff4d_4 ; extern FLOAT64 *pred_energy_d38 ; extern FLOAT64 *pred_energy_d410; extern FLOAT64 gp_mean ; extern FLOAT64 gpfec ; extern FLOAT64 **gaincb2128 ; extern FLOAT64 **gain_cb_2_128_8_5 ; extern FLOAT64 gp3_tab[TAB_SIZE_GVQ_3D][GVQ_VEC_SIZE_3D]; extern FLOAT64 gp4_tab[TAB_SIZE_GVQ_4D][GVQ_VEC_SIZE_4D] ; extern FLOAT64 gainVQ_2_128 [MSMAX2 128] [GVQVECSIZE2D], extern FLOAT64 gainVQ_2_128_8_5[MSMAX_2_128][GVQ_VEC_SIZE_2D] ; extern FLOAT64 gainVQ_3_256[MSMAX_3_256][GVQ_VEC_SIZE_3D] ; extern FLOAT64 gainVQ4_1024 [MSMAX4 1024] [GVQVECSIZE4D], extern FLOAT64 gainSQl32 [MSMAXl32], extern FLOAT64 gainSQ_1_64[MSMAX_1_64] ; /*========================================================== =====================*/ /*===================== LSF quantizers ====================*/ /*========================================================== =====================*/

extern FLOAT64 ***Isf cb 08k ; extern FLOAT64 ***lsf_cb_40k ; extern FLOAT64 ***Isf cb_85k ; extern INT16 *stagecand08k ; extern INT16 *stage_cand_40k ; extern INT16 *stage_cand_85k ; extern FLOAT64 B_08k[LP_08k][LQMA_08k][MAXLNp]; extern FLOAT64 B_40k[LP_40k][LQMA_40k][MAXLNp] ; extern FLOAT64 B_85k[LP_85k][LQMA_85k][MAXLNp]; extern FLOAT64 CBes_08k[MAXLTT_08k][LMSMAX_08k][MAXLNp]; extern FLOAT64 CBes_40k[MAXLTT_40k][LMSMAX_40k][MAXLNp]; extern FLOAT64 CBes_85k[MAXLTT_85k][LMSMAX_85k][MAXLNp] ; extern INT16 *MS08k ; extern INT16 *MS_40k ; extern INT16 *MS 85k ; extern FLOAT64 *last_qlsf ; extern FLOAT64 *lsfq_old, *lsfq_old_dec ; extern FLOAT64 *Mean; extern FLOAT64 **qes ; extern FLOAT64 **qesdec ; extern FLOAT64 *lsfq_mem_dec ; extern FLOAT64 *Isfqmem enc ; /*========================================================== =====================*/ PITCH OPEN LOOP /*========================================================== =====================*/ extern INT16 *l_lag; extern INT16 *lag ;

extern INT16 lagl, low_pit, high_pit ; extern FLOAT64 *Rpsub ; extern FLOAT64 pitchf ; /*------------------------------------------*/ /*------------------------------------------*/ extern FLOAT64 *PitLagTab5b ; extern FLOAT64 *PitLagTab7b; extern FLOAT64 *PitLagTab8b; extern FLOAT64 *SincWindows; /*------------------------------------------*/ extern INT16 WVmm, pitch, pitch_mm, IoptO ; extern INT16 *PITmaxO ; extern INT16 LagCount, VadCount, Av_lag ; extern FLOAT64 Rp_m ; extern FLOAT64 *RmaxO ; // extern FLOAT64 *pitch_f_mem ; /*========================================================== =====================*/ <BR> <BR> <BR> CLOSED PITCH PROCESSING extern FLOAT64 *ext ; extern FLOAT64 *SincWindows E ; extern FLOAT64 *NewTg; extern FLOAT64 *lag_f ; extern INT16 pitch_index, prepitchindex ;

/*========================================================== =====================*/ /*===================PITCH PRE-PROCESSING====================*/ extern FLOAT64 *SincWindows PP ; extern FLOAT64 Delay_pp, Last_Rp ; extern INT16 frame_class_pp_m; extern FLOAT64 *targ_mem ; <BR> <BR> <BR> <BR> <BR> <BR> l == PRC LIBRARY PROCESSING ==================*/ extern FLOAT64 cl_Eg, ol_Eg; extern FLOAT64 m_lpc_gain; <BR> <BR> <BR> <BR> <BR> <BR> l == /*======================GCB LIBRARY PROCESSING====================*/ extern INT64 seedexc ; extern FLOAT64 Zl_gcb ; extern FLOAT64 ref eng_gcb ; extern INT16 rate-mem ; extern INT64 seeddec ; CLA LIBRARY ===================*/ <BR> <BR> <BR> == extern INT16 VUV, VUVm ; extern INT16 frame_class, frame_class_m, frame_class_pp; extern FLOAT64 energy, energy_m ; extern INT16 frame onset ; extern INT16 framepittab, minpit, maxpit ;

extern INT16 *frame-class-mem, *onstplsv_mem, *voiced mem; extern FLOAT64 *windowl; extern FLOAT64 *buffer cla; extern FLOAT64 *Lp buffer ; <BR> <BR> <BR> extern FLOAT64 *buffer_reflO ;<BR> <BR> <BR> <BR> <BR> extern FLOAT64 *buffer_max_cla ; extern FLOAT64 *buffer_wtilt, *buffer_wmax, *buffer_wRp; extern FLOAT64 E noi, Tnoi, Mnoi, Rnoi; extern FLOAT64 **P_w, MA_avg_wRp, MA_min_wtilt ; extern INT16 SVS-Count, Vad-O-Count, FlatSpjlag; extern FLOAT64 Au value; /*------------------------------------------*/ extern FLOAT64 Rp_m_cla, lpcg_m_cla ; /*------------------------------------------*/ extern INT16 OnSet ; extern INT16 frame-class-min ; /*------------------------------------------*/ INT16 SVS_deci_mem ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> l =<BR> <BR> <BR> <BR> <BR> /*================ VAD LIBRARY PROCESSING =================*/ /*========================================================== =====================*/ extern INT16 *lag_buf; xtern FLOAT64 *pgain_buf; extern INT16 Vad, *flag_vad_mem ; extern INT16 flag; extern INT16 count sil ; extern INT16 count ext ;

extern INT16 count noise ; extern INT16 dec3_flg_mem ; extern INT16 onset ftg, countonset ; extern FLOAT64 pitch_gain_mean ; extern FLOAT64 **vad_lsf_mem; extern FLOAT64 min_energy ; extern FLOAT64 mean energy ; extern FLOAT64 *prevcmllsfdiff ; extern FLOAT64 *prev_energy ; extern FLOAT64 snr ; extern FLOAT64 mean max ; extern FLOAT64 mean s energy ; extern FLOAT64 prevminenergy ; extern FLOAT64 *min_energy_mem ; extern FLOAT64 next min energy ; extern FLOAT64 *mean lsf ; extern FLOAT64 *norm_mean_lsf; extern FLOAT64 cml lsf diff filt ; extern FLOAT64 onset trhsd ; SNR LIBRARY ===================*/ extern FLOAT64 NoiseGainFactor; extern INT16 n nois ext enc ; extern FLOAT64 NoisEng_enc, eng_old_enc, diff_lsf_m_enc, diff_eng_m_enc ; extern INT16 snr frm count, snr countvad ; extern FLOAT64 eng_m_enc ; SMO LIBRARY PROCESSING /*========================================================== =====================*/ extern FLOAT64 *Isf smootli ;

extern INT16 Nmodesub est, Nmodefrm ; texternFLOAT64 *lsf_old_smo, *ma_lsf, *dSP_buf; extern INT16 *Nsub ; extern INT16 consec low, consec high, consec vad 0 ; extern INT16 updatesnoise, updatesspeech, calls, lev_reset ; extern FLOAT64 mamaxnoise, mamax speech ; extern FLOAT64 *buffer_smo, *buffer_p, ma_cp ; extern FLOAT64 *buffer_sum_smo, *buffer_max_smo ; extern INT16 Nmodesubref, consec; extern INT16 updates; extern FLOAT64 ma max ; /*========================================================== =====================*/ FCS LIBRARY PROCESSING /*========================================================== =====================*/ extern FLOAT64 pcgm, alpha; extern INT16 lag_m, SVS_flag_m ; extern FLOAT64 *wsp_m ; extern FLOAT64 *hh_hf ; extern FLOAT64 **PHI; extern INT16 *MaxIdx ; extern INT16 **track; extern INT16 **p_track_2_5_0, **p_track_2_7_1 ; extern INT16 ***p_track_3_2_80, ***p_track_3_2_54 ; extern INT16 ** p_track_5_4_0, **p_track_5_3_1, **p_track_5_3_2, **p_track_8_4_0 ; extern FLOAT64 **unfcoddec ; // /* 13 bits */ /*------------------------------------------*/

extern FLOAT64 Stab_13b_enc ; extern FLOAT64 Stab13bdec ; /*------------------------------------------*/ /* bits /*------------------------------------------*/ extern INT64 seedbfiexc ; extern FLOAT64 Stab 15b enc ; extern FLOAT64 Stab-I 5b-enc ; /*============= FRAME ERASURE CONCEALEMENT =================*/ /*========================================================== =====================*/ extern INT16 Nbfi, bfhoh ; extern INT16 past-bfi, ppast-bfi ; extern INT16 bfi caution, nbfi count ; extern FLOAT64 *enrg_buff ; extern FLOAT64 *extdecmem ; /*====================== SIGNAL SYNTHESIS =====================*/ extern FLOAT64 *synth_mem, *synth_mem_dec, *dif_mem, *target_mem ; extern FLOAT64 *qua_synth_mem, *qua_dif_mem, *qua_target_mem, *qua_ext ; extern FLOAT64 *sigsyn_dec, *ext_dec ; /*========================================================== =====================*/ <BR> <BR> <BR> <BR> l = == extern INT16 *bitno0, *bitnol; /*========================================================== =====================*/ /*----------------------- END ------------------*/

/*========================================================== =====================*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> /*==================================================*/ /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE: gbl_var. h */ /*========================================================== =====================*/ #ifdef DIAG_SMV /*========================================================== =====================*/ <BR> <BR> <BR> DIAGNOSTICS FILE POINTERS<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* Encoder unquantized */ // FILE *fdiavad; // /* Encoder */ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FILE *fdiaspenc ; /*------------------------------------------*/ /* Floating point parameter */ /*------------------------------------------*/

/*------------------------------------------*/ /* Decoder */ /*------------------------------------------*/ #endif /*========================================================== =====================*/ /*===================== FRAME COUNTERS ==========================*/ /*========================================================== =====================*/ INT64 frmcount = 0; INT64 frmerasure = 0 ; /*================================ SMV CONTROL ================================*/ <BR> <BR> <BR> <BR> /*========================================================== =====================*/ INT16 smv_mode; INT16 fix_rate, fix_rate_mem; /*========================================================== =====================*/ <BR> <BR> <BR> <BR> /*====================== NOISE SUPRESSION ===================*/<BR> <BR> <BR> <BR> /*========================================================== =====================*/ FLOAT64 MIN_GAIN = -13.0; FLOAT64 MIN_GAIn = -13. 0; <BR> <BR> <BR> <BR> PRE AND POST PROCESSING<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FLOAT64 *pre_flt_num ; FLOAT64 *pre_flt_den; FLOAT64 *pre_flt_buf z ; FLOAT64 *pre_flt_buf p ; FLOAT64 prรฉ-gain ; FLOAT64 *lp_flt_num;

FLOAT64 *lp_flt_buf; /*------------------------------------------*/ INT16 *zeroed; FLOAT64 *zero rate ; FLOAT64 *low rate ; FLOAT64 *high rate ; FLOAT64 *low_neg ; FLOAT64 *low pos ; INT32 min-delta ; FLOAT64 zero-level ; FLOAT64 12_neg, 11_neg, 11_pos, 12_pos ; /*------------------------------------------*/ FLOAT64 tcmemdec ; FLOAT64 tc_coeff; FLOAT64tc_gain ; FLOAT64 *tc_buff_exc ; /*------------------------------------------*/ FLOAT64 *buff LTpost ; FLOAT64 *PFmemsyn ; FLOAT64 r_zero, r_pole; FLOAT64 pst scale ; FLOAT64 pst_hp_mem; /*------------------------------------------*/ FLOAT64 *pst_flt_num; FLOAT64 *pst_flt_den ; FLOAT64 *pst_flt buf z ; FLOAT64 *pst_flt_buf_p; FLOAT64 pst_gain;

/*========================================================== =====================*/ <BR> <BR> <BR> /*==================== LPC ANALYSIS ========================*/ /*========================================================== =====================*/ FLOAT64 *siglpc; /___________________________________________________________ _________________*/ /* LPC analysis */ // FLOAT64 *Ipc_window ; FLOAT64 *Ipc windowl ; FLOAT64 *Ipc_window2 ; /*------------------------------------------*/ /* Tilt analysis */ // FLOAT64 *tilt window; /*------------------------------------------*/ /* Bandwidth expansion */ /*------------------------------------------*/ FLOAT64 *bwefactor ; /*------------------------------------------*/ /* LPC parameters */ // FLOAT64 pderr ; FLOAT64 *rxx, **refl, **pdcf, **pdcfq, **pdcfq_dec ; FLOAT64 *Isf new, *Isf old, *Isf mid ; <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FLOAT64 erg, Ipcgain ; FLOAT64 sub_lpcg;

/*------------------------------------------*/ FLOAT64 *IntLSF C ; /*==================== Weighted Speech =====================*/ /*========================================================== =====================*/ FLOAT64 r pole_ws ; FLOAT64 **wpdcf zero, **wpdcf pole ; FLOAT64 *wspeech, *wspeech mem ; FLOAT64 Z1_ws_1, Z1_ws_2; FLOAT64 *ModiSig_m, *tmp_ws_m; /*========================================================== =====================*/ /*================= Fixed codebook search =================*/ FLOAT64 **fcod, **unfcod; FLOAT64 **quafcod, **quaunfcod; /*========================================================== =====================*/ /*======================== Residual and target signal buffer =================*/ /*========================================================== =====================*/ <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== =====================*/<BR> <BR> <BR> <BR> <BR> Gain VQ<BR> INT16 GainNonnDeci, GainModiDeci; FLOAT64 pgain past ; FLOAT64 pgain_past dec ; FLOAT64 **qua_gainQ ; FLOAT64 **gaincb2128 ; FLOAT64 **gain_cb_2_128_8_5;

FLOAT64 *past_energyq_4d; FLOAT64 *pastenergyq3d ; FLOAT64 *pastenergyq2d ; FLOAT64 *gp_buf; FLOAT64 past_fixed_energy; FLOAT64 *PrevBetaPitch ; FLOAT64 *energy_pred_coeff_1; FLOAT64 *energy_pred_coeff_2; FLOAT64 *energy_pred_coeff_3; FLOAT64 *energypredcoeff4dl ; FLOAT64 *energy_pred_coeff4d_2; FLOAT64 *energy_pred_coeff4d_3; FLOAT64 *energy_pred_coeff4d_4; FLOAT64 *predenergyd38 ; FLOAT64 *pred_energy_d410; FLOAT64 gp_mean ; FLOAT64 gpfec ; #include "gain_vq.tab" LSF quantizers /*========================================================== =====================*/ FLOAT64 ***lsf cb 08k ; FLOAT64 ***lsf_cb_40k; FLOAT64 ***lsf_cb_85k; INT16 *stagecand08k,

INT16 *stagecand40k ; INT16 *stage_cand_85k; #include "lsf_vq.tab" INT16 *MS08k ; INT16 *MS40k ; INT16 *MS_85k ; FLOAT64 *last_qlsf; FLOAT64 *Isfq-old, *Isfq_old dec ; FLOAT64 *Mean ; FLOAT64 **qes ; FLOAT64 **qesdec ; FLOAT64 *lsfq_mem_dec; FLOAT64 *lsfq_mem_enc; PITCH OPEN ==========================*/ INT16 *ol_lag; INT16 *lag; INT16 lag1, ! owpit, highpit ; FLOAT64 *Rp_sub; FLOAT64 pitchf ; /*------------------------------------------*/ /*------------------------------------------*/ FLOAT64 *PitLagTab5b ;

FLOAT64 *PitLagTab7b; FLOAT64 *PitLagTab8b; FLOAT64 *SincWindows; /*------------------------------------------*/ INT16 VUVmm, pitch_m, pitch_mm, IoptO ; INT16 *PITmaxO ; INT16 LagCount, VadCount, Av_lag ; FLOAT64 Rpm ; FLOAT64 *RmaxO ; /*------------------------------------------*/ FLOAT64 *pitch f mem ; /*============================ CLOSED PITCH ====================*/ FLOAT64 *ext ; FLOAT64 *SincWindows E ; FLOAT64 *NewTg; FLOAT64 *lag f INT16 pitchindex, prepitchindex ; <BR> <BR> <BR> <BR> <BR> <BR> PITCH PRE-PROCESSING /*========================================================== =====================*/ FLOAT64 *SincWindows PP ; FLOAT64 Detaypp, LastRp ; INT16 frameclassppm ; FLOAT64 *targ_mem ; /*========================================================== =====================*/

/*============================ PRC LIBRARY PROCESSING=================*/ FLOAT64 cl_Eg, ol_Eg; FLOAT64 m_lpc_gain; <BR> <BR> /*========================================================== =====================*/ /*================= GCB LIBRARY PROCESSING ===============*/ INT64 seed_exc ; FLOAT64 Zlgcb ; FLOAT64 refenggcb ; INT16 rate mem ; INT64 seeddec ; CLA LIBRARY PROCESSING /*========================================================== =====================*/ INT16 VUV, VUVm ; INT16 frame_class, frame_class_m, frame_class_pp; FLOAT64 energy, energy_m ; INT16 frame onset; INT16 framepit tab, minpit, maxpit; INT16 *frame_class_mem, *onstplsv_mem, *voiced_mem; FLOAT64 *windowl; FLOAT64 *buffer_cla ; FLOAT64 *Lp buffer ; FLOAT64 *buffer_refl0; FLOAT64 *buffer_max_cla ; FLOAT64 *buffer_wtilt, *buffer_wmax, *buffer_wRp ; FLOAT64 Enoi, Tnoi, M noi, Rnoi; FLOAT64 **P_w, MA_avg_wRp, MA_min_wtilt; INT16 SVS_Count, Vad_0_Count, FlatSp_Flag;

FLOAT64 Avva!ue ; /*------------------------------------------*/ FLOAT64Rp_m_cla, lpcg_m_cla; /*------------------------------------------*/ FLOAT64av_pit_lag, av_pit_g; INT16 PPmodelm,PPfrmcount ; /*------------------------------------------*/ //INT16SVS-deci_m ; /*------------------------------------------*/ INT16OnSet; INT16 frame classmm ; /*------------------------------------------*/ INT16 SVS deci mem ; // vau VAD LIBRARY =====================*/ INT16 *lag_buf; FLOAT64 *pgain_buf; INT16 Vad, *flag_vad_mem ; INT16 flag ; INT16 count_sil; INT16 countext ;

INT16 count noise ; INT16 dec3_flg_mem; INT16 onset_flg, count_onset; FLOAT64 pitch_gain_mean ; FLOAT64 **vad_lsf_mem; FLOAT64 min_energy; FLOAT64 mean energy ; FLOAT64 *prev-cml_lsf diff, FLOAT64 *prev energy ; FLOAT64 snr; FLOAT64 mean max ; FLOAT64 mean_s_energy; FLOAT64 prevminenergy ; FLOAT64 *min energy mem ; FLOAT64 next_min_energy; FLOAT64 *mean-isf, FLOAT64 *norm_mean_lsf; FLOAT64 cml lsf diff filt ; FLOAT64 onset trhsd ; sur LIBRARY PROCESSING FLOAT64 NoiseGainFactor; INT16 nnoisextenc ; FLOAT64 NoisEng_enc, eng_old_enc, diff_lsf_m_enc, diff_eng_m_enc; INT16 snr_frm_count, snr_count_vad; FLOAT64 eng m enc ; /*=========================== SMO LIBRARY PROCESSING ===========================*/ <BR> <BR> <BR> <BR> /*========================================================== =====================*/ FLOAT64 *lsf_smooth;

INT16 N modesubest, Nmodefrm ; FLOAT64*lsf_old_smo, *ma_lsf, *dSP_buf; INT16 *Nsub ; INT16 conseclow, consechigh, consecvad 0 ; INT16 updatesnoise, updatesspeech, calls, levreset ; FLOAT64 mamaxnoise, mamaxspeech ; FLOAT64 *buffer_smo, *buffer_p, ma_cp ; FLOAT64*buffer_sum_smo, *buffer_max_smo; INT16 Nmode subref, consec; INT16 updates; FLOAT64 mamax ; FCS LIBRARY =================*/ FLOAT64 Ipcg_m, alpha ; INT16lag_m, SVS_flag_m; FLOAT64 *wsp m ; FLOAT64 *hh_hf; FLOAT64 **PHI ; INT16 *MaxIdx ; INT16 **track; INT16**p_track_2_5_0, **p_track_2_7_1; INT16***p_track_3_2_80, ***p_track_3_2_54; INT16**p_track_5_4_0, **p_track__5_3_1, **p_track_5_3_2, **p_track_8_4_0; FLOAT64 **unfcoddec ; *______________________________________________ /* 13 bits */ /*------------------------------------------*/

FLOAT64 Stab_13b_enc ; FLOAT64 Stab13bdec ; /*__________________________________________________________ _________________* /* 15 bits */ /*------------------------------------------*/ INT64 seedbfiexc ; FLOAT64 Stab_15b_enc ; FLOAT64 Stab15bdec ; /*================ FRAME ERASURE CONCEALEMENT ==================*/ INT16 Nbfi, bfhoh ; INT16 pastbfi, ppastbfi ; INT16 bfi caution, nbfi count ; FLOAT64 *enrg_buff; FLOAT64 *extdecmem ; /*========================================================== =====================*/ /*====================== SIGNAL SYNTHESIS ===================*/ FLOAT64 *synthmem, *synthmemdec, *difmem, *targetmem ; FLOAT64 *qua_synth_mem, *qua dif mem, *qua target mem, *quaext ; FLOAT64 *sigsyn_dec, *ext_dec ; /*========================================================== =====================*/ INT16 *bitno0, *bitnol; /*========================================================== =====================*/ l == l

/*========================================================== =====================*/ /*==================================================*/ /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA 92660 */ /*------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: gputil.c */ /*==================================================*/ /*------------------------------------------*/ /*--------------------------------INCLUDE------------------- ----------------*/ /*------------------------------------------*/ &num include"typedef. h" &num include"main. h" #include"mcutil. h" #include"gputil. h" /*------------------------------------------*/ <BR> <BR> <BR> <BR> _*<BR> <BR> <BR> <BR> <BR> <BR> // /*==================================================*/ /* FUNCTIONS. file_open_r 0 */ /*------------------------------------------*/ /* PURPOSE: These functions open the file named file name, */ /* and return a pointer to this */ /*------------------------------------------*/ /* INPUT ARGUMENTS : file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS: None. */

/*------------------------------------------*/ /* RETURN ARGUMENTS : _ pointer to the */ /*========================================================== =====================*/ FILE *file open r (char *file name) { FILE *file_ptr; /*------------------------------------------*/ if ( (file_ptr = fopen (file_name,"r")) == NULL) { #ifdef VERBOSE printf ("\file name: %s\n", file_name) ; nrerror ("error opening file (r)...") ; #endif } &num endif return (file_ptr); /*------------------------------------------*/ } /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTIONS file_open_w () */ /*------------------------------------------*/ /* PURPOSE. These functions open the file named file name, */ /* and return a pointer to this */ /*------------------------------------------*/ /* INPUT ARGUMENTS : file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : None. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : _ pointer to the file. */

/*========================================================== =====================*/ FILE *file open w (char *file name) { // FILE *file_ptr ; /*------------------------------------------*/ if ( (file ptr = fopen (file name,"w")) == NULL) { #ifdef VERBOSE printf ("\file name: %s\n", file_name) ; nrerror ("error opening file (w)...") ; #endif // return (file_ptr) ; /*------------------------------------------*/ /*/ /*========================================================== =====================*/ /* FUNCTIONS fileopenrb () */ /*------------------------------------------*/ /* PURPOSE : These functions open the file named file name, */ /* and return a pointer to this file. */ /*------------------------------------------*/ /* INPUT ARGUMENTS : file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : None. */ // /* RETURN ARGUMENTS: _ pointer to the */ /*========================================================== =====================*/

FILE*file_open_rb (char *file_name) <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FILE *file_ptr ; /*------------------------------------------*/ if ( (file_ptr = fopen (file name,"rb")) == NULL) #ifdef VERBOSE printf ("\file name: %s\n", file_name) ; nrerror ("error opening file (rb)...") ; &num endif /*------------------------------------------*/ return (filetr) ; return (file_ptr); /*------------------------------------------*/ } /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTIONS : file_open_wb () */ /*------------------------------------------*/ /* PURPOSE. These functions open the file named file_name, */ /* and return a pointer to this file. */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _file name. */ // /* OUTPUT ARGUMENTS : None. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : _ pointer to the */ /*========================================================== =====================*/ FILE *fileopenwb (char *file_name)

/*------------------------------------------*/ FILE *file ptr ; /*------------------------------------------*/ if ( (file_ptr = fopen (file name,"wb")) == NULL) #ifdef VERBOSE printf ("\file name: %s\n", file_name) ; nrerror ("error opening file (wb)...") ; &num endif /*------------------------------------------*/ retrn (file_ptr); /*------------------------------------------*/ } /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTIONS output_waves_fle () */ // /* PURPOSE. These functions writes an array of double */ /* XWAVES format */ // /* INPUT ARGUMENTS: _ (char file-name: name of the xwaves file. */ /* : _ (FLOAT64 *) x array of */ /* N size of the x array. */ /* :_(FLOAT6) scale : scale value. */ /* min min range value.

/* max max range */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : None. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : _ pointer to the */ /*========================================================== =====================*/

void output_waves_file (char*fle_name, FLOAT64 *x, INT32 N, FLOAT64 scale; \ FLOAT64 min, FLOAT64 max) /*/ FILE *file_ptr ; INT32 i; INT16 *waves; /*------------------------------------------*/ waves = svector (0, N-1) ; file-pur = file_open_wb (file_name) ; waves [0] = (INT16) (max); waves [1] = (INT16) (min) ; fwrite (waves, sizeof (INT16), 2L, file_ptr) ; for (i=0; i<N i++) waves [i] = (INT16) (scale * x [i]) ; fwrite (waves, sizeof (INT16), N, file-ptr) ; fclose (file_ptr) ; free svector (waves, 0, N-1) ; /*--*/ return ; /*------------------------------------------*/ } /*========================================================== =====================*/

/* FUNCTION file length Q */ /*------------------------------------------*/ /* PURPOSE : This function returns the length of a file */ /* bytes. */ /*------------------------------------------*/ /* INPUT ARGUMENTS : Pointer to a */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS : None. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : _ Length of the file in bytes. */ INT64 file length (FILE *file_ptr) { // INT64 file-size ; /*------------------------------------------*/ file_size= ftell (file_ptr) ; /*------------------------------------------*/ return (file_size); // } /___________________________________________________________ _________________*/ /*========================================================== =====================*/ /* FUNCTION read_signal_double () */ /*------------------------------------------*/ /* PURPOSE : This function reads short samples from a */ /* stores them in an array of */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _Name of the signal */ /* _ Number of */ /*------------------------------------------*/

/*OUTPUT ARGUMENTS : Array of double. */ /*------------------------------------------*/ /* RETURN ARGUMENTS: None. */ /*========================================================== =====================*/ void read_signal_double (FILE *file_ptr, FLOAT64 *array, INT64 N) { /*------------------------------------------*/ INT16 *array_short ; INT64 i; /*------------------------------------------*/ array_short = svector (0, N-1) ; if ( (fread (array short, sizeof (INT16), (INT32) N, file_ptr)) ! = (sizet) N) nrerror ("error reading file for (i=O ; i < N ; i++) * (array+i) = (FLOAT64) (* (array_short+i)) ; free_svector (array_short, 0, N-1); /*------------------------------------------*/ return; /*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION write_signal_double () */ /*------------------------------------------*/ /* PURPOSE: This function writes short samples to a file */ /* from an array of */

/*------------------------------------------*/ /* INPUT ARGUMENTS : _ Array of */ /* Number of samples. */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ Output short file. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void write signal double (FILE *file_ptr, FLOAT64 *array, INT64 N) /___________________________________________________________ ________*/ INT16 *array_short ; INT64 i; /*------------------------------------------*/ array_short = svector (0, N-1) ; for (i=O ; i<N ; i++) * (array_short+i) = (INT16) nint (* (array+i)); if ( (fwrite (array_short, sizeof (INT16), (INT32) N, file_ptr) (sizet) N) nrerror ("error writing file..."); free_svector (array_short, 0, N-1) ; /*------------------------------------------*/ return; /*------------------------------------------*/ // /*========================================================== =====================*/

/* FUNCTION get int */ /*------------------------------------------*/ /* PURPOSE These function read a value from a text file. */ /*/ /* INPUT ARGUMENTS : _ file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT32*) val: output */ /*------------------------------------------*/ <BR> <BR> <BR> <BR> /* RETURN ARGUMENTS : None. */<BR> <BR> <BR> <BR> <BR> /____/ void get int (FILE *file_ptr, INT32 *val) { // char buffer [NB_MAX_CHAR]; /*------------------------------------------*/ fgets (buffer, NBMAXCHAR, fileptr) ; sscanf (buffer, "%d", val); ____________________________________________________________ _______* return; /*/ /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTION : get_two_int (). */ /*------------------------------------------*/ /* PURPOSE : These function read two values from a text */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ file */ /*------------------------------------------*/ /* OUTPUT */

/* _ (INT32*) val 1 : output */<BR> <BR> <BR> <BR> <BR> <BR> (INT32*) val2 output */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void get two int (FILE *file_ptr, INT32 *vall, INT32 *val2) { /___________________________________________________________ ________*/ char buffer [NB_MAX_CHAR]; /*------------------------------------------*/ fgets (buffer, NBMAXCHAR, file ptr) ; sscanf (buffer, "%d %d", val1, val2); // return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =====================*/ /* FUNCTION get-long /*------------------------------------------*/ /* PURPOSE These function read a value from a text */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT64*) val: output */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ void get_long (FILE *file_ptr, INT64 *val)

/*------------------------------------------*/ char buffer [NB_MAX_CHAR]; // fgets (buffer, NB_MAX_CHAR, file_ptr); sscanf (buffer,"% Id", val); /___________________________________________________________ ________*/ return ; /*------------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =====================*/ <BR> <BR> <BR> /* FUNCTION get float Q. */<BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* PURPOSE These function read a value from a text */ /*------------------------------------------*/ /* INPUT ARGUMENTS: _ file */ // /* OUTPUT ARGUMENTS: _ (FLOAT32*) val: output */ // /* RETURN ARGUMENTS : None. */ <BR> <BR> <BR> l = void get FLOAT32 (FILE *file_ptr, FLOAT32 *val) // char buffer [NB_MAX_CHAR]; /*------------------------------------------*/

fgets (buffer, NBMAXCHAR, file_ptr) ; sscanf (buffer,"/of', val); /*------------------------------------------*/ return; /*/ // /*========================================================== =====================*/ /* FUNCTION get_double (). */ // /* PURPOSE : These function read a value from a text */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ file */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) val : output */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ <BR> <BR> <BR> ------------- void get_double (FILe *file_ptr, FLOAT64 *val) /*/ char buffer [NB_MAX_CHAR] ; /*------------------------------------------*/ fgets (buffer, NBMAXCHAR, fileptr) ; sscanf (buffer,"% lf", val) ; /*------------------------------------------*/

return ; /*------------------------------------------*/ /___________________________________________________________ _________________*/ /* FUNCTION inidvector (). */ /*------------------------------------------*/ /* PURPOSE This function initializes a vector of FLOAT64 */ /* to a given value. */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) v vector of double. */ /* _(INT32) nl */ /* _ (INT32) nlt */ /* _ (FLOAT64) val */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) initialized v */ <BR> <BR> <BR> //<BR> <BR> <BR> <BR> /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void ini dvector (FLOAT64 *v, INT32 nl, INT32 nh, FLOAT64 val) { // INT32 i; // for (i = nl; i <= nh; i ++) v [i] = val; /*------------------------------------------*/ return ; /___________________________________________________________ ________*/

/*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTION ini_svector (). */ <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> /* PURPOSE This function initializes a vector of */ /* to a given */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (INT16 *) v vector of */ /* (INT32) */ /* (INT32) */ /* _(INT16) val */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS : _ (INT16 *) initialized v vector. */ /*------------------------------------------*/ /* RETURN ARGUMENTS None. */ void inisvector (INT16 *v, INT32 nl. INT32 nh, INT16 val) <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ INT32 i; /*------------------------------------------*/ for (i = nl ; i <= nh; i ++) v [i] = val ; /___________________________________________________________ ________*/ return; <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //

/* FUNCTION ini_ivector (). */ /*------------------------------------------*/ /* PURPOSE. This function initializes a vector of */ /* to a given */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (INT32 *) v vector of */ /* (INT32) */ /* _ (INT32) nh */ /* _ (INT32) val */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT32 *) initialized v */ /*------------------------------------------*/ /* RETURN ARGUMENTS: None. */ /*========================================================== =====================*/ void ini ivector (INT32 *v, INT32 nl, INT32 nh, INT32 val) /___________________________________________________________ ________*/ INT32 i; // for (i = nl; i <= nh; i ++) v [i] = val ; /*--.......---.........---............--..----*/ return; /*------------------------------------------*/ } /*------------------------------------------*/ /*========================================================== =====================*/ /* FUNCTION cpysvector (). */ /*------------------------------------------*/ /* PURPOSE. This function writes vl to */

/*------------------------------------------*/ /* INPUT ARGUMENTS : _ (INT16 *) vl vector of */ /* (INT16 *) v2 vector of */ (INT32) nl /* _(INT32) nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT16*) new v2 */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ void cpy_svector (INT16 *vl, INT16 *v2, INT32 nl, INT32 nh) /___________________________________________________________ ________*/ INT32 i; /*------------------------------------------*/ for (i = nl ; i <= nh; i ++) v2 [i] = vl [i] ; // return ; /*------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> /*-.----------.------------*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /*========================================================== =====================*/ /* FUNCTION. cpy_ivector Q. */ /*------------------------------------------*/ /* PURPOSE This function writes vl to */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (INT32*) vl vector of */

/* (INT32*) v2 vector of */ (INT32) nl /* _(INT320 nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT32*) new v2 */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void cpy_ivector (INT32 *vl, INT32 *v2, ONT32 nl, INT32 nh) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> { INT32 i; /*------------------------------------------*/ for (i=nl ; i<=nh ; i++) v2 [i] = vl [i] ; /*------------------------------------------*/ return; /*------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* FUNCTION : cpy_dvector Q. */ /*------------------------------------------*/ /* PURPOSE. This function writes vl to */ /*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* _ (FLOAT64*) v2 vector of double. */ (INT32) nl /* _(INT32) nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) new v2 */

/*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void cpy_dvector (FLOAT64 *vl, FLOAT64 *v2, INT32 nl, INT32 nh) /*/ INT32 i; /*/ for (i = nl; i <= nh ; i ++) v2 [i] = vl [i] ; /*------------------------------------------*/ return; /*------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION sfr_ivector (). */ /*------------------------------------------*/ /* PURPOSE. This function shift rigth v elements of */ /* position. */ // /* INPUT ARGUMENTS : _ (INT32 *) vl vector of */ /* (INT32) n number of rigth */ /* _ (INT32) nl lower */ /* (INT32) nh higher */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (INT32 *) v2 shifted rigth vl */ /*------------------------------------------*/ /* RETURN ARGUMENTS : _ None. */ /*========================================================== =====================*/

void sfr ivector (INT32 *vl, INT32 *v2, INT32 n, INT32 nl, INT32 nh) { /___________________________________________________________ ________*/ INT32 i; /*------------------------------------------*/ for (i = nh-n; i >= nl ; i--) v2[i+n] = v1 [i]; /*------------------------------------------*/ return; /*------------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =====================*/ /* FUNCTION sfr_dvector (). */ // /* PURPOSE. This function shift roigth v elements of n */ /* position. */ /*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* (INT32) n number of rigth */ /* (INT32) nl lower */ /* _ (INT32) nli higher */ // /* OUTPUT ARGUMENTS : _ (FLOAT64*) v2 shifted rigth vl */ // /* RETURN ARGUMENTS: None. */ /*========================================================== =====================*/ void sfrdvector (FLOAT64 *vl, FLOAT64 *v2, INT32 n, INT32 nl, INT32 nh) // INT32 i;

/*------------------------------------------*/ for (i = nh-n ; i >= nl ; i--) v2 [i+n] = vl [i] ; /*------------------------------------------*/ return; /*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION rev_devector (). */ /*/ /* PURPOSE. This function reverse the order of */ /* elements of a */ /*------------------------------------------*/ /* INPUT ARGUMENTS: _ (FLOAT64*) vl vector of */ (INT32) nl lower */ /* _ (INT32) nh higher */ // /* OUTPUT ARGUMENTS : _ (FLOAT64*) v2 reversed vl */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ void revdvector (FLOAT64 *vl, FLOAT64 *v2, INT32 nl, INT32 nh) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> /*/ INT32 i; /*------------------------------------------*/ for (i=nl; i<=nh; i++) v2 [i] = vl [nh-i] ;

/*------------------------------------------*/ return; /*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION scadvector (). */ /*------------------------------------------*/ /* PURPOSE : This function scale vl into v2 by the */ <BR> <BR> <BR> /* s. */<BR> <BR> <BR> <BR> // /* INPUT ARGUMENTS : _(FLOAT64*) v1 vector of */ /* _(FLOAT64) s scale */ (INT32) nl /* (INT32) */ /*/ /* OUTPUT ARGUMENTS: _ (FLOAT64*) v2 scaled */ /*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void scadvector (FLOAT64 *vl, FLOAT64 s, FLOAT64 *v2, INT32 nl, INT32 nh) { /*/ INT32 i; /*/ for (i = nl; i <= nh; i ++) v2 [i] = s * vl [i] ; /*------------------------------------------*/ return;

/*------------------------------------------*/ } /*========================================================== =====================*/ <BR> <BR> <BR> <BR> /* FUNCTION. dot dvector Q. */<BR> <BR> <BR> <BR> // /* PURPOSE : This function calculate the dot */ /* between vl and v2 */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* (FLOAT64*) v2 vector of */ <BR> <BR> <BR> /* _ (INT32) nl */<BR> <BR> <BR> <BR> /* _ (INT32) */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 *) s dot */ /*-----..--.-.--.---.,---------*/ /* RETURN ARGUMENTS: None. */ void dot dvector (FLOAT64 *vl, FLOAT64 *v2, FLOAT64 *s, INT32 nl, INT32 nh) { /___________________________________________________________ ________*/ INT32 i; /*------------------------------------------*/ (*s) = 0.0; for (i = nl; i <= nh; i ++) (*s) += vl [i] * v2 [i]; /*------------------------------------------*/ return;

/*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION. adddvector (). */ /*------------------------------------------*/ /* PURPOSE. This function adds vl to v2 in */ /*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* _ (FLOAT64*) v2 vector of */ /* _ (INT32) nl */ /* _(INT32) nh */ // /* OUTPUT ARGUMENTS : _ (FLOAT64*) v=vl+v2 */ // /* RETURN ARGUMENTS : None. */ void adddvector (FLOAT64 *vl, FLOAT64 *v2, FLOAT64 *v, INT32 nl, INT32 nh) // INT32 i; // for (i = nl ; i <= nh; i ++) v [i] =v1 [i] + v2 [i]; /*------------------------------------------*/ return; // /*--------------------------------------------------*/

/* FUNCTION wad_dvector (). */ /*------------------------------------------*/ /* PURPOSE. This function adds vl to v2 in */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* _ (FLOAT64) wl weigth for vl. */ /* _ (FLOAT64*) v2 vector of */ /* (FLOAT64) w2 weigth for */ /* (INT32) nl */<BR> /* _ (INT32) */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS: _ (FLOAT64*) v = wl * vl + w2 * v2 */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void wad_dvector (FLOAT64 *v1, FLOAT64 w1, FLOAT64 *v2, FLOAT64 w2, FLOAT64 *v, INT32 nl, INT32 nh) { /*/ INT32 i; /*------------------------------------------*/ for (i=nl ; i <= nh ; i++) v [i] = wl * vl [i] + w2 * v2 [i] ; /*------------------------------------------*/ return; /*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION mul dvector (). */

/*------------------------------------------*/ /* PURPOSE. This function multiply vl by v2 in */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* _ (FLOAT64*) v2 vector of */ /* _ (INT32) */ /* (INT32) */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) v=vl*v2 */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void mul dvector (FLOAT64 *vl, FLOAT64 *v2, FLOAT64 *v, INT32 nl, INT32 nh) { INT32 i; /*------------------------------------------*/ for (i = nl ; i <= nh ; i ++) v [i] = vl [i] * v2 [i] ; // return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /*========================================================== =====================*/ /* FUNCTION dif dvector (). */ /*------------------------------------------*/ /* PURPOSE : This function substracts v2 to vl into */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of */ /* _ (FLOAT64*) v2 vector of */

/* (INT32) */ /* _(INT32) nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) v=vl-v2 vector. */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> void dif dvector (FLOAT64 *v1, FLOAT64 *V2, FLOAT64 *V, INT32 nl, INT32 nh)<BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> 1NT32 ; INT32 i; /*------------------------------------------*/ for (i=nl; i<= nh; i++) v [i] = v1 [i] - v2 [i] ; /*------------------------------------------*/ return; // } /*========================================================== =====================*/ /* FUNCTION cml dvector (). */ /*------------------------*/ /* PURPOSE This function accumulates v2 to vl. */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (FLOAT64*) vl vector of double. */ (FLOAT64*) v2 vector of double.

/* _(INT32) nl */ /* _ (INT32) nll */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) new vl=vl+v2 vector. */ /*------------------------------------------*/

/* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void cmldvector (FLOAT64 *vl, FLOAT64 *v2, INT32 nl, INT32 nh) /___________________________________________________________ ________*/ INT32 i; /*------------------------------------------*/ for (i=nl; i <= nh; i++) v1 [i] += v2 [i]; /*------------------------------------------*/ return ; <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== =====================*/ /* FUNCTION cml_svector (). */ /*------------------------------------------*/ /* PURPOSE This function accumulates v2 to */ /*------------------------------------------*/ /* INPUT ARGUMENTS : _ (INT16*) vl vector of */ /* (INT16*) v2 vector of */ /* _ (INT32) nl */ /* _ (INT32) nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) new vl=vl+v2 */ /*------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =====================*/ void cml svector (INT16 *vl, INT16 *v2, INT32 nl, INT32 nh)

/*------------------------------------------*/ INT32 i ; /*------------------------------------------*/ for (i = nl; i <= nh; i ++) v1 [i] += v2 [i]; /*------------------------------------------*/ return; /*------------------------------------------*/ } /*-------------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION max-dvector 0.

/*------------------------------------------*/ /* PURPOSE This function finds the maximum of v. */ /*-*/ /* INPUT ARGUMENTS : (FLOAT64*) v vector of double. */ /* _ (INT32) nl */ /* _ (INT32) */ // /* OUTPUT ARGUMENTS : _ (FLOAT64*) max. */ // /* RETURN ARGUMENTS: None. */ <BR> <BR> <BR> l = void max dvector (FLOAT64 *v, FLOAT64 *max, INT32 nl, INT32 nh) { /*__________________________________________________________ _________*/ INT32i; /*------------------------------------------*/

for (i = n1+1, *max = * (v+nl) ; i <= nh; i ++) *max = ( (* (v+i) > *max)? * (v+i): *max); /*------------------------------------------*/ return; /*------------------------------------------*/ } /*========================================================== =====================*/ /* FUNCTION min dvector (). */ /*------------------------------------------*/ /* PURPOSE This function finds the minimum of v. */ /*------------------------------------------*/ /* INPUT ARGUMENTS (FLOAT64*) v vector of */ /* _ (INT32) */ /* _(INT32) nh */ /*------------------------------------------*/ /* OUTPUT ARGUMENTS : _ (FLOAT64*) */ // /* RETURN ARGUMENTS : None. */ void min dvector (FLOAT64 *v, FLOAT64 *min, INT32 nl, INT32 nh) // INT32 i; INT32 i; /*------------------------------------------*/ for (i= nl+l, *min = *(v+nl); i <=nh; i++) *min = ( (* (v+i) < *min)? * (v+i): *min) ; /*------------------------------------------*/ return;

/*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION. limit dvector (). */ /*------------------------------------*/ /* PURPOSE. This function limits the range of v. */ /*/ /* INPUT ARGUMENTS : _ (FLOAT64*) v vector of double. */ (INT32) nl /* _(INT32) nh */ <BR> <BR> <BR> (FLOAT64) min<BR> <BR> <BR> <BR> <BR> (FLOAT64) max /*------------------------------------*/ /*------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =========*/ void Hmitdvector (FLOAT64 *v, INT32 nl, INT32 nh, FLOAT64 min, FLOAT64 max) { // INT32 i; /*------------------------------------*/ for(i= nl; i <= nh; i ++) { * (v+i) = ( (* (v+i) < min)? min : * (v+i)); * (v+i) = ( (* (v+i) > max)? max: * (v+i)); /___________________________________________________________ ________*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /*------------------------END-------------------*/ 5/*========================================================= =========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ // /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* PROTOYPE FILE: gputil. li /*========================================================== =========*/ /*------------------------------------*/ /___________________________________________________________ _________________*/ FILB *file_open_r (char*); FILE *file_open_w (char *) ; FILE *file open rb (char *) ; FILE *file open_wb (char *) ; void output_waves_file (char*, FLOAT64 *, INT32, \ FLOAT64, FLOAT64, FLOAT64); INT64 file-length (FILE) ; void read signal double (FILE *, FLOAT64 *, INT64) ; void write signal double (FILE FLOAT64 INT64 void get int (FILE *file_ptr, INT32 *val) ; void get-long FILE *file_ptr, INT64 *val) ; void get float (FILE *file_ptr, FLOAT32 *val) ; void get_double (FILE *file_ptr, FLOAT64 *val) ; void get two int (FILE *fileptr, INT32 *, INT32 *) ;

void ini_svector (INT16 *, INT32, INT32, INT16) ; void ini_ivector (INT32 *, INT32, INT32, INT32); voidinidvector (FLOAT64 *, INT32, INT32, FLOAT64); void cpy_svector (INT16 *, INT16 *, INT32, INT32) ; void cpy_ivector (INT32 *, INT32 *, INT32, INT32); void cpy_dvector (FLOAT64 *, FLOAT64 *, INT32, INT32) ; voidrevdvector (FLOAT64 *, FLOAT64 *, INT32, INT32); voidsfrdvector (FLOAT64 *, FLOAT64 *, INT32, INT32, INT32); void sfr ivector (INT32 *, INT32 *, INT32, INT32, INT32); voidscadvector (FLOAT64 *, FLOAT64, FLOAT64 *, INT32, INT32); void dot dvector (FLOAT64 *, FLOAT64 *, FLOAT64 *, INT32, INT32); voidcmldvector (FLOAT64 *, FLOAT64 *, INT32, INT32) ; voidcmlsvector (INT16 *, INT16 *, INT32, INT32) ; void max_dvector (FLOAT64 *, FLOAT64 *, INT32, INT32); void min dvector (FLOAT64 *, FLOAT64 *, INT32, INT32); voidadddvector (FLOAT64 *, FLOAT64 *, FLOAT64 *, INT32, INT32); void wad dvector (FLOAT64 *, FLOAT64, FLOAT64 *, FLOAT64, FLOAT64 *, INT32, INT32); void mul_dvector (FLOAT64*, FLOAT64*, FLOAT64*, INT32, INT32); void dif_dvector (FLOAT64 *, FLOAT64 *, FLOAT64 *, INT32, INT32); void limit_dvector (FLOAT64 *, INT32, INT32, FLOAT64, FLOAT64) ; /*========================================================== =========*/

/*========================================================== =========*/ /*========================================================== */ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*/ /* Copyright (C) 2000 Conexant System */ /*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE : lib bit. c */ /*========================================================== */ /*--------------------------------------*/ /*----------------INCLUDE--------------------*/ include"typedef. h" &num include"typedef. h" #include"main. h" &num include"const. h" #include "ext_var.h" #include"gputil. h" #include"mcutil. h" #include "lib_bit.h" /*------------------------------------*/ /*-----------------------------FUNCTIONS-------------------- -------------*/ /*------------------------------------*/ /* FUNCTION: BIT init lib 0. */ /*-----------------------------*/ /* PURPOSE: Performs the bit packing library */ /*-----------------------------*/ /*ALGORITHM */

/*-----------.--.----.-----.-*/ /* INPUT ARGUMENTS /*None.*/ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ None.

/*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*------------------------------------*/ /* RETURN */ /* _None. */ /*========================================================== =========*/ void BIT_init_lib (void) <BR> <BR> <BR> <BR> <BR> <BR> <BR> void BIT init lib (void)<BR> // bitnoO [O] = 7; bitno0 [l] = 6; bitnoO [2] = 2; bitnol [0] = 4; bitnol [l] = 4; bitno1[2] = 3; /*------------------------------------*/ return; /*------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : BIT bitpack Q. */ /*------------------------------------*/ /* PURPOSE: This function converts the encoder indices */ /* the bit-stream. */

/*------------------------------------*/ /*INPUT ARGUMENTS*/ /* _(INT16) in: input */ /* _(INT16) NoOfBits: number of bits. */ /*------------------------------------*/ /* OUTPUT */ /* (UNSINT16*) TrWords: trasmitted word. */ /* _(INT16 *) ptr: bit and word pointers. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS*/ /* None. */ /*------------------------------------*/ /* RETURN */ /* None. */ <BR> <BR> <BR> - void BIT bitpack (INT16 in, UNS_INT16 *TrWords, INT16 NoOfBits, INT16 *ptr) /*------------------------------------*/ INT16 temp ; UNSINT16 *WordPtr; /*/ WordPtr = TrWords + ptr [1]; *ptr-= NoOfBits ; if (*ptr >= 0) *WordPtr = *WordPtr | (in ยซ *ptr) ; else { temp = in >> (-*ptr); *WordPtr= *WordPtr | temp; WordPtr++; *ptr = 16 + *ptr; *WordPtr = (INT16) ( (INT64) ( (INT64) in << *ptr) & Oxflff) ;

ptr [l] = (INT16) (WordPtr-TrWords); /*------------------------------------*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : BITbitunpack (). */ /*-*/ /* PURPOSE : This function converts the decoder */ /* into */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* -(UNS_INT16 *) RecWords: received */ /* (INTI6) NoOfBits: number of */ // /* OUTPUT */ /* _ (INT16 *) out: output */ // /* INPUT/OUTPUT ARGUMENTS */ /* _(INT16 *) ptr: bit and word */ /*------------------------------------*/ /* RETURN ARGUMENTS */ None. void BIT_bitunpack (INT16 *out, UNS_INT16 *RecWords, INT16 NoOfBits, INT16 *ptr) // INT64 temp ; UNS INT16 *WordPtr; /*------------------------------------*/

WordPtr = RecWords + ptr [l] ; *ptr-= NoOBits; if (*ptr >= 0) temp = (INT64) (*WordPtr) ยซ NoOfBits ; else { temp = (INT64) (*WordPtr) << (NoOfBits + *ptr); WordPtr++ ; temp = (temp ยซ (-*ptr)) |((INT64) *WordPtr << (-*ptr)); *ptr = 16 + *ptr; *WordPtr = (INT16) (temp & 0xffff) ; *out = (INT16) ( (INT64) (temp & 0xffff0000) ยป 16); ptr [l]- (INT16) (WordPtr-RecWords); /*------------------------------------*/ return; // } /___________________________________________________________ _________________*/ /*========================================================== =========*/ /*FUNCTION : BIT_cdbk_index_to_bits (). */ /*------------------------------------*/ /* PURPOSE: This function converts the fixed codebook */ /* into the bit-stream */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (PARAMETER *) indices: fixed codebook indices. */ /*------------------------------------*/ /* OUTPUT */ /* (INT16 []) packedwords: bit-stream. */ /*------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS*/ /* _(INT16 []) packw_ptr: pointer to the bit-stream. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ None. void BIT_cdbk_index_to_bits (PARAMETER *chan, INT16 packedwords [], INT16packw_ptr []) <BR> <BR> <BR> f<BR> <BR> <BR> { INT16 i, i_sf; /*------------------------------------*/ /* Initalizing bit packing parameters */ // packw_ptr [0] = 16; /*------------------------------------*/ /* Points to the second */ // packw_ptr[1] = 1; inisvector (packedwords, 0, PACKWDSNUM-1, 0); /*####################### Slected bitrate #####################*/ switch (chan->fix rate) { case RATEZ : packedwords [0] = 4; break; case RATE4OK : packedwords [0] = 3; break;

case RATE2OK : packedwords [0] = 2; break; case RATEO_8K : packedwords [0] = 1; break; default: nrerror ("Invalid rate []"); break; } /*========================================================== =========*/ /*##################### Classification inde ###################*/ /*========================================================== =========*/ if ((chan->fix_rate == RATE8_5K) || chan->fix_rate==RATE4_0K)) BIT_bitpack(chan->idx_SVS_deci, (unsigned short *) packedwords, 1, packw_ptr) ; /*========================================================== =========*/ /*################### LSF q1uantizer index #####################*/ switch (chan->fix rate) { /*------------------------------------*/ /*====================== case RATE8_5K ========================*/ /*------------------------------------*/ case RATE85K : // /* 25 bits */ /*------------------------------------*/ BITbitpack (chan->idxJsf [0], (unsigned short *) packedwords, 7, packwptr) ; BIT bitpack (chan->ida lsf [l], (unsigned short *) packedwords, 6, packw_ptr) ; BIT_bitpack (chan->idx_lsf [2], (unsigned short *) packedwords, 6, packw_ptr) ;

BIT_bitpack (chan->idx lsfl3], (unsigned short *) packedwords, 6, packw_ptr) ; // /* LSF interpolation 2 */ /*------------------------------------*/ if (chan->idxSVSdeci == 0) BIT bitpack (chan->idx_lpc int, (unsigned short *) packedwords, 2, packwptr) ; break; // /*===================== case RATE4_0K ====================*/ /*------------------------------------*/ case RATE4OK : /*-----------------------------------*/ /* 21 bits */ /*-----------------------------------*/ BIT_bitpack(chan->idx_lsf[0], (unsigned short *) packedwords, 7, packw_ptr) ; BIT bitpack (chan->ida Isfll], (unsigned short *) packedwords, 7, packw_ptr) ; BIT bitpack (chan->idx lsfl2], (unsigned short *) packedwords, 6, packw_ptr) ; BIT_bitpack(chan->idx_lsf[3], (unsigned short *) packedwords, 1, packw_ptr) ; break; /*------------------------------------*/ <BR> <BR> <BR> <BR> /*==================== case RATE2OK ==========================*/ /*------------------------------------*/ case RATE2_0K:

/*------------------------------------*/ /* 25 bits */ // BIT bitpack (chan->idx lsfl0], (unsigned short *) packedwords, 7, packw_ptr) ; BIT_bitpack(chan->idx_lsf[1], (unsigned short *) packedwords, 6, packwptr) ; BIT bitpack (chan->idx_lsf2], (unsigned short *) packedwords, 6, packwptr) ; BIT_bitpack(chan->idx-lsf[3], (unsigned short *) packedwords, 6, packwptr) ; /*------------------------------------*/ /* LSF interpolation 2 bits */ /*------------------------------------*/ BIT_bitpack(chan->idx_lpc_int, (unsigned short *) packedwords, 2, packwptr) ; break; /*------------------------------------*/ /*==================== caseRATE0_8K =======================*/ /*------------------------------------*/ case RATE0_8K; // /* 11 */ /*-----------------------------------*/ BIT_bitpack(chan->idx_lsf[0], (unsigned short *) packedwords, 4, packw_ptr) ; BIT_bitpack(chan->idx_lsf[1], (unsigned short *) packedwords, 4, packwj) tr) ;

BIT_bitpackchan->idx_lsf[2], (unsigned short *) packedwords, 3, packw_ptr); break; default: nrerror ("Invalid ! !") ; break; } /*========================================================== =========*/ /*################## Pitch index #####################*/ /*========================================================== =========*/ if ((chan->fix_rate == RATE8_5K) || (chan_>fix_rate == RATE4_0K)) { if (chan->idx_SVS_deci == 1) { if (chan->fix_rate == RATE8_5K) BIT_bitpack(chan->idx_pitch[0], (unsigned short *) packedwords, 8, packwptr) ; else if (chan->fix_rate==RATE4_0K) <BR> <BR> <BR> BIT bitpack (chan->idx_pitch [0],<BR> <BR> <BR> <BR> <BR> (unsigned short *) packedwords, 7, packwptr) ; } else { if (chan->fix_rate == RATE85K) { BITbitpack (chan->idxpitch [0], <BR> <BR> <BR> (unsigned short *) packedwords, 8, packwptr) ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> BIT_bitpack (chan->idx_pitch [l],<BR> <BR> <BR> <BR> <BR> (unsigned short *) packedwords, 5, packwptr) ; BITbitpack (chan->idxpitch [2], (unsigned short *) packedwords, 8, packw_ptr) ; BIT bitpack (chan->idxpitch [3], (unsigned short *) packedwords, 5, packwptr) ;

} else if (chan->fixrate==RATE4OK) { for (i = 0 ; i < NSF2 ; i++) BITbitpack (chan->idxpitch [i], (unsigned short *) packedwords, 7, packw_ptr) ; } } } <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*###################### Gains index #####################*/ /*========================================================== =========*/ switch (chan->fix_rate) /*----------------------*/ /*=================== case RATE8_5K ======================*/ /*------------------------------------*/ case RATE85K : if (chan->idxSVSdeci==l) { BIT bitpack (chan->idx GpVQ, (unsigned short *) packedwords, 6, packw_ptr) ; BITbitpack (chan->idxGcVQ, (unsigned short *) packedwords, 10, packwptr) ; } else { for (i = 0 ; i < N_SF4 ; i++) <BR> <BR> <BR> <BR> BIT bitpack (chan->idx_gainVQ [i],<BR> <BR> <BR> <BR> <BR> <BR> <BR> (unsigned short *) packedwords, 7, packwptr) ;<BR> <BR> <BR> <BR> <BR> <BR> }<BR> break; break; /*------------------------------------*/ /*=================== case RATE4_0K =====================*/ /*------------------------------------*/

case RATE4OK : if (chan->idx_SVS_deci==l) { BIT_bitpack(chan->idx_Gp_VQ, (unsigned short *) packedwords, 4, packw_ptr) ; BIT_bitpack(chan->idx_Gc_VQ, (unsigned short *) packedwords, 8, packw_ptr) ; } else { for (i = 0; i < N_SF2 ; i++) BIT_bitpack(chan->idx_gainVQ[i], (unsigned short *) packedwords, 7, packwptr) ; break; /*------------------------------------*/ /*==================== case RATE2_0K ====================*/ // case RATE2 OK : for (i = 0; i < NSF2 ; i++) BIT_bitpack(chan->idx_gainVQ[i], (unsigned short *) packedwords, 6, packw_ptr) ; break; case RATEO8K : BIT_bitpack(chan->idx_gainVQ[0], (unsigned short *) packedwords, 5, packw_ptr) ; break; default: nrerror ("Invalid rate !!"); break; } /*========================================================== =========*/ /*################### Code boks index ####################*/

/*========================================================== =========*/ switch (chan->fix_rate) f /*------------------------------------*/ /*==================== case RATE8_5K ====================*/ // case RATE85K : if (chan->idxSVSdeci == 1) { /*------------------------------------*/ /* Stationary voiced speech */ // for (i_sf= 0; isf< NSF4 ; i_sf++) { /_______________________________________________________*/ /* 8 pulses CB: 6p x 3b + 2p x 4b + 4b signs = 30 bits */ /*------------------------------------*/ for (i = 0 ; i < 4 ; i++) BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][0]), (UNS_INT16 *) packedwords, 4, packw ptr) ; for (i = 1; i < 4; i++) BIT_bitpack((chan->idx_cpcb[i_sf][i]), (UNS_INT16 *) packedwords, 3, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][4]), (UNSINT16 *) packedwords, 4, packw ptr) ; for (i = 5; i < 8; i++)

BIT_bitpack((chan->idx_cpcb(i_sf][i]), (UNS_INT16 *) packedwords, 3, packwptr) ; } /_______________________________________________________*/ else // /* Non-Stationary voiced */ /*------------------------------------*/ for (i sf = 0; isf< NSF4 ; i_sf++) BIT-bitpack ( (chan->idx-subcpcb [i_sq [0]), (UNSINT16 *) packedwords, 1, packwptr) ; if (chan->idx_subcpcb [i_sfl [0] ==1) /_______________________________________________*/ /* 5 pulses CB : 3p x 4b + 2p x 3b + 3b signs */ /* = 21 */ /*--------------------------------*/ for (i = 0; i < 3; i++) BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNSINT16 *) packedwords, 1, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][0]), (UNSINT16 *) packedwords, 4, packwptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][1]), (UNS_INT16 *) packedwords, 4, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][2]), (UNS_INT16 *) packedwords, 3, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][3]), (UNS_INT16 *) packedwords, 4, packwptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][4]), (UNS_INT16 *) packedwords, 3, packw_ptr); } else { BIT bitpack ((chan->idx_subcpcb [i_sfl [1]), (UNSINT16 *) packedwords, 1, packwptr) ; /*------------------------------------*/ /* 5 pulses CB: 5p x 3b + 5b */ /* = 20 */ /*------------------------------------*/ for (i = 0 ; i<5 ; i++) BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNS_INT16 *) packedwords, 1, packwptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][i]), (UNS_INT1 *) packedwords, 3, packwptr) ; } } } } break; /___________________________________________________________ */ /*==================== case RATE4_0K ====================*/ case RATE4OK : if (chan->idx_SVS_deci==1) { /*------------------------------------*/ /* Stationary voiced */ /*------------------------------------*/ for (isf= 0; isf<NSF3 ; i_sf++) BIT_bitpack((chan->idx_subcpcb[i_sf][0]), (UNS_INT16 *) packedwords, 1, packw-ptr) ;

if (chan->idx_subcpcb [i_sfl [0] == 1) { // /* 2 pulses CB: 2pulses x 5bits/pulse + 2 */ /* = 12 bits */ /*------------------------------------*/ for (i=0 ; i<2 ; i++) { BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNSINT16 *) packedwords, 1, packwptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][i]), (UNS_INT16 *) packedwords, 5, packw_ptr) ; } } else { /*---.---------------*/ /* 3 pulses CB: 3 pulses x 2 bits/pulse */ /* 3 signs + 3bits center = 12 */ /*--------.----------*/ for (i = 0; i < 3; i++) BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][i]), (UNS_INT16 *) packedwords, 2, packw_ptr) ; BIT_bitpack((chan->idx_center[i_sf]), (UNSINT16 *) packedwords, 3, packw_ptr) ; } } } else <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> <BR> <BR> { /* Non-Stationary voiced */

/*------------------------------------*/ for (i_sf = 0 ; isf< NSF2 ; isf++) BIT_bitpack((chan->idx_subcpcb[i_sf][0]), (UNS_INT16 *) packedwords, 1, packw_ptr) ; if chan->idx_subcpcb[i_sf][0]==1) { /*/ /* 2 pulses CB: 2pulses x 6. */ /* + 1 sign = 12 */ /*/ BIT_bitpack((chan->idx_cpcbsign[i_sf][0]), (UNSINT16 *) packedwords, 1, packwptr) ; BIT_bitpack((chan->idx)cpcb[i_sf][0]), (UNSINT16 *) packedwords, 13, packw_ptr) ; } else { BIT_bitpack((chan->idx_subcpcb[i_sf][1]), (UNS_INT16 *) packedwords, 1, packwptr) ; if (chan->idx_subcpcb[i_sf][1] == 1) { /*----------------*/ /* 3 pulses CB: 3 pulses x 2 */ /* 3 signs + 4bits center = 13 */ // for (i=0 ; i < 3 ; i++) { BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNS_INT16 *) packedwords, 1, packwptr) ; BIT_bitpack(chan->idx_cpcb[i_sf][i]), (UNS_INT16 *) packedwords, 2, packwptr) ; } BIT-bitpack ( (chan->idx-ccnter [i_sfl), (UNS_INT16 *) packedwords, 4, packwptr) ;

} else /___________________________________________*/ /* Gaussian codebook, 13 */ /*-------------------------------*/ for (i = 0; i < 2; i++) BIT_bitpack((chan->idx_cpcbsign[i_sf][i]), (UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitpack((chan->idx_cpcb[i_sf][0]), (UNSINT16 *) packedwords, 11, packw_ptr) ; } } break; /*------------------------------------*/ /*==================== case RATE2_0K ====================*/ /*------------------------------------*/ case RATE2_0K : break; /*------------------------------------*/ /*==================== case RATE0_8K ====================*/ /*/ case RATEO8K : break; /*------------------------------------*/ /*======================== ERROR ========================*/ // default: nrerror ("Invalid ! !") ; break;

l*---------------------------------------------------------- ---------*l return; /*/ } /*========================================================== =========*/ /* FUNCTION BIT bits to cdbk index Q. */ /*------------------------------------*/ /* PURPOSE: This function converts the the */ /* representation into the codebook */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* (INT16 []) packedwords: */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (PARAMETER *) indices: fixed codebook indices. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* (INT16 []) packwptr: pointer to the */ // /* RETURN */ /* None. */ void BIT bits to cdbk index (INT16 packedwords [], INT16 packwptr [], PARAMETER *chan) { INT16 i, i_sf; /*------------------------------------*/ /*========================================================== =========*/

Classification */ if ((chan->fix_rate == RATE8_5K) || (chan->fix_rate == RATE4_0K)) BIT bitunpack (&chan->idx-SVS_deci, (UNSINT16 *) packedwords, 1, packwptr) ; else <BR> <BR> <BR> <BR> chan->idxSVSdeci=0 ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== =========*/<BR> <BR> <BR> <BR> <BR> /*################# LSF quantizer index ###################*/ /*========================================================== =========*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> f /*==================== case RATE8_5K ====================*/ /*------------------------------------*/ case RATE85K : /*------------------------------------*/ /* 25 bits */ /*/ BIT_bitunpack (&chan->idx_lsf[0], (UNS_INT16 *) packedwords, 7, packwptr) ; BIT_bitunpack (&chan->idx_lsf[1], (UNS_INT16 *) packedwords, 6, packwptr) ; BIT_bitunpack (&chan->idx_lsf[2], (UNS_INT16 *) packedwords, 6, packwptr) ; BIT_bitunpack (&chan->idx_lsf[3], (UNS_INT16 *) packedwords, 6, packwptr) ; /*------------------------------------*/ /* LSF interpolation 2 bits */

/*------------------------------------*/ if (chan->idxSVSdeci == 0) BIT_bitunpack (&chan->idx_lpc_int, (UNS_INT16 *) packedwords, 2, packw_ptr) ; break; /*------------------------------------*/ /*====================case RATE4_0K ====================*/ /*------------------------------------*/ case RATE4OK : /*------------------------------------*/ /* 21 bits */ /*------------------------------------*/ BIT_bitunpack (&chan->idx_lsf[0], (UNS_INT16 *) packedwords, 7, packwptr) ; BIT_bitunpack (&chan->idx_lsf[1], (UNS_INT16 *) packedwords, 7, packwptr) ; BIT_bitunpack (&chan->idx_lsf[2], (UNSINT16 *) packedwords, 6, packw_ptr) ; BIT bitunpack (&chan->idx lst33], (UNS_INT16 *) packedwords, 1, packw_ptr) ; break; /*------------------------------------*/ case case RATE2OK ==================-=-=*/ /*------------------------------------*/ case RATE2OK : /*---------------------------------*/ /* 25 bits */ /*---------------------------------*/

BIT_bitunpack (&chan->idx_lsf[0], (UNS_INT16 *) packedwords, 7, packw_ptr) ; BIT_bitunpack (&chan->idx_lsf[1], (UNS_INT16 *) packedwords, 6, packw_ptr) ; BIT_bitunpack (&chan->idx_lsf[2], (UNSINT16 *) packedwords, 6, packwjptr) ; BITbitunpack (&chan->idxlsf [3], (UNS_INT16 *) packedwords, 6, packwptr) ; /*------------------------------------*/ /* LSF interpolation 2 bits */ /*------------------------------------*/ BIT_bitunpack (&chan->idx_lpc_int, (UNS_INT16 *) packedwords, 2, packwjptr) ; break; /*------------------------------------*/ /*==================== case RATE0_8K ====================*/ /*------------------------------------*/ case RATEO 8K : /*------------------------------------*/ /* 11 */ /*------------------------------------*/ BIT bitunpack (&chan->idx lsf [0], (UNSINT16 *) packedwords, 4, packw_ptr) ; BIT_bitunpack (&chan->idx_lsf[1], (UNSINT16 *) packedwords, 4, packw_ptr) ; BIT_bitunpack (&chan->idx_lsf[2], (UNSINT16 *) packedwords, 3, packwjptr) ; break;

default: nrerror ("Invalid rate! !") ; break; } break ; Pitch index if((chan->fix_rate == RATES_5K) || (chan->fix_rate == RATE4_0K)) if (chan->idxSVSdeci == 1) if (chan->flxrate == RATES 5K) { BIT_bitunpack (&chan->idx_pitch[0], (UNS_INT16 *) packedwords, 8, packwptr) ; else if (chan->fix_rate == RATE4_0K) BITbitunpack (&chan->idxpitch [0], (UNS_INT16 *) packedwords, 7, packwptr) ; } else if (chan->fixrate == RATE8 5K) BIT bitunpack (&chan->idx pitch[0], (UNS_INT16 *) packedwords, 8, packw ptr) ; BIT_bitunpack (&chan->idx_pitch[1], (UNSINT16 *) packedwords, 5, packw_ptr); BIT bitunpack (&chan->idxpitch [2], (UNS_INT16 *) packedwords, 8, packw_ptr) ;

BIT bitunpack (&chan->idx_pitch [3], (UNSINT16 *) packedwords, 5, packw_ptr) ; else if (chan->fix_rate == RATE4_0K) { for (i = 0 ; i < NSF2 ; i++) BIT_bitunpack (&chan->idx_pitch[i], (UNSINT16 *) packedwords, 7, packwptr) ; } } /*========================================================== =========*/ /*###################### Gains index ####################*/ switch (chan->fix_rate) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { /*==================== case RATE8_5K ====================*/ /*------------------------------------*/ case RATE85K : if (chan->idxSVSdeci == 1) { BITbitunpack (&chan->idxGpVQ, (UNS_INT16 *) packedwords, 6, packw_ptr); BIT_bitunpack (&chan->idx_Gc_VQ, (UNS_INT16 *) packedwords, 10, packwptr) ;

else { for (i = 0; i < NSF4 ; i++) BITbitunpack (&chan->idxgainVQ [i], (UNS_INT16 *) packedwords, 7, packw_ptr) ; break; /*------------------------------------*/ <BR> <BR> <BR> <BR> /*==================== case RATE4OK ================-======*/ /*------------------------------------*/ case RATE4OK : if (chan->idx_SVS_deci == 1) BITbitunpack (&chan->idxGp VQ, (UNSINT16 *) packedwords, 4, packw_ptr) ; BITbitunpack (&chan->idxGcVQ, (UNSINT16 *) packedwords, 8, packwptr) ; } else for (i = 0; i < N SF2 ; i++) BIT_bitunpack (&chan->idx_gain VQ[i], (UNS_INT16 *) packedwords, 7, packwptr) ; } break; /*------------------------------------*/ <BR> <BR> <BR> <BR> case case RATE2OK ========================*/ /*------------------------------------*/ case RATE2OK : for (i = 0 ; i < NSF2 ; i++) BITbitunpack (&chan->idxgainVQ [i], (UNS_INT16 *) packedwords, 6, packwptr) ; break;

case RATEO8K : BIT_bitunpack (&chan->idx_galnVQ[0], (UNS_INT16 *) packedwords, 5, packw_ptr) ; break; default: nrerror ("Invalid rate ! !") ; break; /*========================================================== =========*/ /* Codeboks index */ /*========================================================== =========*/ switch (chan->fixrate) { // /*==================== case RATE8_5K ====================*/ /*------------------------------------*/ case RATES 5K : if (chan->idx_SVS_deci == 1) { /*------------------------------------*/ /* Stationary voiced */ /*------------------------------------*/ for (isf= 0; isf< NSF4 ; i_sf++) { /*------------------------------------*/ /* 8 pulses CB: 6p x 3b + 2p x 4b + 4b signs = 30 bits */ // for (i = 0; i < 4; i++) BIT_bitunpack (&chan->idx_cpcbsign[1_sf][1], (UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][0],

(UNSINT16 *) packedwords, 4, packwptr) ; for (i = 1 ; i < 4 ; i++) BIT_bitunpack (&chan->idx_cpcb[i_sf][i], (UNS_INT16 *) packedwords, 3, packwptr) ; BIT bitunpack (&chan->idxcpcb [isf] [4], (UNSINT16 *) packedwords, 4, packwptr) ; for (i = 5; i < 8; i++) BIT_bitunpack (&chan->idx_cpcb[i_sf][i], (UNS_INT16 *) packedwords, 3, packwptr) ; } else { // /* Non-Stationary voiced */ /*------------------------------------*/ for (i_sf = 0; i_sf < N_SF4; i_sf++) { BIT_bitunpack (&chan->idx_subcpcb[i_sf][0], (UNS_INT16 *) packedwords, 1, packw_ptr) ; if (chan->idx_subcpcb[i_sf][0] == 1) /*-*/ /* 5 pulses CB : 3p x 4b + 2p x 3b + 3b signs */ /* = 21 */ /*------------------------------------*/ for (i=0 ; i< 3; i++) BIT_bitunpack (&chan->idx_cpcbsign[i_sf][i],

(UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][0], (UNS_INT16 *) packedwords, 4, packw_ptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][1], (UNS_INT16 *) packedwords, 4, packwptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][2], (UNSINT16 *) packedwords, 3, packwptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][3], (UNSINT16 *) packedwords, 4, packwptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][4], (UNS_INT16 *) packedwords, 3, packwptr) ; } else BIT_bitunpack (&chan->idx_subcpcb[i_sf][1], (UNS_INT16 *) packedwords, 1, packw_ptr) ; /*------------------------------------*/ /* 5 pulses CB: 5p x 3b + 5b */ /* = 20 */ /*------------------------------------*/ for (i = 0 ; i < 5 ; i++) BIT_bitunpack (&chan->idx_cpcbsign[i_sf][i], (UNSINT16 *) packedwords, 1, packw_ptr); BIT-bitunpack (&chan->idx_cpcb [i_sfl [i], (UNSINT16 *) packedwords, 3, packw ptr) ;

} break ; } break; /*------------------------------------*/ /*==================== case RATE4_0K ====================*/ /*------------------------------------*/ case RATE4OK : if (chan->idxSVSdeci == 1) // /* Stationary voiced */ // for (i_sf = 0; i_sf < N_SF3; i_sf++) { BIT_bitunpack (&chan->idx_subcpcb[i_sf][0], (UNS_INT16 *) packedwords, 1, packw_ptr) ; if (chan->idx_subcpcb[i_sf][0] == 1) { /*_______________________________________________*/ /* 2 pulses CB : 2pulses x 5bits/pulse + 2 */ /* = 12 */ /*------------------------------------*/ for (i = 0; i < 2; i++) BIT_bitunpack (&chan->idx_cpcbsign[i_sf][i],

(UNS_INT16 *) packedwords, 1, packw_ptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][i], (UNS_INT16 *) packedwords, 5, packwptr) ; } } else /*------------.----*/ /* 3 pulses CB: 3 pulses x 2 bits/pulse */ /* 3 signs + 3bits center = 12 */ /*------------------------------------*/ for (i = 0 ; i < 3 ; i++) { BIT bitunpack (&chan->idxcpcbsign [i sf] [i], (UNS_INT16 *) packedwords, 1, packwptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][i], (UNS_INT16 *) packedwords, 2, packw_ptr) ; } BIT_bitunpack (&chan->idx_center[i_sf], (UNS_INT16 *) packedwords, 3, packw_ptr) ; } else <BR> <BR> <BR> <BR> else<BR> <BR> <BR> // /* Non-Stationary voiced */ /*------------------------------------*/ for (i_sf = 0; i_sf < N_SF2; i_sf++)

BITbitunpack (&chan->idxsubcpcb [isf] [O], (UNS_INT16 *) packedwords, 1, packw_ptr); if (chan->idxsubcpcb[isf][0]-= 1) { /*------------------------------------*/ /* 2 pulses CB: 2pulses x 6. */ /* + 1 sign = 12 */ /*---------------*/ BIT_bitunpack (&chan->idx_cpcbsign[i_sf][0], (UNSINT16 *) packedwords, 1, packwptr) ; BIT bitunpack (&chan->idx_cpcb [i sfl [0], (UNSINT16 *) packedwords, 13, packw_ptr) ; } else BIT_bitunpack (&chan->idx_subcpcb[i_sf][1], (UNS_INT16 *) packedwords, 1, packwptr) ; if (chan->idx_subcpcb[i_sf][1] == 1) /*----------------*/ /* 3 pulses CB: 3 pulses x 2 */ /* 3 signs + 4bits center = 13 */ /*------------------------------------*/ for (i = 0 ; i < 3 ; i++) BIT_bitunpack (&chan->idx_cpcbsign[i_sf][i], (UNS_INT16 *) packedwords, 1, packwptr) ; BIT_bitunpack (&chan->idx_cpcb[i_sf][i], (UNS_INT16 *) packedwords, 2, packw_ptr);

} BIT_bitunpack (&chan->idx_center[i_sf], (UNSINT16 *) packedwords, 4, packwptr) ; } else <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { /* Gaussian codebook, 13 */ /*----------------*/ for (i = 0; i < 2; i++) BIT bitunpack (&chan->idx_cpcbsign [i_sf] [i], (UNS_INT16 *) packedwords, 1, packw_ptr); BIT bitunpack (&chan->idx_cpcb [i_sfl [0], (UNSJNT16 *) packedwords, 11, packw_ptr) ; } break; /*------------------------------------*/ /*==================== case RATE2_0K ====================*/ /*------------------------------------*/ case RATE2OK : break; /*------------------------------------*/ /*==================== case RATE0_8K ====================*/ /*------------------------------------*/ case RATEO8K : break;

/*------------------------------------*/ /*============================ ERROR =========================*/ /*------------------------------------*/ default: nrerror ("Invalid ! !") ; break; /___________________________________________________________ ________*/ return; /*------------------------------------*/ <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> l == /*========================================================== =========*/

/*========================================================== =========*/ /*========================================================== */ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ l == l /* LIBRARY: lib_bit. */ /*========================================================== =========*/ /*------------------------------------*/ /*--------------- FUNCTIONS --------------*/ /*------------------------------------*/ void BIT_init_lib (void); void BITbitpack (INT16, UNSINT16 *, INT16, INT16 *) ; void BITbitunpack (INT16 *, UNS_INT16 *, INT16, *) ; void BIT_cdbk_index_to_bits (PARAMETER *, INT16 [], []) ; void BIT bits to cdbk index (INT16 [], INT16 [], *) ; /*========================================================== =========*/ /*----------------- END ----------------*/ <BR> <BR> <BR> <BR> l =

===== /*========================================================== =========*/ /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System Inc. */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib_cla. */ /*========================================================== =========*/ /*------------------------------------*/ // /*------------------------------------*/ #include "typedef.h" #include "main.h" #include"const. h" #include "gputil.h" #include "ext_var.h" #include "lib_cla.h" #include "lib_lpc.h" #ifdef DIAGNOSTICS #include "lib_dia.h" #endif &num endif /*--------------------- FUNCTIONS ------------------*/

/*------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : CLA_init_lib (). */ /___________________________________________________________ ________*/ /* PURPOSE : This function initialise the global */ /* of the CLA */ /*------------------------------------*/ /* INPUT ARGUMENTS : */ None.

/*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void CLA init lib (void) { /___________________________________________________________ ________*/ INT16 k; FLOAT64 x; /*------------------------------------*/ VUV=0 ; WVm = 2; frame class = 0 ; frame onset=0 ; energy_m = 0.0; energy = 0.0; /*------------------------------------*/

ini_svector (frame_class_mem, 0, CLAMEMSIZE-1, (INT16) 0); inisvector (onstplsvmem, 0, CLAMEMSIZE-1, (INT16) 0); ini_svector (volced_mem, 0, CLAMEMSIZE-1, (INT16) 0); inidvector (buaerda, 0, LFRM+MEMCLASS+LLPCLHD-1, 0.0); ini_dvector (Lp_buffer, 0, N_Lp-l, (FLOAT64) MINLAG) ; MA_avg_wRp = 0.0; MA_min_wtilt = 0.0; ini_dvector (P_w[0], 0, SLOPEMAXSIZE-1, 0.0); ini_dvector (P_w [l], 0, SLOPE_MAX_SIZE-1, 0.0); /*------------------------------------*/ /* Generate Hamming */ /*------------------------------------*/ for (k = 0; k < LPC_WIN1 ; k++) { x = cos (2.0*PI* (FLOAT64) k/(FLOAT64)(LPC_WIN1-1)) ; window1 [k] = 0.54-0.46 * x ; ini dvector (buffer ren0, 0, CLA MEMSIZE-1, 0.0); Enoi= 1.0; Tnoi = 0.0; M_noรญ = 0.0; Rnoi = 0.0; ini_dvector (buffer_wtilt, 0, MAX_N_SF-1, 0.0); inidvector (bufferwmax, 0, MAXNSF-1, 0.0); ini_dvector (buffer_wRp, 0, MAX_N_SF-1, 0.0); ini_dvector (buffer_max_cla, 0, MAX_N_SF-1, 0.0); /*------------------------------------*/ SVSCount = 0; Vad0Count = 0;

FlatSpjlag = 0 ; Au value = 0.0; /*------------------------------------*/ Rp_m_cla = 0.0; lpcg_m_cla = 0.0; /*------------------------------------*/ OnSet =0; frame_class_mm = 5; /*------------------------------------*/ SVS deci mem = 0; // return ; /*------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*----------------.---------.--*/ /* FUNCTION : CLA_signal_classifier (). */ /*------------------------------------*/ /* PURPOSE : This function classify teh input signal */ /* file. */ /* frame class 0: */ /* frame_class 1: noise-like (CURRENTLY, NOT */ /* frame class 2: */ /* frame-class 3: */ /* frame-class 4: plosive (CURRENTLY, NOT */ /* frame class 5 : non-stationary voiced */ /* frame class 6: stationary voiced (CURRENTLY, NOT DISTINGUISHED */ /* FROM CLASS */

/*------------------------------------*/ /* INPUT ARGUMENTS */ (FLOAT64 signal: input */ /* (FLOAT64) Rp : Pitch correlation. */ /* (FLOAT64) Lp Pitch lags.

/* _ (INT16) Vad: VAD of current frame. */ // /* OUTPUT */ /*None.*/ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN */ /*- (INT16) frame class : current fame frame-class.

/*======================================================= ============*/ INT16 CLA_signal_classifier (FLOAT64 signal [], FLOAT64 Rp, FLOAT64 Lp, INT16 Vad) /*------------------------------------*/ INT16 framec ! ass, isf, k, idx; /*------------------------------------*/ /* Parameters for local first order LPC */ /*------------------------------------*/ FLOAT64 siglpcl [LPC_WINl], rxxl [2], pderr ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> /* Pitch lag */ /*------------------------------------*/ FLOAT64 Lp_avg, Lp_std; /*------------------------------------*/ /* Maximum */ /*------------------------------------*/

INT16 start, end; FLOAT64 val, max, den; /*------------------------------------*/ /* Weighted spectral tilt and weighted */ /*------------------------------------*/ FLOAT64 Eseg, nsr, min_slope_tilt, sum_slope_stilt, max_slope_wmax, sums ! ope wmax ; FLOAT64num_filt, num_max, slope_wtilt, slope_wman; FLOAT64 min wtilt, avg_wtilt, max_wRp, avg wRp ; INT16 onstplsv, voiced; /___________________________________________________________ ________*/ /* Update signal */ /*------------------------------------*/ for (k = 0; k < MEMCLASS ; k++) buCer c) a [k] = buffer_cla[k+L_FRM] ; for (k = 0 ; k < L_FRM + LLPCLHD ; k++) buffer_cla [k+MEM_CLASS1 = signal [k]; /*------------------------------------*/ /* Calculate evolution of pitch lag /*------------------------------------*/ /___________________________________________________________ ________*/ /* Update buffer with pitch */ /*------------------------------------*/ for (k=0 ; k<N_Lp-l ; k++) Lpbuffer [k] = Lp buffer [k+l] ; Lp_buffer[N_Lp-1] = Lp; /*------------------------------------*/ Average pitch lag /*------------------------------------*/

for (Lp_avg=0. 0, k=0 ; k<N_Lp ; k++) Lp_avg += Lp_buffer[k]; Lp_avg /= (FLOAT64) N_Lp ; /*--------------------------*/ /* Standard deviation on lag */ /*------------------------------------*/ for (Lpstd=0. 0, k=0 ; k<N_Lp ; k++) Lp_std += (Lp_buffer [k]-Lp_avg) * (Lp_buffer[K]-Lp_avg) ; Lp_std= sqrt (Lp_std/(FLOAT64) N_Lp)/Lp_avg ; // /* Buffer onset parameters of the previous */ /*------------------------------------*/ for (k = 0; k < SLOPEMAXSIZE ; k++) Pw [0] [k] = P_w [l] [k] ; /*------------------------------------*/ /* Calculate spectral tilt ===================== */ /*------------------------------------*/ for (isf= 0; isf< CLAMEMSIZE ; i_sf++) { /*------------------------------------*/ /* =========== Local first order LPC ============ */ /*------------------------------------*/ /*------------------------------------*/ /* LPC */ /*------------------------------------*/ mul dvector (signal+i sf*L LPC SF-OVERLAP, windowl, siglpcl, 0, LPC_WIN1-1);

/*--------.-----------.--*/ /* Autocorrelation */ // LPC autocorrelation (siglpcl, LPC WIN1, rxxl, 2); /*------------------------------------*/ /* Leroux-Gueguen recursion */ // LPC_leroux_gueguen (rxx1, &buffer_ref10[i_sf], &pderr, 1); } /*---------------------------------------*/ /* ======================= Calculate Maximum ======================= */ /* =================== (the lookahead is ================= */ <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> for (isf=0 ; isf<MAXNSF i_sf++) { // /* Find max in pitch cycle */ /*------------------------------------*/ if(Lp > MAX_L_SF) if (Lp > MAX_L_SF) start = MEM_CLASS+MAX_L_SF-(INT16) (1.5*Lp) + i_sf*MAX_L_SF+L_LPCLHD: start = (start < 0? 0: start); } else start = MEMCLASS+isf*MAXLSF+LLPCLHD ; end = MEM_CLASS+(i_sf+1)*MAX_L_SF+L_LPCLHD; for (max=-MAXFLT, k=start ; k<end ; k++) { val = {buffer_cla[k] > 0.0? buffer-cia [k] : -buffer_cla [k]);

if (val > max) max = val ; /*------------------------------------*/ /* Update buffer of */ /*------------------------------------*/ buffer_max_cla [i_sfl = max ; } /*--------------------------------------------*/ /* ======== Calculate weighted tilt, weighted maximum, ============*/ /* ================== weighted pitch ======================*/ /* ========== the parametric noise component is suppressed ========= */ /* =================== (the lookahead is ===================*/ /*------------------------------------*/ min_slope_wtilt = MAXFLT; sum slope wtilt = 0.0; max slope wmax =-MAXFLT ; sum_slope_wmax = 0.0; min wtilt = MAXFLT ; avg_wtilt= 0. 0; max_wRp =-MAXFLT ; avg_wRp = 0.0; for (isf= 0 ; isf< MAXNSF ; i_sf++) /*__________________________________________________________ _*/ /* Find energy in pitch */ /*------------------------------------*/ if (Lp > MAXLSF) { start = MEMCLASS+MAXLSF- (INT16) (2. 0*Lp) +isf*MAXLSF ; start = (start < 0 ? 0 : start) ; } else start = MEMCLASS+isf*MAXLSF ;

end = MEMCLASS+ (isM) *MAXLSF ; /*------------------------------------*/ /* Update segment */ /*------------------------------------*/ E seg = 0.0; for (k=start; k<end k++) Eseg += bufferc ! a [k] *buffer_cla [k]; /*------------------------------------*/ <BR> <BR> <BR> <BR> /* Nonnalizc */<BR> <BR> <BR> <BR> <BR> <BR> // E_seg = 1.0+E_seg/(FLOAT64)(end_start+1); /*------------------------------------*/ /* Update noise level, noise tilt, noise */ // if (frmcount < 6 && buffer_ref10[(INT16)((FLOAT64)i_sf/2. 0)] < -0.4 && Rp < 0.50) { // /* Relaxed update with fast */ /*------------------------------------*/ E noi = 0.; idx = (INT16) ((FLOAT64)i_sf/2. 0); T noi 0. 75 * Tnoi + 0.25 * buffer_ref10 [idx]; M_noi = 0.75*M_noi+0.25*buffer_max_cla[i_sf]; Rnoi = 0.25*Rp; } else if (Vad == 0) /_______________________________________________________*/ /* Stringent update with slow */ /*------------------------------------*/

Enoi = 0.; idx = (INT16) ((FLOAT64)i_sf/2. 0); T_noi = 0.990 * T_noi + 0.010 * buffer_ref10 [idx]; M_noi = 0.990*M_noi+0.010*buffer_max_cla[i_sf]; Rnoi = 0.010*Rp; // /* Calculate weighting */ /*------------------------------------*/ nsr = sqrt (Enoi/Eseg) ; /*------------------------------------*/ /* Limit noise suppression to */ /* nsr_lim=1-10^(-dB_lim/20) */ /* 10dB : 0.684,20dB: 0.900,30dB: */ /*------------------------------------*/ nsr = (nsr > 0.968? 0.968: nsr); // /* Update buffer of weighted tilt, weighted maximum, */ /* weighted pitch correlation */ // for (k = 0 ; k < MAXNSF-1 ; k++) { buffer_wtilt[k] = buffer_wtilt[k+1]; buffer_wmax[k] = buffer_wmax[k+1]; buffer_wRp[k] = buffer_wRp[k+1]; /___________________________________________________________ */ /* Suppress noise component in tilt, maximum, and */ /* correlation */ /*------------------------------------*/ idx = (INT16) ((FLOAT64) i_sf/2 0);

buffer_wtilt[MAX_N_SF-1] = buffer_ref10[idx] - nsr*T_noi; buffer_wmax[MAX_N_SF-1] = buffermaxcla[isf]-nsr*Mnoi ; buffer_wRp[MAX_N_SF-1] = Rp - nsr*R_noi; /*------------------------------------*/ /* Calculate slope of weighted tilt and weighted */ // num tilt = 0.0; num max = 0.0; den = 0. 0; for (k = 0; k < MAXNSF ; k++) { num tilt += (FLOAT64) k* (buffer_wtilt[k]-buffer_wtilt[0]) ; num_max += (FLOAT64)k*(buffer_wmax[k]-buffer-wmax[0]); den += (FLOAT64) (k*k); } // /* Update sum, max, min, avg, etc of weighted */ /* weighted maximum, and weighted pitch */ /*----------------.------*/ slope_wtilt = num_tilt/(den+EPSI); if (slope wtilt < min slope wtilt) min_slope_wtilt = slope_wtilt; sum_slope_wtilt += slope_wtilt; slope_wmax = num_max/(den+EPSI); if (slope_wmax > max_slope_wmax) max_slope_wmax = slope_wmax; sum s ! opewmax += slope_wmax ; /*------------------------------------*/ /* Update minimum and average of weighted tilt */ // if (buffer wtilt [MAX_N SF-1] < min wtilt)

min_wtilt = buffer_wtilt[MAX_N_SF-1]; avg_stilt += buffer_wtilt[MAX_N_SF-1]; /*------------------------------------*/ /* Update maximum and average of weighted pitch */ // if (bufferwRp [MAXNSF-l] > max_wRp) max_wRp = buffer_wRp[MAX_N_SF-1] ; avg_wRp += buffer_wRp [MAX_N_SF-l] ; /*------------------------------------*/ /___________________________________________________________ ________*/ /* Normalize average weighted tilt and pitch correlation */ /*------------------------------------------*/ avg_wRp /= (FLOAT64)MAX_N_SF; avgwtilt/= (FLOAT64) MAX_N_SF ; // /* Update moving average of weighted spectral */ /*-----------------------------------------*/ MA-min-wtiIt = 0. + 0.; /*-----------------------------------------*/ /* Update moving average of pitch */ /*-----------------------------------------*/ MAavgwRp = 0. + 0.; /*-----------------------------------------*/ /* The first reflection coefficient of the last subframe */ /* inverted sign for probability */ /* i. e. mapped to [-1: 1] */ /*-----------------------------------------*/

P_w[1][4] = -buffer_wtilt[MAX_N_SF-1]; /*------------------------------------*/ /* Limit sum of slopes to min of-1. 0, max of 1.0, mapped to [-1 : 1] */ /* inverted sign for probability */ /*------------------------------------*/ P_w[1][0] = -sum_slope_wtilt; if (Pw [l] [0] > 1. 0) Pw [l] [0] = 1.0; else if (P_w [l] [0] <-1.0) Pw [l] [0] =-1.0; Pw [l] [0] *= 1.0; /*------------------------------------*/ /* Limit sum of slopes to min of-0.5, max of 0.5, mapped to [-1 : 1] */ /* inverted sign for probability */ /*------------------------------------*/ P_w[1][1] = -min_slope_wtilt; if(P_w[1][1] > 0.5) Pw [l] [l] =0. 5; else if (P_w[1][1] <-0.5) Pw [l] [l] =-0. 5; P w [1] [1] *= 2; // /* Limit sum of slopes to min of-10000, max of */ /* mapped to [-1: 1] */ /*------------------------------------*/ P_w[1][2] = sum_slope_wmax; if (P_w [l] [2] > 10000.0) P_w [1] [2] = 10000.0; else if (P_w [1] [2] <-10000.0) P_w[1] [2] =-10000. 0; P_w[1][2] *= 0.0001;

/*------------------------------------*/ /* Limit sum of slopes to min of-1000, max of */ /* mapped to [-1 : 1] */ /*-----------------.-------*/ P_w [1] [3] = max stopewmax ; if (P_w [1] [3] > 1000.0) P_w[1] [3] = 1000.0; else if (Pw [1] [3] <-1000.0) P_w[1] [3] =-1000.0; P_w[1] [3] *= 0.001; onstplsv = 0; /*------------------------------------*/ /* Rewritten in order to output criterion that triggers */ /*------------------------------------*/ if (P_w [l] [l] > 0.3409 && Pw [l] [2] > 0.025 && P-w [l] [4] >-0.075) { onstplsv = 1; } else if (P_w[1][1] > 0.2273 && P_w[1] [2] > 0.027 && P_w[1][4] >-0.075) onstplsv= 1 ; else if (P_w [l] [1] > 0.1818 && Pw [l] [2] > 0.031 && P_w[1] [4] >-0.075) onstplsv = 1; else if (P_w [l] [l] > 0.0909 && P_w[1][2] > 0.040 && P_w[1] [4] > 0.075) { onstplsv = 1; else if (P_w[1][1] > 0.0773 && P_w[1][2] > 0.060 && P_w[1] [4] > 0.075) { onstplsv = 1; else if w [l] [1] > 0.0591 && P_w[1] [2] > 0.080 && P_w[1] [4] > 0.100)

onstplsv = 1; else if (P_w[1][1] > 0.03636 && Pw [l] [2] > 0.100 && P_w [1] [4] > 0.100) { onstplsv = 1; } else if (P_w [l] [l] > 0.1818 && P_w[1][2] > 0.025 && Pw [l] [3] > 0.100 && P_w[1] [4] >-0.075) onstplsv = 1; } else if (Pw [1] [1] > 0.1364 && Pw [0] [l] > 0.1364 && P_w[1][2] > 0. && P_w[0][2] > 0. && P_w [1] [4] >-0.075) onstplsv = 1 ; else if (P_w all [l] > 0.1364 && Pw [l] [3] > 0.120 && Pw [l] [4] > 0.150) { onstplsv = 1 ; } else if (P_w [l] [1] > 0.2273 && P_w[1] [3] > 0.070 && P_w [1] [4] > 0.150) { onstplsv = 1; } else if (P_w [l] [1] > 0.2500 && P_w[1][3] > 0.060 && Pw [l] [4] > 0.150) { onstplsv = 1; } else if (P_w[1][1] > 0.4091 && P_w [1] [3] > 0.030 && P_w[1] [4] > 0.150) { onstplsv = 1; } else if (P_w[1][1] > 0.1818 && P_w[0][3] > 0.30 && Pw [l] [4] > 0.000) onstplsv = 1; } voiced = 0 ; if (avg_wRp >= 0.70)

voiced = 1; else if (avg_wRp >= 0.5 && Lp_std < 0.10) { voiced = 1; else if (MA_avg_wRp >= 0.6 && Lp_std < 0.10) { voiced = 1; else if (avgwtilt <-0.50 && avgwRp >= 0.2) voiced = 1 ; else if (minwtilt <-0.70 && avg_wRp >= 0.2) voiced = 1; } else if (avg_wtilt < -0. 75) voiced = 1; } else if (MA_avg_wRp > 0.50 && maxwRp > 0.40 && minwtitt <-0.40) voiced = I ; } else if (avgwRp > 0.50 && minwtilt <-0.35) { voiced = 1; } else if (avg_wRp > 0.50 && min_wtilt < -0.05) voiced = 1; /*------------------------------------*/ /* Offset handling */ /*------------------------------------*/

else if (voiced mem [3] == 1 && voiced_mem [2] == 1) { if (MAavgwRp > 0.55 && MA_min_wtilt < -0. 10 && Lp_std < 0.05) voiced =1; } if(Vad == 0) voiced = 0 ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> /*==================== Make frame_class decision ====================*/<BR> <BR> <BR> <BR> <BR> <BR> /*--------.----.-----------*/ frame class =2; /*------------------------------------*/ Onset frame-classification /*------------------------------------*/ if ((frame_class_mem[3] == 0 || frame_class_mem[3] == 1 || frame class mem [3] == 2) && voiced == 1) frame class =3; else if (onstplsv == 1 && (frame class mem [3] ! = 5 11 frame_class_mem[3] ! = 6 11 voiced ! = 1)) frame_class = 3; /*------------------------------------*/ /* Voiced frame_classification */ /*------------------------------------*/ else if (onstplsv_mem [3] == 1 && voiced == 0) frame class = 5; else if (voiced == 1) frame class =5; if (Vad == 0)

frame_class = 0; /*------------------------------------*/ /* Update frame class buffer */ /*------------------------------------*/ for (k = 0 ; k < CLAMEMSIZE-1 ; k++) { frame class mem [k] = frame_class_mem[k+1]; onstplsv_mem [k] = onstplsvmem [k+1]; voiced mem [k] = voiced_mem[k+1] ; } frame_class-mem [CLA_MEM_SIZE-1] = frame class ; onstplsv_mem [CLA MEMSIZE-1] = onstplsv ; voiced_mem [CLA_MEM_SIZE-1] = voiced; /*------------------------------------*/ /* frame class 0 : silence */ /* frame class 1 : noise-likc (CURRENTLY, NOT */ /* frame class 2 : unvoiced */ /* frame class 3 : onset */ /* frame class 4 : plosive (CURRENTLY, NOT */ /* frame_class5 : non-stationaryvoiced */ /* frame class 6 : stationary voiced (CURRENTLY, NOT */ /* FROM CLASS */ /___________________________________________________________ ________*/ /*------------------------------------*/ return frame class ; // /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION: CLA_NoisUnvoiceDetect (). */ /*------------------------------------*/

/* PURPOSE: This function temporally detects noise-like */ /* speech to reset the delay for the LT preprocessing and */ /* control the excitation weighting. The decision will */ /* finalized after */ /*------------------------------------*/ /* INPUT ARGUMENTS */ _ (FLOAT64 residu : input residual */ /* (FLOAT64 sig : input speech */ /* (INT16) I_frm : input frame */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (INT16 *) frame class : frame-class frame.

/*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void CLA_NoisUnvoiceDetect (FLOAT64 residu[], FLOAT64 sig[], INT16 *uv_mode, FLOAT64 *frm_erg, FLOAT64 *frm_sharp, INT16 1-frm) { /*------------------------------------*/ FLOAT64 P1_SHP, P2R1, P3ZC, P4RE ; FLOAT64 X, XI, X2, Max, M, val; INT16 i, N; // /* Calculate parameter 1 : P1SHP */ /*------------------------------------*/ X = 0 ; Max = 0 ; for (i = 0 ; i < 1_frm ; i++) M = fabs (residu [i]) ; X += M; if (M > Max)

Max = M ; } P1SHP = X/ (1-frm*MAX(1. 0, Max)) ; (*frm_sharp) = P1_SHP; /*------------------------------------*/ /* Calculate parameter 2 : P2_R1 */ /*------------------------------------*/ dot_dvector (sig+1_frm/2, sig+1_frm/2+1, &X, $0,1_frm/2-2); dot_dvector (sig+1_frm/2, sig+1_frm/2, &X2,0,; P2_R1 = X/MAX (X2,1.0); /*/ /* Calculate parameter 3 : P3_ZC */ /*/ N = 0 ; for (i = 0; i < 1_frm/2-1 ; i++) { if (sig [i+1_frm/2]*sig[i+1_frm/2+1] < 0) N++; } P3_ZC= (FLOAT64) N/(1_frm/2-1. 0); /*------------------------------------*/ /* Calculate parameter 4 : P4_RE */ /*------------------------------------*/ dot dvector (residu, residu, frm_erg, 0,; dot dvector (residu+l frm/2, residu+l frm/2, frm erg+l, 0, 1_frm/2-1) ; X1 = frm_erg[1]; XI = sqrt (X1/MAX (1. 0, X2)); P4_RE = 1. 0-MIN (1. 0, X1) ; /*------------------------------------*/ /* Make noise-like decision */

/*------------------------------------*/ N = 0 ; for (i = 0 ; i < 1_frm ; i++) if (fabs (sig [i]) < 0. 1) N++; } dot dvector (sig, sig, &val, 0, (INT32) (1_frm*0.75)-1) ; X2 = val/ (I fnn*0. 75); if (X2 < 1000.0 || N*1.0/1_frm > 0.5) *uvmode=0 ; if (P1_SHP>0.15)*uv_mode=1; if ((P2_R1 < 0.60) && (P1_SHP > 0.20)) (*uvmode) = 2; if ((P3_ZC > 0.40) && (P1_SHP > 0.18)) (*uvmode) = 2; if ((P4_RE < 0.40) && (P1_SHP > 0. 20)) (*uv_mode) = 2; /*------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION: CLA_Identify_InputSpeech (). */ /*------------------------------------*/ /* PURPOSE: This function identifys input speech as flat */ /* The decision needs at least two sentences to */ /* the memory. */

/*.-----------------. */ /*INPUT ARGUMENTS */ /* (INT16) ppmode : = mode 1 or mode 0 */ /* _ (FLOAT64) reflO : first reflection */ /* _(FLOAT64)lsf0 : first lsft */ /* _ (FLOAT64) ltp_g : past LTP */ /* _(FLOAT64)lpc_g : current LPC */ /* _ (INT16) vad: vad */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* (INT16 *) flatdeci : flat speech */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ <BR> <BR> <BR> <BR> <BR> <BR> void CLA_Identify_Input(INT16 pp_mode, FLOAT64 *pdcfq, FLOAT64 lsf0, FLOAT64 ltp_g, FLOAT64 *lpc_g, INT16 fix_rate, INT16 *flat_deci) { /*/ INT16 i; FLOAT64 sub_refl [NP], x; /*/ LPC_pred2refl (pdcfq, sub_refl, NP); (*lpc_g) = 1.0; for (i = 0 ; i < NP; i++) (*lpc_g)*= (1.0_sqr(sub_refl[i])); (*lpc_g) = -10.0*log10((*lpc_g)+EPSI); /*------------------------------------*/ /* Vad */ /*------------------------------------*/

if (fix_rate==RATEO_8K) Vad0Count++ ; else Vad_0_Count = 0; if (ppmode==l){ x=MIN((*lpc_g)/35.0, 1.0) - 2.0*sub_refl[0]+ MIN(ltp_g, 1.0)-lsf0*15; x *= 2.5; if (SVS_Count==0) Av_value =0.; elsc { if (SVS_Count<10) Av_value = 0. 9*Av_value + 0.; else { if (SVS_Count<100) Avvalue = 0. 99*Av_value + 0.01*x; else Av_value = 0. 998*Av_value + 0.002*x; } } SVSCount++ ; SVSCount = MIN (SVS_Count, 10000); } else { if ((Av_value > 5.8) && ((*flat_deci) == 0) && (Vad_0_Count > 10) && (SVS_Count > 200)) (*flat_deci) = 1; if ((Av_value < 5.3) && ((*flat_deci) == 1) && (Vad_0_Count > 10) && (SVS_Count > 200)) (*flat_deci) = 0; /*------------------------------------*/ return; /*------------------------------------*/ }

/*--------------------------------------------*/ /* FUNCTION : CLACiassCorrectO */ /*------------------------------------*/ /* PURPOSE: This function works for */ /* (1) improving voiced-unvoiced */ /* (2) improving noise-like unvoiced */ /* (3) detecting specific "onset"; */ /* (4) making classification for pitch */ /* (5) improving vad; */ /* (6) detecting voied speech with high prediction */ /* but noise-like HF */ /___________________________________________________________ ________*/ /* INPUT ARGUMENTS */ /* _(INT16 *) frame class m : vad */ /* class_m, Rp_sub[], NSR, **refl, frm_sharp, */ /* energy_m, energy, FrmResEng, Ipcgain */ /*/ /* OUTPUT ARGUMENTS */ <BR> <BR> <BR> /* *OnSetFlag, *NoisyV_flag */<BR> <BR> <BR> <BR> /*/ /* INPUT/OUTPUT ARGUMENTS */ /* *class, *class_pp, *Vad, *VUV */ /*/ /* RETURN ARGUMENTS */ <BR> <BR> <BR> /* None */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> void CLA_Class_Correct(INT16 *frame_class, INT16 *frame_class_pp, INT16 *Vad, INT16 *VUV, INT16 *OnSetFlag, INT16 frame_class_m, FLOAT64 Rp_sub[], FLOAT64 NSR, FLOAT64 **refl, FLOAT64 frm_sharp, INT16 smv_mode,FLOAT64 energy_m, FLOAT64 energy, FLOAT64 FrmResEng, FLOAT64 lpcgain, INT16 *NoisyV flag) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> // FLOAT64 x, y;

/*------------------------------------*/ <BR> <BR> <BR> <BR> /* Class correction */<BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /*------------------------------------*/ /* unvoiced to voiced */ /*------------------------------------*/ if (((*frame_class) < 3) && (frame_class_m > 2) && (Rp_sub[0] > 0.43) && (Rp_sub[1] > 0.43)) { if ((frm_sharp < 0.15) && ((Rp_sub[0] + Rp_sub [l]) > 0.9) && (refl [2] [0] >-0. 4)) (*frame class) = 5; if ((frm_sharp < 0.25) && ((Rp_sub[0]+Rp_sub[1]) > 1.0) && (refl [2] [0] >-0.1)) (*frame class) = 5; if ((fnn_sharp < 0.3) && ((Rp_sub[0]+Rp_sub[1]) > 1.15) && (refl [2] [O] >-0. 1)) (*frame class) = 5; /*------------------------------------*/ /* voiced to unvoiced */ /*------------------------------------*/ x = MIN (3*frmsharp-0. 2,0.65); if ((*frame_class>2) && (Rp_m_cla<x) && (Rp_sub[0]<x) && (Rp_sub[1]<x) && (Rp_sub[2]<x)) (*frame class) = 2; /*------------------------------------*/ /* noise-like */ /*------------------------------------*/ if ((*VUV==2) && ((Rp_sub[0]>0.75) || (Rp_sub[1]>0.75))) (*VUV) = 3 ; if ((*VUV==2) && (refl[2][0]>-0.1) &&

((Rp_sub[0]>0. 55) 11 (Rp_sub [1] >0. 55))) (*WV) = 3; if ((*VUV==2) && (frm_sharp>0.2) && ((Rp_m_cla>0.75) || (Rp_sub[2]>0.75))) (*VUV) = 3; if ((*frame_class<3) && (*frameclass>0) && ( ( (NSR < 0.25) && (RP_sub[1] <0.7) && (frm_sharp>0. ! ! ((Rp_sub[1]<0.5) && ((*VUV)==2)))) (*frame class) = 1; /*------------------------------------*/ /* Onset */ /*------------------------------------*/ x = energy/MAX (energy_m, 0.1); y = refl[0][0]-refl[N_SF4-1][0]; (*OnSetFlag) = (*frame class==3) && (y+0. 2*x-0.6>0) && (Rp_sub[2]>0, 5); /*------------------------------------*/ /* Classification for pitch */ /*------------------------------------*/ if (*frame_class>=3) { (*frame_class_pp) = 2 ; if (Rp_sub[1] > 0.5) (*frame_class_pp) = 3; if (Rp_sub[1] > 0.75) (*frame_class_pp) = 4; } else (*frame_class_pp) = 0 ; if((*VUV) == 0) (*frame_class_pp) = 0 ; if ((frame_class_m < 3) && ((*frame_class < 2) 11 (((*frame_class) == 2) && (Rpsub[ll < 0.5)))) (*frameclasspp) =-1 ;

/*------------------------------------*/ /* Making the VAD more agressive */ /*------------------------------------*/ if (smv_mode == 2) if (smv(_mode == 2) if ((FrmResEng < 400*L_FRM) && (refl [2] [0] < 0.125) && (Rp_sub[1] < 0.55) && ((*frame_class) < 3) && (frm_sharp > 0.15)) (*frame class) = 0; (*Vad) = 0; } } else if ( ( (NSR > 0.6) || (FnnResEng < 100*L_FRM)) && (refl [2] [0] < 0) && (Rp_sub[1] < 0.4) && ((*frame_class) < 3) && (frm_sharp > 0.18)) { (*frame class) = 0; (*Vad) = 0; } } /___________________________________________________________ ________*/ /* Voiced speech with high prediction gain but noise-like */ /* HF excitation */ /*------------------------------------*/ x = 10*frm_sharp - 1. 5*refl [2] [0] + Rp_sub [l] + Ipcgain/20. 0; *NoisyV_flag = 0; if ((*frame_class) > 2) { if (x>4. 5) (*NoisyVf ! ag) = 1; if ( (x > 5.7) && (frm_sharp > 0.29) && (refl [2] [0] <-0.92)) (*NoisyVf ! ag) = 2;

Rpmcta=Rpsub[l], lpcg_m_cla = lpcgain; /*------------------------------------*/ return; /*------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : CLARateSeIect (). */ /*------------------------------------*/ /* PURPOSE: This function select the SMV */ // /* INPUT ARGUMENTS */ /* class_m, Rp_sub [], NSR, **refl, frmsharp, */ /* energy_m, energy, FrmResEng, lpcgain */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* *OnSetFlag, *NoisyV_flag */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* *class, *class_pp, *Vad, *VUV */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None */ void CLA Rate Select (INT16 smv mode, INT16 frame class, INT16 frame class m, INT16 onsetflag, FLOAT64 Rp [], FLOAT64 NSR, FLOAT64 sharp, FLOAT64 refl0, FLOAT64 frm_eng, INT16 *codec rate) /___________________________________________________________ ________*/ FLOAT64 x;

/*------------------------------------*/ switch (smv_mode) // /* Mode 0. Note: average rate must be equal to EVRC */ /*------------------------------------*/ case 0: (*codec rate) = RATE85K ; if ( (frame class == 1) && (sharp > 0.2) && (Rp [l] < 0.32) && (Rp [2] < 0. 3)) (*codec rate) = RATE4OK ; if ((frame_class == 1) && (NSR > 0.15) && (Rp [l] < 0.5) && (Rp [2] < 0. 5)) (*codec_rate) = RATE4_0K ; if ((frame_class < 3) && (NSR > 0.5) && (refl0 < 0.0) && (Rp [l] < 0. 5)) (*codec rate) = RATE4OK ; if (frame class==0) (*codec rate) = RATEZ ; if ( (frame class == 0) && (frame class m==0)) (*codec rate) = RATE0_8K ; break; /*------------------------------------*/ /* Mode 1. Note: average rate must be equal to 0.7 */ /*------------------------------------*/ case 1: (*codec rate) = RATE85K ; x = MAX (0. 77-NSR, 0.7); if ( (frame class > 3) && (frame_class_m > 5) && (Rp [0] > x) && (Rp [l] > x)) (*codec_rate) = RATE4_0K; if ((frame_class == 2) && (Rp [0] > 0. &&

(Rp [l] > 0. 31)) (*codec rate) = RATE4OK ; if ( (frame class == 2) && (sharp > 0.18)) (*codec rate) = RATEZ ; if ( (frame class == 2) && (NSR > 0.5)) (*codec rate) = RATE4OK ; if (frame class == 1) (*codec rate) = RATEZ ; if ((frame_class == 1) && (Rp [0] < 0.5) && (Rp [l] < 0. 5) && (Rp [2] < 0.5) && ( ( (refl0 > 0.0) && (sharp > || (sharp > 0.25))) (*codec rate) = RATE2OK ; if ( (NSR > 0.08) && (frame_class == 1) && (sharp > 0.15)) (*codec_rate) = RATE2_0K ; if (frame class == 0) (*codec rate) = RATEO8K ; break ; // /* Mode 2. Note: average rate must be equal to 0.55 */ // case 2: (*codec rate) = RATE4OK ; if ( (OnSet == 1) && (NSR > 0.02) && (frame_class > 2)) (*codec_rate) = RATE8_5K; if ( (OnSet == 1) && (Rp [0] < 0.85) && (frame class > 2)) (*codec rate) = RATE85K ; if ((onsetflag == 1) || ( (frame class m < 3) && (frame_class >= 3)) || (frame_class == 3)) OnSet= 1; else

OnSet = 0; if (OnSet == 1) (*codec rate) = RATE85K ; if ( (frame class > 3) && (ref10 <-0.8) && (Rp [l] < 0.5) && (sharp < 0. 15)) (*codec rate) = RATE85K ; if ( (NSR > 0.025) && (frame class > 2) && (Rp [l] < 0. 57)) (*codec_rate) = RATE85K ; if (frame class < 3) (*codec_rate) = RATE4OK ; else { if (frm_eng < 2500*L_FRM) (*codec rate) = RATE4 OK ; if ((frm_eng < 5000*L_FRM) && (frame_class_m < 3) && (Rp [l] < 0.6)) (*codec rate) = RATE4OK ; } if ((frame_class == 1) && (Rp [0] < 0.5) && (Rp [l] < 0. 5) && (Rp [2] < 0.5) && (((ref10 > 0.0) && (sharp > 0.15)) 11 (sharp > 0.25))) (*codec rate) = RATE2OK ; if ( (NSR > 0.08) && (frame class == 1) && (sharp > 0.15)) (*codec rate) = RATE2OK ; if (frame class == 0) (*codec rate) = RATEZ ; break; default: #ifdef VERBOSE printf ("Invalid SMV mode: % d\n", smv mode) ; exit (l) ; #endif break;

/*---------------------------------------------------------- --------- framec!assmm=framedassm ; /*------------------------------------*/ return ; /*------------------------------------*/ } /*/ /*========================================================== =========*/ /*---------------------- END ------------------*/ I,

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /___________________________________________________________ ________*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* LIBRARY: lib_cla. h */ /*/ /*------------------------------------*/ /*---------------- FUNCTIONS ---------------*/ /*------------------------------------*/ void CLANoisUnvoiceDetect (FLOAT64 [], FLOAT64 [], INT16 *, *, FLOAT64 *, INT16); INT16 CLA_signal_classifier (FLOAT64 *, FLOAT64, FLOAT64, INT16); void CLA Class Correct (INT16 *, INT16 *, INT16 *, INT16 *, INT16 *, INT16, FLOAT64 [], FLOAT64, FLOAT64 **, FLOAT64, INT16, FLOAT64, FLOAT64, FLOAT64, FLOAT64, *) ; void CLA Rate Select (INT16, INT16, INT16, INT16, FLOAT64 [], FLOAT64, FLOAT64, FLOAT64, FLOAT64, *) ; void CLA init lib (void); void CLA Identify_Input (INT16, FLOAT64 *, FLOAT64, FLOAT64, FLOAT64*, INT16, *) ; /*========================================================== =========*/ /*------------------- END -----------------*/ /*========================================================== =========*/

/*========================================================== =========*/ /*========================================================== =*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: lib_cpr.c */ /*========================================================== */ /*------------------------------------*/ /*----------------- INCLUDE ----------------*/ <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num include"main h"<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /*------------------- FUNCTIONS -----------------*/ <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*FUNCTION : print copyright Q. */ /*------------------------------------*/ /* PURPOSE: Print the Copyright */ /___________________________________________________________ ________*/ /* ALGORITHM */ /*------------------------------------*/ /* INPUT ARGUMENTS : */ /* None */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None */ /*------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ /* None */ /*------------------------------------*/ /* RETURN ARGUMENTS*/ /* None. */ <BR> <BR> <BR> <BR> ------------ void print_copyright (void) { /*------------------------------------*/ printf("\n /***************************************#n"); printf(" /* *#n"); printf ("/* SMV Speech Codec Floating Point Simulation *An") ; printf ("/* *An") ; printf ("/* These executable and sources files are delivered *An") ; printf ("/* under NDA and are SOLELY to be used for the *An") ; printf ("/* purpose of the 3GPP SMV Collaboration Phase. *#n"); printf(" /* *#n"); printf ("/* Any other use is STRICTLY prohibited. *#n"); printf ("/* *#n") ; printf ("/* *An") ; printf ("/* Version 1.0, 30 June 2000 *#n"); printf ("/* *An") ; printf ("/* This executable, all sources, object *#n"); printf ("/* and processed files should be deleted by *#n"); printf ("/* the and of the collaboration phase or at *An") ; printf ("/* any time upon the Conexant's request. *An"), printf(" /* *#n"); printf ("/* CONEXANT SYSTEMS Inc. *#n"); printf(" /* *#n"); printf ("/* All Rights Reserved, November 1999-June 2000 *An") ; printf(" /* *#n"); printf (" /*------------------------------------*/ return; /*------------------------------------*/ } /*------------------------------------*/ 5/*========================================================= ==========*/ /*------------------- END ----------------*/ /*========================================================== =========*/

/*========================================================== =========*/ /*========================================================== ==*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*PROTOYPE FILE : Hbcpr. h */<BR> <BR> <BR> <BR> <BR> <BR> // /*------------------------------------*/ /*------------------- FUNCTIONS -----------------*/ void print_copyright (void); /*========================================================== =========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by any */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* LIBRARY : lib_dia. c */ /*========================================================== =========*/ &num ifdef DIAG SMV /*----------------------------------------*/ /*--------... */ /*----------------------------------------*/ &num include"typedef. h" #include"main. h" #include "const.h" #include "ext_var.h" #include "mcutil.h" #include"gputil. h" &num include"lib_dia. h" #include "lib swb.h" /*------------------------------------*/ /*-------------------- FUNCTIONS -------------------*/ /*------------------------------------*/ /*========================================================== =========*/

/* FUNCTION: DIA_enc_open_files (). */ /*------------------------------------*/ /* PURPOSE : This function open the diagnostics */ /*--*/ /* INPUT : */ /* None.. */ // /* OUTPUT */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ None. voidDIA_enc_open_files (vold) { // /* Encoder unquantized */ // fdiavad = file_open_wb ("vad. enc") ; /*------------------------------------*/ /* Encoder */ /*------------------------------------*/ fdia_sp_enc = file_open_wb ("sp_out.enc"); /*------------------------------------*/ return; /*------------------------------------*/ <BR> <BR> <BR> //

/*========================================================== =========*/ /* FUNCTION : DIA_enc_close_files (). */ /*------------------------------------*/ /*PURPOSE : This function close the diagnostics */ /*-*/ /* INPUT ARGUMENTS : */ /* None. */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN : */ /* None. */ /*========================================================== =========*/ void DIA enc close files (void) /___________________________________________________________ ________*/ /* Encoder */ /*------------------------------------*/ fclose (fdiavad) ; /*------------------------------------*/ /* Encoder */ /*------------------------------------*/ fclose (fdia_sp_enc) ; /*/ return; }

/*------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : DIA_dec_open_files (). */ /*-*/ /* PURPOSE: This function open the diagnostics */ /*------------------------------------*/ /* INPUT ARGUMENTS <BR> <BR> <BR> <BR> /*None.*/<BR> <BR> <BR> <BR> <BR> /*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ---------- void DIA_dec_open_files (void) { /*------------------------------------*/ // return ; // } <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTION : DIA_dec_close_files (). */ /*------------------------------------*/ /* PURPOSE: This function close the diagnostics */ /*------------------------------------*/ /* INPUT ARGUMENTS /* None. */

/*-----------------------------------------*/ /*OUTPUT */ None.

/*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void DIA_dec_close_files (void) { // return ; return; /*------------------------------------*/ } /*-----------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : DIA-trace-data 0.

// /* PURPOSE: Trace the value of the variable by writing a file */ /* with data alined with the input */ /*------------------------------------*/ /* INPUT ARGUMENTS */ (FLOAT64) val: variable to */ /* _ (INT16) data size : output data */ /* _ (FLOAT64) scale factor : scale factor for val. */ /* _ (FILE *) file data : output file */ // /* OUTPUT */ /* None */ /*------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ /* None */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void DIA_trace_data (FLOAT64 val, INT16 datasize, FLOAT64 scale factor, FILE *file_data) { /*------------------------------------*/ INT16 *uval ; INT16 i, wtsamp ; /*------------------------------------*/ /* Memory */ /*------------------------------------*/ s val = svector (0, data size-1) ; /*------------------------------------*/ s val [0] = (INT16) (scale factor * val) ; for (i = 1; i < datasize ; i ++) s_val [i] = s_val [0]; #ifdef BYTE_SWAP_OUTPUT for (i = 0 ; i < datasize ; i ++) s_val[i] = byte_swap_intl6 (s_val [i]) ; #endif wtsamp = fwrite (s_val, sizeof (INT16), data size, file data) ; #ifdef VERBOSE

if (wt_samp ! = data size) nrerror ("Error Writing output Samples!"); #endif /___________________________________________________________ ________*/ /* Memory */ /*------------------------------------*/ free svector (s val, 0, data-size-1) ; /*------------------------------------*/ return ; /*------------------------------------*/ } /*-----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION : DIA_trace_sig (). */ /*------------------------------------*/ /* PURPOSE: Trace a signal by scaling it and writing a file */ /* with data alined with the input */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) x: signal to */ /* _(INT16 )x_size : output signal */ /* _ (FLOAT64) scale factor : scale factor for val. */ /* _ (FILE *) file_x : output file */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None */ // /* INPUT/OUTPUT */ /* None */ /*------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/

void DIA trace sig (FLOAT64 x [], INT16 a size, FLOAT64 scale_factor, FILE *file x) /___________________________________________________________ ________*/ INT16 *sx ; INT16 i, wu-vamp ; /*------------------------------------*/ /* Memory Allocation */ /*------------------------------------*/ s_x = svector (0, x_size-l) ; /*------------------------------------*/ for (i = 0; i < xsize ; i ++) s x [i] = (short) nint (scale factor * x [i]) ; &num index SWAP OUTPUT for (i = 0; i < xsize ; i ++) s_x[i] = byteswapintl6 (sx [i]) ; #endif wtsamp = fwrite (s x, sizeof (INT16), x_size, file_x) ; &num ifdef VERBOSE if (wtsamp ! = x size) nrerror ("Error Writing output Samples!"); #endif /___________________________________________________________ ________*/ /* Memory */ /*------------------------------------*/ free_svector (s_x, 0, x_size-l) ;

/*------------------------------------*/ return; /*------------------------------------*/ } /*-----------------------------------------*/ #endif /*========================================================== =========*/ /*---------------------- END ------------------*/ /*========================================================== =========*/

/* Conexant System Inc. */ /* 4311 Jamboree road */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* PROTOYPE FILE : ibdia. */ /*========================================================== =========*/ /*-----------------------------------------*/ /*----------------------------FUNCTIONS--------------------- ------------*/ /*-----------------------------------------*/ void DIAenc openfiles (void); void DIA enc close files (void); void DlA_dec_open_files (void); void DIA_dec_close_files (void); void DIA trace data (FLOAT64, INT16, FLOAT64, *) ; void DIAtracesig (FLOAT64 [], INT16, FLOAT64, *) ; /*========================================================== ================*/

/*========================================================== =========*/ /*========================================================== =*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib-fcs. */ /*------------------.--------*/ /*-----------------------------------------*/ /*------------------ INCLUDE --------------------*/ #include"typedef. h" #include"main. h" &num include"const. h" #include"gputil. h" #include"mcutil. h" #include "ext_var.h" &num include"lib_fcs. h" #include"lib_gcb. h" #include "lib_flt.h" &num include"lib_lpc. h" &num include"lib_ppp. h" #include"tracks. tab" /*------------------------------------*/ /*-------------------- FUNCTIONS ------------------*/ /______________________________________*/

/* FUNCTION : PCS_init_lib (). */ /*------------------------------------*/ /*PURPOSE : This function performs the initialisation of */ /* global variables of the library */ /*------------------------------------*/ /* INPUT ARGUMENTS : */ /*None.*/ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ None.

// /* INPUT/OUTPUT ARGUMENTS */ None.

// /* RETURN ARGUMENTS */ /* None. */ { void FCS_init_lib (void) /___________________________________________________________ ________*/ seedbfiexc = (INT64) 21845 ; /*------------------------------------*/ lpcg_m = 0.0; alpha = 0.0125; lag_m = 20; SVS_flag_m= 0; /*------------------------------------*/ /* High frequency Noise filter */ /*------------------------------------*/ FCS_Init_HF_Noise (hh_hf, L_HF); /*------------------------------------*/

/* Pulse code-books */ /*------------------------------------*/ FCS_Init CPCBQ ; /*------------------------------------*/ /* 13 bits */ /*------------------------------------*/ Stab_13b_enc = 0.0; Stab 13b dec = 0.0; /*------------------------------------*/ /* 15 bits */ <BR> // Stab 15b enc = 0. 0; Stab_15b_dec = 0.0; /*------------------------------------*/ return ; // /*/ /*========================================================== =========*/ <BR> /* FUNCTION : FCSInitCPCB (). */<BR> /*/ /* PURPOSE : This function performs the initialisation of */ /* pulse */ /*/ /* INPUT ARGUMENTS /* None. */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */

/* None. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void FCS Init CPCB (void) { /___________________________________________________________ ________*/ INT16 n, i, pli-Mode ; /*------------------------------------*/ // /*========================= 2 pulses CB =========================*/ /*------------------------------------*/ // /* 2 pulses CB: 2pulses x 5bits/pulse + 2 signs = 12 */ /*------------------------------------*/ for (i = 0 ; i < 2 ; i++) for (n = 0; n < 32; n++) p track 2 5 0 [i] [n] = track250 [i] [n]; /*------------------------------------*/ /* 2 pulses CB: 2pulses x 7 bits/pulse + 1 sign = 15 */ /*------------------------------------*/ for (i = 0; i < 2; i++) for (n = 0; n < 80; n++) p_track_2_7_1 [i] [n] = track_2_7_1 [i] [n]; /*------------------------------------*/

/*========================= 3 pulses CB =========================*/ /*-----------------------------------------*/ for (ph_mode = 0; ph_mode < 16; mode++) { for (i=0 ; i<3 ; i++) for (n = 0; n < 4; n++) p_track_3_2_80[ph_mode] [i] [n] = track320 [i] [n] + trackt40 [0] [ph mode] ; for (i = 0 ; i<3 ; i++) for (n = 0; n < 4; n++) p_track_3_2_54[ph_mode] [i] [n] = track320 [i] [n] + track_1_3_0[0][ph_mode]; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> 5 pulses CB /*------------------------------------*/ for (i = 0 ; i < 5 ; i++) for (n = 0 ; n < 16; n++) ptrack54 0 [i] [n] = track_5_4_0 [i] [n] ; for (i = 0 ; i < 5; i++) for (n = 0; n < 8; n++) p_track_5_3_1 [i] [n] = track_5_3_1 [i] [n]; for (i = 0 ; i < 5 ; i++) for (n = 0 ; n < 8 ; n++) p_track_5_3_2 [i] [n] = track532 [i] [n] ; /*-----------------------------------------*/ <BR> <BR> <BR> <BR> /*===========================pulses CB /*-----------------------------------------*/

for (i = 0 ; i < 8 ; i++) for (n = 0; n < 16 ; n++) p track 8 4 0 [i] [n] = track84 0 [i] [n] ; /*-----------------------------------------*/ return; /*-----------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCSSetCPCB (). */ /*-----------------------------------------*/ /* PURPOSE : This function performs the fixed */ /* initialisation. */ /*-----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) phas_mode : initial phase for the */ /* (INT16) bitp : number of */ _ (INT16) n_p : number of pulses. */ /* _ (INT16) Lex: excitation */ /*-----------------------------------------*/ /* OUTPUT */ /* None. */ /*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void FCS Set CPCB (INT16 phas mode, INT16 bit_p, lNT16 n_p, INT16 Lex) /*/

INT16i; /*-----------------------------------------*/ switch(n_p) <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> 2 pulses CB<BR> <BR> <BR> <BR> // case2: /*------------------------------------*/ /* 2 pulses CB : 2pulses x 5bits/pulse + 2 signs = 12 bits */ /*------------------------------------*/ if (phas_mode == 0) if (phas mode == 0) for (i = 0; i < 2; i++) Maxldx [i] = 32; track = p track 2 5 0; /*------------------------------------*/ /* 2 pulses CB: 2pulses x 6. 5bits/pulse + 1 sign = 14 */ // if (phas mode == 1) { for (i = 0; i < 2; i++) MaxIdx [i] = 80; track = p track27l ; break; /*------------------------------------*/

/*======================= pulses ========================*/ /*-----------------------------------------*/ case 3 : if (Lex == LSF) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> /_______________________________________________________*/ /* 3 pulses CB: 3 pulses x 2 bits/pulse */ /* 3 signs = 9 bits */ /*------------------------------------*/ for (i=0 ; i<3 ; i++) Maxldx [i] = 4; track = p_track_3_2_80 [phas_mode] ; // } else { /*------------------------------------*/ /* 3 pulses CB 3 pulses x 2 bits/pulse */ /* 3 signs = 9 */ /* 3 pulses CB 3 pulses x 2 bits/pulse + 3 */ /* + 3bits center = 11 bits */ /*------------------------------------*/ for (i = 0 ; i < 3 ; i++) Maxldx [i] = 4; track = p_track_3_2_54 [phas_mode]; } break; <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> break pulses CB<BR> <BR> <BR> <BR> <BR> //

case 5: /*------------------------------------*/ /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ /*/ if (phas mode == 0) for (i = 0; i < 5 ; i++) Maxldx [i] = 16; MaxIdx [2] = 8; MaxIdx [4] = 8; track = p_track_5_4_0; <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* 5 pulses CB : 5p x 3b + 5b signs = 20 bits */ /*------------------------------------*/ if (phas_mode == 1) if (phas mode == 1) for (i = 0; i < 5; i++) MaxIdx [i] = 8; track = p_track_5_3_1 ; } // /* 5 pulses CB: 5p x 3b + 5b signs = 20 */ // if (phas mode == 2) { for (i = 0; i < 5; i++) MaxIdx [i] = 8; track = p_track_5_3_2 ; <BR> <BR> <BR> <BR> }<BR> break; break; /*------------------------------------*/

8 pulses CB /*------------------------------------*/] case8 : /*------------------------------------*/ /* 8 pulses CB : 6p x 3b + 2p x 4b + 4b signs = 30 bits */ /___________________________________________________________ */ for (i=0 ; i < 8 ; i++) Maxldx [i] = 8 ; Maxldx [O] = 16; MaxIdx [4] = 16; track=p_track_8_4_0; break; /*------------------------------------*/ default: &num ifdef VERBOSE nrerror (" Error in the definition of track [] ! !") ; #endif break; /*------------------------------------*/ <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________*/ return; /*-----------------------------------------*/ <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION ; FCS_Init_HF_Noise (). */ //

/* PURPOSE : This function generated a impulse */ /* introducing a random noise in the */ /* frequencies. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) I_sf : sub-frame */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) hhhf : high frequency noise */ /* response. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> t<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // INT64 seed; FLOAT64 ZI=0, Z2=0; INT16 i; FLOAT64 x; /*------------------------------------*/ /* Initialisation */ /*------------------------------------*/ seed = 56672; Z1 = 0 ; Z2 = 0 ; for (i = 0; i < 1_hf; i++) hh_hรญli] = GCBgaussnoise (&seed); for (i = 0; i < I_hf ; i++) {

x =hh_li]-Zl ; Zl = hh_hf[i]; hh_hf[i] = x; x = hh_hfli]-Z2 ; Z2 = hh_hfli] ; hh_hf[i] = x; } for (i = 0 ; i < I hf ; i++) { x = cos(i*PI*1.0/1_hf); i] *= 0. 03* (0.45*x); hh_hf [0] = 1.0; /*/ return ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /* FUNCTION : FCS_DetermPulsLoc (). */ /*------------------------------------*/ /* PURPOSE : This function determines all pulse */ /* and their magnitudes in terms of the */ /* function and the main pulse whose */ /* needs to be */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64) PitGain: current pitch */ /* (INT16) pitch: current pitch */ /* _ (FLOAT64) Mag: current pulse */ /* _(INT16 ) Loc: current pulse */

/* _ (INT16) I_sf: sub-frame */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) MagV: array of pulse */ /* _ (INT16 []) LocV: array of locations magnitudes. */ <BR> <BR> <BR> /* _ (INT16 *) NumPit: number of */<BR> <BR> <BR> <BR> <BR> // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* RETURN */ /* None. */ void FCS_DetermPulsLoc (FLOAT64 PitGain, INT16 pitch, FLOAT64 Mag, INT16 Loc, FLOAT64 MagV[], INT16 LocV[], INT16 *NumPit, INT16 1_sf) <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*---------------------------------------------------------- ---------<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT16 i, N, M, max_i ;<BR> INT16 i, N, M, max_i; /*------------------------------------*/ MagV [0] = Mag; LocV (0] = Loc; N = 0; if (PitGain < 0.4) max_i = 3; else max_i = 4; for (i = 1; i < max_i ; i++) if ( (Loc + pitch * i) < lsf) { MagV [i] = MagV [i-l] *PitGain; LocV [i] = Loc + pitch*i ; N = i;

else break; <BR> <BR> <BR> <BR> <BR> <BR> } MIN ; /*------------------------------------*/ if ( ( (Loc-pitch) >= 0) && ((N+1) < max i)) MagV [1+N] = Mag V[0] *PitGain; LocV [1+N] = Loc-pitch ; M = N+1; for (i = 2; i < max-i-N ; i++) { if ((Loc - pitch*i) >= 0) { MagV [i+N] =MagV [i+N-1] *PitGain; LocV [i+N] =Loc-pitch*i; M = N+i; } else break; } } <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ (*NumPit) = M+1 ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*------------------------------------*/<BR> return; /*------------------------------------*/

/*-----------------------------------------*/ /* FUNCTION :FCSOneSearchCPCB().*/ // /* PURPOSE : This function determines the position of */ /* pulse using the forward pitch */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT16 ) n_p : number of */ /* _ (INT16 []) Idx : array of idexes. */ (FLOAT64 Mag : array of current pulse mgnitude. */ /* _ (FLOAT64 []) ref sig : target signal. */ /* _ (INT16 []) IdxOpt : optimized index */ /* _(INT16 []) PosOpt: optimized pulse postion */ // /* OUTPUT ARGUMENTS */ /* (FLOAT64 *) Rn-m : maximized criterion */ /* _(INT16 *) Rdm : maximized criterion denominator. */ // /* INPUT/OUTPUT ARGUMENTS */ /* _(FLOAT64 *) MaxCrit: maximized criterion. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void FCSOneSearchCPCB (INT16 n_p, INT16 Idx [], FLOAT64 [], FLOAT64 ref sig [], INT16 IdxOpt [], INT16 PosOpt [], FLOAT64 *MaxCrit, FLOAT64 *Rn_m, FLOAT64 *Rdm) { /*/ INT16 n, k, Pos [MAXPN] ; FLOAT64 GG, Rn, Rd; /*------------------------------------*/ for (n = 0 ; n < n_p ; n++)

Pos [n] = track [n] [Idx [n]] ; Rn=0 ; for (n = 0; n < n_p ; n++) Rn += ref sig [Pos [n]] *Mag [n]; /*------------------------------------*/ Rd=0 ; for (n = 0; n < np-l ; n++) for (k = n+1 ; k < np ; k++) Rd += Mag [n] *PHI [Pos [n]] [Pos [k]] *Mag [k]: Rd *= 2 ; for (n = 0 ; n < np ; n++) Rd += Mag [n] *PHI [Pos [n]] [Pos [n]] *Mag [n] ; /*------------------------------------*/ GG = Rn*Rn/MAX (0. 1, Rd); if (GG > (*MaxCrit)) { (*MaxCrit) = GG; for (n = 0; n < n_p ; n++) IdxOpt [n] = Idx [n] ; PosOpt [n] = Pos [n] ; } (*Rn_m) = Rn; (*Rd m) = Rd; /*------------------------------------*/ return; /*------------------------------------*/

/*-----------------------------------------*/ FUNCTION : FCSOneSearch4kCB (). */ /*------------------------------------*/ /* PURPOSE : This function determines the position of */ /* pulse using the forward + backward */ /* enhancement. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16 []) SignTab: array of pulse */ /* _ (FLOAT64) pit_g : current pitch */ /* _ (INT16) lag : current pitch */ /* _ (INT16) n_p : number of */ /* _ (INT16) no_p : pulse */ /* (INT16 []) Idx : array of */ /*- (FLOAT64 []) Mag : array of current pulse mgnitude. */ /* _ (FLOAT64 []) ref sig : target signal. */ /* _ (INT16) I_sf : sub-frame */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (INT16 []) IdxOpt : optimized index */ /* _(INT16 []) PosOpt: optimized pulse postion array. */ /* _(FLOAT64 *) Rn-m : maximized criterion */ /* (INT16 *) Rdm : maximized criterion denominator. */ /*/ /* INPUT/OUTPUT */ /* _ (FLOAT64 *) MaxCrit: maximized criterion. */ /*---------------------------------------------------------- ---------/ /* RETURN ARGUMENTS */ /* None. */ l = void FCSOneSearch4kCB (INT16 SignTab [], INT16 lag, FLOAT64 pit_g, INT16 no_p, INT16 n_p, INT16 Idx [], FLOAT64 Mag [], FLOAT64 ref sig [], INT16 IdxOpt [], INT16 PosOpt [], FLOAT64 *MaxCrit, FLOAT64 *Rn_m, FLOAT64 *Rd_m, INT16 1_sf) { /*/

INT16 n, k, Pos [MAXPN], Num, NumP, LocP [MAXFBPULSENUM*MAXPN] ; FLOAT64 GG, Rn, Rd, Rdl, MagP [MAX_FB_PULSE_NUM+MAXPN] ; /*------------------------------------*/ /* Determine pulses */ /*------------------------------------*/ NumP = 0; for (n = 0 ; n < n_p ; n++) { Pos [n] = track [n] [Idx [n]] ; FCS_DetermPulsLoc (pit_g, lag, (Mag [n] *SignTab [Pos [n]]), Pos [n], MagP+NumP, LocP+NumP, &Nmn, lsf) ; NumP += Num ; } // /* Correlation */ /*------------------------------------*/ Rn = 0 ; for (n = 0; n < NumP ; n++) Rn += ref sig [LocP [n]] *MagP [n]; /*------------------------------------*/ /* Energy */ // Rd=0 ; for (n = 0; n < NumP-1 ; n++) { Rdl = 0.0; for (k = n+1 ; k < NumP; k++) Rdl += PHI [LocP [n]] [LocP [k]] *MagP [k]; Rdl *= MagP [n]; Rd += Rd1;

Rd *= 2 ; for (n = 0; n < NumP ; n++) Rd += MagP [n] *PHI [LocP [n]] [LocP [n]] *MagP [n] ; /*/ /* Criterion calculation and */ /*------------------------------------*/ GG = Rn*Rn/MAX (0. 1, Rd); if (GG > (*MaxCrit)) (*MaxCrit) = GG; IdxOpt [no_p] = Idx [no_p] ; PosOpt [no_p] = Pos [no_p] ; (*Rn_m) = Rn; (*Rdm) = Rd; /*------------------------------------*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS_Full_Search_CPCB (). */ /*------------------------------------*/ /* PURPOSE : This function determines the pulses */ /* using forward pitch enhancement. */ /*------------------------------------*/ /* INPUT */ /* (INT16) phas mode : initial phase for the pulses. */ /* _ (FLOAT64) pmag : pulse magnitude. */

/* _(INT16 ) n_p: number of pulses. */ /* _(INT16 []) SignTab: array of pulse */ /*- (FLOAT64 []) ref sig : target */ /* (INT16) Lex: excitation */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (INT16 []) SignOpt: optimized array of pulse */ /* _ (FLOAT64 []) EXopt: optimized excitation signal. */ /* _ (INT16 Q) SignOpt: optimized array of */ /*------------------------------------*/ /t INPUT/OUTPUT ARGUMENTS */ /* _(FLOAT64 *) Criterion: maximized */ /*------------------------------------*/ /* RETURN ARGUMENTS */ None.

/*======================================================= ============*/ void FCS_Full_Search_CPCB (INT16 phas mode, INT16 SignOpt [], FLOAT64 pmag, INT16 bits_p, INT16 n_p, INT16 SignTab [], FLOAT64 ref_sig [], FLOAT64 *Criterion, FLOAT64 EXopt [l, INT16 Lex, INT16 IndexOpt []) { /*------------------------------------*/ INT16 k, Idx [MAXPN], IdxOpt [MAXPN], PosOpt [MAXPN] ; FLOAT64 GG, Rn m, Rdm, MaxCrit, Mag [MAXPN] ; /*------------------------------------*/ Algorithm initialisation /*------------------------------------*/ /*------------------------------------*/ /* Set-up the track positions */ /*------------------------------------*/ FCS_Set_CPCB (phas_mode, bits_p, n_p, Lex) ; /*------------------------------------*/ /* Magnitudes of */

/*------------------------------------*/ GG = 1.0; for (k = 0 ; k < n_p ; k++) { Mag [k] = GG ; GG *= pmag ; /*------------------------------------*/ /*======================== Close-loop searching =====================*/ /*------------------------------------*/ MaxCrit =-1 ; switch (n_p) { // /* 2 pulses */ // case 2: for (Idx [O] = 0 ; Idx [O] < Maxldx [0]; Idx[0] ++) for (Idx [l] = 0 ; Idx [1] < MaxIdx [l] ; Idx [l] ++) FCS_One_Search_CPCB (n_p, Idx, Mag, ref_sig, IdxOpt, PosOpt, &MaxCrit, &Rn_m, &Rd_m) ; break; /*------------------------------------*/ /* 3 pulses */ /*------------------------------------*/ case 3: for (Idx [O] = 0 ; Idx [O] < MaxIdx [0]; Idx[0] ++) for (Idx [l] = 0 ; Idx [l] < MaxIdx[1] ; Idx [l] ++) for (Idx [21 = 0; Idx [2] < MaxIdx [2] ; Idx [2] ++) {

FCS_One_Search_CPCB(n_p, Idx,Mag, ref_sig, IdxOpt, PosOpt, &MaxCrit, &Rn_m, &Rd_m); } break; /*------------------------------------*/ default: #ifdef VERBOSE nrerror ("Invalid number of pulses ! !") ; #endif break; /*-----------------------------------------*/ } // /* Excitation */ // if (MaxCrit > (*Criterion)) (*Criterion) = MaxCrit; for (k = 0; k < n_p ; k++) SignOpt [k] = SignTab [PosOpt [k]]; for (k = 0 ; k < n_p ; k++) IndexOpt [k] = IdxOpt [k]; inidvector (EXopt, 0, Lex-1, 0.0); for (k = 0 ; k < np ; k++) EXopt [PosOpt [k]] += SignOpt [k] *Mag [k];

/*-----------------------------------------*/ return ; /*-----------------------------------------*/ // /*========================================================== =========*/ /* FUNCTION : FCSSimpSearchCPCB (). */ /*__________________________________________________________ _________*/ /* PURPOSE : This function determines the pulses */ /* using a simplifie algorithm and the forward */ /* pitch */ /*-----------------------------------------*/ /* INPUT ARGUMENTS : */ /* (INT16) tum0 : first turn */ /* _ (INT16) turnl : last turn number. */ /* _ (INT16) phas mode : initial phase for the pulses. */ /* _ (FLOAT64) pmag : pulse */ /* (INT16) np : number of */ /* _(INT16 []) SignTab: array of pulse */ /* _ (FLOAT64 []) ref sig : target */ /* _(INT16 ) Lex: excitation */ /*-----------------------------------------*/ /* OUTPUT */ /* (INT16 []) SignOpt: optimized array of pulse */ /* (FLOAT64 []) EXopt: optimized excitation */ /* _ (INT16 []) IndexOpt: optimized array of */ /*-----------------------------------------*/ /* INPUT/OUTPUT */ /* _ (FLOAT64 *) Criterion: maximized criterion. */ /*-----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/

void FCS_Simp_Search_CPCB (INT16 turn0, INT16 turn1, INT16 phas-mode, INT16 SignOpt [], FLOAT64 pmag, INT16 bits_p, INT16 n_p, INT16 SignTab [], FLOAT64 ref_sig[], FLOAT64 *Criterion, FLOAT64 EXopt [], INT16 Lex, INT16 IndexOpt []) // INT16 n, flag ; INT16 kO, kl, k, i, m, POS, Idx [MAXPN], IdxOpt [MAXPN], PosOpt [MAXPN]; FLOAT64 GG, Rnm, Rd_m, MaxCrit, Mag [MAXPNI ; /*-----------------------------------------*/ /*======================= Algorithm initialisation ==================*/ /*-----------------------------------------*/ // /* Set-up the track */ /*-----------------------------------------*/ FCS_Set CPCB (phas_mode, bits_p, n_p, Lex); /*-----------------------------------------*/ /* Magnitudes of */ // GG = 1.0; for (k = 0; k < n_p ; k++) Mag [k] = GG ; GG *= pmag ; /*-----------------------------------------*/ /* Reset for signed pulses */ /*-----------------------------------------*/ if (turn0 == 0) {

/*------------------------------------*/ for (k = 0 ; k < np ; k++) Idx [k] = 0 ; for (k = 0; k < n_p; k++) { MaxCrit =-32767*32767; for (i = 0 ; i < MaxIdx [k] ; i++) { flag = 1 ; POS = track [k] [i] ; for (n = 0; n < k; n++) if (POS == PosOpt [n]) flag = 0 ; if ((ref_sig[POS] > MaxCrit) && (flag == 1)) MaxCrit = ref_sig[POS]; Idx [k] = i ; PosOpt [k] =POS; } IdxOpt [k] = IndexOpt [k] ; /*------------------------------------*/ // else for (k = 0 ; k < n_p ; k++) Idx [k] = IndexOpt[k]; IdxOpt [k] =lndexOpt [k]; PosOpt[k]=track [k] [ldx [k]] ; }

/*-----------------------------------------*/ Close-loop searching /*-----------------------------------------*/ if (((n_p == 5) || (n_p == 8)) && (turn0 > 0)) { /*------------------------------------*/ /* 5 and 8 pulses */ /*----------*/ if (n_p == 5) // /* 5 pulses */ /*------------------------------------*/ MaxCrit =-1 ; k=0 ; while (k < n_p) { k0 = k; k1 = k+1; if (k1 == n_p) kl = 0 ; for (Idx [k0] = 0; Idx [k0] < MaxIdx [k0] ; Idx [k0] ++) for (Idx[k1] = 0; Idx [kl] < MaxIdx [kl] ; Idx [kl] ++) FCS One Search CPCB (n_p, Idx, Mag, ref sig, IdxOpt, PosOpt, &MaxCrit, &Rn m, &Rdm) ; Idx[k0]=IdxOpt[k0]; Idx[k1]=IdxOpt[k1]; if (k == n_p-1) k = 1; else } } if (n_p == 8)

/*------------------------------------*/ /* pulses /*------------------------------------*/ MaxCrit =-1; k=0 ; while (k < MAXPN) { k0 = srchpuls[k]; k1 = srchpuls[k+1]; for (Idx [k0] = 0 ; Idx [k0] < MaxIdx[k0]; Idx[k0] ++) for (Idx [kl] = 0 ; Idx [kl] < Maxldx [kl], Hx [kl] ++) FCS_One_Search_CPCB(n_p, Idx, Mag, ref_sig, IdxOpt, PosOpt, &MaxCrit, &Rn_m, &Rd_m) ; Idx [k0] = IdxOpt [k0] ; Idx [kl] = IdxOpt [kl] ; k += 2 ; } } } else { // /* Others pulsc configuration */ /*----------------------*/ for (m = turnO ; m <= turn I ; m++) { for (k = 0; k < n_p; k++) { MaxCrit=-l ; for (Idx [k] = 0; Idx [k] < MaxIdx [k]; Idx [k] ++) { flag = 1; POS = track [k] [Idx [k]];

for (i = 0 ; i < k ; i++) { if (POS == PosOpt[i]) flag = 0; } for (i = k+1 ; i < np ; i++) { if (POS == PosOpt [i]) flag = 0 ; if (flag == 1) FCSOneSearchCPCB (np, Idx, Mag, ref sig, IdxOpt, PosOpt, &MaxCrit, &Rn_m, &Rd_m) ; Idx [k] = [IdxOpt [k]; } } /*------------------------------------*/ // /*================= Criterion calculation and maximisation ==============*/ /*-----------------------------------------*/ if (MaxCrit > (*Criterion)) { (*Criterion) = MaxCrit; for (k = 0 ; k < n_p ; k++) SignOpt [k] =SignTab [PosOpt [k]] ; for (k = 0 ; k < n_p ; k++) IndexOpt [k] = IdxOpt [k]; inidvector (EXopt, 0, Lex-1, 0.0); for (k = 0 ; k < np ; k++) EXopt [PosOpt [k]] += SignOpt [k] *Mag[k];

/*-----------------------------------------*/ return ; /* */ } // /*========================================================== =========*/ /* FUNCTION : FCSSimpSearch4kCB (). */ // /* PURPOSE : This function determines the pulses */ /* using a simplified algorithm and the forward */ /* backward pitch */ /*-----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) turn0 : first turn */ /* _ (INT16) turnl : last turn number. */ /* (INT16) phas mode : initial phase for the */ /* _ (FLOAT64) pmag : pulse */ (INT16) bits_p : bits per */ /* _ (INT16) n_p : number of pulses. */ /* (INT16 []) SignTab: array of pulse */ /* (FLOAT64 []) ref sig : target */ /* _ (INT16) Lex: excitation */ /* _ (INT16) lag : current pitch */ /* _(FLOAT64 ) pit_g: pitch gain. */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (INT16 []) SignOpt: optimized array of pulse */ /* _ (FLOAT64 []) EXopt: optimized excitation */ /* _(INT16 []) Indexpt: optimized idex array. */ /*-----------------------------------------*/ /* INPUT/OUTPUT */ /* _(FLOAT64 *) Criterion: maximized criterion. */ /*-----------------------------------------*/ /* RETURN ARGUMENTS */

None.

/*======================================================= ============*/ void FCSSimpSearch4kCB (INT16 turnO, INT16 turnl, INT16 phas-mode, INT16 SignOpt [], FLOAT64 pmag, INT16 bits_p, INT16 n_p, INT16 SignTab [], FLOAT64 ref sig [], FLOAT64 *Criterion, FLOAT64 EXopt [], INT16 Lex, INT16 IndexOpt [], INT16 lag, FLOAT64 pit_g) { /*/ INT16 flag ; INT16 k, i, m, POS, Idx [MAXPN], IdxOpt [MAXPN], PosOpt [MAXPN], LocV [6] ; FLOAT64 GG, Rn_m, Rdm, MaxCrit, MaglMAXPN], MagV [6] ; FLOAT64 x; /*-----------------------------------------*/ Algorithm initialisation /*-----------------------------------------*/ /*-----------------------------------------*/ /* Set-up the track */ /*-----------------------------------------*/ FCS_Set_CPCB (phas_mode, bits_p, n_p, Lex); /*-----------------------------------------*/ /* Magnitudes of */ /___________________________________________________________ ________*/ GG = 1.0; for (k = 0 ; k < n_p ; k++) Mag [k] = GG ; GG *= pmag ; /___________________________________________________________ ________*/ /* Reset for signed */

/*-----------------------------------------*/ if (turn0 == 0) { // for (k = 0; k < n_p ; k++) POS = track [k] [0] ; MaxCrit = ref_sig[POS]; Idx [k] = 0 ; for (i = 1; i < Maxldx [k]; i++) POS = track [k] [i] ; x = fabs (ref_sig [POS]); if (x > MaxCrit) { MaxCrit = x; Idx [k] = i; PosOpt [k] = POS ; } IdxOpt[k]=Idx[k]; } /*------------------------------------*/ else for (k = 0; k < n_p; k++) { Idx [k] = IndexOpt [k] ; IdxOpt [k] =IndexOpt [k] ; PosOpt [k] =track [k] [Idx [k]]; /___________________________________________________________ ________*/ /*======================= Close-loop searching =====================*/

/*-----------------------------------------*/ for (m = turnO ; m <= turn1 ; m++) { for (k = 0 ; k < n_p ; k++) MaxCrit =-1 ; for (Idx [k] = 0; Idx [k] < MaxIdx [k]; Idx [k] ++) flag = 1; POS = track[k][Idx[k]]; for (i = 0 ; i < k ; i++) if (POS == PosOpt[i]) flag = 0 ; } for (i = k+1 ; i < n_p ; i++) { if (POS == PosOpt[i]) flag=0 ; if (flag == 1) FCSOneSearch4kCB (SignTab, lag, pit_g, k, n_p, Idx, Mag, ref_sig, IdxOpt, PosOpt, &MaxCrit,&Rnm, &Rdm, Lex); } Idx[k]= IdxOpt[k]; } /*/ /*=============== Criterion calculation and maximisation ================*/ /*-----------------------------------------*/ if (MaxCrit > (*Criterion))

{ (*Criterion) = MaxCrit; for (k = 0; k < n-P, k++) SignOpt [k] = SignTab [PosOpt [k]]; for(k = 0 ; k < n_p; k++) IndexOpt [k] = IdxOpt [k]; inidvector (EXopt, 0, Lex-1, 0.0); for (k = 0; k < n_p; k++) FCS DetennPulsLoc (pit_g, lag, Mag [k], PosOpt [k], MagV, LocV, &m, Lex) ; for (i = 0; i < m; i++) EXopt [LocV [i] 1 += MagV [i] *SignOpt [k]; } /*/ return ; /*-----------------------------------------*/ } /*--------------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTION : FCSDecodCPCB (). */ /*------------------------------------*/ /* PURPOSE: This function decode the fixed */ /*------------------------------------*/ /* INPUT */ /* _(INT16 ) phas_mode : initial phase for the */ /* _(INT16 []) Sign: array of pulse signs. */ /* _ (FLOAT64) pmag: magnitude of */ /* (FLOAT64) bitsp: number of bits per pulse. */ /* _(INT16 )n_p : number of */ /* _(INT16 []) Index: optimized array of */ /* _(INT16 ) Lex: excitation */

/*------------------------------------*/ /*OUTPUT */ /* (FLOAT64 []) EXopt: optimized excitation */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void FCS Decod CPCB (INT16 phas mode, INT16 Sign [], FLOAT64 pmag, INT16 bits_p, INT16 n_p, FLOAT64 EXopt [], INT16 Lex, INT16 Index []) /*------------------------------------*/ INT16 n, k, Pos [MAXPN] ; FLOAT64 GG; // /* Set-up the track */ /*------------------------------------*/ FCSSetCPCB (phasmode, bitsp, nj). Lex); for (n = 0 ; n < n_p ; n++) Pos [n] = track [n] [Index [n]] ; /*------------------------------------*/ /* Calculate the excitation */ /*------------------------------------*/ ini-dvector (EXopt, 0, Lex-1, 0.0); Gag=1. 0; for (k = 0 ; k < n_p ; k++) { EXopt [Pos [k]] += Sign [k] *GG ; GG *= pmag ;

/*-----------------------------------------*/ return ; /*-----------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS_Decod_PitCB 0. */ /*-----------------------------------------*/ /* PURPOSE : This function determines decode the */ /* codebook and performs the forward and */ /* pitch */ // /* INPUT ARGUMENTS */ /* _ (INT16) phas mode : initial phase for the */ /* _ (INT16 []) Sign : array of pulse */ /* (FLOAT64) pmag: magnitude of */ /* _ (INT16) bits_p : number of bits per */ (INT16) n_p : number of */ /* _ (INT16) Lex : excitation */ /* _ (INT16 []) Index: optimized array of */ /* _ (INT16) lag : pitch */ /* _ (FLOAT64) pit g : pitch */ /*-----------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) EXopt: optimized excitation */ /*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* RETURN */ /* None. */ void FCSDecodPitCB (INT16 phas mode, INT16 Sign [], FLOAT64 pmag, INT16 bits_p,

INT16 n_p, FLOAT64 EXopt [], INT16 Lex, INT16 Index [], INT16 lag, FLOAT64 pit_g) /*-----------------------------------------*/ INT16 k, i, Pos [MAXPN], LocP [5], NumP; FLOAT64 GG, MagP [5] ; /___________________________________________________________ ________*/ /* Set-up the track */ /*-----------------------------------------*/ FCS_Set_CPCB (phas_mode, bits_p, n_p, Lex); for (k = 0 ; k < np ; k++) Pos [k] = track [k] [Index [k]] ; // Calculate the excitation */ /*-----------------------------------------*/ ini_dvector(EXopt, 0, Lex-1, 0.0); GG = 1.0; for (k = 0 ; k < n_p ; k++) { FCS DetennPulsLoc (pit_g, lag, GG, Pos [k], MagP, LocP, &NumP, Lex); for (i = 0; i < NumP; i++) EXopt [LocP [i]] += Sign [k] *MagP [i]; GG *= pmag ; } /___________________________________________________________ ________*/ return; /___________________________________________________________ ________*/

/*-----------------------------------------*/ /*=========================================== /* FUNCTION : FCS_Calc_pre_search (). */ /*------------------------------------*/ /* PURPOSE: This function determines. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) hh: impulse sesponse W (z) /A */ /* _(INT16 ) lag: pitch lag. */ /* _(FLOAT64 ) pgain: pitch */ /* _(FLOOAT64 []) target: target */ (INT16 SignTab: array of pulse */ /* _ (INT16 []) res:"ideal excitation"signal. */ /* _ (FLOAT64) SignWeight : weigthing factor for sign pulse*/ /* determination (0.0 in all */ /* calls). */ /* _(INT16 ) AppSign: use of sign table */ /* _(INT16 )1_sf: excitation size. */ /*------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 *) Gpm : modified pitch gain for harmonic*/ /* weighting. */ /* _ (FLOAT64 []) ref : reversed target */ /* _(FLOAT64 []) hh_v : modified impulse */ // /* INPUT/OUTPUT */ None.

/*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ---------- void FCS_Calc_pre_search (FLOAT64 hh [], FLOAT64 hhv [], INT16 lag, FLOAT64 pgain, FLOAT64 *Gpm, FLOAT64 target [], FLOAT64 refEl, INT16 SignTabQ, FLOAT64 res [], FLOAT64 SignWeight, INT16 AppSign, INT16 lsf) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> {

INT16 i, j, k; FLOAT64 tinp [L_SF], GG, CC; FLOAT64 *buf ; /*-----------------------------------------*/ buf= dvector (0, 1_sf-1) ; /*-----------------------------------------*/ /* Harmonic weighting on */ /*-----------------------------------------*/ cpy_dvector(hh, hh_v, 0, 1_sf-1); (*Gp_m) = MIN (pgain, PASTPGAINMAX) ; (*Gp_m) = MAX(PAST_PJGAIN_MIN, (*Gp_m)); if (AppSign == 1) for (i = lag; i < 1_sf; i++) hh_v[i] = hh_v[i] + (*Gp_m) * hh_v[i-lag]; /*-----------------------------------------*/ /* Backward */ /*-----------------------------------------*/ for (j = 0 ; j < I_sf ; j++) ref[j] = target[1_sf-1-j]; filterAZ (h ! iv, ref, tmp, buf, (INT16) (1_sf-l), l_sf) ; for (j = 0 ; j<tsf ; j++) refjjJ = tmp [1_sf-1-j]; /*-----------------------------------------*/ /* Calculte PHI [] */ /*-----------------------------------------*/ for (i = 0 ; i < I_sf ; i++) PHI[i][1_sf-1] = hh_v[1_sf-1-i]*hh_v[0];

for (k = 1 ; k < I_sf ; k++) for (i = 1 ; i <= k ; i++) PHI [k-il [l_sf-l-il = PHI [k-i+1] [1_sf-i] + hh_v[1_sf-k+i- 1]*hh_v[i]; /*------------------------------------*/ /* Set-up Signtable */ /*------------------------------------*/ if (SignWeight > 0. 01) dot dvector (ref, ref, &GG, 0, 1_sf-1) ; dot dvector (res, res, &CC, 0, 1_sf-1) ; CC = sqrt (GG/MAX (CC, 0.1)); CC *= SignWeight ; for (i = 0; i < 1_sf; i++) tmp [i] = CC*res [i]+ref[i]; for (i = 0; i < 1_sf; i++) if (tmp [i] > 0) SignTab [i] = 1; else SignTab [i] =-l ; } else { for (i = 0 ; i < 1_sf; i++) if (ref [i] > 0) SignTab [i] = 1 ; else SignTab [i] =-1 ;

/*-----------------------------------------*/ Apply sign table /*-----------------------------------------*/ if (AppSign == 1) { for (i = 0 ; i < i_sf; i++) ref[i] *= SignTab [i) ; for (i = 0 ; i < I i++) for (j = i ; j < I_sf ; j++) PHI [illjl *= SignTab [i] *SignTab[j] ; for (i = 1 ; i < 1_sf; i++) for (j = 0 ; j < i ; j++) PHI[i][j] = PHI[j][i]; /*------------------------------------*/ free dvector (buf, 0, 1_sf-1) ; /*------------------------------------*/ return ; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS PulseExchange 0. */ /*------------------------------------*/ /* PURPOSE : This function swaps pulse 1 and 2 sign and index. */ /*/ /* INPUT ARGUMENTS : */ /* None. */ /*------------------------------------*/ /* OUTPUT */

/* None. */ /*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ - (INT16 *) indexl: pulse 1 */ /*- (INT16 *) signl: pulse 1 */ /* _(INT16 *)index2 : pulse 2 index. */ /* _(INT16 *)sign2 : pulse 2 */ // /* RETURN */ /* None. */ vooid FCS_PulseExchange(INT16 *index1, INT16 *sign1, INT16 *index2, INT16 *sign2) <BR> <BR> <BR> <BR> {<BR> { INT16 i; INT16 i; /*-----------------------------------------*/ i = (*index1); (*indexl) = (*index2) ; (*index2) = i; i = (*signl); (*signl) = (*sign2); (*sign2) = i; /*-----------------------------------------*/ return ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /* FUNCTION FCSSTparameter (). */ /*-----------------------------------------*/ /* PURPOSE: This function determines the stationary */

/* coefficient that is comprise between 0.0 and 1.0. */ /*-----------------------------------------*/ /* INPUT ARGUMENTS */ /* (INT16) isf : sub-frame */ /* _ (INT16) rate m : selected */ /* (INT16) SVSflag : coding mode */ /* _ (FLOAT64 []) pdcfq: quantized prediction coeff. */ /* _(INT16 )lag : pitch lag. */ /* _ (FLOAT64) lpcg : LC gain. */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS*/ /* (FLOAT64 []) pdcfq_w : weighted quantized predic. coeff. */ /*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _(FLOAT64 *) Stab: stationary signal cvaluation */ /* coefficient (0.

/*-----------------------------------------*/ /* RETURN */ /* None. */ <BR> <BR> <BR> <BR> None. void FCS ST_parameter (INT16 isf, INT16 rate m, INT16 SVS_flag, FLOAT64 pdcfq [], INT16 lag, FLOAT64 *Stab, FLOAT64 pdcfq_w [], FLOAT64Ipcg) // FLOAT64 y, val ; INT16i; /*-----------------------------------------*/ <BR> <BR> <BR> <BR> /* LPC */<BR> <BR> <BR> <BR> <BR> // if(isf==0) { y =, fabs (lpcg-lpcg_m)/MAX (fabs (lpcg + !pcgm), EPSI); if ((SVS_flag ! = 1) && (abs (lag-lag m) > 0. y = 1.0;

(*Stab) = 0.25 * (*Stab) + 0.75* (1.0-y); if (rate m ! = RATE4_0K) (*Stab) = 0; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /__________________________________________________________* /<BR> <BR> <BR> <BR> <BR> /* Update memory */ /*-----------------------------------------*/ lpcg_m = lpcg ; lag_m = lag; /*------------------------------------*/ /* Update the weighting coefficients */ /*------------------------------------*/ if (lpcg < 10.0) alpha = 0. 0125; else { if (Ipcg < 20. 0) alpha = 0.025; else alpha = 0.05; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> // val =1.0; for (i = 0; i < NP; i++) { val *= alpha; pdcfq-w [i] = pdcfq [i] * val ; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> // return;

/*-----------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS_Search_pastcrr (). */ /*------------------------------------*/ /* PURPOSE : This function calculate the autocorrelation */ /* the past weighted quantized */ /*------------------------------------*/ /* INPUT ARGUMENTS */ (FLOAT64 ext : excitation */ /* _(FLOAT64 []) pdcfq: quantized prediction coeff. */ /* (FLOAT64) Stab: stationary signal */ /* coefficient (0.

/* _(INT16 )pitch : pitch value. */ /* _ (FLOAT64) ltpg : LTP gain. */ /* _ (INT16) SVS flag : coding mode */ /* (INT16) isf : sub-frame */ /* _(INT16 )1_sf: sub-frame size. */ // /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) Rw : autocorrelation */ /* _ (FLOAT64 []) T_Rw : index of autocorrelation */ /* _(FLOAT64 *)N_Rw : number of autocorrelation */ /*-----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*-----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void FCSSearchpastcorr (FLOAT64 ext [], FLOAT64 pdcfq [], FLOAT64 Stab, INT16 pitch, FLOAT64 Itpg, INT16 rate m, INT16 SVS_flag, INT16 i_sf, INT16 I_sf, FLOAT64 Rw [], INT16 TRw [], INT16 *NRw) {

/*-----------------------------------------*/ FLOAT64 x, y, pdcfq_w [NP], wsp [L_WSPl, tmpmem [NP], val; INT16 i, k, m ; /*-----------------------------------------*/ /* Weighting filtering */ /*-----------------------------------------*/ val = 1.0; for (i = 0; i < NP; i++) { val *= 0.85; pdcfq_w [i] = pdcfq [i] * val ; } ini_dvector (tmpmem, 0, NP-1,0.0); if (SVS_flag != 1) FLT_allsyn (ext+MAX_LAG-L_WSP, L_WSP, pdcfq_w, NP, wsp, tmpmem); else if (isf==0) cpy_dvector (ext+MAXLAG-LWSP, wspm, 0, L_WSP-1) ; FLT_allsyn(wsp_m, L_WSP, pdcfq_w, NP, wsp, tmpmem); <BR> <BR> <BR> }<BR> // Correlation /* Correlation */ /*-----------------------------------------*/ dot_dvector (wsp+L_WSP-L_CORR, wsp+L_WSP-L_CORR, &x, 0, L_CORR-1); (*NRw) = 0; inidvector (Rw, 0, 1_sf-1, 0.0); for (k=3 ; k<5 ; k++) { i = (INT16) (pitch/k + 0. 5);

if ((i<l_sf) && (i> min_pit)) { for (m = 1; m < 6 ; m++) if (m*i < 1_sf && m*i < pitch-6) { dotdvector (wsp+L WSP-LCORR, wsp+L_WSP-1_CORR- m*i, &Rw [*NRw], 0, L_CORR-1); dot_dvector (wsp+L_WSP-L-CORR-m*i, wsp+LWSP-LCORR- m*i, &y, 0, L_CORR-1); Rw [*N_Rw] = MAX (MIN (Rw [*NRw]/ MAX (0. 5* (x+y), 0.001), 1.0), 0.0); T_Rw[*N_Rw] = m*i; (*N_Rw)++; } } } // /* Reduction factor */ /*-----------------------------------------*/ if ((SVS_flag == 1) && (SVS_flag_m == 1) && (rate_m == RATE4_0K)) { for (i = 0 ; i < *N_Rw ; i++) Rw [ij *= Stab * 0.5; for (i = 0 ; i < *NRw ; i++) Rw [i] *= MIN (ltpg, 1.0); } else {

for (i = 0; i < ; i++) Rw [i] *= Stab*0. 25 ; for (i = 0; i < *N_Rw ; i++) Rw [i] *= MIN (ltpg, 0.75); if (isf==0) SVS_flag_m = SVS_flat; /*-----------------------------------------*/ return; /*/ /*-----------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : FCS_cdbk_search_13b_sub54 (). */ /*------------------------------------*/ /* PURPOSE : This function estimate the optimal */ /* excitation for 4.0 kbps mode 1. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ (FLOAT64 ext : excitation */ /* _(FLOAT64 []) pdcfq: quantized prediction coeff. */ /* _(FLOAT64 []) target: target signal. */ (FLOAT64 res :"ideal excitation"signal */ /* LTP */ /* _ (FLOAT64 []) hh : W (z)/A (z) impulse */ /* _ (INT16) I_sf : sub-frame */ /* (INT16) isf : sub-frame */ /* _ (INT16) lag : pitch lag. */ /* _(INT16 ) VUV : frame */ /* (FLOAT64) pgain: pitch preprocessing quantized */ /* pitch */ /* _ (FLOAT64) NSR: noise to signal */ /* _ (FLOAT64) Rp: pitch preprocessing */

/* correlation. */ /* _(INT16 )rate_m : selected */ /* _(FLOAT64 )lpcg: LPC gain. */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) unfcod: unfiltered excitation */ /* _ (PARAMETER *) chan: output data structure. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ voidFCScdbksearch13bsub54 (FLOAT64 ext [], FLOAT64 pdcfq [], FLOAT64 target [], FLOAT64 res [], FLOAT64 hh [], FLOAT64 unfcod [], INT16 I_sf, INT16 i sf, INT16 lag, INT16 VUV, FLOAT64 pgain, FLOAT64 NSR, FLOAT64 Rp, INT16 rate m, FLOAT64 Ipcg, PARAMETER *chan) /*------------------------------------*/ INT16 mode ; INT16 T_Rw [L_SF3], N_Rw, n; INT16 i, Iopt ; INT16 IdxPuls [MAXP= {0}, SignjMAXPN] = {0} ; INT16 SignTab [L_SF3] ; FLOAT64 Criter, Criter m, Gp m ; FLOAT64 hh_v[L_SF3], raf[L_SF3]; FLOAT64 Rw [L_SF3], tmpmem [NP], pdcfq_w [NP] ; /*------------------------------------*/ cpy_dvector(hh,hh_v, 0, 1_sf-1); FCSSTparameter (isf, ratem, 1, pdcfq, lag, &Stab_13b_enc, pdcfqw, Ipcg) ;

FCS_Search_pastcorr (ext, pdcfq, Stab_13b_enc, lag, pgain, rate_m, 1, i_sf, 1_sf, Rw, TRw, &NRw) ; for (i = 0; i < N_Rw ; i++) for (n = T_Rw [i]; n < 1_sf; n++) hliv [n] += Rw[i]*hh[n+T_Rw[i]]; inidvector (tmpmem, 0, NP-1,0.0); FLT allsyn (hh v, 1 sf, pdcfq_w, NP, hhv, tmpmem); cpy_dvector (hhv, ref, 0, 1_sf-1) ; for (i = 1 ; i < L_HF ; i++) for (n = i; n < I_sf ; n++) hhv [n] += hh_hf[i]*ref[n-i] ; FCS_Calc_pre_search (hh_v, hh_v, lag, pgain, &Gp m, target, ref, SignTab, res, 0.0, 1_sf) ; Iopt = 0; Criter--l ; /*------------------------------------*/ /* 2 pulses CB: 2pulses x 5bits/pulse + 2 signs = 12 */ /*------------------------------------*/ FCS_Full_Search_CPCB (0, Sign, 1.0,5,2, SignTab, ref, &Criter, unfcod, I sf, IdxPuls) ; mode = 3; Criter_m = Criter; /*------------------------------------*/ /* 3 pulses CB: 3 pulses x (2 or l) bits/pulse + 3 signs + */ /* center= 12bits */ /*------------------------------------*/ /*------------------------------------*/ /* Determine the */ /*------------------------------------*/

for (i = 0 ; i < SEGNUMM1 ; i++) FCS_Full_Search_CPCB (i, Sign, 1.0,2, SignTab, ref, &Criter, unfcod, 1_sf, IdxPuls); if (Criter > Criter_m) { Iopt = i; mode = 2; Criter_m = Criter; } } /*------------------------------------*/ /* Save the Index of the */ /*------------------------------------*/ for (i = 0; i < MAXPN ; i++) chan->idx_cpcb [i_sfJ [i] = IdxPuls [i] ; for (i = 0; i < MAXPN ; i++) chan->idxcpcbsign [isf) [i] = (Sign [i] +l)/2; chan->idx_center [i_sfJ = Iopt ; if (mode == 3) chan->idx_subcpcb[i_sf][0] = 1; else chan->idxsubcpcb [isf] [0] = 0 ; /*------------------------------------*/ /* Harmonic weighting on unfcod */ /*------------------------------------*/ for (i = lag; i < 1_sf; i++) unfcod[i] += Gp_m * unfcod[i-lag]; cpy_dvector (unfcod, hh_v, 0, 1_sf-1);

for (i = 0; i < NRw ; i++) for (n = T_Rw [i] ; n < 1_sf; n++) unfcod [n] += Rw [i] * hhv [n-TRw [i]]; inidvector (tmpmem, 0, NP-1,0.0); FLT allsyn (unfcod, 1 sf, pdcfq-w, NP, unfcod, tmpmem); cpy_dvector (unfcod, ref, 0, !sf-l) ; for (i = 1 ; i < L_HF; i++) for (n = i; n < 1_sf; n++) unfcod [n] += hh_hf[i]*ref[n-i] ; /*------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /* FUNCTION : FCS_cdbk_decod_13b_sub54 (). */ /*------------------------------------*/ /* PURPOSE : This function decode the optimal fixed /* excitation for 4.0 kbps mode */ /___________________________________________________________ ________*/ /* INPUT : */ /* _(FLOOAT64 []) ext: excitation signal. */ (FLOAT64 pdcfq: quantized prediction coeff. */ <BR> <BR> <BR> /* _ (INT16) I_sf : sub-frame */<BR> <BR> <BR> <BR> /* _ (INT16) i_sf : sub-frame */ /* _ (INT16) lag : pitch lag. */ /* _ (FLOAT64) pgain: decoded pitch */ /* _ (INT16) rate m : current fixed */ /* _ (FLOAT64) lpcg : decoded LPC */ // /* OUTPUT ARGUMENTS */ /* - (FLOAT64 []) unfcod: unfiltered excitation signal. */ /*------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ /* _ (PARAMETER *) chan : output data */ /*------------------------------------*/ /* RETURN */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> None. void FCS+_cdbk_decod_13b_sub54 (FLOAT64 ext [], FLOAT64 [], FLOAT64 unfcod [], INT16 1 sf, INT16 isf, INT16 lag, FLOAT64 pgain, INT16 rte_m, FLOAT64 lpcg, PARAMETER *chan) { // INT16 TRw [LSF3], NRw, n; INT16 i, Iopt, IdxPuls[MAXPN], Sign[MAXPN]; FLOAT64 Gpm ; FLOAT64Rw[L_SF3], hh_v[L_SF3], tmpmem[NP], pdcfq_w[NP]; /*------------------------------------*/ for (i = 0; i < MAXPN ; i++) IdxPuls [i] = chan->idx_cpcb [i_sfl [i] ; for (i = 0; i < MAXPN ; i++) Sign [i] = 2*chan->idx_cpcbsign [i_sfJ [i]-l ; if (chan->idx_subcpcb[i_sf][0] == 1) { /* 2 pulses CB: 2pulses x 5bits/pulse + 2 signs = 12 */ // FCS_Decod_CPCB (0, Sign, 1.0,5,2, unfcod, I sf, IdxPuls) ; else <BR> <BR> <BR> <BR> else<BR> <BR> <BR> <BR> <BR> // /* 3 pulses CB: 3 pulses x (2 or l) bits/pulse */ /* 3 signs + 3bits center = 11 */

/*------------------------------------*/ Iopt = chan->idx_center[i_sf]; FCS_Decod_CPCB (Iopt, Sign, 1.0,2,3, unfcod, I sf, IdxPuls) ; } /*------------------------------------*/ /* Pitch enhancement */ /*------------------------------------*/ Gp_m = MIN (pgain, PASTPGAINMAX) ; Gp_m = MAX (PASTPGAINMIN, Gpm) ; for (i = lag ; i < 1_sf; i++) unfcod [i] = unfcod [i] + Gp_m*unfcod[i-lag]; FCS_ST_parameter (i_sf, rate_m, 1, pdcfq, lag, &Stab13bdec, pdcfq_w, lpcg) ; FCS_Search_pastcorr (ext, pdefq, Stab_13b_dec, lag, pgain, rate_m, 1, i_sf, 1_sf, Rw, T Rw, &N Rw) ; cpy_dvector (unfcod, hh v, 0, (1_sf-1) ; for (i = 0; i < N_Rw ; i++) for (n = T Rw [i] ; n < 1_sf; n++) unfcod [n] += Rw [i] *hh v [n-TRw [i]] ; inidvector (tmpmem, 0, NP-1,0.0); FLT_allsyn (unfcod, 1_sf, pdcfq_w, NP, unfcod, tmpmem); cpy_dvector (unfcod, hh_v, 0, 1_sf-1); for (i = 1 ; i < L HF ; i++) for (n = i ; n < 1_sf; n++) unfcod [n] += hhhf [i] *hh v [n-i] ; // return;

/*------------------------------------*/ } /*-----------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : FCS_cdbk_search_15b_sub80 (). */ // /* PURPOSE: This function estimate the optimal */ /* excitation for 4.0 kbps mode */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) ext: excitation */ /* (FLOAT64 pdcfq: quantized prediction */ /* (FLOAT64 target : target */ /* (FLOAT64 res:"ideal excitation"signal after */ /* LTP */ /* _ (FLOAT64 []) hh: W (z)/A (z) impulse */ /* _ (INT16) 1 sf: sub-frame */ /* (INT16) isf : sub-frame */ /* (INT16) lag: pitch */ /* _ (INT16) VW frame */ /* _ (FLOAT64) pgain: quantized pitch */ /* _ (FLOAT64) NSR: noise to signal */ /* _ (FLOAT64) Rp: pitch preprocessing */ /* correlation. */ /*------------------------------------*/ /* OUTPUT */ _ (FLOAT64 []) unfcod: unfiltered excitation */ /* _ (PARAMETER *) chan: output data */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void FCS cdbk search_15b sub80 (FLOAT64 ext [], FLOAT64 pdcfq [], FLOAT64 target [], FLOAT64 res [], FLOAT64 hh [], FLOAT64 unfcod [],

INT 16 1 sf, INT 16 i sf, INT 16 lag, INT16 VUV, FLOAT64 pgain, FLOAT64 NSR, FLOAT64 Rp, INT16 rate m, FLOAT64 lpcg, PARAMETER *chan) { INT16 mode; INT16 TRw [LSF], NRw ; INT16 IdxPuls [MAXPN] = {0}, Sign [MAXPN] = {0} ; INT16 i, n, Iopt ; INT16 IdxPuls_tmp [MAXPN], Sign_tmp[MAXPN], SignTab[L_SF]; FLOAT64 P1_SHP, Criter, Criter m, Criter tmp, Gp m, gp; FLOAT64 hh_v[L_SF], ref[L_SF]; FLOAT64 RW[L_SF], tmpmem[NP], pdcfq_w[NP]; /*------------------------*/ cpy_dvector (hh, hh_v, 0, 1_sf-1); FCS_ST_parameter (i_sf, rate_m, 1, pdcfq, lag, &Stab15benc, pdcfq_w, lpcg); FCS_Search_pastcorr(ext, pdcfq, Stab_15b_enc, lag, pgain, rate_m, 0, i_sf, 1_sf, Rw, TRw, &NRw) ; for (i = 0; i < N_Rw ; i++) for (n = T Rw [i] ; n < I_sf ; n++) hhv [n] += Rw [i] *hh [n-TRw [i]] ; inidvector (tmpmem, 0, NP-1,0.0); FLT_allsyn(hh_v, l_sf, pdcfq_w, NP, hh v, tmpmem) ; cpy_dvector hh_v, ref, 0, 1_sf-1); for (i = 1 ; i < L_HF ; i++) for (n = i; n < 1_sf, n++) hhv [n] += hh_hf[i]*ref[n-i] ; /*------------------------------------*/ /* 2 pulses CB: 2pulses x 6bits/pulse + 2 signs = 14 */

/*------------------------------------*/ FCSCaIcpresearch (hhv, hhv, ! ag, pgain, &Gp_m, target, ref, SignTab, res, 0.0,0, 1_sf) ; Criter =-1 ; gp = 0. 75; FCS_Simp_Search_4kCB (0,1,1, Sign, 1.0,7,2, SignTab, ref, &Criter, unfcod, 1_sf, IdxPuls, lag, gp); mode= 3; Criter m = Criter ; /*------------------------------------*/ /* Sign */ /*------------------------------------*/ if (IdxPuls [0] <=IdxPuls [l]) if (Sign [0] ! =Sign [l]) FCS PulseExchange (IdxPuls, Sign, IdxPuls+l, Sign+l) ; else if (Sign[0] == Sign[1]) FCS PulseExchange (IdxPuls, Sign, IdxPuls+1, Sign+1) ; IdxPuls [0] = IdxPuls [0] *L_SF + IdxPuls [1]; /*------------------------------------*/ /* 3 pulses CB: 3 pulses x 2 bits/pulse + 3 signs + 4bits = */ /* 13 bist */ /*------------------------------------*/ /*------------------------------------*/ /* Reference */ /*------------------------------------*/

Focs ! cpresearch (hhv, lag, 0.25, &Gpm, target, ref, SignTab, res, 0.0, 1, l_sf) ; /*------------------------------------*/ /* Determine the */ /*------------------------------------*/ Iopt = 0; Criter =-1 ; Criter tmp = Criter; for (i = 0; i < SEGNUMMO ; i++) { FCS_Simp_Search_CPCB (0, 0, i, Sign_tmp, 1.0,2,3, SignTab, ref, &Criter,hh_v, 1_sf, IdxPuls_tmp); if (Criter > Criter tmp) Iopt = i ; Criter tmp = Criter; // /* Determine the */ /*------------------------------------*/ Criter = Criter m ; if ((lag < 35) && (Rp < 0. 6)) Criter*=MIN (0. 6+0.4* (lag-MIN_LAG)/(35.0-MIN_LAG), 1.0); Criter tmp = Criter; FCS_Full_Search_CPCB(Iopt, Sign, 1.0,2,3, SignTab, ref, &Criter, unfcod,1_sf, IdxPuls); if (Criter >Critertmp) mode = 2 ; else Criter = Criter m ;

/*------------------------------------*/ /* Perceptual Wheighted */ /*------------------------------------*/ P1SHP = PPP_sharpness (I_sf, res); if ( (VUV >= 3) && (Rp<0.75)) Criter *= MIN (MAX (1. 5-4. 0*P1_SHP, 0.5), 1.0); Criter *= MIN (MAX (1. 5-5. 0*P1_SHP, 0.25), 1.0); if (WV <= 1) Criter *= 0. 75*MIN (MAX (1. 5-5. 0*P1_SHP, 0.0), 1.0); if ( (VUV == 1) && (mode == 3) && (lag < 50)) Criter *= 0. 5; if (WV >= 2) Criter *= 1. 0-0.5*NSR*MIN (P1_SHP+0, 5,1.0); Criter m = Criter; /*------------------------------------*/ /* Gaussian codebook, 13 */ /*------------------------------------*/ GCBgausscbitu4k (target, res, hh, &Criter, unfcod, I*dxPuls, Sign, N_GAUSS_13b, N_GAUSS_13b); if (Criter > Criter m) { mode= 1 ; IdxPuls[0] = IdxPuls[0]*N_GAUSS_13b + IdxPuls[1];' } /*/ /* Index of the */ /*/ for (i = 0; i < MAXPN; i++) chan->idxcpcb [i sf] [i] = IdxPuls [i];

for (i = 0; i < MAXPN; i++) chan->idxcpcbsign [isf] [i] = (Sign [i] +l)/2 ; chan->idx_center[i_sf] = Iopt; if (mode == 3) chan->idx_subcpcb[i_sf][0] = 1; else { chan->idx_subcpcb[i_sf][0] = 0; if (mode == 2) chan->idxsubcpcb [isf] [l] = 1 ; else chan->idxsubcpcb [isf] [l] = 0 ; } // /* Harmonic weighting on */ /*------------------------------------*/ if (mode >= 2) if (mode == 2) for (i = lag ; i < I sf ; i++) unfcod [i] += Gp_m * unfcod [i-lag] ; cpy_dvector (unfcod, hh_v, 0, 1_sf-1); for (i = 0; i < N Rw ; i++) for (n = T Rw [i] ; n < 1_sf; n++) unfcod [n] += Rw [i] *hhv [n-TRw [i]]; ini_dvector (impmem, 0, NP-1,0.0); FLT_allsyn (unfcod, ! sf, pdcfqw, NP, unfcod, tmpmem); cpy_dvector (unfcod, ref, 0, ! sf-l) ; for (i = 1 ; i < L_HF ; i++) for (n = i; n < tsf ; n++) unfcod [n] += hh_hf[i]*ref[n-i] ;

/*------------------------------------*/ return ; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION :FCScdbkdecod15bsub80().*/ /*------------------------------------*/ /* PURPOSE : This function decode the fixed excitation */ /* for 4.0 kbps mode */ /*------------------------------------*/ /* INPUT */ /* _ (FLOAT64 []) ext : excitation */ /* _ (FLOAT64 []) pdcfq : quantized prediction coeff. */ /* _ (INT16) I_sf : sub-frame */ /* _(INT16 )i_sf: sub-frame */ /* _ (INT16) lag : pitch lag. */ /* (FLOAT64) pgain: decoded pitch */ /*- (INT16) rate m : decoded fix */ /* _(FLOAT64 )lpcg : decoded LPC */ /___________________________________________________________ ________*/ /* OUTPUT */ /* _ (FLOAT64 []) unfcod: unfiltered excitation */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* _ (PARAMETER *) chan : output data structure. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ 0 void FCScdbkdecod15bsub80 (FLOAT64 ext [], FLOAT64 pdcfq [], FLOAT64 unfcod [], INT16 1 sf, INT16 isf, INT16 lag, FLOAT64 pgain, INT16 rate m, FLOAT64 lpcg, PARAMETER *chan)

{ /*------------------------------------*/ INT16 mode; INT16 T Rw [L_SF], N Rw ; INT16 i, n, Iopt, IdxPuls[MAXPN], Sign[MAXPN], IdxGauss[2]; FLOAT64 gp, tmp SF] ; FLOAT64 Rw SF], tmpmem [NP], pdcfq_w [NP] ; /*------------------------------------*/ for (i = 0; i < MAXPN; i++) IdxPuls[i] = chan->idx_cpcb[i_sf][i]; for (i = 0; i < MAXPN ; i++) Sign [i] = 2*chan->idxcpcbsign [isf] [i]-1 ; if (chan->idx_subcpcb[i_sf][0] == 1) { /*/ /* 2 pulses CB: 2pulses x 6bits/pulse + 2 signs = 14 */ /*------------------------------------*/ mode = 3; gp = 0.75; i = IdxPuls[0]/L_SF; IdxPuls[1] = IdxPuls [0]-i*L SF ; IdxPuls [O] = i; /*------------------------------------*/ /* Sign */ /*------------------------------------*/ if (IdxPuls [0] <= IdxPuls [11) Sign [l] = Sign [0] ; else Sign[1] = -Sign[0]; FCS_Decod_PitCB (1, Sign, 1.0,7,2, unfcod, 1_sf, IdxPuls,

lag, gp); } else { if (chan->idxsubcpcb [isf] [l] == 1) { // /* 3 pulses CB: 3 pulses x 2 bits/pulse + 3 signs */ /* 4bits center = 13 */ /*------------------------------------*/ mode = 2; Iopt = chan->idx_center[i_sf]; FCS_Decod_CPCB (Iopt, Sign, 1.0,2,3, unfcod, tsf, IdxPuls); else { // /* Gaussian codcbook, 13 */ // mode= 1; #ifdef VERBOSE if (1-SF ! = 40+40) nrerror ("ERROR: dimension mismatch decoding gaussian excitation\n") ; #endif // /* Decode the 11 bits index into the two 45-entry */ /* codebooks */ /*------------------------------------*/ IdxGauss [0] = IdxPuls [0]/N_GAUSS_13b ; IdxGauss[1] =IdxPuls[0] - N_GAUSS_13b*IdxGauss[0]; GCB_decode_gauss_cb_itu4k(N_GAUSS_13b, 40, IdxGauss [0], Sign [0], unfcod); GCBdecodegausscb itu4k (NGAUSS13b, 40, IdxGauss [l],

Sign [l], unfcod+1) ; } FCS_ST_parameter (i_sf, rate_m, 1, pdcfq, lag, &Stab15bdec, pdcfq_w, lpcg) ; FCS_Search_pastcorr(ext, pdcfq, Stab_15b_dec, lag, pgain, rate m, 0, isf, Isf, Rw, TRw, &NRw) ; if (mode >= 2) if (mode == 2) for (i = lag ; i < tsf;i++) unfcod [i] = unfcod [i] + 0.25*unfcod [i-lag] ; cpy_dvector (unfcod, tmp, 0, 1_sf-1) ; for (i = 0; i < N_Rw ; i++) for (n = T Rw [i] ; n < 1_sf; n++) unfcod [n] += Rw [i]*tmp[n-T_Rw[i]] ; ini_dvector (tmpmem, 0, NP-1,0.0); FLT_allsyn (unfcod, I_sf, pdcfq_w, NP, unfcod, tmpmem); cpy_dvector (unfcod, tmp, 0, 1_sf-1) ; for (i = 1 ; i < L_HF ; i++) for (n = i; n < 1_sf; n++) unfcod [n] += hh_hf[i] *tmp [n-i] ; /*/ return ; /*------------------------------------*/ } //

/*========================================================== =========*/ /* FUNCTION : FCS_cdbk_search_22b_sub40 (). */ // /* PURPOSE: This function estimate the optimal */ /* excitation for 8.5 kbps mode 0. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* (FLOAT64 []) ext: excitation */ (FLOAT64 pdcfq: quantized prediction coeff. */ (FLOAT64 target: target signal. */ /* _ (FLOAT64 []) res:"ideal excitation"signal */ /* LTP */ /* _(FLOAT64 []) hh: W (z)/A (z) impulse */ /*- (INT16) 1 sf : sub-frame */ /* _ (INT16) i_sf: sub-frame */ /* _(INT16 ) lag: pitch lag. */ /* _ (INT16) VW frame class. */ /* _ (FLOAT64) pgain: quantized pitch */ /* _ (FLOAT64) NSR: noise to signal */ /* (FLOAT64) Rp: pitch preprocessing */ /* correlation. */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (I ; LOAT64 []) unfcod: unfiltered excitation */ /* (PARAMETER *) chan : output data */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* _None. */ /*------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ void FCScdbksearch22bsub40 (FLOAT64 ext [], FLOAT64 0, FLOAT64 target [], FLOAT64 res [], FLOAT64 [], FLOAT64 unfcod [], INT16 Isf, INT16 isf, INT16 lag, INT16 VUV, FLOAT64 pgain, FLOAT64 NSR, FLOAT64 Rp, PARAMETER *chan)

/*------------------------------------*/ INT16 i, mode ; INT16 IdxPuls[MAXPN], Sign[MAXPN], SignTab[L_SF4]; FLOAT64 P1_SHP, Criter, Criter m, Criter m3, Criter m2, Gp m, Gp; FLOAT64 hh_v[L_SF4], ref[L_SF4]; /*/ if ((lag < 20) && (pgain > 0.5)) Gp = MIN (pgain, 1.0) *0.75; else Gp = pgain; Gp = MIN (Gp, PASTPGAINMAX2) ; /*------------------------------------*/ <BR> <BR> <BR> /* Refcrence */<BR> <BR> <BR> <BR> // FCS Caicpresearch (hh, hhv, tag, Gp, &Gp_m, target, ref, SignTab, res, 0.5,; /*------------------------------------*/ /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ /*------------------------------------*/ Criter=-1; FCS_Simp_SearclaCPCB (0,1,0, Sign, 1.0,4,5, SignTab, ref, &Criter, unfcod, 1_sf, IdxPuls); mode = 3; Criter m = Criter; Criter m3 = Criter; /*------------------------------------*/ /* 5 pulses CB : 5p x 3b + 5b signs = 20 */ /*------------------------------------*/ FCS_Simp_Search_CPCB(0, 0,2, Sign, 1.0,3,5, SignTab, ref, &Criter, unfcod, 1 sf, IdxPuls) ; if (Criter > Criter m)

{ mode = 2; Criter m2 = Criter; /___________________________________________________________ ________*/ /* Perceptual Wheighted decison */ /*------------------------------------*/ P1 SHP = PPP-sharpness(1_sf, res); Criter *= 0. 9*MIN (MAX (1. 5-5. 0*P1_SHP, 0.7), 1.0); if (WV == 1) Criter *= 0. 9; if (VUV>= 1) Criter *= 1. 0-0. (P1_SHP+0. 5,1.0); Criter_m = Criter; /*-----------------------------------------*/ /* 5 pulses CB: 5p x 3b + 5b signs = 20 */ /*-----------------------------------------*/ FCSSimpSearchCPCB (0, 1,1, Sign, 1.0,3,5, SignTab, ref, &Criter, unfcod, 1 sf, IdxPuls) ; if (Criter >Criterm) mode = 1; /*-----------------------------------------*/ /* Fine */ /*/ switch (mode) { // /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ //

case 3: Criter= Criter m3; FCS_Simp_Search_CPCB (2,2,0, Sign, 1.0,4,5, SignTab, ref, &Criter, unfcod, 1_sf, IdxPuls) ; /*------------------------------------*/ /* Sign check on the same */ /*------------------------------------*/ for (i = 1; i < 3; i++) if (IdxPuls zip <= IdxPuls [i+2]) { if (Sign [i]! = Sign [i+2]) FCS_PulseExchange (IdxPuls+i, Sign+i, IdxPuls+i+2, Sign+i+2); else { if (Sign[i] == Sign[i+2]) FCS_PulseExchange (IdxPuls+i, Sign+i, IdxPuls+i+2, Sign+i+2); break; break; /*------------------------------------*/ /* 5 pulses CB : 5p x 3b + 5b signs = 20 bits */ // case 2: Criter = Criter m2; FCS_Simp_Search_CPCB(1, 1,2, Sign, 1.0,3,5, SignTab, ref, &Criter, unfcod, tsf,IdxPuts) ; break; /*------------------------------------*/ /* 5 pulses CB: 5p x 3b + 5b signs = 20 */ /*------------------------------------*/

case 1: FCS_Simp_Search_CPCB (2,2,1, Sign, 1.0,3,5, SignTab, ref, &Criter, unfcod, 1_sf, IdxPuls) ; break; default: nrerror ("Wrong ! !") ; break; } /___________________________________________________________ ________*/ /* Index of the */ /*------------------------------------*/ for (i = 0; i < MAXPN ; i++) chan->idxcpcb [isf) [i] = IdxPuls [i]; for (i = 0; i < MAXPN ; i++) chan->idx_cpcbsign[i_sf][i] = (Sign(i)+1)/2; if (mode == 3) chan->idx subcpcb [i_sfJ [0] = 1 ; else { chan->idxsubcpcb [isf) [0] = 0 ; if (mode == 2) chan->idx subcpcb [i_sfl [l] = 1; else chan->idx_subcpcb[i_sf][1] = 0 ; } /*/ /* Harmonic weighting on unfcod */ /*------------------------------------*/ for (i = lag ; i < tuf ; i++) unfcod [i] += Gp_m * unfcod [i-lag] ; /*------------------------------------*/

return; /*------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : FCS_cdbk_decod_22b_sub40 0. */ /*------------------------------------*/ /* PURPOSE : This function decode the fixed excitation */ /* for 8. mode */ /*------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (INT16) I_sf : sub-frame */ /* _ (INT16) i_sf : sub-frame */ /* _ (INT16) lag : pitch lag. */ /* (FLOAT64) pgain: decoded pitch */ /* (INT16) ratem : decoded fix */ /* _ (FLOAT64) Ipcg : decoded LPC */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) unfcod: unfiltered excitation */ // /* INPUT/OUTPUT ARGUMENTS */ _ (PARAMETER *) chan : output data */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void FCS cdbk decod 22b sub40 (FLOAT64 unEcod l], INT16 1_sf, INT16 i_sf, INT16 lag, FLOAT64 pgain, PARAMETER *chan) { /*------------------------------------*/ INT16 i, IdxPulslMAXPNl, Sign [MAXPN] ; FLOAT64 Gp_m; /*------------------------------------*/

for (i = 0 ; X MAXPN ; i++) IdxPuls[i]=chan->idx_cpcb[1_sf][i]; for (i = 0 ; i < MAXPN ; i++) Sign [i] = 2*chan->idx_cpcbsign [i_sfl [i]-1 ; if (chan->idx_subcpcb [1_sf][0] == 1) // /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ /*------------------------------------*/ for (i = 1 ; i<3 ; i++) if (Id. xPuls [i] <=IdxPuls [i+2]) Sign[i+2) = Sign[i]; else Sign [i+2] = -Sign [i] ; FCS_Decod_CPCB(0, Sign, 1.4,5, unfcod, 1_sf, IdxPuls) ; else { if (chan->idx_subcpcb[i_sf][1]==1) { // /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ /*------------------------------------*/ FCSDecodCPCB (2, Sign, 1.0,3,5, unfcod, 1_sf, IdxPuls) ; } else // /* 5 pulses CB : 5p x 3b + 5b signs = 20 */ /*------------------------------------*/

FCS_Decod_CPCB(1, Sign, 1.0,3,5, unfcod, l_sf, IdxPuls) ; } } /*/ /* Pitch enhancement */ /*------------------------------------*/ if ((lag < 20) && (pgain > 0.5)) Gp_m = MIN (pgain, 1.0) *0.75; else Gp_m = pgain; Gp_m = MIN (Gpm, PASTPGAINMAX2) ; Gp_m = MAX (PASTPGAINMIN, Gpm) ; for (i = lag ; i < I sf ; i++) unfcod [i] = unfcod [i] + Gp_m*unfcod[i-lag]; /*------------------------------------*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS_cdbk_search_30b_sub40 (). */ /*------------------------------------*/ /* PURPOSE : This function estimate the optimal */ /* excitation for 8. mode 1. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) ext : excitation signal. */ /* (FLOAT64 pdcfq : quantized prediction coeff. */ (FLOAT64 target: target signal. */ /* _ (FLOAT64 []) res :"ideal excitation"signal after */

/* LTP contribution. */ /* _ (FLOAT64 []) hh: W (z)/A (z) impulse */ /* _(INT16 )1_sf: sub-frame size. */ /* _(INT16 )i_sf: sub-frame index. */ /* _ (INT16) lag : pitch */ /* (INT16) VUV frame */ /* (FLOAT64) pgain: quantized pitch */ /* (FLOAT64) NSR: noise to signal */ /* _ (FLOAT64) Rp: pitch preprocessing */ /* correlation. */ /*------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) unfcod: unfiltered excitation */ /* _ (PARAMETER *) chan : output data */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ None. void FCScdbksearch30bsub40 (FLOAT64 ext [], FLOAT64 pdcfq [], FLOAT64 [], FLOAT64 res [], FLOAT64 hh [], FLOAT64 [], INT16 I_sf, INT16 isf, INT16 lag, INT16 VUV, FLOAT64 pgain, FLOAT64 NSR, FLOAT64 Rp, PARAMETER *chan) /*/ INT16 i; INT16 IdxPuls [MAXPN], Sign [MAXPN], SignTab [L_SF4] ; FLOAT64 Criter, Gp m, Gp; FLOAT64 hh_v[L_SF4], ref[L_SF4]; /*------------------------------------*/ if ((lag < 20) && (pgain > 0.5)) Gp = MIN (pgain, 1.0) *0.75; else

Gp = pgain ; /*------------------------------------*/ FCS_Calc_pre_search (hh, hh_v, lag, Gp, &Gp_m, target, ref, SignTab, res, 0.5, 1, ! si) ; /*------------------------------------*/ /* 8 pulses CB: 6p x 3b + 2p x 4b + 4b signs = 30 */ /*------------------------------------*/ Criter =-1 ; FCS_Simp_Search_CPCB(0, 0,0, Sign, 1.0,4,8, SignTab, ref, &Criter, unfcod,1_sf, IdxPuls); FCS_Simp_Search_CPCB(1, 1,0, Sign, 1.4,8, SignTab, ref, &Criter, unfcod,1_sf, IdxPuls); /*------------------------------------*/ /* Sign check on the same */ /*------------------------------------*/ for (i = 0 ; i < 4; i++) { if (IdxPuls [i] <= IdxPuls [i+4]) if (Sign [i] ! = Sign [i+4]) FCS_PulseExchange(IdxPuls+i, Sign+i, IdxPuls+i+4, Sign+i+4); } else if (Sign [i] == Sign [i+4]) FCS PulseExchange (IdxPuls+i, Sign+i, IdxPuls+i+4, Sign+i+4); <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> /* Index of the cdbk */ /*------------------------------------*/

for (i = 0; i < MAXPN; i++) chan->idxcpcb [isf) [i] = IdxPuls [i]; for (i = 0; i < MAXPN; i++) chan->idx_cpcbsign[i_sf] [i] = (Sign [i] +l)/2 ; chan->idxsubcpcb[tsf]{0] = 1; /*------------------------------------*/ /* Harmonic weighting on */ // for (i = lag ; i < 1_sf; i++) unfcod [i] += Gp_m * unfcod [i-lag] ; /*-*/ return; // /*-----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTION : FCS_cdbk_decod_30b_sub40 (). */ /*------------------------------------*/ /* PURPOSE : This function decode the fixed excitation */ /* for 8.5 kbps mode 1. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) I_sf : sub-frame*/ /* _ (INT16) i_sf : sub-frame */ /* _ (INT16) lag : pitch lag. */ /* (FLOAT64) pgain: decoded pitch */ /* (INT16) ratem : decoded fix */ /* _ (FLOAT64) lpcg : decoded LPC */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) unfcod : unfiltered excitation */

/*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (PARAMETER *) chan: output data */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void FCScdbkdecod30bsub40 (FLOAT64 unfcod [], INT16 sf, INT16 isf, INT16 lag, FLOAT64 pgain, PARAMETER *chan) { /*------------------------------------*/ INT16 i, IdxPuls[MAXPN], Sign [MAXPN], FLOAT64 Gpm ; /___________________________________________________________ ________*/ for (i = 0; i < MAXPN ; i++) IdxPuls [i] = chan->idx_cpcbli_sfl [i]; for (i = 0 ; i < MAXPN; i++) Sign [i] = 2*chan->idx_cpcbsign [isfj [i]-l ; /*------------------------------------*/ /* 8 pulses CB: 6p x 3b + 2p x 4b + 4b signs = 30 */ /*------------------------------------*/ for (i = 0; i < 4; i++) { if (IdxPuls [i] <= IdxPuls [i+4]) Sign [i+4] = Sign [i] ; else Sign [i+41 =-Sign [i]; FCSDecodCPCB (0, Sign, 1.0,4,8, unfcod, l_sf, IdxPuls) ; /*------------------------------------*/

/* Pitch enhancement */ /*------------------------------------*/ if ((lag < 20) && (pgain > 0. 5)) Gp_m = MIN (pgain, 1.0) *0.75; else Gpm = pgain; Gp_m = MIN (Gpm, PASTPGAINMAX) ; Gp_m = MAX (PASTPGAINMIN, Gpm) ; for (i = lag ; i < 1_sf; i++) unfcod [i] = unfcod [i] + Gp_m*unfcod [i-lag] ; /*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : FCS_ChangeSign (). */ /*------------------------------------*/ /* PURPOSE : This function modify the sign of the */ /* gain. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (PARAMETER *) chan : output data */ /* _ (INT16) i_sf : sub-frame */ /* _ (INT16) I_sf : sub-frame */ /* _(FLOAT64 []) unfcod: unfiltered excitation */ (FLOAT64 fcod: filtered excitation */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */

/* _ (FLOAT64 *) gain: unquntized excitation */ /*/ /* RETURN ARGUMENTS*/ /* None. */ None. void FCSChangeSign (PARAMETER *chan, INT16 isf, INT16 Isf, FLOAT64 unfcod [], FLOAT64 fcod [], FLOAT64 *gain) { // INT16 i; /*------------------------------------*/ for (i = 0; i < MAXPN ; i++) chan->idx_cpcbsign [i_sfl [i] *=-1 ; for (i = 0 ; i < MAXPN ; i++) chan->idx_cpcbsign[i_sf][i] += 1; for (i = 0; i < 1_sf; i++) unfcod [i] *=-1. 0; for (i = 0; i < I_sf ; i++) fcod [i] *=-1. 0; (*gain)= -(*gain); // return; /*------------------------------------*/ } /*========================================================== =========*/ /*----------------------- END ----------------------*/ /*========================================================== =========*/

/*========================================================== =========*/ l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ // /* ALL RIGHTS RESERVED : */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transfonnation */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* PROTOTYPE FILE : libfcs. h */<BR> <BR> <BR> <BR> <BR> // /*------------------------------------*/ /*---------------- FUNCTIONS -----------------*/ void FCS init lib (void); void FCS Init CPCB (void); void FCSSetCPCB (INT16, INT16, INT16, INT16); void FCS Init HF_Noise (FLOAT64 [], INT16); void FCS DetennPulsLoc (FLOAT64, INT16, FLOAT64, INT16, [], INT16 [], INT16 *, INT16); void FCS_One_Search_CPCB (INT16, INT16 [], FLOAT64 [], FLOAT64 [], [], INT16 [], FLOAT64 *, FLOAT64 *, *) ;

void FCSOneSearch4kCB (INT16 [], INT16, FLOAT64, INT16, INT16, INT16 [], FLOAT64 [], FLOAT64 [], INT16 [], [], FLOAT64 *, FLOAT64 *, FLOAT64 *, INT16) ; void FCS_Full_Search_CPCB (INT16, INT16 [], FLOAT64, INT16, INT16, [], FLOAT64 [], FLOAT64 *, [], INT16, INT16 []) ; void FCSSimpSearchCPCB (INT16, INT16, INT16, INT16 [], FLOAT64, INT16, INT16, INT16 [], FLOAT64 [], *, FLOAT64 [], INT16, INT16 []) ; void FCSSimpSearch4kCB (INT16, INT16, INT16, INT16 [], FLOAT64, INT16, INT16, INT16 [], FLOAT64 [], FLOAT64 *, FLOAT64 [], INT16, INT16 [], INT16, FLOAT64); void FCS Dccod_CPCB (INT16, INT16 [], FLOAT64, INT16, INT16, FLOAT64 [], INT16, INT16 []); void FCS_Decod_PitCB (INT16, INT16 [], FLOAT64, INT16, INT16, FLOAT64 [], INT16, INT16 [], INT16, FLOAT64) ; void FCS Calc_pre search (FLOAT64 [], FLOAT64 [], INT16, FLOAT64, *, FLOAT64 [], FLOAT64 [], INT16 [], FLOAT64 [], FLOAT64, INT16, INT16); void FCS cdbk search_13b sub54 (FLOAT64 [], FLOAT64 [], FLOAT64 [], [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, INT16, FLOAT64, FLOAT64, FLOAT64, INT16, FLOAT64, PARAMETER *);

void FCScdbkdecod13bsub54 (FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, FLOAT64, INT16, FLOAT64, *) ; voidFCScdbksearch15bsub80 (FLOAT64 [], FLOAT64 [], FLOAT64 [], [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, INT16, FLOAT64, FLOAT64, FLOAT64, INT16, FLOAT64, *) ; void FCScdbkdecod15bsub80 (FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, FLOAT64, INT16, FLOAT64, *) ; void FCScdbksearch22bsub40 (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, INT16, FLOAT64, FLOAT64, FLOAT64, PARAMETER *) ; voidFCScdbkdecod22bsub40 (FLOAT64 [], INT16, INT16, INT16, FLOAT64, *) ; void FCS_cdbk_scarch_30b_sub40 (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16, INT16, INT16, FLOAT64, FLOAT64, FLOAT64, PARAMETER *) ; void FCScdbkdecod30bsub40 (FLOAT64 [], INT16, INT16, INT16, FLOAT64, PARAMETER *chan); void FCSPulseExchange (INT16 *, INT16 *, INT16 *, INT16 *); void FCSChangeSign (PARAMETER *, INT16, INT16, FLOAT64 [], FLOAT64 [], *) ; void FCS Search_pastcorr (FLOAT64 [], FLOAT64 [], FLOAT64, INT16, FLOAT64, INT16,

INT16, INT16, INT16, FLOAT64 [], INT16 [], INT16 *); void FCSSTparameter (INT16, INT16, INT16, FLOAT64 [], INT16, FLOAT64 *, FLOAT64 [], FLOAT64); /*========================================================== =========*/ /*--------------------- END --------------------*/

/*========================================================== =========*/ /*========================================================== =========*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ // /*========================================================== =========*/ /*-----------------------------------------*/ /*---------------- INCLUDE ------------------*/ /*-----------------------------------------*/ &num include"typedef. h" #include"main. h" &num include"mcutil. h" #include"gputil. h" &num include"lib-flt. 1i" /*-----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> /*-------------------------------FUNCTIONS------------------ ----------------*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION : filterAP (). */ /*------------------------------------*/ /* PURPOSE: Frame data all poles filtering. */ /*------------------------------------*/ /* INPUT : */ /* */ /* _ (FLOAT64 Q) a: filter coefficients. */

/* _ (FLOAT64 []) x: input signal */ /* _ (INT16) P : filter */ /* _(INT16) N : number of input */ /*------------------------------------*/ /* OUTPUT */ /* */ /* _ (FLOAT64 []) y: output signal */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* */ /* _ (FLOAT64 []) buf: input/output memory */ /*------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =========*/ void filterAP (FLOAT64 a [], FLOAT64 x [], FLOAT64 y [], FLOAT64 [], INT16 P,INT16 N) { /*/ INT16 i,j; /*------------------------------------*/ for (i = 0; i < N; i ++) { buf [0] = x [i]; for (j =P ; j>0 ; j--) { buf[0] = (a [j] * buf [j]); buf [j] =buf [j-1]; <BR> <BR> <BR> yti] =buf [0],<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/

return ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : filkterAZ (). */ /*------------------------------------*/ /* PURPOSE : Frame data all zeros filtering. */ /*------------------------------------*/ /* INPUT ARGUMENTS : */ /* */ /* _ (FLOAT64 []) b : filter coefficients. */ /* _ (FLOAT64 []) x : input signal */ /* (INT16) P : filter */ /* _(INT16) N : number of input */ // /* OUTPUT ARGUMENTS */ /* */ /* _ (FLOAT64 []) y: output signal */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* */ /* _ (FLOAT64 []) buf: input/output memory */ /*------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== =========*/ void P, INT16 INT16 P, INT16 <BR> <BR> <BR> N)<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT16 i, j ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/

for (i = 0 ; i < N ; i ++) buf [0] = x [i]; Y [i] = 0. 0; for (j=P ; j>0 ; j-) { y [i] += buf [j] * b [j]; buf [j] = buf [j-l] ; y [i] += (buf [0] * b [0]); /___________________________________________________________ ________*/ return; /*-----------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : filterPZ (). */ /*-----------------------------------------*/ /* PURPOSE : Frame data all poles-zeros */ /*-----------------------------------------*/ /* INPUT ARGUMENTS : */ /* */ /* (FLOAT64 b numerator filter */ /* _ (FLOAT64 []) a : denominator filter */ /* _(FLOAT64 []) x : imput signal */ /* _(INT16) P : filter */ /* (INT16) N : number of input */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* */ /* _ (FLOAT64 []) y: output signal frame. */ /*-----------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ * *l /* _ (FLOAT64 []) buf: input/output memory */ /*----------------------------------------------*/ /* RETURN ARGUMENTS : None. */ /*========================================================== ======================*/ void filterPZ (FLOAT64 b [], FLOAT64 a [], FLOAT64 x [], FLOAT64 [], \ FLOAT64 buf #, INT16 P, INT16 N) /*----------------------------------------------*/ INT16 i, j; /*----------------------------------------------*/ for (i = 0; i < N; i ++) { buf [0] = x [i]; y [i] = 0.0; for (j=P ; j>0 ; j-) { y zip += (buf [j] * b[j]); buf [0]-= (a [j] *buf [j]); buf [j] = buf [j-1]; } y [i] += (buf [0] * b [0]); } } return; /*----------------------------------------*/ } /*----------------------------------------*/

/*========================================================== ================================*/ /* FUNCTION: FLT_conv (). */ /*--------------------------------------------------*/ /* PURPOSE: This function perform a filtering */ /* */ /* The input array, x, is assumed to include past input */ /* (NCOFS-1 values) for the filter memory, as well as new */ /* values. The array is set up as */ l* *l /* Xin (NCOFS) Xin (N+NCOFS-l) */ /* | new data {*/ /* I---------II------------------------------I */ /* t old |/ /* Xin (l) Xin (NCOFS-l) */ /* */ /* The first NCOFS-1 points of array Xin are assumed to be */ /*"warm-up"points for the first output point, Xout (l). */ /*--------------------------------------------------*/ /* INPUT : */ /* */ /* (FLOAT64 x input signal frame. */ /* _(FLOAT64 []) a :denominator filter coefficients. */ /* _(INT16) P : filter */ /* _(INT16) N number of input samples to be */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) y: output signal frame. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* (FLOAT64 []) buf: input/output memory array. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> /*========================================================== ======================*/ void FLT_conv (FLOAT64 x[], FLOAT64 a[], INT16 P, INT16 N, FLOAT64 y[]) //

INT16 i, 1, k; FLOAT64 sum ; /*----------------------------------------*/ for (i = 0; i < N; i++) sum = 0. 0 ; l = p + i; for (k=0 ; k < P ; k++) { sum += a [k] * x [l] ; y[i] = sum; } /*----------------------------------------*/ return ; /*----------------------------------------*/ } /*---------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTION : FLT_allsyn (). */ /*----------------------------------------*/ /* PURPOSE: This function filter a signal using an all-pole */ /* filter */ /*----------------------------------------*/ /* INPUT ARGUMENTS : */ /* */ /* _ (FLOAT64 []) x: input signal */ /* _ (FLOAT64 []) a: denominator filter coefficients. */ /* (INT16) P: filter */

/* _ (INT16) N: number of input samples to be filtered. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /*- (FLOAT64 []) y: output signal */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) buf: input/output memory array. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ==*/ void FLT_allsyn (FLOAT64 x [], INT16 N, FLOAT64 a [], INT16 P, y [], FLOAT64 buffl]) { /___________________________________________________________ ________*/ INT16 i, k; FLOAT64sum; /*----------------------------------------*/ for (i = 0 ; i < N; i++) sum = x [i] ; for (k = P-l; k >= l; k-- ) sum = sum + a [k] * buff [k] ; buff[k] = buff[k-1]; } if (P>0) sum = sum + a[0]*buff[0]; buff = sum; y [i] = sum; }

/*----------------------------------------*/ return; /*----------------------------------------*/ } /*----------------------------------------*/ /*========================================================== ============*/ /*--------------------END--------------------*/ /*========================================================== ============*/

/*========================================================== ============*/ /*========================================================== ==*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------*/ /* ALL RIGHTS RESERVED : */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: lib_fit. */ /*========================================================== ==*/ /*----------------------------------------*/ /*--------------------FUNCTIONS--------------------*/ /*__________________________________________________________ __________________*/ void filterAP (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16); void filterAZ (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16); void filterPZ (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, INT16) ; void FLT_conv (FLOAT64 [], FLOAT64 [], INT16, INT16, []) ; void FLT_allsyn (FLOAT64 [], INT16, FLOAT64 [], INT16, FLOAT64 [], []); <BR> <BR> <BR> <BR> <BR> <BR> l = === l /*--------------------END--------------------*/ /*========================================================== ==*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib_gcb. */ /*========================================================== ============*/ // /*--------------------INCLUDE--------------------*/ /*----------------------------------------*/ #include "typedef.h" #include"main. h" #include "const.h" #include"gputil. h" <BR> <BR> <BR> <BR> &num include"mcutil. h"<BR> <BR> <BR> <BR> <BR> <BR> &num include"ext_var. h" &num include"lib_gcb. h" #include "lib_flt.h" #include "gauss_bv.tab" /*----------------------------------------*/ /*--------------------DEFINE--------------------*/ /*----------------------------------------*/ #define TABLE SIZE 32.0 #define INV_TABLE_SIZE1.0/32.0

#define a 25173 &num define c 13849 #define m 65536 #define UNIFVARNUM 12 #define GAUSS_VEC_SIZE 40 #define MAXVECNUM 2 /*----------------------------------------*/ /*--------------------FUNCTIONS--------------------*/ /*----------------------------------------*/ /*=================================================== /* FUNCTION : GCB_init_lib (). */ // /* PURPOSE: This function initialise the global variable */ <BR> <BR> <BR> <BR> /*thelibrary */<BR> <BR> <BR> <BR> <BR> // /* INPUT ARGUMENTS /* None. */ /*----------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ <BR> <BR> <BR> <BR> ---------- void GCB init lib (void) /___________________________________________________________ ________*/ /* GCBdecodegausscbitu4k */ /*----------------------------------------/* seed_exc= 21845;

/*----------------------------------------*/ /* GCBgaussexcitdec */ /*----------------------------------------*/ Zl_gcb=0 ; /*----------------------------------------*/ /* GCBgaussexcit */ // refeng gcb = 0; rate mem = RATE85K ; // /* GCBgaussexcitdec */ /*----------------------------------------*/ seeddec = 0; /*----------------------------------------*/ return; /___________________________________________________________ ________*/ } /___________________________________________________________ _________________*/ /*========================================================== ============*/ /* FUNCTION : GCB_decode_gauss_cb_itu4k (). */ /*----------------------------------------*/ /* PURPOSE: This function extract the gaussina vector */ /* the */ /*----------------------------------------*/ /* INPUT */ /* (INT16) Ngauss : gaussian codebook */ /* _ (INT16) L_vec: gaussian vector */ /* (INT16) index: codebook */ /* (INT16) sign: */

/*----------------------------------------*/ /*OUTPUT ARGUMENTS */ /* (FLOAT64 []) unfcod : unfiltered */ /* vector. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== ============*/ void GCB dccode_gauss cb itu4k (INT16 N_gauss, INT16 Lvec, INT16 index, INT16 sign, FLOAT64 []) { // INT16 k, delay, table entry ; FLOAT64 x, *unfcod_p ; /*----------------------------------------*/ if (index >= N_gauss) index = (INT16) (gauss* GCB_quickuran (&seedexc)) ; x = GCBquickuran (&seedexc) ; if (x < 0. 5) sign= 1 ; else sign =-1 ; /*----------------------------------------*/ if (index < N_gauss) delay = (INT16) (index*INVTABLESIZE) ; table entry = (INT16) (index-delay*TABLE_SIZE) ;

if (sign == 1) { unfcod_p = unfcod-2*delay ; for (k = delay ; k < L vec ; k++) unfcod [2*k] = bv [table entry] [k]; unfcod_p = unfcod + 2* (L_vec-delay) ; for (k = 0; k < delay; k++) unfcod [2*k] = bv [table_entry] [k]; } else unfcod_p = unfcod-2*delay ; for (k = delay ; k < Lvec ; k++) unfcod_p[2*k] = -bv[table_entry][k]; unfcodp = unfcod + 2* (L vec-delay) ; for (k = 0; k < delay; k++) unfcodp [2*k] =-bv [table_entry] [k]; } else { #ifdef VERBOSE printf ("FATAL ERROR: cb index (%d) out of range\n", index); exit(0); #endif } #endif return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ============*/ /* FUNCTION : GCB_gauss_cb_itu4k 0. */ /*----------------------------------------*/ /* PURPOSE : This function select the MAX_VEC_NUM gaussian */

/* vectors in the */ /*/ /* INPUT ARGUMENTS */ (FLOAT64 target: target vector. */ (FLOAT64 res : residual */ /* (INT16) isf : sub-frame */ /* _ (INT16) I_sf : sub-frame index */ /* _ (FLOAT64 []) hh : impulse */ (FLOAT64 Criter: maximazed criterium. */ /* -(INT16 ) N_gass_1: 1st gaussian codebook size. */ /* (INT16) Ngauss2 : 2nd gaussian codebook */ /*/ /* OUTPUT */ /* _ (FLOAT64 []) unfcod : unfiltered */ /* vector. */ /* _(INT16 []) index: selected codebook */ (INT16 sign: selected vectors */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void GCB_gauss_cb_itu4k (FLOAT64 target [], FLOAT64 res [], FLOAT64 hh [], FLOAT64 *Criter, FLOAT64 unfcod [], INT16 *index, INT16 [], INT16 N_gauss_1, INT16 N-gauss 2) { INT16 index_1buf [NUM_PRESELECT], sign1_buf[NUM_PRESELECT]; INT16 index2_buf [NUM_PRESELECT], sign2_buf[NUM_PRESELECT]; INT16 index_tmp[MAX_VEC_NUM], sign_tmp[MAX_VEC_NUM]; FLOAT64match; /*----------------------------------------*/ <BR> <BR> <BR> Preselcction<BR> <BR> <BR> <BR> <BR> /*/

/*----------------------------------------*/ /* First basis vector */ /*----------------------------------------*/ GCB_basis_preselect_itu4k (res, N_gauss_1, GAUSS_VEC_SIZE, index1_buf, signl buf, NUM_PRESELECT); /*----------------------------------------*/ /* Second basis */ /*----------------------------------------*/ GCB_basis_preselect_itu4k(res+1, N_guass_2, GAUSS_VEC_SIZE, index2_buf, sign2 buf, NUM_PRESELECT) ; /*----------------------------------------*/ /*==============================Fine search==============================*/ /*----------------------------------------*/ match = GCB_fine_search_itu4k(target, hh, indexl buf, signl buf, GAUSSVECSIZE, Ngaussl, index2 buf, sign2buf, GAUSSVECSIZE, N_gauss_2, NUM_PRESELECT, index tmp, sign tmp) ; /*----------------------------------------*/ Compare match /*----------------------------------------*/ if (match > (*Criter)) { (*Criter) = match ; index[0] = index_tmp[0]; index[1] = index_tmp[1]; sign [0] = sign_tmp[0];

sign[1] = sign_tmp[1]; GCBdecodegausscbitu4k (Ngaussl, GAUSSVECSIZE, index [0], sign [0], unfcod) ; GCBdecodegausscbitu4k(Ngauss2,GAUSSVECSIZE, index [l], sign [l], unfcod+1) ; } /*/ return; // } // /* FUNCTION : GCB_basis_preselect_itu4k (). */ /*----------------------------------------*/ /* PURPOSE : This function pre-select the 2 gaussian */ /* in the */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) res : residual */ (INT16) N_gauss gaussian codebook */ /* (INT16) Lvec : gaussian vector */ /* (INT16) skipfac : skip */ /* _ (INT16) num_preselect : number of pre-selected */ /* candidates. */ /*----------------------------------------*/ /* OUTPUT */ /* (INT16 index-buf* codebook index */ /* (INT16 []) signbuf : codebook sign buffer. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */

/*========================================================== ============*/ void GCBbasispresetectitu4k (FLOAT64 res [], INT16 N_gauss, INT16 Lvec, INT16 index buf [], INT16 sign_buf [], INT16 num_preselect) // INT16 i, j, k, table entry, delay, sign; FLOAT64 numer [NUM_PRESELECT], tstnum, x, *res_p ; /*----------------------------------------*/ for (i = 0; i < num_preselect ; i++) { numer [il =-1.0; index_buf[i] = 0 ; sign_buf[i] = 1; } /*----------------------------------------*/ /* Preselection of the basis */ /*----------------------------------------*/ for (i = 0 ; i < N_gauss ; i++) { delay = (INT16) (i*INVTABLESIZE) ; table-entry = (INT16) (i-delay*TABLE_SIZE) ; /*------------------------------------*/ /* Correlation between target and codebook */ // res_p = res-2*delay; for (tstnum=0.0, j=delay ; j<Lvec ; j++) tstnum += res_p[2*j]*bv[table_entry][j]; res_p = res + 2* (L_vec-delay) ; for (j=0 ; j<delay ; j++)

tstnum += res_p[2*j]*bv[table_entry][j]; /*----------------------------------------*/ if (tstnum >= 0.0) sign = 1; else sign = -1; tstnum =-tstnum; } /*/ /* NOTE : see AMR fixed-point code for low */ /* (and bit-exact) approachCorrelation between target */ /* codebook */ /*----------------------------------------*/ if (tstnum > numer [0]) { // numer [0] = tstnum; index_buf[0] = i; sign_buf[0] = sign; for (j=0 ; j<num_preselect-1 ; j++) { if (numer [j] > numer[j+1]) x = numer[j]; numer [j] = numer[j+1] ; numer[j+1] = x; k = index_buf[j]' index_buf[j] = index_buf[j+1]; index bufTj+l] = k; k = sign_buf[j] ; sign_buf[j] = sign_buf[j+1]; sign_buf[j+1] = k;

} /*----------------------------------------*/ } return ; /*--------------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION : GCB_fine_search_itu4k (). */ /*--------------------------------------------------*/ /* PURPOSE: This function pre-select the 2 gaussian */ /* in the */ /*--------------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) target: taget */ /* _ (FLOAT64 []) hh: impulse */ /* _ (INT16 []) indexl: 1st codebook */ /* indexes. */ /* _ (INT16 []) signl: 1st codebook vector signs. */ /* _ (INT16) ll: 1st gaussian vector */ /* _ (INT16) N1: 1st gaussian */ /* size. */ /* _(INT16 []) index2: 2nd codebook */ /* indexes. */ /* _(INT16 []) sign2: 2nd codebook vector signs. */ /* _(INT16 ) 12 : 2nd gaussian vector */ /* _(INT16 ) N2: 2nd gaussian */ /* size. */ /* _ (INT16) num_preselect: number of pre-selected */ /* vectors. */ /*--------------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (INT16 []) indextmp: selected codebook */

/* indexes. */ /* (INT16 []) signtmp : selected codebook */ /* signs. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ None.

/*----------------------------------------*/ /* RETURN */ /* _ (FLOAT64) tmax: maximized */ /*========================================================== ============*/ FLOAT64 GCBfinesearchitu4k (FLOAT64 target [], FLOAT64 [], INT16 *indexl, INT16 *signl, INT16 11, INT16 N1, INT16 *index2, INT16 *sign2, INT16 12, INT16 N2, INT16 num_preselect, INT16 *index tmp, INT16 *sign_tmp) // INT16 il, i2, 1_sf; FLOAT64 unfcod_tmp[L_SF], fcod_tmp[L_SF], tstden, tstnum, x, tmax; FLOAT64 *buf; /*----------------------------------------*/ 1_sf = 11 + 12; /*----------------------------------------*/ buf= dvector (0, lsf-l) ; /*----------------------------------------*/ tmax =-1.0; for (il = 0; il < num_preselect ; il++) GCBdecodegausscbitu4k (N1, 11, indexl [il], signl [i1],

unfcod tmp) ; for (i2=0; i2<num_preselect ; i2++) { GCBdecodegausscbitu4k (N2,12, index2 [i2], sign2 [i2], unfcod tmp+1) ; /*----------------------------------------*/ /* Compute the filtered random */ /*----------------------------------------*/ ini_dvector (buf, 0, 1_sf-1, 0.0); filterAZ (hh, unfcod tmp, fcod tmp, buf, (INT16) (1_sf-1), 1_sf); /*----------------------------------------*/ /* Compute the */ /*----------------------------------------*/ dot dvector (target, fcod tmp, &tstnum, 0,; dot dvector (fcod tmp, fcod tmp, &tstden, 0, tsf-l) ; tstden += EPSI; x = tstnum*tstnum/tstden ; /*----------------------------------------*/ /* Maximisation of the criterium */ /*----------------------------------------*/ if(x > tmax) if (x > tmax) tmax = x; index_tmp[0] = index1[il]; <BR> <BR> <BR> indextmp [l] = index2 [i2] ;<BR> <BR> <BR> <BR> <BR> sign_tmp[0] = signl [il] ;<BR> <BR> <BR> <BR> sign_tmp[1] = sign2 [i2] ; }

/*--------------------------------------*/ } /*------------------------------*/ } /*------------------------------*/ free_dvector (buf, 0, 1_sf-1) ; /**/ return tmax ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> } /*========================================================== ============*/ /* FUNCTION : GCB_quickuran (). */ /*----------------------------------------*/ /* PURPOSE: This function generate Gaussian random */ /* with mean zero and the variance is */ /*-----------------------------------------*/ /* INPUT ARGUMENTS : */ /* None. */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* INPUT/OUTPUT */ /* _(INT64 *) seed : random generetor seed. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* _(INt64 *) val : random gaussian */ <BR> <BR> <BR> l == l FLOAT64 GCB_quickuran (INT64 *seed)

{ /*----------------------------------------*/ FLOAT64 val ; /*-----------------------------------------*/ *seed = (a* (*seed) + c) % m; val = (FLOAT64) (*seed)/ (FLOAT64) m; // return val ; /*-----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : GCBgaussnoise (). */ /*-----------------------------------------*/ /* PURPOSE : This function generate Gaussian random */ /* with mean zero and variance */ /___________________________________________________________ ________*/ /* INPUT : */ /* None. */ // /* OUTPUT ARGUMENTS */ /* None. */ /*-----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (INT64 *) seed: random generetor seed. */ /*-----------------------------------------*/ /* RETURN ARGUMENTS */ /* _ (INT64 *) val : random gaussian */ /*========================================================== ============*/ FLOAT64 GCBgaussnoise (INT64 *seed)

/*----------------------------------------*/ INT16 i; FLOAT64 sum, val ; /*----------------------------------------*/ sum = 0.0; for (i = 0; i < UNIFVARNUM ; i++) sum += GCB_quickuran (seed) ; /*----------------------------------------*/ val = sum- (FLOAT64) UNIF'-VAR NUM/2. 0; /___________________________________________________________ ________*/ return val ; // } /*========================================================== ============*/ /* FUNCTION : GCB_gauss_excit_dec (). */ // /* PURPOSE : This function generate Gaussian noise for */ /* decoder at very low bit-rate */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* (INT16) rate: fixed bit-rate. */ // /* OUTPUT */ /* _ (FLOAT64 []) ext: gaussian excitation */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* _(INT64*) seed : random generetor seed. */ /*----------------------------------------*/

/* RETURN ARGUMENTS */ /*None.*/ /*========================================================== ============*/ void GCBgaussexcitdec (INT64 *seed, INT16 rate, FLOAT64 ext []) { /*/ INT16 i; FLOAT64 C; /*----------------------------------------*/ C = 0. 0; for (i = 0; i < LFRM ; i++) { ext [i] = GCB_gauss_noise (seed) + C*Zl_gcb ; Z1_gcb = ext[i]; } // return ; /*----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTION : GCB_gauss_excit (). */ /*----------------------------------------*/ /* PURPOSE : This function generate Gaussian noise for */ /* encoder at very low bit-rate */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) rate: fixed bit-rate. */ /* _ (INT16) rate m : past fixed */ /* _ (FLOAT64) NSR: estimated noise to signal ratio. */ /* _ (FLOAT64 []) ResEng : estimated residual */

/*----------------------------------------*/ /*OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) ext : gaussian excitation */ /* _ (FLOAT64 []) gc : gain scaling */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _(INT64 *) seed: random generetor */ /*----------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ /*========================================================== =========*/ void GCB gaussexcit (INT64 *seed, INT16 rate, INT16 rate m, FLOAT64 NSR, FLOAT64 ResEng [], FLOAT64 ext [], FLOAT64 gc []) { { FLOAT64 x; /*----------------------------------------*/ GCB_gauss_excit_dec (seed, rate, ext); if (rate==RATE2OK) ref eng_gcb = ResEng [O] ; dotdvector (ext, ext, &x, 0, LFRM/2-1) ; gc [O] = 0.7*sqrt (MAX (ref eng_gcb-80*4, 0)/MAX (x, 0.0001)); ref_eng_gcb = ResEng[1]; dotdvector (ext+LFRM/2, ext+LFRM/2, &x, 0, L_FRM/2-1) ; gc [2] =0. 7*sqrt (MAX (refenggcb-80*4, 0)/MAX (x, 0. 0001)); } else if ( (rate mem ! = RATE0_8K) || (rate_m ! = RATE0_8K))

ref eng_gcb = ResEng [0] + ResEng [1] ; else ref eng_gcb = 0. eng_gcb + 0.5* (ResEng [0] +ResEng [l]); dot dvector (ext, ext, &x, 0, LFRM-1) ; gc [0] = 0.7*sqrt (MAX (ref eng-gcb-160*6, 0)/MAX (x, 0.0001)); } /*/ /* Memory */ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> rate mem = rate m ; /*----------------------------------------*/ return; /*----------------------------------------*/ } /*========================================================== ============*/ /*--------------------END--------------------*/ /*========================================================== ============*/

/*========================================================== ===============*/ /*========================================================== =====*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ /*PROTOTYPE FILE : lib_gcb. h */ /*========================================================== =====*/ /*----------------------------------------*/ /*--------------------FUNCTIONS--------------------*/ /*---------------------------*/ void GCB_init_lib (void); void GCBdecodegausscbitu4k (INT16, INT16, INT16, INT16, FLOAT64 []) ; void GCBgausscbitu4k (FLOAT64 [], FLOAT64 [], [], FLOAT64 *, FLOAT64 [], INT16 *, INT16 [], INT16, INT16); void GCB basis_preselect itu4k (FLOAT64 [], INT16, INT16, INT16 [], INT16 [], INT16) ; FLOAT64 GCBfinesearchitu4k (FLOAT64 [], [], INT16 *, INT16 *, INT16, INT16, INT16 f INT16 *, INT16, INT16, INT16, INT16 *, INT16 *);

FLOAT64 GCB_quickuran (INT64 *); FLOAT64 GCB_gauss-noise (INT64 *); void GCBgaussexcitdec (INT64 *, INT16, FLOAT64 []) ; void GCB_gauss_excit (INT64 *, INT16, INT16, FLOAT64, FLOAT64 [], FLOAT64 [], FLOAT64 []) ; /*========================================================== ============*/ <BR> <BR> <BR> /*--------------------END--------------------*/

l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */- /*----------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ============*/ /*LIBRARY : lib_geq. c */ /*========================================================== ============*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------INCLUDE------------------- ----------------/<BR> <BR> <BR> <BR> <BR> <BR> // /*----------------------------------------*/ #include "typedef.h" #include "main.h" #include"const. h" #include"gputil. h" <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num includc"ext_var. h"<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num include"lib_geq.h" /*----------------------------------------*/ /*--------------------FUNCTINS--------------------*/ /___________________________________________________________ _________________*/ /*========================================================== ====*/ /* FUNCTION : GEQinit lib 0. */ /*----------------------------------------*/ /* PURPOSE : This function initilise the global variables of */ /* the GEQ */

/*----------------------------------------*/ /*INPUT ARGUMENTS */ /*None.*/ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQinit lib (void) // INT16 i,j; /*----------------------------------------*/ ini_dvector(past_energyq_2d, 0, GVQ_VEC_SIZE_2D-1, -20.0); ini_dvector(past_energyq_3d, 0, GVQ_VEC_SIZE_3D-1, -20.0); ini_dvector(past_energyq_4d, 0, GVQ_VEC_SIZE_4D-1, -20.0); inidvector (gpbuf, 0, GP_BUF_SIZE-1, 0.0); past fixed energy = 0.0; pgain_past = PASTPGAINMIN ; pagain_past_dec = PASTPGAINMIN ; ini dvector (Prev Beta Pitch, 0, BETA BUF-SIZE-1, 0.0); GainNonnDeci = 0 ; GainModiDeci = 0 ; /*----------------------------------------*/ energy_pred_coeff_1[0] = 0.6;

energypredcoeal [l] = 0.3; energy-pred coeff 1 [2] = 0. 1; energypredcoea2 [0] = 0.40; energy_pred_coeff_2[1] = 0.25; energy_pred_coeff 2 [2] = 0.10; energy_pred_coeff_3[0] = 0.300; energy_pred_coeff_3[1] = 0.150; energy_pred_coeff_3[2] = 0.075; energy_pred_coeff4d_1[0] = 0.7; energy_pred_coeff4d_1[1] = 0.6; energy_pred_coeff4d_1[2] = 0.4; energypredcocfr4dl [3] = 0.2; energypredcoeS4d2 [0] = 0.40; energypredcoeS4d2 [l] = 0.20; energy_pred_coeff4d_2[2] = 0.10; energy_pred_coeff4d_2[3] = 0.05; energypredcoeS4d3 [0] = ; energypredcoeS4d3 [l] = 0.20; energy_pred_coeff4d_3[2] = ; energy_pred_coeff4d_3[3] = 0.025; energypredcoeS4d4 [0] = 0.20; energy_pred_coeff4d_4[1] = ; energypredcoeH4d4 [2] = ; energy_pred_coeff4d_4[3] = 0.0; /*----------------------------------------*/ /* VQ Tables */ /*----------------------------------------*/ for (i = 0; i < MSMAX_2_128 ; i++) for (j = 0 ; j < GVQVEC_SIZE_2D ; j++) { gaincb2128 [i][j] = gainVQ_2_128[i][j] ; gain_cb_2_128_8_5 [i] [j] = gainVQ212885 [i] [j] ;

l*---------------------------------------------------------- ---------l return ; /*--------------------------------------------*/ } /*----------------------------------------*/ /*========================================================== ============*/ /* FUNCTION : GEQ_gain VQMA_2 (). */ /*------------------------------------*/ /* PURPOSE: This function performs 2-D VQ of Gp and Gc */ /* 7 bits. */ // /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Tgs: target signal. */ (FLOAT64 unfcod: adaptive and fixed */ /* excitation. */ (FLOAT64 fcod: filtered adaptive and */ /*codebookexcitation.*/ /* _ (INT16) I_sf: length of */ /*/ /* OUTPUT */ /* (FLOAT64 []) gainQ: Quantized adaptive and */ /* fixed codebook */ /* _(INT16 *) idx: codebook */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== ============*/ void GEQ_gain VQMA_2(FLOAT64 Tgs [], FLOAT64 **unfcod, FLOAT64 **fcod, FLOAT64 gainQ [], INT16 *idx, INT16 1_sf, INT16 rate) {

/*----------------------------------------*/ FLOAT64 energy, pred_gain, dist, distmin, gpitch, g cdbk, corr[CORR_SIZE]; INT16 i; INT16 num candidate ; FLOAT64 Renergy ; FLOAT64 unqRenergy ; FLOAT64 predenergy, errenergy ; FLOAT64 **ptr; /*----------------------------------------*/ /*================== Compute the predicted cdbk ====================*/ /*----------------------------------------*/ // /* Note: compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ if (rate==RATE4OK) <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> <BR> dot dvector (past energycL2d, energy_pred coeff 1, &predenergy, 0, GVQVECSIZE2D-1) ; ptr=gaincb2128 ; } else dot_dvector (past_energyq_4d, energy_pred_coeff4d_1, &predenergy, 0, GVQVECSIZE4D-1) ; ptr = gain_cb_2_128_8_5; predenergy = MAX (predenergy,-20. 0); dot_dvector (unfcod [l], unfcod [l], &energy, 0, 1_sf-1) ; Renergy = energy; energy = 30.0-10.; /*----------------------------------------*/

/* Compute the predicted */ /*----------------------------------------*/ energy += predenergy ; /*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ pred_gain = pow(10. 0, energy/20.0); err energy =-energy + 20*log10 (fabs (gainQ [1]) + EPSI); errenergy = pow (10. 0, err energy/20. 0); unq_Renergy = 10. *log 10 (sqr (gainQ [l]) *Renergy+EPSI); /*----------------------------------------*/ /*==================== Optimal gainVQ search ====================*/ /*----------------------------------------*/ dist-min = MAXFLT ; num candidate = 128; dot dvector (fcod [0], fcod [0], &corr [0], 0,; dot dvector (fcod [0], Tgs, &corr [l], 0, 1_sf-1) ; corr [l] *=-2. 0; dot dvector (fcod [l], fcod [l], &corr [2], 0, 1_sf-1) ; dot dvector (fcod [l], Tgs, &corr [3], 0, 1_sf-1); corr [3] *=-2. 0; dot dvector (fcod [0], fcod [l], &corr [4], 0,; corr [4] *= 2.0; for (i = 0; i < num candidate ; i++) g_pitch = ptr [i] [0] ; g_cdbk = pred_gain*ptri[i][1]; dist = sqr (g_pitch) *corr [0] + g_pitch*corr [l] + sqr (g_cdbk) *corr [2] + g_cdbk*corr [3] +

g_pitch*g_cdbk*corr[4]; if (dist<distmin) { dist min = dist ; (*idx) = i ; /*---------------------------------------------------------- --------- /* get the quantized */ /*/ gainQ[0] = ptr[*idx][0]; gainQ [l] = prcd_gain*ptr[*idx][1] ; /*----------------------------------------*/ /* update past quantized energies */ /*----------------------------------------*/ if( rate == RATE4_0K) for (i = GVQ_VEC_SIZE_2D-1; i > 0; i--) past_energyq_2d[i] = past_energyq_2d[i-1]; past_energyq_2d[0] = 20.0*log10(gainVQ_2_128[*idx][1]); } else { for (i = GVQ_VEC_SIZE_4D-1 ; i > 0; i--) past_energyq_4d [i] = past energyq_4d [i-1) ; past_energyq_4d[0] = 20.0*log10(gainVQ_2_128_8_5[*idx][1]); } /*----------------------------------------*/ return;

/*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION: GEQdec_gains_2_7 0. */ /*----------------------------------------*/ /* PURPOSE: This function decodes the 7 bit 2-D VQ of */ /* and Gc. */ /*----------------------------------------*/ /* INPUT */ /* _(INT16 ) Lag: current pitch lag. */ /* _(INT16 ) index: codebook */ /*- (INT16) N bfi: duration of bad */ /* seq. (0=good frame) */ /* _ (FLOAT64 []) unfcod: adaptive and */ /* codebook */ /* (INT16) isf : subframe */ /* _ (INT16) I_sf: length of */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) gainQ: Quantized adaptive */ /* fixed codebook gains. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ void GEQ_dec_gains_2_7(INT16 rate, INT16 Lag, INT16 index, FLOAT64 gainQ [], INT16 N_bfi, FLOAT64 unfcod [], INT16 i_sf, INT16 1_sf) { /*-----------------------------------------*/ INT16 i, num count ;

FLOAT64 current_fixed_energy ; FLOAT64 energy, pred_gain ; FLOAT64 pdown, cdown; FLOAT64val; FLOAT64 min erg 27 ; /___________________________________________________________ ________*/ /* Compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ dot dvector (unfcod, unfcod, &energy, 0,; current fixed energy =energy; energy/= (FLOAT64) tsf; energy = 30. 0-10. (energy+EPSI); /*----------------------------------------*/ Compute the predicted */ /*----------------------------------------*/ if(rate == RATE4_0K) dot_dvector (past_energyq_2d, energy_pred_coeff_1, &val, 0, GVQ_VEC_SIZE_2D-1); else dot_dvector (past_energyq_4d, energy_pred_coeff4d_1, &val, 0, GVQVECSIZE4D-1) ; val = MAX (val,-20. 0); energy += val ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, (energy/20. if(N_bfi == 0) {

if frame // if (rate == RATE4_0K) { gainQ [0] = gainVQ2_128 [index] [0] ; gainQ [l] = pred_gain*gainVQ2_128 [index] [1]; /*----------------------------------------*/ /* update past quantized */ /*----------------------------------------*/ for (i = GVQVECSIZE2D-1 ; i > 0; i--) past_energyq_2d[i] = past_energyq_2d[i-1]; pastenergyq2d [0] = 20. (gainVQ2_128 [index] [1]) ; } else gainQ [0] = gainVQ_2_128_8_5 [index] [0] ; gainQ [1] = pred_gain*gainVQ_2_128_8_5[index][1] ; for (i = GVQVECSIZE4D-1 ; i > 0; i--) past_energyq_4d[i] = past_energyq_4d [i-1] ; past_energyq_4d[0] = 20.0*log10(gainVQ_2_128_8_5[index][1]); } } else else /*/ /*======================== frame /*----------------------------------------*/ /*----------------------------------------*/ /* set down-scaling according to number of bad */ /*----------------------------------------*/

switch (Nbfi) { case 1 : pdown = 0. 95; cdown =0.75; break; case2: pdown = 0. 95; cdown = 0.75; break; case 3 : pdown = 0.90; cdown = 0.75; break; case 4 : pdown = 0. 90; cdown = 0.40; break; case 5 : pdown = 0. 90; cdown = 0.30; break; case 6 : pdown = 0. 90; cdown = 0.20; break; default: pdown = 0.70; cdown = 0.20; break; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ */<BR> <BR> <BR> <BR> <BR> <BR> /*------.-------.---.---*/<BR> <BR> <BR> <BR> <BR> <BR> // if (N_bfi == 1) {

if (isf==0) { if (Lag <= 40) gp_mean = 0.5* (gp_buf[6]+gp_buf[7]) ; else if (Lag <= 80) gp_mean= 0. 0; num count = 0; for (i = 4; i < 8; i++) if (gp_buf[i] >= 0.5) gp_mean += gp_buf[i] ; nus ; if (num count > 0) gp_mean/= (FLOAT64) num count ; else gp_mean = MAX(MAX(gp_buf[6], gp_buf[7]), gp_buf[5]); } else if (Lag <= 120) { gp-mean = 0.0; num count = 0; for (i = 2; i < 8; i++) if (gp_buf[i] >=0.5) gp mean += gp_bufli] ; num count++ ; } if (num count > 0) gp_mean /= (FLOAT64) num count ; else gp_mean = MAX (MAX (MAX (gp_buf[6], gp_buf[7]), gpbufl5]), gpbufl4]) ;

} else { gp-mean =0.0; num count =0; for (i = 0; i < 8; i++) { if (gp_buf[i] >= 0.5) { gp_mean += gp_buf[i]; num count++ ; if (num count > 0) gp_mean /= (FLOAT64)num_count; else gp_mean = MAX (MAX (MAX (MAX (gp_buf[6], gp_buf[7]), gpbuft5]), gpbufl4]), gpbufl3]) ; } #ifdef ALGOBUGFIX if (rate==RATE4OK) { if (MAX (Prev_Beta_Pitch[0], Prev_Beta_Pitch[1]) > 0.70) gainQ [0] = 0.95; else gainQ [0] = MIN (0. 95, gp_mean) ; else { <BR> <BR> <BR> if (MAX (PrevBetaPitch [0], MAX (PrevBetaPitch [l],<BR> <BR> <BR> <BR> <BR> MAX (PrevBetaPitch [2], Prev Beta Pitch [3]))) > 0.70) gainQ [0] = 0.95; else gainQ [0] = MIN (0. 95, gp_mean) ; #else

if (MAX (Prev_Beta_Pitch[0], Prev_Beta_Pitch[1]) > 0.70) gainQ [0] = 0. 95; cdown = 0.0; } else gainQ [0] = MIN (0. 95, gp_mean) ; #endif } else gainQ [0] = gp_fec ; } else { gainQ [0] = gp_fec ; gainQ [0] *= pdown; } gp_fec = gainQ [0] ; gainQ[1] = sqrt(past_fixed_energy/current_fixed_energy); gainQ [1] *= cdown ; /*----------------------------------------*/ /* update past quantized */ /*----------------------------------------*/ if (rate==RATE4OK) min_erg_27 = MIN(past_energyq_2d[0], past_energyq_2d[1]); for (i = GVQVEC SIZE-2D-1 ; i > 0; i--) pastenergyq2d [i] = past_energyq_2d[i-1] ; pastenergyq2d [0] = MIN (min_erg_27, -energy + 20*log10 (fabs (0. 6*gainQ [1]) + EPSI)) ; else { min_erg_27 = MIN(past_energyq_4d[0], past_energyq_4d[1]);

minera27 = MIN (minerg27, pastenergyq4d [2]); min erg 27 = MIN (min_erg_27, past_energyq_4d[3]) ; for (i = GVQVECSIZE4D-1 ; i > 0; i--) pastenergyq4d [i] = past_energyq_4d[i-1]; pastenergyq4d [0] = MIN (min erg 27,-energy + 20*log10 (fabs (0. 6*gainQ [l]) + EPSI)) ; /*========================================================== ============*/ } /*----------------------------------------*/ /* Update the past fixed codebook */ /*----------------------------------------*/ past_fixed_energy = current_fixed_energy*sqr(gainQ[1]); /*__________________________________________________________ _________*/ return ; <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> // /*----------------------------------------*/ /*========================================================== ============*/ /* FUNCTION : GEQ_Quant_PitchGain_3D (). */ /*---------------------------------------------*/ /* PURPOSE: This function performs 3-D VQ of Gal, Ga2, */ /* Ga3 with 4 */ // /* INPUT */ /* None. */ /*----------------------------------------

/* OUTPUT ARGUMENTS */ /* _(INT16 ) idx: codebook */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) Gp : unquantized/quantized pitch */ /* gains. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQQuantPitchGain 3D (FLOAT64 *Gp, INT16 *idx) /*----------------------------------------*/ INT16 i; FLOAT64 min dist ; FLOAT64 dist; FLOAT64 err [GVQVECSIZE3D], /**/ min zist = MAXFLT ; for (i = 0 ; i < TAB_SIZE_GVQ3D ; i++) { dif dvector (Gp, gp3tab [i], err, 0, GVQ_VEC_SIZE_3D-1) ; dot dvector (err, err, &dist, 0, GVQVECSIZE3D-1) ; if (dist < min dist) { min dist = dist; (*idx) = i; } } for (i = 0 ; i < GVQ_VEC_SIZE_3D ; i++) Gp [i] =gp3tab [ (*idx)] [i] ; /___________________________________________________________ ________*/

return; /*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : DecPitchGain3D () */ /*----------------------------------------*/ /* PURPOSE : This function decodes the 4 bit 3-D VQ of */ /* Ga2, and */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) N bfi : duration of bad */ /* seq. (0=good frame) */ /* (INT16) isf : subframe */ /* _(INT16 ) index: codebook */ /*---------------------------------------------------------- ---------/ /* OUTPUT */ /* _ (FLOAT64 []) gainQ : Quantized */ /* codebook */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQDec PitchGain 3D (INT16 N_bif, INT16 isf, INT16 index, FLOAT64 *gainQ) { // FLOAT64 pdown; /*/ if (N_bfi == 0)

/*----------------------------------------*/ good frame /*----------------------------------------*/ gainQ [0] = gp3tab [index] [i_sf] ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> else<BR> { /*========================================================== ============*/ // /*======================== frame /*----------------------------------------*/ // /* set down-scaling according to number of bad frames */ /**/ switch (N_bfi) { case 1: pdown = 0.99; break; case 2: pdown = 0.98; break; case 3: pdown = 0.96; break; case 4: pdown = 0.96; break; case 5: pdown = 0.96; break; case 6: pdown = 0.96; break; default:

pdown = 0.70; break; } /___________________________________________________________ */ /*==================== Pitch Gain ====================*/ // if (N_bfi == 1) gainQ [O] = 0. else { gainQ [0] = gp_buf[7] ; gainQ [0] *= pdown; } <BR> <BR> <BR> <BR> <BR> <BR> /*__________________________________________________________ _________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> return;<BR> return; /*----------------------------------------*/ } /*----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTION : GEQ_Quant_PitchGain_4D (). */ /*----------------------------------------*/ /* PURPOSE: This function performs 4-D VQ of Gal, Ga2, */ /* and Ga4 with 6 */ /*----------------------------------------*/ /* INPUT */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _(INT16) idx: codebook */ /*----------------------------------------*/

/* INPUT/OUTPUT */ /* _ (FLOAT64 []) Gp: unquantized/quantized */ /* gains. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void GEQQuantPitchGain4D (FLOAT64 *Gp, INT16 *idx) // INT16 i; FLOAT64 min dist ; FLOAT64 dist; FLOAT64 err[GVQ_VEC_SIZE_4D]; /*----------------------------------------*/ min dist = MAXFLT ; for (i = 0 ; i < TAB_SIZE_GVQ_4D ; i++) { dif dvector (Gp, gp4tab [i], err, 0, GVQ_VEC_SIZE_4D-1) ; dot dvector (err, err, &dist, 0, GVQ_VEC_SIZE_4D-1) ; if (dist < min_dist) { min dist = dist ; (*idx) = i ; } for (i = 0 ; i < GVQ_VEC_SIZE_4D ; i++) Gp [i] = gp4_tab[(*idx)][i]; /*----------------------------------------*/ return;

/*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : GEQDec_PitchGain_4D 0. */ /*----------------------------------------*/ /* PURPOSE : This function decodes the 6 bit 4-D VQ of */ /* Ga2, Ga3, and */ /*----------------------------------------*/ /* INPUT */ /* (INT16) Nbfi : duration of bad */ <BR> <BR> <BR> /* seq. (0=good frame) */<BR> <BR> <BR> <BR> /* (INT16) isf : subframe */ /* (INT16) index: codebook */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) gainQ : Quantized adaptive */ /* codebook */ /*----------------------------------------*/ /* INPUT */ None.

/*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQ-Dec PitchGain 4D (INT16 N bfi, INT16 i sf, INT16 index, FLOAT64 *gainQ) /*---------------------------------------------------------- --------- FLOAT64 pdown; /*----------------------------------------*/ if (Nbfi==0) /*/ /*==================== good frame ====================*/

/*----------------------------------------*/ gainQ [0] = gp4tab [index] [i_sf] ; } else else // /*==================== bad frame ====================*/ <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* set down-scaling according to number of bad */ /*----------------------------------------*/ switch (N_bfi) case1: pdown = 0.99; break ; case2: pdown = 0.98; break; case3: pdown = 0. 96; break; case4: pdown = 0.96; break; case5: pdown = 0.96; break; case6: pdown = 0.96; break; default : pdown = 0.70; break;

/*----------------------------------------*/ /*==================== Pitch Gain ====================*/ /*----------------------------------------*/ if (N_bfi == 1) gainQ[0] = 0.95; Pitch Gain /*/ if (Nbfi == 1) gainQ [0] = 0. 95; else f <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> gainQ[0] = gp_buf[7];<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> gainQ [01 *= pdown;<BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> return ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> return;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*----------------------------------------*/<BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------------------*/<BR> /*/ /* FUNCTION: GEQgainVQMA_3 0. */ /*----------------------------------------*/ /* PURPOSE: This function performs 3-D VQ of Gcl, Gc2, */ /* Gc3 with 8 bits. */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* (FLOAT64 []) Tgs: target */ /* _ (FLOAT64 []) unfcod: fixed codebook excitation. */ /* _(FLOAT64 []) fcod: filtered fixed */ excitation.

/*----------------------------------------*/ /* OUTPUT ARGUMENTS : */ /* (FLOAT64 []) gainQ: Quantized fixed */ /* gains. */

/* (INT16) idx: codebook index. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ /*========================================================== ============*/ void GEQgainVQMA3 (FLOAT64 Tgs [], FLOAT64 **unfcod, FLOAT64 **fcod, FLOAT64 **gainQ, INT16 *idx) { /___________________________________________________________ ________*/ INT16 i; INT16 num candidate ; INT16 i_s, i_sf; INT16 LL_SF[N_SF3] = {LSFO, LSFO, LSF3} ; FLOAT64 erg_ratio[N_SF3]; FLOAT64 pred_energy[N_SF3]; FLOAT64 err_energy[N_SF3]; FLOAT64 lin_err_energy [N_SF3] ; FLOAT64 energy [N_SF3], pred_gain [N_SF3], dist, dist min, corr [CORRSIZE] [NSF3] ; FLOAT64 val ; FLOAT64 corr coeff a [3], corr coeff b [3), corr coeff c ; /*----------------------------------------*/ /*================== Compute the predicted cdbk ====================*/ /*----------------------------------------*/ /*----------------------------------------*/ /* MA */ /*----------------------------------------*/ dot_dvector(past_energyq_3d, energy_pred_coeff_1, &predenergy [0], 0, GVQVECSIZE3D-1) ;

predenergy [0] = MAX (predenergy [0],-20. 0); dotdvector (pastenergyq3 d, energypredcoeff2, &pred_energy [l], 0, GVQ_VEC_SIZE_3D-1) ; pred_energy[1] = MAX (pred energy [l],-20. 0); dot_dvector(past_energyq_3d, energy_pred_coeff_3, &pred_energy[2], 0, GVQ_VEC_SIZE_3D-1); predenergy [2] = MAX (predenergy [2],-20. 0); /*--------------------------------------------------*/ /*======================= Process all ===========================*/ /*--------------------------------------------------*/ i = 0 ; for (isf= 0; isf<NSF3 ; i_sf++) /*----------------------------------------*/ /* compute the cdbk energy with mean removed (i. */ // dot_dvector (unfcod[1]+i_s, unfcod[1]+i_s, &energy[i_sf], 0, LL_SF[i_sf]-1); energy[i_sf] = 34.0 - 10.0*log10(energy[i_sf] / (FLOAT64)LL_SF[i_sf]+EPSI); /*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ energy [i_sfl += pred_energy [i_sfl ;

/*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ pred_gain [i_sf] = pow (10. 0, energy [i_sfl/20. 0); err_energy[i_sf] = -energy[i_sf] + 20*log10(fabs(gainQ[1][i_sf]) + EPSI); lin_err_energy[i_sf] = pow (10. 0, err energy [i sfl/20. 0); i_s += LL_SF[i_sf]; } /___________________________________________________________ ________*/ /*==================== Optimal gain VQ search ====================*/ /*------------------------------------------*/ dist-min = MAXFLT; num candidate = 256; i = 0 ; for (isf= 0; isf<NSF3 ; i_sf++) { dot dvector (fcod [0] +i s, fcod [0] +i s, &val, 0, LL_SF[i_sf]-1) ; corr [0] [i_sf] = val ; dot dvector (fcod [0J+i_s, Tgs+i_s, &val, 0, LL_SF[i_sf]-1) ; corr[1][i_sf] = -2.0 * val; dot_dvector(fcod[1]+i_s, fcod[1]+i_s, &val, 0, LL_SF[i_sf]-1); corr [2] [isf] = val ; dot dvector (fcod [1]+i_s, Tgs+i_s, &val, 0, LLSF [isf]-l) ; corr [3] [i_sfl =-2.0*val; dot dvector (fcod [0] +i_s, fcod [1]+i_s,&val, 0, LLSF [isf]-l) ; corr [4] [i_sf] = 2.0*val ;

dot_dvector(Tgs+i_s, Tgs+i_s, &val, 0, LL_SF[i_sf]-1); corr[5][i_sf] = val; i_s += LL_SF[i_sf]; } ergratio [0] = corr [5] [01 corr [5] [0]+corr[5][1]+corr[5][2] +EPSI); erg_ratio[1] = corr [5] [1] /( corr[5][0]+corr[5][1]+corr [5] [2] +EPSI); erg_ratio[2] = corr [5] [2] /( corr[5][0]+corr[5][1]+corr[5] [2] +EPSI); corrcoeffa [0] = erg_ratio[0] * corr [2] [0] * predgain [0] * pred_gain [0] ; corr_coeff_b[0] = ergratio [0] * (corr [3] [0] + gainQ [0] [0] * corr [4] [0]) * pred_gain [0] ; corr_coeff_a[1] = erg_ratio[1]*corr[2][1]*pred_gain[1]*pred_gain[1]; corrcoeab [l] =erg ratio [l] * (corr [3] [1]+gainQ[0][1]*corr [4] [1]) *pred_gain [l] ; corr_coeff_a[2] = erg_ratio [2] *corr [2] [2] *pred_gain [2] *pred_gain [2] ; corr_coeff_b[2] = erg_ratio[2]*(corr[3][2]+gainQ[0][2]*corr [4] [2]) *pred_gain [2] ; corr_coeff_c = erg_ratio[0]*(corr[5][0]+sqr(gainQ[0][0])*corr[0][0]+gainQ[0 ][0]* corr[1][0])+ erg_ratio[1]*(corr[5][1]+sqr(gainQ[0][1])*corr[0][1]+gainQ[0 ][1]*corr[1][1])+ erg_ratio [2] * (corr [5] [2] +sqr (gainQ [0] [2])*corr[0] [2] +gainQ [0] [2]*corr[1] [2]); for (i = 0 ; i < num candidate ; i++) dist = corr_coeff_a[0]*sqr(gainVQ_3_256 [i] [0]) + corr_coeff_b[0]*gainVQ_3_256 [i] [0] + corr_coeff_a[1]*sqr(gainVQ_3_256[i][1])+ corr_coeff_b[1]*gainVQ_3_256 [i] [1] + corrcocaa [2]*sqr(gainVQ3256 [i] [2]) + corr_coeff_b[2]*gainVQ_3_256[i][2] + corr_coeff_c; if (dist < dist min) dist-min = dist; (*idx) = i ;

/*---------------------------------------------------------- --------- /* Get the quantized */ /*----------------------------------------*/ gainQ [I] [0] = pred_gain [0]*gainVQ_3_256[*idx][0] ; gainQ [l] [1] = predgain [1]*gainVQ_3_256[*idx][1]; gainQ [1] [2] = predgain [2] *gainVQ3256 [*idx] [2] ; /*----------------------------------------*/ /* Update past quantized */ /*----------------------------------------*/ for (isf= 0; isf<NSF3 ; isf++) { val = gainVQ_3_256[*idx][i_sf] ; past encrgyqL3d [N_SF3-1-i_sfl = 20.0* logl0 (val); /*/ return ; /*----------------------------------------*/ } /*----------------------------------------*/ /*========================================================== ============*/ /* FUNCTION : GEQ_dec_gc_3_8 (). */ /*/ /* PURPOSE: This function decodes the 8 bit 3-D VQ of Gcl, */ /* Gc2, and Gc3. Note that the gains are */ /* one-by-one on a subframe */ /*----------------------------------------*/ /* INPUT */ /* (INT16) index: codebook */ /* _(INT16 ) N_bfi : duration of bad */ /* seq. (0=good frame) */

/* _(FLOAT64 []) unfco@@ fixed @@ @@ok excitation.*/ /* _(INT16 ) i_sf: subframe number. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS : */ /* _(FLOAT64 *) gainQ: Quantized fixed codebook */ /* gains. */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* None. */ /*__________________________________________________________ _________*/ /* RETURN ARGUMENTS*/ <BR> <BR> <BR> <BR> /*None.*/<BR> <BR> <BR> <BR> <BR> ---------- void GEQdecSc_3_8 (1NT16 index, FLOAT64 *gainQ, INT16 N_bfi, FLOAT64 **unfcod, INT16 isf) { /*/ INT16 i sf local ; INT16 LLSF [NSF3] = {LSFO, LSFO, LSF3} ; FLOAT64 cdown, currentfixedenergy, energy, pred_gain ; FLOAT64 min erg 38 ; /*----------------------------------------*/ /* Note: the gains are decoded one-by-one on a subframe */ /*----------------------------------------*/ /*----------------------------------------*/ /* Compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ /*----------------------------------------*/ /* Predict energy for all subframes at first subframe */ /*----------------------------------------*/ if(i_sf == 0) { dot_dvector(past_energyq_3d, energy_pred_coeff_1,

pred_energy_d38, 0,3-1); predenergyd38 [0] = MAX (predenergyd38 [0],-20. 0); dot_dvector(past_energyq_3d, energy_pred_coeff_2, pred_energy_d38+1, 0,3-1); predenergyd38 [l] = MAX (pred_energy_d38 [1],-20. 0); dot_dvector(past_energyq_3d, energy_pred_coeff_3, pred_energy_d38+2, 0,3-1); predenergyd38 [2] = MAX (pred energyd38 [2],-20.0); } dot dvector (unfcod [l], unfcod [l], &energy, 0, LL_SF[i_sf]-1) ; current fixed energy = energy; energy = 34.0-10. 0*log10(energy/(FLOAT64)LL_SF[i_sf]+EPSI) ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ energy += pred_energy_d38 [i_sfl ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, energy/20.0); if (N_bfi == 0) /_/ /*========================= Good frame ===========================*/ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* Get the quantized */ /*----------------------------------------*/ (*gainQ) = pred_gain*gainVQ3_256 [index] [i_sf] ;

past_fixed_energy = current_fixed_energy*sqr((*gainQ)); if (i sf == N SF3-1) { /_______________________________________________________*/ /* Update past quantized */ /*----------------------------------------*/ for (i_sf local= 0; isf!ocat < NSF3 ; i_sf local++) { past_energyq_3d[N_SF3-1-i_sf_local] = 20. (gainVQ3_256 [index] [i_sf local]) ; } } <BR> <BR> <BR> <BR> <BR> <BR> <BR> else<BR> { /*----------------------------------------*/ /*============================== Bad frame ==============================*/ /*----------------------------------------*/ /*----------------------------------------*/ /* set down-scaling according to number of bad */ /___________________________________________________________ */ switch (N_bfi) case 1: cdown = 0.75; break; case 2: cdown = 0.75; break; case 3: cdown = 0.75; break; case 4: cdown = 0.40; break;

case 5 : cdown = 0. 30 ; break; case 6 : cdown = 0. 20; break; default: cdown = 0.20; break; /*----------------------------------------*/ /*=========================== Fix Codebook ======================*/ // (*gainQ) = sqrt (pastfixedenergy/currentfixedenergy) ; (*gainQ) *= cdown; past fixed energy = current_fixed_energy*sqr((*gainQ)) ; // /* Buffer data for update after the last */ /*----------------------------------------*/ min erg 38 = MIN (past_energyq_3d[0], past_energyq_3d[1]) ; min erg 38 = MIN (min_erg_38, past_energyq_3d[2]) ; past energyq_3d [GVQVEC_SIZE_3D-1-i_sfl = MIN (min_erg_38, -energy + 20*log10 (fabs (0. 6* (*gainQ)) + EPSI)) ; /*----------------------------------------*/ /* Set GC to zero for this mode under */ /*----------------------------------------*/ (*gainQ) = 0. 0 ; /*/

return; /*----------------------------------------*/ *-_/ /*========================================================== ============*/ /* FUNCTION : GEQgainVQMA40. */ /*----------------------------------------*/ /* PURPOSE : This function performs 4-D VQ of Gcl, Gc2, */ /* and Gc4 with 10 */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Tgs: target */ /* _ (FLOAT64 []) unfcod: fixed codebook excitation. */ (FLOAT64 fcod: filtered fixed */ /* excitation. */ /*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) gainQ : Quantized fixed codebook */ /* gains. */ /* _ (INT16) idx: codebook */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== ============*/ void GEQ_gain VQMA_4 (FLOAT64 Tgs [], FLOAT64 **unfcod, FLOAT64 **fcod, FLOAT64 **gakinQ, INT16 *idx) { /___________________________________________________________ ________*/ INT16 i; INT16 num candidate ; INT16 is, isf ;

FLOAT64 pred_energy[N_SF4]; FLOAT64 err_energy[N_SF4]; FLOAT64 Iinerrenergy [NSF4], FLOAT64 energy SF4], pred_gainlN_SF4], dist, dist min, corr [CORRSIZE] [NSF4], FLOAT64 val ; FLOAT64 corr_coeff_a[4], corr_coeff_b[4], corr_coeff_c; /*----------------------------------------*/ /*================== Compute the predicted cdbk ====================*/ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* MA Prediction */ // dot_dvector(past_energyq_4d, energy_pred_coeff4d_1, &pred_energy[0], 0, GVQVEC SIZE-4D-1) ; pred_energy[0] = MAX(pred_energy[0], -20.0); dot_dvector(past_energyq_4d, energy_pred_coeff4d_2, &predenergy [l], 0, GVQVECSIZE 4D-1) ; pred energy [1] =MAX (predenergy [l],-20. 0); dot_dvector(past_energyq_4d, energy_pred_coeff4d_3, &pred_energy[2], 0, GVQ_VEC_SIZE_4D-1); predenergy [2] = MAX (predenergy [2],-20.0); dot dvector (past energyq_4d, energy_pred coeff4d 4, &pred_energy[3], 0, GVQ_VEC_SIZE_4D-1); predenergy [3] = MAX (predenergy [3],-20.0); /*----------------------------------------*/ /*==================== Process all subframe =======================*/

/*----------------------------------------*/ ils=0 ; for (isf= 0 ; isf< NSF4 ; i_sf++) /*--------*/ /* compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ dot_dvector (unfcod[1]+i_s, unfcod[1]+i_s, &energy[i_sf], 0, LSF4-1) ; energy [i_sfl = 34. (energy [i_sfl/ (FLOAT64)L_SF4+EPSI); /*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ energy[i_sf] += pred_energy[i_sf]; /*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ pred_gain [i_sfl = pow (10. 0, energy [i_sf]/20. 0); err_energy[i_sf] = -en ergy[i_sf] + 20*log10(fabs(gainQ[1][i_sf]) + EPSI); Hnerrenergy [isf] = pow (10. 0, err_energy [i_sfl/20. 0); is += LSF4 ; // /*======================= Optimal gainVQ ==============================*/

/*----------------------------------------*/ dist min = MAXFLT ; num candidate = 1024; is=0 ; for (i_sf = 0; isf<NSF4 ; i_sf++) dot dvector (fcod [0] +i s, fcod [0] +i_s, &val, 0, L SF4-1) ; corr [0] [i_sf] = val ; dot_dvector (fcod[0]+i_s, Tgs+i_s, &val, 0, L_SF4-1); corr [l] [i_sfl =-2. dot dvector (fcod [l] +is, fcod [l] +i_s, &val, 0, L_SF4-1) ; corr [2] [i_sf] = val ; dot dvector (fcod [1]+i_s, Tgs+i_s, & val, 0, LSF4-1) ; corr [3] [i_sf] =-2.; dot dvector (fcod [0]+i_s, fcod [l] +i_s,&val, 0, LSF4-1) ; corr [4] [i_sfl = 2.; dotdvector (Tgs+is, Tgs+is, &val, 0, LSF4-1) ; corr [5] [i_sf] = val ; is += LSF4 ; } corr_coeff_a[0] = corr[2][0]*pred_gain[0]*pred_gain[0]; corr_coeff_b[0] = (corr[3][0]+gainQ[0][0]*corr[4][0])*pred_gain[0]; corr_coeff_a[1] = corr[2][1]*pred_fain[1]*pred_gain[1]; corrcoeffbtl] = (corr [3][1] +gainQ [0] [1] *corr [4] [l]) *pred_gain [1]; corr_coeff_a[2] = corr[2][2]*pred_gain[2]*pred_gain[2]; corr coeff b [2] = (corr [3] [2] +gainQ [0] [2] *corr [4] [2]) *pred_gain [2] ; corr_coeff_a[3] = corr [2] [3] *predgain [3] *predgain [3]; corr_coeff_b[3] = (corr [3] [3] +gainQ [0} [3] *corr [4] [3]) *pred_gain [3] ;

corr_coeff_c = corr[5][0]+sqr(gainQ[0][0])*corr[0][0]+gainQ[0][0]*corr[1][0 ]+ corr[5][1]+sqr(gainQ[0][1])*corr[0][1]+gainQ[0][1]*corr[1][1 ]+ corr [5] [2] +sqr (gainQ [0] [2]) *corr [0] [2]+gainQ[0][2]*corr[1][2]+ corr [5] [3] +sqr (gainQ [0] [3]) *corr [0] [3]+gainQ[0] [3] *corr [lj [3] ; for (i = 0 ; i < num candidate ; i++) { dist = corr_coeff_a[0]*sqr(gain VQ_4_1024[i][0])+corr_coeff_b[0]*gainVQ_4_1024[i][0] + corr_coeff_a[1]*sqr(gainVQ_4_1024[i][1])+corr_coeff_b[1]*gai nVQ_4_1024[i][1] + corr coeff a [2] *sqr (gainVQ_4_1024 [i] [2]) +corr_coeff_b[2]*gainVQ_4_1024 [i] [2] + corr coeff a [3] *sqr (gainVQ4_1024 [i] [3]) +corr_coeff_b[3]*gainVQ_4_1024 [i] [3] + corr_coeff_c; if (dist < dist min) dist min = dist; (*idx) = i; } // /* Get the quantized */ /*----------------------------------------*/ gainQ[1][0] = pred_gain[0]*gainVQ_4_1024[*idx][0]; gainQ [1] [1] = pred_gain [l] *gainVQ41024 [*idx] [l] ; gainQ [1] [2] = pred_gain [2] *gainVQ4I024 [*idx] [2] ; gainQ [1] [3] = pred_gain [3] *gainVQ4_1024 [*idx] [3];

/*----------------------------------------*/ /* Update past quantized */ /*----------------------------------------*/ for (isf= 0; isf< NSF4; isf-) { val = gainVQ_4_1024[*idx][1_sf]; past_energyq_4d [N_SF4-1-i_sf] = 20.0* logl0 (val); } // return; /*----------------------------------------*/ } /*-----------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTION: GEQdec_gc_4_10 0. */ /*----------------------------------------*/ /* PURPOSE: This function decodes the 10 bit 4-D VQ of Gcl, */ /* Gc2, Gc3, and Gc4. Note that the gains */ /* decoded one-by-one on a subframe */ /*----------------------------------------*/ /* INPUT */ /* _(INT16 ) index: codebook */ /* (INT16) Nbfi : duration of bad */ /* seq. (0=good */ (FLOAT64 unfcod : fixed codebook excitation. */ /* (INT16) isf : subframe */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) gainQ: Quantized fixed */ /* gains. */ /*----------------------------------------*/ /* INPUT */ /* None. */

/*----------------------------------------*/ /* RETURN */ /* None. */ <BR> <BR> <BR> <BR> l =<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> void GEQdecgc410 (INT16 index, FLOAT64 *gainQ, INT16 N bfi, FLOAT64 **unfcod, INT16 isf) /___________________________________________________________ ________*/ INT16 i_sf_local; FLOAT64 cdown, current fixed energy, energy, pred_gain ; FLOAT64 min_erg_410; // /* Note: the gains are decoded one-by-one on a subframe */ /*----------------------------------------*/ /*----------------------------------------*/ /* Compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ /*----------------------------------------*/ /* Predict energy for all subframes at first */ /*----------------------------------------*/ if (i_sf == 0) { dot_dvector(past_energyq_4d, energy_pred_coeff4d_1, pred_energy_d410, 0,4-1); predenergyd410 [0] = MAX (predenergyd410 [0],-20. 0); dot dvector (past_energyq_4d, energy_pred_coeff4d_2, pred_energy_d410+1,0,4-1); pred_energy_d410 [1] = MAX (predenergyd410 [l],-20.0); dot_dvector(past_energyq_4d, energy_pred_coeff4d_3,

predenergyd410+2, 0,4-1); predenergyd410 [2] = MAX (predenergyd410 [2],-20. 0); dot dvector (past energyqL4d, energy_pred_coeff4d 4, pred_energy_d410+3,0,4-1); predenergyd410 [3] = MAX (predenergyd410 [3],-20.0); dot dvector (unfcod [l], unfcod [l], &energy, 0, LSF4-1) ; current fixed energy =energy; energy = 34.0 - 10.0*log10(energy/(FLOAT64)L_SF4+EPSI); /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ energy += predenergyd410 [isf] ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, energy/20.0); if(N_bfi == 0) <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> /*=======================Goodframe=======================*/ /*----------------------------------------*/ /*----------------------------------------*/ /* Get the quantized */ /*----------------------------------------*/ (*gainQ) = pred_gain*gainVQ4_1024 [index] [i_sf] ; past fixed energy = current_fixed_energy*sqr ((*gainQ)) ; if(i_sf == N_SF4-1)

{ /*----------------------------------------*/ /* Update past quantized */ /*----------------------------------------*/ for (i_sf local= 0; isfjocat < NSF4 ; i_sf local++) past_energyq_4d[N_SF4-1-i_sf_local] = 20. (gainVQ4_1024 [index] [i_sf local]) ; } } } else <BR> <BR> <BR> else<BR> <BR> <BR> { /*=========================== Bad frame ===========================*/ // /*----------------------------------------------*/ /* set down-scaling according to number of bad frames */ /*----------------------------------------------*/ switch (N_bfi) case 1: cdown = 0.75; break; case 2: cdown = 0.; break; case 3: cdown = 0.75; break; case 4: cdown = 0.40; break; case 5: cdown = 0.30;

case 6 : cdown = 0.20; break; default: cdown = 0.20; break; // Pitch gain /*----------------------------------------*/ (*gainQ) = sqrt (past_fixed_energy/current_fixed_energy) ; (*gainQ) *= cdown; pastfixedenergy = currentfixedenergy*sqr ( (*gainQ)) ; /*----------------------------------------*/ /* Buffer data for update after the last */ // min erg_410 = MIN (past_energyq_4d[0], past_energyq_4d[1]) ; min erg 410 = MIN (min_erg_410, past_energyq_4d[2]) ; min erg_410 = MIN (min_erg_410, past_energyq_4d[3]) ; past_energyq_4d[GVQ_VEC_SIZE_4D-1-i_sf] = MIN(min_erg_410, -energy + 20*log10 (fabs (0. 6* (*gainQ)) + EPSI)); /*----------------------------------------*/ /* Set GC to zero for this mode under FER */ // (*gainQ) = 0. 0 ; } /*/ return; // }

/*----------------------------------------*/ /*========================================================== ==*/ /* FUNCTION: GEQgainNSQMA_1_5 0. */ /*----------------------------------------*/ /* PURPOSE: This function performs 1-D VQ of Gc */ /* 5 bits. */ /*----------------------------------------*/ /* INPUT */ /* _ (FLOAT64 []) unfcod: fixed */ /* excitation. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) gainQ: Quantized adaptive and */ /* fixed codebook */ /* _ (INT16 *) idx: codebook */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ---------- void GEQgainNSQMA_1_5 (FLOAT64 *unfcod, FLOAT64 **gainQ, INT16 *idx) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> /*------------.--.----------*/ FLOAT64 energy, pre-gain, dist, distmin, gcdbk; INT16 i; INT16 num candidate ; FLOAT64 predenergy ; /*----------------------------------------*/ /*================== Compute the predicted cdbk =======================*/ /*----------------------------------------*/ /*----------------------------------------*/ /* Note: compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/

dot dvector (past energyq_4d, energy_pred coeff4d_l, &pred energy, 0, GVQVEC_SIZ4D-1) ; predenergy = MAX (predenergy,-20. 0); dot dvector (unfcod, unfcod, &energy, 0, LFRM-1) ; energy = 30. 0-10. (energy/(FLOAT64) L_FEM+EPSI) ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ energy += predenergy ; /*----------------------------------------*/ /* compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, energy/20.0); /*----------------------------------------*/ /*======================= Optimal gainVQ search ====================*/ /*----------------------------------------*/ dist-min = MAXFLT ; num candidate = 32 ; for (i = 0 ; i < num candidate ; i++) g cdbk = pred_gain*gainSQ_1_32 [i]; dist = sqr (g_cdbk - gainQ[1][0]) ; if (dist < dist min) { dist min = dist; (*idx) = i;

} /*----------------------------------------*/ /* get the quantized */ /*----------------------------------------*/ gainQ[1][0] = pred_gain*gainSQ_1_32]*idx]; /*______________________________,___________________________ ______* /* update past quantized */ /*----------------------------------------*/ for (i = GVQVECSIZE4D-1 ; i > 0; i--) pastenergyq4d [i] = pastenergyq4d [i-l], pastenergyq4d [0] = 20. (gainSQ_1_32 [*idx]); /*----------------------------------------*/ return ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ============*/ /* FUNCTION : GEQdecgainsl5 (). */ /*/ /* PURPOSE : This function decodes the 5 bit 1-D VQ of */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT16 ) index: codebook */ /* _ (INT 16) N bfi : duration of bad */ /* seq. (0=good frame) */ /* _ (FLOAT64 []) unfcod : adaptive and fixed */ /* codebook */ /*----------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 [] []) gainQ : Quantized adaptive */

/* fixed codebook gains. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ <BR> <BR> <BR> <BR> /*None.*/<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* RETURN */ /* None. */ /*========================================================== ============*/ void GEQdecgainsl5 (INT16 index, FLOAT64 **gainQ, FLOAT64 *unfcod, INT16 Nbfi) { // INT16 i; FLOAT64 current fixed energy ; FLOAT64 energy, pred_gain ; FLOAT64 cdown; FLOAT64 val ; FLOAT64 min erg-15 ; /*----------------------------------------*/ /* Compute the cdbk energy with mean removed (i. */ /*----------------------------------------*/ dot dvector (unfcod, unfcod, &energy, 0, LFRM-1) ; current fixed energy = energy; energy/= (FLOAT64) L FRM ; energy = 30. 0-10. (energy+EPSI); /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ dot_dvector (past_energyq_4d, energy_pred_coeff4d_1, &val, 0, GVQVECSIZE4D-1) ;

val = MAX (val,-20. 0); energy += val ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, energy/20.0); if (N_bfi == 0) <BR> <BR> <BR> <BR> <BR> <BR> /*---.......................-----..-.....--*/<BR> <BR> <BR> <BR> /*============================== good frame ==============================*/<BR> /*----------------------------------------*/ /*----------------------------------------*/ /* get the quantized */ // gainQ [1] [0] = predgain*gainSQl32 [index] ; /*----------------------------------------*/ /* update past quantized */ // for (i = GVQVEC SIZE_4D-1 ; i > 0; i--) past energyq4d [i] = past energyq_4d [i-1] ; pastenergyq4d [0] = 20. (gainSQ_1_32[index]) ; else /*========================================================== ========*/ else /*========================= bad frame ========================*/ //

/*----------------------------------------*/ /* set down-scaling according to number of bad frames */ /*----------------------------------------*/ switch (N_bfi) switch (N_bfi) case 1: cdown = 0.98; break; case 2: cdown = 0. 94; break; case 3: cdown = 0.88; break; case 4: cdown = 0.80; break; case 5: cdown = 0. 30; break; case 6: cdown = 0.20; break; default: cdown = 0.20; break; gainQ [1] [0] = sqrt (pastfixed energy/currentfixedenergy) ; gainQ [1] [0] *= cdown; /*----------------------------------------*/ /* update past quantized */ /*----------------------------------------*/ min erg-15 = MIN (past_energyq_4d [0], past_energyq_4d [1]); miner15 = MIN (min erg15, pastenergyq4d [2]); minerg15 = MIN (minerg15, pastenergyq4d [3]);

for (i = GVQVEC SIZE-4D-1 ; i > 0; i--) pastenergyq4d [i] = past energyq_4d [i-1] ; past_energyq_4d[0] = MIN (minerg15,-energy + 20*logis (fabs (0. 6*gainQ [1] [0]) + EPSI)); /*----------------------------------------*/ /* Update the past fixed codebook */ /*----------------------------------------*/ past_fixed_energy = currentfixedenergy*sqr (gainQ [1] [0]); /*----------------------------------------*/ return; } } /*========================================================== ============*/ /* FUNCTION : GEQgainNSQMAl6 (). */ /*----------------------------------------*/ /* PURPOSE : This function performs 1-D VQ of Gc */ /* 6 bits. */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) unfcod: fixed */ /* excitation. */ /*----------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) gainQ : Quantized adaptive */ /* fixed codebook */ /* (INT16 *) idx: codebook */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */

/* None. */ void GEQ_gainNSQMA_1_6(INT16 pos, FLOAT64 *unfcod, FLOAT64 **gainQ, INT16 *idx) { /*/ FLOAT64 energy, pred_gain, dist, dist_min, g_cdbk ; INT16 i; INT16 num-candidate, FLOAT64 pred_energy ; /*----------------------------------------*/ /*================== Compute the predicted cdbk ====================*/ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* Note: compute the cdbk energy with mean removed (i. */ /*---------------------------------------------------------- ---------/ dot_dvector (past_energyq_2d, energy_pred_coeff_1, &pred_energy, 0, GVQ_VEC_SIZE_2D-1); predenerg ;' = MAX (predenergy,-20. 0); dot dvector (unfcod+pos*40, unfcod+pos*40, &energy, 0,80-1); energy = 30.0-10. 0*log10(energy/(FLOAT64) 80+EPSI); /*----------------------------------------*/ /* Compute the predicted */ /___________________________________________________________ ________*/ energy += predenergy ; /*----------------------------------------*/ /* compute the predicted */ /*/ pred_gain = pow (10. 0, energy/20.0);

/*----------------------------------------*/ /*==================== Optimal gainVQ search ====================*/ /*----------------------------------------*/ dise-min = MAXFLT; num candidate = 64; for (i = 0; i < numcandidate ; i++) g cdbk = pred_gain*gainSQl 64 [i] ; dist = sqr (g_cdbk - gainQ[1][pos]) ; if (dist < dist min) { dist min = dist; (*idx) = i; // /* get the quantized */ // gainQ [1] [pos] = predgain*gainSQl64 [*idx] ; /*----------------------------------------*/ /* update past quantized */ /*----------------------------------------*/ for (i = GVQ_VEC_SIZE_2D-1 ; i > 0; i--) past energyq2d [i] = past_energyq_2d [i-1] ; pastenergyq2d [0] = 20. 0*log10(gainSQ_1_64[*idx]) ; /*----------------------------------------*/ return;

/*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : GEQdec_gains_1_6 0. */ /*----------------------------------------*/ /* PURPOSE : This function decodes the 6 bit 1-D VQ of */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT16 ) index: codebook */ /* (INT16) Nbfi : duration of bad */ /* seq. (0=goodframe) */ /* _ (FLOAT64 []) unfcod : adaptive and fixed */ codebook excitation.

/*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 [] []) gainQ : Quantized adaptive */ fixed codebook gains. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQ_dec_gains_1_6(INT16 pos, INT16 index, FLOAT64 **gainQ, FLOAT64 *unfcod, INT16 N_bfi) // INT16 i; FLOAT64 current fixed energy ; FLOAT64 energy, pred_gain ; FLOAT64 cdown; FLOAT64 val ; FLOAT64 min erg_16 ;

/*----------------------------------------*/ /* Compute the cdbk energy with mean removed (i. */ // dot dvector (unfcod+pos*40, unfcod+pos*40, &energy, 0,80-1); current_fixed_energy = energy; energy/= (FLOAT64) 80; energy = 30. 0-10. (energy+EPSI) ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ dot_dvector (past_energyq_2d, energy_pred_coeff_1, &val, 0, GVQVEC SIZE 2D-1) ; val = MAX (val,-20. 0); energy += val ; /*----------------------------------------*/ /* Compute the predicted */ /*----------------------------------------*/ pred_gain = pow (10. 0, energy/20.0); <BR> <BR> <BR> <BR> <BR> <BR> if (N_bfi == 0)<BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> /*---...----.-............-.--.-.-...........*/<BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* get the quantized */ // gainQ [1] [pos] = pred_gain*gainSQl 64 [index] ;

/*----------------------------------------*/ /* update past quantized */ /*----------------------------------------*/ for (i = GVQ_VEC_SIZE_2D-1 ; i > 0; i--) past energyq2d [i] = past_energyq_2d [i-1] ; pastenergyq2d [0] = 20. 0*log10(gainSQ_1_64[index]) ; else /*========================================================== ============*/ else bad frame /*----------------------------------------*/ /___________________________________________________________ */ /* set down-scaling according to number of bad */ /___*/ switch (Nbfi) { case 1: cdown = 0.98; break; case 2: cdown = 0.94; break; case 3: cdown = 0.88; break; case 4: cdown = 0.80; break; case 5: cdown = 0.30; break; case 6:

cdown = 0. 20; break; default: cdown = 0.20; break; } gainQ [l] [pos] = sqrt (pastfixedenergy/currentfixedenergy) ; gainQ [1] [pos] *= cdown ; /*----------------------------------------*/ /* update past quantized */ /*------------------*/ miner16 = MIN (past_energyq_2d[0], past_energyq_2d[1]) ; for (i = GVQVEC SIZE_2D-1 ; i > 0; i--) pastenergyq2d [i] = past_energyq_2d [i-1] ; pastenergyq2d [0] = MIN (minerg16,-energy + 20*log10 (fabs (0. 6*gainQ [l] [pos]) + EPSI)); } /___________________________________________________________ ________*/ /* Update the past fixed codebook */ // pastfixedenergy = currentfixedenergy*sqr (gainQ [l] [pos]) ; /*----------------------------------------*/ return; /___________________________________________________________ ________*/ } /*========================================================== ============*/ /* FUNCTION : GEQ_gain_reopt_2 (). */ /*----------------------------------------*/ /* PURPOSE : This function jointly estimates Ga and */

/*----------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (FLOAT64 []) vec0 : filtered adaptive */ excitation.

/* _(FLOAT64 []) vecl: filtered fixed */ excitation.

/* _ (FLOAT64 []) target: target */ /* _(INT16 ) 1_sf; length of */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64) gainO : adaptive codebook */ /* _ (FLOAT64) gainl : fixed codebook */ /*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void GEQ_gain_reopt_2 (FLOAT64 *vec0, FLOAT64 *vecl, FLOAT64 *target, FLOAT64 *gain0, FLOAT64 *gainl, INT16 I_sf) { // FLOAT64 *Cp, *Tgs, *Cc; FLOAT64 R_Cp_Tgs, R_Cp_Cp, R_Cc_Cc, R_Cp_Cc, R_Cc_Tgs; FLOAT64 den, num; // Tgs = target; Cp = vec0; Cc = vecl ; dot dvector (Cp, Tgs, &R_Cp_Tgs, 0, lsf-l) ; dot dvector (Cp, Cp, &RCpCp, 0, 1_sf-1) ; dot dvector (Cc, Cc, &R_Cc_Cc, 0, tsf-l) ; dot dvector (Cp, Cc, &R_Cp_Cc, 0, I sf-l) ; dot dvector (Cc, Tgs, &R_Cc-Tgs, 0, ! sf-l) ;

/*----------------------------------------*/ /* Optimize all */ /*----------------------------------------*/ num = RCpTgs*RCcCc-RCpCc*RCcTgs ; den = RCpCp*R CcCc-RCpCc*RCpCc ; if (den > 0) den = MAX (0. 001, den); else den = MIN (-0. 001, den); (*gain0) = num/den; (*gain0) = MAX (0. 0, *gain0) ; (*gain0) = MIN (1. 2, *gain0) ; (*gainl) = (R_Cc_Tgs- (*gainO) *R Cp_Cc)/MAX (R_Cc_Cc, 0.00001); /*----------------------------------------*/ return; /*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : GEQenergy_extrapolation (). */ /*----------------------------------------*/ /* PURPOSE : This function extrapolate the energy of */ /* excitation when a frame erasure */ /*----------------------------------------*/ /* INPUT ARGUMENTS : */ /* (INT16) is : subframe starting sample. */ /* (INT16) isf : subframe */ /* _ (INT16) 1 sf : length of */ /* _ (FLOAT64 []) gainQ : adaptive and fixed codebook */ /* _ (FLOAT64 **) unfcod dec : adaptive and fixed codebook */

/* _ (INT16) bfi : current frame Bad Frame */ /* _ (INT16 []) lag : subframe lags. */ /* (FLOAT64 []) ForPitchdec : decoded picth */ /* (PARAMETER) channel: decoded indexes. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) extdec : final scaled */ /* _(FLOAT64 []) Prev_Beta_Pitch : excitation scaling */ /* _ (FLOAT64 ET-buf-subframe energy */ /*----------------------*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ = void GEQenergy_extrapolabon (INT16 i_s, INT16 i_sf, INT16 1_sf, FLOAT64 gainQ [], FLOAT64 **quaunfcod, INT16 bfi, INT16 lag [], FLOAT64 ext_dec [], FLOAT64 PrevBetaPitch [], FLOAT64 ETbuf [], FLOAT64 ForPitch_dec [], PARAMETER channel) /*/ INT16 i; FLOAT64 El, E2, ET, FET, PFET; FLOAT64 *px, AA, BB; FLOAT64 tmp_vec1[L_SF], tmp_vec2[L_SF], tmp_vec3[L_SF]; /*----------------------------------------*/ for (i = 0; i < 1_sf; i++) tmp_vec1[i] = gainQ [l] * qua unfcod [l] [i+i s] ; tmp_vec2[i] = gainQ[0] * qua_unfcod[0][i+i_s]; tmp_vec3 [i] = gainQ [0] * qua unfcod [0] [i+i_s] + gainQ [l] * qua_unfcod[1][i+i_s];

dotdvector (tmpvecl, tmpvecl, &E1, 0, tsf-l) ; dotdvector (tmpvec2, tmpvec2, &E2,0, 1_sf-1) ; dotdvector (tmpvec3, tmpvec3, &ET, 0, 1_sf-1) ; ET_buf[i_sf] = 10.0*log10 (ET + EPSI) ; Prev_Beta_Pitch[i_sf] = E2/ (E1 + E2 + EPSI) ; px = extdec+MAXLAG ; dot dvector (px, px, &FET, 0, tsf-l) ; FET += EPSI ; if (bfi == 1) { { if (gainQ [0] > 0. 6) if (channel.idx_SVS_deci == 0) BB = 0.90; else BB = 0.95; else BB = 0.8; /*----------------------------------------*/ if (channel.idx_SVS_deci == 0) { if ((lag[i_sf] > 0) && (gainQ [0] >= 0.6)) px = ext_dec+MAX_LAG-lag[i_sf] ; else px = extdec+MAXLAG-Isf ; else if (lag[i_sf] > 0) px = ext dec+MAXLAG- (INT16) ForPitchdec [is] ; else px = ext_dec+MAX_LAG-1_sf;

} /*-----------------------*/ dot dvector (px, px, &PFET, 0, tsf-l) ; AA = BB*sqrt (PFET/FET) ; px = extdec+MAXLAG ; scadvector (px, AA, px, 0, tsf-l) ; } /*/ return; /*----------------------------------------*/ } /*========================================================== ============*/ <BR> <BR> <BR> <BR> <BR> /* FUNCTION : GEQupdatemem4dto2d (). */<BR> <BR> <BR> <BR> <BR> <BR> /*.------------------------*/ /* PURPOSE : This function update the cross */ /* for the gain quantizers for the */ /* 4 to 2 */ // /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /*None.*/ /*========================================================== ============*/

void GEQupdatemem4dto2d (void) /___________________________________________________________ ________*/ pastenergyq2d [0] = 0.5* (past_energyq_4d[0]+ past_energyq_4d[1]) ; past_energyq_2d[1] = 0.5* (past_energyq_4d [2] + past_energyq_4d[3]) ; /*----------------------------------------*/ return; /*----------------------------------------*/ } /*========================================================== ============*/ /* FUNCTION : GEQ_update_mem_2d_to_4d (). */ /*----------------------------------------*/ /* PURPOSE : This function update the cross */ /* for the gain quantizers for the */ /* 2 to 4 */ // /* INPUT */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> ----------<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> void GEQ_update mem 2d to 4d (void)<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/

FLOAT64 val ; /*----------------------------------------*/ val = 0.5* (pastenergyq2d [0] + pastenergyq2d [l]) ; pastenergyq4d [0] = past_energyq_2d [0] ; past_energyq_4d [1] = val ; past energyq_4d [2] = val; past_energyq_4d[3] = past_energyq_2d[1]; /*----------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ============*/ /* FUNCTION : GEQupdatemem3dto2d (). */ /*/ /* PURPOSE : This function update the cross */ /* for the gain quantizers for the */ /* 3 to 2 */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/

voidGEQupdate mem3dto 2d (void) /___________________________________________________________ ________*/ pastenergyq2d [0] = 0.5* (pastenergyq3d [0] + pastenergyq3d [l]) ; pastenergyq2d [l] = 0.5* (past_energyq_3d[1]+ past_energyq_3d[2]) ; /*----------------------------------------*/ return; /___________________________________________________________ ________*/ } /___________________________________________________________ _________________*/ /*========================================================== ============*/ /* FUNCTION : GEQ_update_mem_2d_to_3d (). */ /*----------------------------------------*/ /* PURPOSE : This function update the cross */ /* for the gain quantizers for the */ /* 2 to 3 */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ <BR> <BR> <BR> <BR> *=========================================================== ===========*/<BR> { void GEQ_update_mem_2d_to_3d(void) //

past_energyq_3d[0] = past_energyq_2d[0]; pastenergyq3d [l] = 0.5* (pastenergyq2d [0] + past_energyq_2d [1]); past_energyq_3d[2] = past_energyq_2d[1]; /*----------------------------------------*/ return; /*----------------------------------------*/ } <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== ============*/ /* FUNCTION : GEQ_update_mem_3d_to_4d (). */ // /* PURPOSE: This function update the cross */ /* for the gain quantizers for the */ /* 3 to 4 */ // /* INPUT */ /* None. */ // /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ voidGEQupdatemem 3dto4d (void) { /*/ past_energyq_4d[0] = past_energyq_3d[0]; past_energyq_4d[1] = past_energyq_3d[1];

past_energyq_4dl2] = pastenergyq3d [l], past_energyq_4d[3] = past_energyq_3d[2]; /*----------------------------------------*/ return; /___________________________________________________________ ________*/ } /___________________________________________________________ _________________*/ /*========================================================== ============*/ /* FUNCTION GEQupdatemem4dto3d (). */ /*----------------------------------------*/ /* PURPOSE: This function update the cross */ /* for the gain quantizers for the */ /* 4 to 3 */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /* None. */ // /* OUTPUT */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> /*========================================================== ============*/ void GEQ_update_mem_4d_to_3d(void) { // past_energyq_3d[0] = past_energyq_4d[0]; pastenergyq3d [l] = 0.5* (past_energyq_4d[1]+ past_energyq_4d[2]) ; pastenergyq3d [2] = pastenergyq4d [3],

/*----------------------------------------*/ return; /*----------------------------------------*/ } /*----------------------------------------*/ /*========================================================== ============*/ /*-------------------- END --------------------*/ /*========================================================== ============*/

/*========================================================== ============*/ /*========================================================== ==*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------- ---------/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: lib_geq. */ /*========================================================== ==*/ /*----------------------------------------*/ /*-------------------- FUNCTIONS --------------------*/ // void GEQinit lib (void); void GEQgainVQMA2 (FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 [], *, INT16, INT16) ; void GEQdecgains27 (INT16, INT16, INT16, FLOAT64 [], INT16, FLOAT64 [], INT16, INT16); void GEQgainVQMA285 (FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 [], *, INT16) ; void GEQdecgains2 785 (INT16, INT16, FLOAT64 [], INT16, FLOAT64 [], INT16, INT16) ; void GEQQuant PitchGain3D (FLOAT64 *, INT16 *) ; void GEQQuantPitchGain4D (FLOAT64 *, INT16 *) ; void GEQDec PitchGain 3D (INT16, INT16, INT16, *) ;

void GEQ_Dec_PitchGain_4D (INT16. INT16, INT16, FLOAT64 *); void GEQgainVQMA3 (FLOAT64 [], FLOAT64 **, FLOAT64 FLOAT64 INT16 void GEQdecgc38 (INT16, FLOAT64 *, INT16, FLOAT64 **, INT16) ; void GEQ_gainVQMA_4 (FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 **, INT16 *) ; void GEQdec_gc 4_10 (INT16, FLOAT64 *, INT16, FLOAT64 **, INT16) ; void GEQ_gainNSQMA_1_5 (FLOAT64 [], FLOAT64 **, INT16 []) ; void GEQdec_gains_1_5 (INT16, FLOAT64 **, FLOAT64 [], INT16) ; void GEQgainNSQMA_1 6 (INT16, FLOAT64 [], FLOAT64 **, []) ; void GEQdecgainsl6 (INT16, INT16, FLOAT64 **, FLOAT64 [], INT16) ; void GEQ_gain_reopt_2 (FLOAT64 [], FLOAT64 [], FLOAT64 [], *, FLOAT64 *, INT16); void GEQ_energy_extrapolation (INT16, INT16, INT16, FLOAT64 [], FLOAT64 **, INT16, INT16 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], PARAMETER) ; void GEQupdatemem4dto2d (void); void GEQ_update_mem_2d_to_4d (void); void GEQupdate mem3dto2d (void); void GEQ_update_mem_2d_to_3d (void); void GEQupdatemem3d to4d (void) ; void GEQupdatemem4dto 3d (void); /*========================================================== ============*/ /*___________________________________ENp____________________ ______________*/ /*========================================================== ============*/

=<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : tib-ini. c /*========================================================== ==*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*----------------------------------------*/<BR> <BR> <BR> <BR> <BR> /*--------------------------------INCLUDE------------------- ------------*/<BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ &num include"typedef. h" #include"const. h" &num include"main. h" &num include"mcutil. h" #include"gputil. h" #include "ext_var.h" #include "lib_ini.h" #include "lib_lpc.h" #include "lib_qlsf.h" &num include"lib_geq. h" #include "lib_vad.h" &num include"lib_ppr. h" &num include"lib_cla. h" #include "lib_snr.h" &num include"libwwf. h"

#include "lib_pit.h" #include "lib_ltp.h" #include "lib_smo.h" #include "lib_prc.h" &num include"lib_bit. h" #include "lib_ppp.h" &num include"lib_fcs. h" /*----------------------------------------*/ /*-------------------- FUNCTIONS --------------------*/ /*----------------------------------------*/ /*========================================================== ============*/ /* FUNCTION : INI_allocate_memory (). */ /*----------------------------------------*/ /* PURPOSE: This function performs memory */ /___________________________________________________________ ________*/ /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* OUTPUT */ /* None. */ /___________________________________________________________ ________*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ ?*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ void INI_allocate_memory (void) { /*/ /* Memory Allocation for Time-Domain Pre */ <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> prefltnum = dvector (0, PPRFLTORDER-1) ; prefltden = dvector (0, PPRFLTORDER-1) ; pre_flt_buf_2 = dvector (0, PPRFLTORDER-1) ; pre_flt_buf_p = dvector (0, PPRFLTORDER-I) ;

lp_flt_num = dvector (0, LPFLTORDER-1) ; Ip_flt_buf = dvector (0, LPFLTORDER-1) ; /*----------------------------------------*/ /* Memory Allocation for Silence */ /*----------------------------------------*/ zeroed = svector (0, SEMEMSIZE-1) ; zero_rate = dvector (0, SEMEMSIZE-1) ; low-rate = dvector (0, SEMEM SIZE-1) ; high-rate = dvector (0, SEMEM SIZE-1) ; ! owneg = dvector (0,1); low pos = dvector (0,1); /*----------------------------------------*/ /* Memory Allocation for Tilt compansation Post */ /___________________________________________________________ ________*/ tcbuffexc = dvector (0, L_LPC-1) ; // Memory Allocation for Time-Domain Post */ /*----------------------------------------*/ buff_LTpost = dvector (0, MAXLAG+LSF-1) ; PF_mem_syn = dvector (0, NP-1); /*----------------------------------------*/ /* Memory Allocation for Time-Domain Post */ /*----------------------------------------*/ pst flt num = dvector (0, PPRFLTORDER-1) ; pst_flt_den = dvector (0, PPRFLTORDER-1) ; pstfltbufz = dvector (0, PPR_FLT_ORDER-1) ; pst_flt_buf_p = dvector (0, PPR FLTORDER-1) ; /*----------------------------------------*/

/* Memory Allocation for Linear Prediction */ /*----------------------------------------*/ siglpc = dvector (0, L_LPC-1) ; tilt_window = dvector (0, L_LPC-1); Ipcwindow = dvector (0, L_LPC-1) ; tpcwindowl = dvector (0, L_LPC-1) ; Ipc window2 = dvector (0, L_LPC-1) ; bwe_factor = dvector (0, NP); rxx = dvector (0, NP); refl = dmatrix (0, N SF MAX, 0, NP-1); 1sf_ new = dvector (0, NP-1); lsf old = dvector (0, NP-1); Isf mid = dvector (0, NP-1); IntLSFC = dvector (0, N_SF4-1) ; pdcf = dmatrix (0, N SF MAX, 0, NP-1); pdcfq = dmatrix (0, N SF MAX, 0, NP-1); pdcfq_dec = dmatrix (0, N SF MAX, 0, NP-1); // /* Memory Allocation for the LSF */ /*----------------------------------------*/ lsfcb08k = d3tensor (0, MAXLTT_08k-1, 0, LMSMAX_08k-1, 0, MAXLNp-1) ; lsf cb 40k = d3tensor (0, MAXLTT 40k-1, 0, LMSMAX 40k-1, 0, MAXLNp-1) ; 1st_cb_85k = d3tensor (0, MAXLTT 85k-1, 0, LMSMAX 85k-1, 0, MAXLNp-1) ; stage_cand_08k = svector (0, 2); stage_cand_40k = svector (0, 3); stage_cand_85k= svector (0, 3); MS_08k = svector (0, LTT_08k-1); MS_40k = svector (0, LTT_40k-1); MS_85k = svector (0, LTT_85k-1);

qes = dmatrix (0, LQMA 40k-1, 0, NP-1); qesdec = dmatrix (0, LQMA_40k-1, 0, NP-1); last_qlsf = dvector (0, NP-1); lsfq_old = dvector (0, NP-1) ; lsfqolddec = dvector (0, NP-1); Mean = dvector (0, NP-1); lsfq_mem_dec = dvector (0, NP-1); lsfqmemenc = dvector (0, NP-1); /*----------------------------------------*/ /* Memory Allocation for Perceptual Weighting */ // wspeech = dvector (0, LOLPIT-1) ; wspeeclamem = dvector (0, NP-1); wpdcfpote = dmatrix (0, NSFMAX, 0, NP-1); wpdcf zero = dmatrix (0, NSFMAX, 0, NP-1); tmpwsm = dvector (0, NP-1); ModiSig m = dvector (0, NP-1); /*----------------------------------------*/ /* Memory Allocation for Impulse Response of the synthesis */ /*----------------------------------------*/ // /* Memory Allocation for Signal */ /*----------------------------------------*/ frame class mem = svector (0, CLAMEMSIZE-1) ; onstplsv_mem = svector (0, CLAMEMSIZE-1) ; voiced mem = svector (0, CLAMEMSIZE-1) ; buffercla = dvector (0, LFRM+MEM CLASS+LLPCLHD-1) ; Lp buffer = dvector (0, N_Lp-l) ; windowl = dvector (0, LPC WINl-1) ; P w = dmatrix (0, 1, SLOPE_MAX_SIZE-1) ;

buffer refl0 = dvector (0, CLAMEMSIZE-1) ; buffer_wtilt = dvector (0, MAX_N_SF-1); buBerwmax = dvector (0, MAX_N_SF-1) ; buffer_wRp = dvector (0, MAXNSF-1) ; buffer_max_cla = dvector (0, MAXNSF-1) ; /*----------------------------------------*/ /* Memory Allocation for Voice Activity */ /*----------------------------------------*/ lag buf = svector (0, LTPBUFFSIZE-1) ; pgain buf = dvector (0, LTP_BUFF_SIZE_1) ; flag vad mem = svector (0, FLAGVADMEMSIZE-1) ; vad_lsf_mem = dmatrix (0, VADMEMSIZE-1, 0, NP-1); minenergymem = dvector (0, VADMINMEMSIZE-1) ; meantsf = dvector (0, NP-1); normmeantsf = dvector (0, NP-1); prev_cml lsf diff= dvector (0, VADMEM SIZE-1) ; prevenergy = dvector (0, VAD-MEM SIZE-1) ; /*----------------------------------------*/ /* Memory Allocation for Smoothing parameters estimation */ /___________________________________________________________ ________*/ lsf smooth = dvector (0, NP-1); N_sub = svector (0, NSFMAX-1) ; Isf !dsmo = dvector (0, NP-1); ma_lsf= dvector (0, NP-1); dSP buf= dvector (0, DSPBUFFSIZE-1) ;; buffet sumo = dvector (0, Hl_LAG2+L_SF-1) ; buffer_sum_smo = dvector (0, SMO_BUFF_SIZE-1); buffermaxsmo = dvector (0, SMOBUFFSIZE-1) ;

/*---------------.----------*/ /* Memory Allocation for Open Loop Pitch */ /*----------------------------------------*/ ol_lag = svector(0, N_SF_MAX); lag = svector(0, N_SF_MAX); Rp_sub = dvector (0, NSFMAX-1) ; SincWindows = dvector (0, LENSINCTAB-1) ; PITmaxO = svector (0, NUM MAX-SRCH-1) ; Rmax0 = dvector (0, NUM_MAX_SRCH-1) ; pitch fmem = dvector (0, PIT_F_MEM-1) ; PitLagTab5b = dvector (0, LENPITCHTAB5BIT-1) ; PitLagTab7b-dvector (0, LENPITCHTAB7BIT-1) ; PitLagTab8b = dvector (0, LENPITCHTAB8BIT-1) ; /*----------------------------------------*/ /* Memory Allocation for Open Pitch */ /*----------------------------------------*/ SincWindows PP = dvector (0, LENSINCTABPP-1) ; targ mem = dvector (0, MAX_LAG-1) ; /*----------------------------------------*/ /* Memory Allocation for Closed Loop Pitch */ /*----------------------------------------*/ SincWindows E = dvector (0, LENSINCTABE-1) ; NewTg = dvector (0, LFRM+NP-1) ; lag_f = dvector (0, N_SF_MAX-1); ext = dvector (0, MAXLAG+LSF-1) ; /*----------------------------------------*/

/* Memory Allocation for Short Term Algebraic */ /*----------------------------------------*/ MaxIdx= svector (0, MAXPN-1) ; p track 2 5 0 = smatrix (0, 2-1,0,32-1); p_track_2_7_1 = smatrix (0, 2-1,0,80-1); p_track_3_2_80 = s3tensor (0, 16-1,0,3-1,0,4-1); p_track_3_2_54 = s3tensor(0,16-1,0,3-1,0,4-1); p track 5 4 0 = smatrix (0, 5-1,0,16-1); p_track_5_3_1 = smatrix (0, 5-1,0,8-1); p_track_5_3_2 = smatrix (0, 5-1,0,8-1); p track 8 4 0 = smatrix (0, 8-1,0,16-1); PHI = dmatrix (0, L_SF-1, 0, L_SF-1); unfcod = dmatrix (0,1,0, LSF-1) ; fcod = dmatrix (0,1,0, LSF-1) ; quaunfcod = dmatrix (0,1,0, LFRM-1) ; qua_fcod = dmatrix (0,1,0, LFRM-1) ; unfcoddcc = dmatrix (0,0, L_SF-1) ; wspm = dvector (0, LWSP-1) ; hh_hf = dvector (0, LHF-1) ; /*----------------------------------------*/ /* Memory Allocation for Gain Vector */ /*----------------------------------------*/ qua_gainQ = dmatrix (0,1,0, NSFMAX-1) ; pastenergyq2d = dvector (0, GVQVEC SIZE 2D-1) ; pastenergyq3d = dvector (0, GVQ_VEC_SIZE_3D-1) ;

pastenergyq4d = dvector (0, GVQ_VEC_SIZE_4D-1) ; gp_buf = dvector (0, GPBUFSIZE-1) ; predenergyd38 = dvector (0, GVQ_VEC_SIZE_3D-1) ; pred_energy_d410 = dvector (0, GVQ_VEC_SIZE_4D-1 ; Prev BetaPitch = dvector (0, BETA_BUF_SIZE-1) ; energy_pred_coeff_1 = dvector (0, GVQ_VEC_SIZE_3D-1); energy_pred_coeff 2 = dvector (0, GVQVECSIZE3D-1) ; energypredcoeff3 = dvector (0, GVQVEC_SIZE_3D-1) ; energy_pred_coeff4d_1 = dvector (0, GVQ_VEC_SIZE_4D-1); energy_pred coeff4d 2 = dvector (0, GVQVECSIZE4D-1) ; energypredcoeff4d3 = dvector (0, GVQ_VEC_SIZE_4D-1) ; energy_pred_coeff4d_4 = dvector (0, GVQVECSIZE4D-1) ; gain_cb_2_128 = dmatrix (0,MSMAX_2_128-1, 0, GVQVECSIZE2D-1) ; gain_cb_2_128_8_5 = dmatrix (0, MSMAX2128-1, 0, GVQVECSIZE2D-1) ; /*----------------------------------------*/ /* Memory Deallocation for bit */ /*----------------------------------------*/ bitnoO = svector (0, 3-1); bitnol = svector (0, 3-1); /*----------------------------------------*/ /* Memory Deallocation for Frame Erasure */ /*----------------------------------------*/ enrg_buff = dvector(0, ERNG_MEM_SIZE-1); extdecmem = dvector (0, MAXLAG+LSF-1) ; /*----------------------------------------*/

/* Memory Allocation for Speech */ /*-------------------------*/ synth-mem = dvector (0, NP-1); synthmemdec = dvector (0, NP-1); dif mem = dvector (0, LSF+NP-1) ; target mem = dvector (0, NP-1); quasynth mem = dvector (0, NP-1); quadifmem = dvector (0, LSF+NP-1) ; qua targetmem = dvector (0, NP-1); qua_ext= dvector (0, MAX_LAG+L_SF-1); sigsyndec = dvector (0, L-SF+NP-1) ; extdec = dvector (0, MAXLAG+LSF-1) ; /*----------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ============*/ /* FUNCTION : INI_deallocate_memory (). */ /*----------------------------------------*/ /* PURPOSE : This function performs memory */ /*----------------------------------------*/ /* INPUT ARGUMENTS : */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/

/* RETURN ARGUMENTS : */ /* None. */ <BR> <BR> <BR> <BR> /*========================================================== ==*/ void INI_deallocate_memory ( void ) /___________________________________________________________ ________*/ /* Memory Deallocation for Time-Domain Pre */ /*----------------------------------------*/ free_dvector (pre_flt_num, 0, PPR_FLT_ORDER-1); free_dvector (pre_flt_den, 0, PPRFLTORDER-1) ; free_dvector (pre_flt_buf_z, 0, PPR_FLT_ORDER-1); free_dvector (pre_flt_buf_p, 0, PPR_FLT_ORDER-1); free_dvector (lp_flt_num, 0, LPFLTORDER-1) ; free_dvector (lp_flt_buf, 0, LP_FLT_ORDER-1); /*--------------------------------------------------*/ /* Memory Deallocation for Time-Domain Silence */ /*--------------------------------------------------*/ free-svector (zeroed, 0, SEMEMSIZE-1) ; free dvector (zero rate, 0, SEMEMSIZE-1) ; free dvector (low rate, 0, SEMEMSIZE-1) ; freedvector (highrate, 0, SEMEMSIZE-1); freedvector (lowneg, 0,1); free_dvector (low_pos, 0,1); /*--------------------------------------------------*/ /* Memory Deallocation for Tilt compansation Post Filtering */ <BR> <BR> <BR> /*---*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> freedvector (tcbuffexc, 0, L LPC-1) ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* Memory Deallocation for Time-Domain Post */ /*--------------------------------------------------*/

free_dvector (buff_LTpost, 0, MAXLAG+LSF-1) ; freedvector (PFmemsyn, 0, NP-1) ; /*----------------------------------------*/ /* Memory Deallocation for Time-Domain Post */ /*----------------------------------------*/ free_dvector (pst_flt_num, 0, PPRFLTORDER-1) ; free_dvector (pst_flt_den, 0, PPR_FLT_ORDER-1); free_dvector (pstfltbufz, 0, PPR_FLT ORDER-1) ; free_dvector (pst_flt_buf_p, 0, PPR_FLT_ORDER-1); // /* Memory Deallocation for Linear Prediction */ /*--------------------------------------------------*/ free dvector (siglpc, 0, L LPC-1) ; free_dvector (tilt_window, 0, L_LPC-1); free dvector (Ipc window, 0, L LPC-1) ; free dvector (lpc windowl, 0, L_LPC-1) ; free_dvector (Ipc_window2, 0, L_LPC-1) ; free_dvector (bwe_factor, 0, NP); freedvector (rxx, 0, NP) ; free_dmatrix (refl, 0, N_SF_MAX, 0, NP-1); free_dvector (Isf_new, 0, NP-1); freedvector (tsfotd, 0, NP-1); free_dvector (lsf_mid, 0, NP-1); free_dvector (InfLSF_C, 0, NSF4-1) ; free dmatrix (pdcf, 0, NSFMAX, 0, NP-1); free dmatrix (pdcfq, 0, NSFMAX, 0, NP-1); free_dmatrix (pdcfq_dec, 0, NSFMAX, 0, NP-1); // /* Memory Allocation for the LSF */ /*--------------------------------------------------*/

free_d3tensor (lsf_cb_08k, 0, MAXLTT_08k-1, 0,LMSMAX_08k-1, 0, MAXLNp-1) ; free_d3tensor (lsf_cb_40k, 0, MAXLTT_40k-1, 0,LMSMAX_40k-1, 0, MAXLNp-1) ; free_d3tensor (lsf_cb_85k, 0, MAXLTT_85k-1, 0,LMSMAX_85k-1, 0, MAXLNp-1) ; free_svector (stage_cand_08k,0,2); freesvector (stagecand40k, 0,3); free_svector (stage_cand_85k,0,3); free svector (MS 08k, 0, LTT_08k-1) ; free svector (MS 40k, 0, LTT_40k-1) ; free_svector (MS_85k, 0, LTT_85k-1); free dmatrix (qes, 0, LQMA_40k-1, 0, NP-1); free_dmatrix (qes_dec, 0, LQMA_40k-1, 0, NP-1); free dvector (last_qlsf, 0, NP-1); free_dvector (lsfq_old, 0, NP-1); free_dvector (lsfq_old_dec, 0, NP-1); free dvector (Mean, 0, NP-1); free dvector (lsfq_mem_dec, 0, NP-1) ; free_dvector (lsfq_mem_enc, 0, NP-1); // /* Memory Deallocation for Perceptual */ /*-------------------------*/ free dvector (wspeech, 0, LOLPIT-1) ; free dvector (wspeech mem, 0, NP-1); free dmatrix (wpdcf_pole, 0, NSFMAX, 0, NP-1); free-dmatrix (wpdcf zero, 0, NSFMAX, 0, NP-1); free_dvector (tmp_ws_m, 0, NP-1); free_dvector (ModiSig_m, 0, NP-1); /*----------------------------------------*/ /* Memory Deallocation for Impulse Response of the synthesis filter */ /*----------------------------------------*/

/*----------------------------------------*/ /* Memory Deallocation for Signal */ /*----------------------------------------*/ free_svector (frame_class_mem, 0, CLAMEMSIZE-1) ; freesvector (onstp ! svmem, 0, CLAMEMSIZE-1) ; free svector (voiced mem, 0, CLAMEMSIZE-1) ; free-dvcctor (buffer-cla, 0, LFRM+MEMCLASS+LLPCLHD-1) ; free_dvector (Lp_buffer, 0, N_Lp-1); free dvector (windowl, 0, LPC_WIN1-1) ; free_dmatrix (P_w, 0, 1, SLOPEMAXSIZE-1) ; freedvector (bufferref) 0, CLA_MEM SIZE-1) ; free_dvector (buffer_wtilt, 0, MAX_N_SF-1); free dvector (buffer wmax, 0, MAX_N_SF-1) ; free_dvector (buffer_wRp, 0, MAXNSF-1) ; free_dvector (buffer_max_cla, 0, MAX_N_SF-1) ; /___________________________________________________________ ________*/ /* Memory Deallocation for Voice Activity */ /___________________________________________________________ ________*/ free_svector (lag_buf, 0, LTP_BUFF_SIZE-1); free dvector (pgain buf, 0, LTPBUFFSIZE-1) ; free_svector (flag_vad_mem, 0, FLAGVADMEMSIZE-1) ; free_dmatrix (vad_lsf_mem, 0, VADMEMSIZE-1, 0, NP-1) ; freedvector (minenergymem, 0, VADMINMEMSIZE-1) ; free_dvector (mean_lsf, 0, NP-1); free_dvector (norm_mean_1sf, 0, NP-1); free dvector (prev_cml lsf diff, 0, VADMEMSIZE-1) ; freedvector (prevenergy, 0, VADMEMSIZE-1) ; /*--------------------------------------------------*/

/* Memory Deallocation for Smoothing parameters */ /*--------------------------------------------------*/ free-dvector (isf smooth, 0, NP-1); freesvector (Nsub, 0, NSFMAX-1) ; free_dvector (1sf_old_smo, 0, NP-1); free dvector (ma lsf, 0, NP-1); free dvector (dSP buf, 0, DSPBUFFSIZE-1) ;; free_dvector (buffer_smo, 0, HILAG2+LSF-1) ; free dvector (buffer sum smo, 0, SMO BUFF_SIZE-1) ; free_dvector (buffer_max_smo, 0, SMOBUFFSIZE-1) ; /*--------------------------------------------------*/ /* Memory Deallocation for Open Loop Pitch */ /*--------------------------------------------------*/ free_svector (ol_lag, 0, NSFMAX) ; free svector (lag, 0, NSFMAX) ; freedvector (Rpsub, 0, NSFMAX-1) ; free dvector (SincWindows, 0, LENSINCTAB-1) ; free svector (PITmaxO, 0, NUMMAXSRCH-1) ; free_dvector (Rmax0, 0, NUM_MAX_SRCH-1); freedvector (pitchfmem, 0, PITFMEM-1) ; free dvector (PitLagTab5b, 0, LENPITCHTAB5BIT-1) ; free_dvector (PitLagTab7b, 0, LENPITCHTAB7BIT-1) ; free_dvector (PitLagTab8b, 0, LENPITCHTAB8BIT-1) ; /*--------------------------------------------------*/ /* Memory Deallocation for Open Pitch Pre-processing */ /*--------------------------------------------------*/ free dvector (SincWindows PP, 0, LENSINCTABPP-1) ;

free_dvector (targ_mem, 0, MAXLAG-1) ; /*--------------------------------------------------*/ /* Memory Deallocation for Closed Loop Pitch Detection */ /*--------------------------------------------------*/ free_dvector (SincWindows E, 0, LENSINCTABE-1) ; free dvector (NewTg, 0, LFRM+NP-1) ; free-dvector (lag_f, 0, NSFMAX-1) ; free dvector (ext, 0, MAXLAG+LSF-1) ; /*--------------------------------------------------*/ /* Memory Allocation for Residual and target signal */ /*--------------------------------------------------*/ /*--------------------------------------------------*/ /* Memory Deallocation for Short Term Algebraic */ /*/ freesvector (Maxidx, 0, MAXPN-1) ; free dmatrix (PHI, 0, LSF-1, 0, LSF-1) ; freesmatrix (ptrack250, 0,2-1,0,32-1); free smatrix (p_track 2 7_l, 0,2-1,0,80-1); frees3tensor (ptrack3280, 0,16-1,0,3-1,0,4-1); frees3tensor (ptrack3254, 0,16-1,0,3-1,0,4-1); free_smatrix(p_track_5_4_0,0,5-1,0, free_smatrix(p_track_5_3_1,0,5-1,0,8-1); free_smatrix(p_track_5_3_2,0,5-1,0,8-1); free_smatrix(p_track_8_4_0,0,8-1,0,16-1); freedmathx (unfcod, 0,1,0, L_SF-1) ; free dmatrix (fcod, 0,1,0, LSF-1) ;

free dmatrix (qua unfcod, 0,1,0, L_FRM-1) ; freedmatrix (quafcod, 0,0, LFRM-I) ; free_dmatrix (unfcoddec, 0,1,0, LSF-1) ; free_dvector (wsp_m, 0, L_WSP-1); free_dvector (hh_hf, 0, L-HF-1); /*--------------------------------------------------*/ /* Memory Deallocation for Gain Vector */ /*--------------------------------------------------*/ freedmatrix (quagainQ, 0,1,0, N_SF_MAX-1) ; free_dvector (past_energyq_2d, 0, GVQVECSIZE2D-1) ; free_dvector (past_energyq_3d, 0, GVQ_VEC_SIZE_3D-1); freedvector (pastenergyq4d, 0, GVQVEC SIZE 4D-1) ; freedvector (gpbuf, 0, GPBUFSIZE-1) ; free_dvector (pred_energy_d38, 0, GVQ_VEC_SIZE_3D-1); free_dvector (pred_energy_d410, 0, GVQ_VEC_SIZE-4D-1); freedvector (Prev BetaPitch, 0, BETABUFSIZE-1) ; free-dvector (energy_pred_coeff_1, 0, GVQVEC_SIZE_3D-1) ; free_dvector (energy_pred_coeff_2, 0, GVQVECSIZE3D-1) ; free_dvector (energy_pred_coeff_3, 0, GVQ_VEC_SIZE_3D-1); free_dvector (energy-pred_coeff4d_1, 0, GVQVECSIZE4D-1) ; free_dvector (energy_pred_coeff4d_2, 0, GVQ_VEC_SIZE_4D-1); free_dvector (energy_pred_coeff4d_3, 0, GVQVECSIZE4D-1) ; free_dvector (energy_pred_coeff4d_4, 0, GVQ_VEC_SIZE_4D-1); freedmatrix (gaincb2128, 0, MSMAX2128-1, 0, GVQ_VEC_SIZE_2D-1) ; free_dmatrix (gain_cb_2_128_8_5,0,MSMAX_2_128-1, 0, GVQVEC SIZE-2D-1) ;

/*--------------------------------------------------*/ /* Memory Deallocation for bit */ /*--------------------------------------------------*/ freesvector (bitno0, 0,3-1); free svector (bitnol, 0,3-1); /*--------------------------------------------------*/ /* Memory Deallocation for Frame Erasure Concealenement */ // free_dvector (enrg_buff, 0, ERNG_MEM_SIZE-1); freedvector (extdecmem, 0, MAXLAG+LSF-1) ; /*--------------------------------------------------*/ /* Memory Deallocation for Speech */ /*--------------------------------------------------*/ free_dvector (synth_mem, 0, NP-1) ; freedvector (synthmemdec, 0, NP-1); free dvector (dif mem, 0, LSF+NP-1) ; free dvector (target mem, 0, NP-1); freedvector (quasynthmem, 0, NP-1); free-dvector (qua-dif mem, 0, LSF+NP-1) ; free-dvector (qua_target_mem, 0, NP-1); free_dvector (que_ext, 0, MAX_LAG+L_SF-1); free_dvector (sigsyn_dec, 0, L_SF+NP-1) ; free_dvector (ext_dec, 0, MAX_LAG+L_SF-1); /*--------------------------------------------------*/ return; /*/

/*--------------------------------------------------*/ /*========================================================== ============*/ /* FUNCTION: INI_parameters_setup 0. */ /*--------------------------------------------------*/ /* PURPOSE: Performs the encoder parameter */ /*--------------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT32 ) argc: number of input */ /* (char * []) argv: pointer to the input */ /*--------------------------------------------------*/ /* OUTPUT */ /* (FILE **) fpspeechin: input speech */ _ (FILE **) fp bitstream: input speech file. */ /* _ (FILE **) fp_mode: input speech */ /* (FILE fp_signaling: input speech */ /* _ (INT16 **) smv_mode: SMV mode. */ /*--------------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void INI_parameters_setup (INT32 argc, char *argv [], FILE **fp_speech_in, FILE **fp_bitstream, FILE **fp_mode, FILE **fp_signaling, INT16 *smv mode) { /___________________________________________________________ ________*/ INT16 i, non switchcnt ; /*Initialisation*/ Initialisation /*--------------------------------------------------*/ *fpspeechin = NULL; *fpbitstream = NULL ; *fp_mode = NULL;

*fp_signaling = NULL; /*--------------------------------------------------*/ if(argc < 5) { printf ("Usage: %s -m M [-f mode_file] [-s signaling_file] ", argv[0]); printf (" input_speech_file output_bitstream_file\n"); exit (l) ; else <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> i=1; (*smv mode) = 0; non_switch_cnt = 0; while (i < argc) if (argv [i] [0] ! ='-') { if (nonswitchcnt > 2) nrerror ("Usage : smv_enc -m M [-f mode_file] [-s signaling_file] input_speech_file output_bitstream_file\n"); if (nonswitchcnt == 0) *fp_speech_in = file_open_rb (argv [i]); printf ("Input speech file : % s\n", argv [i]) ; nonswitchcnt++ ; else *fp_bitstream = iileopenwb (argv [i]) ; printf ("Output bitstream file: %s\n", argv [i]) ; nonswitchcnt++ ; } i++; else

{ switch (argv [i] [1]) { case'm' : i++; (*smv_mode) = atoi (argv [i]) ; if (((*smv_mode) < 0) || ((*smv_mode) > 2)) { printf ("SMV mode = % hd (0,1, and 2 allowed) \n", (*smv_mode)) ; exit(0); } i++; break; case'f: i++; *fp_mode = fopen (argv [i],"r"); printf ("Mode control file: %s\n", argv [i]) ; i++; break; case's' : i++; *fp_signaling = fileopen rb (argv [i]); printf ("Signaling file: % s\n", argv [i]); i++; break; default: printf ("Usage: %s -m M [-f mode_file] [-s signaling_file] ", argv [0]) ; printf ("input speech file outputbitstreamfile\n") ; exit (l) ; break; } } }

/*--------------------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ======================*/ /* FUNCTION : INI_init_decoder (). */ /*--------------------------------------------------*/ /* PURPOSE: Performs the encoder */ /*--------------------------------------------------*/ /* ALGORITHIvI */ /*--------------------------------------------------*/ /* INPUT : */ /* None. */ /*--------------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /___________________________________________________________ ________*/ /* INPUT/OUTPUT */ /* None. */ /*--------------------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== ======================*/ void INI_init_encoder (void) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ fiv rate = RATEZ 5K ; /*--------------------------------------------------*/ BIT_init_lib (); PPR_silence_enhan_init ();

PPR_filters_init (); <BR> <BR> <BR> VAD_init lib () ;<BR> <BR> <BR> <BR> <BR> CLAJnitJib(); PPP_init_lib (); PIT_init_lib (); GEQinit lib 0 ; LPC init lib (); PWF_init_lib (); SMO_init_lib (); LSFQinitJib 0.

SNR_init_lib(); FCS_init_lib (); LTP-init lib () ; PRC_init_lib (); /*--------------------------------------------------*/ return; /___________________________________________________________ ________*/ } /___________________________________________________________ _________________*/ /*========================================================== ======================*/ /* FUNCTION : INI_init_decoder (). */ /*--------------------------------------------------*/ /* PURPOSE: Performs the decoder */ /*--------------------------------------------------*/ /* ALGORITHM */ /*--------------------------------------------------*/ /* INPUT : */ /* None. */ /*--------------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------------*/

/* RETURN */ /* None. */ /*========================================================== ============*/ void INI_init_decoder(void) /*----------------------*/ fix rate mem = RATE85K ; past bfi = 0; ppast bfi = 0 ; bfi caution = 0; nbficount = MAX_BFI_COUNT ; N bfi = 0; bfh_oh = 0; /8*--------------------------------------------------*/ BIT_init_lib (); GEQ_init_lib (); PPR_filters_init (); LPC_init_lib (); LSF_Q_init_lib (); CLA init lib Q ; FCS_init_lib (); LTP_init lib 0 ; /*--------------------------------------------------*/ return; /*--------------------------------------------------*/ } /*========================================================== ======================*/ /*-------------------------- END -------------------------*/ /*========================================================== ======================*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ // /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ l = /* PROTOTYPE FILE: lib_ini. h */ /*========================================================== ======================*/ /*------------------------------------------------------*/ /*------------------------- FUNCTIONS -------------------------*/ /*--------------------------------------------------*/ void M-allocate-memory (void); void INI deallocate memory (void); void INIparameterssetup (INT32, char * [], FILE **, FILE **, **, FILE **, INT16 *) ; void INI_init encoder (void); void INIinitdecoder (void); <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* END----*/ /*------------------------- END -------------------------*/

*=========================================================== =====================*/<BR> / /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ============*/ /* LIBRARY: lib io. c */ /*========================================================== ============*/ /*----------------------------------------*/ &num inctude"typedef. h" /*----------------------------------------*/ #include "typedef.h" #include "main.h" #include"const. h" #include"mcutil. h" &num include"lib_io. h" &num include"lib swb. h" /*----------------------------------------*/ /*_____________-------------------FUNCTIONS----------------- ----------------*/<BR> /___________________________________________________________ _________________*/<BR> <BR> <BR> /* FUNCTION : IO readsamples (). */ /*----------------------------------------*/ /* PURPOSE : This function reads one block from the */ /* file. */

/*..--*/ /* INPUT */ /* _(FILE *) file_x : input */ /* _(INT32) N: number of samples to */ /* extracted. */ /*----------------------------------------*/ /* OUTPUT */ /* (FLOAT64 []) x: extracted */ /* (INT16 []) sx: extrac. frame short format. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*__________________________________________________________ _________*/ /* RETURN ARGUMENTS */ /* None. */ <BR> /*========================================================== ======================*/ INT32 IO_readsamples (FILE *file_x, INT16 s_x[], FLOAT64 x [], INT32 N) { // INT32 rdsamp, i, r_val; /*----------------------------------------*/ rdsamp = fread (s_x, sizeof (INT16), N, file_x) ; /*----------------------------------------*/ if (rdsamp>0) { for (i = 0 ; i < N; i++) { #ifdef BYTESWAPINPUT s_x[i] = byte_swap_intl6 (s_x [i]); #endif x [i] = (FLOAT64) s_x [i];

r_val= rd_samp ; } else r val = 0; /<).......................-..-....-...-..----.-....*/ return r val ; /*------------------------------*/ } /___________________________________________________________ _________________*/ /*========================================================== ============*/ /* FUNCTION : IO_writesamkples (). */ /*----------------------------------------*/ /*PURPOSE : This function write one block into the */ /* file. */ /*----------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (FILE *) file_y : output */ /* _(INT32) N: number of samples to */ /* (FLOAT64 []) y: output frame. */ /*/ /* OUTPUT ARGUMENTS */ /* _(INT16 []) s_y : output frame short */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ============*/ INT32 IO writesamples (FILE *file_y, FLOAT64 y [], INT16 s_y [], INT32 N) { /*/

INT32 i, wtsamp ; FLOAT64 tmp; /*----------------------------------------*/ for (i = 0; i < N; i++) for (i = 0 ; i < N; i++) tmp = y [i]; if (tmp >= 0. 0) tmp += 0.5; else tmp-= 0.5; if (tmp > 32767.0) tmp = 32767.0; if (tmp <-32768.) tmp =-32768. ; if ( (INT16) tmp < 0.0) s_yli] = (INT16) tmp + 2; else s_y [i] = (INT16) tmp; #ifdef BYTESWAPOUTPUT s_y [i] = byte_swap_intl6 (s_y [i]); #endif } wt_samp = fwrite (sy, sizeof (INT16), N, file_y) ; /*----------------------------------------*/ #ifdef VERBOSE if (wt_samp ! = N) nrerror ("Error Writing output Samples!");

#endif /*----------------------------------------*/ return wt_samp ; #endif /*========================================================== ============*/ /*-------------------- END --------------------*/ <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------------__------------------ ---------------/ /*========================================================== ==*/ /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ // /* Copyright (C) 2000 Conexant System */ /*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ==*/ /* PROTOTYPE FILE: lib_io. */ /*========================================================== ==*/ /*----------------------------------------*/ /*--------FUNCTIONS---------------------------------*/ /*----------------------------------------*/ INT32 IO readsamples (FILE *, INT16 [], FLOAT64 [], INT32); INT32 IO writesamples (FILE *, FLOAT64 [], INT16 [], INT32);

/*========================================================== ============*/ /*-------------------- END --------------------*/ /*========================================================== ============*/

/*========================================================== ============*/ /*========================================================== ==*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------*/ /* Copyright (C) 2000 Conexant System Inc. */ /*----------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ l == l /* LIBRARY : lib_lpc. */ /*========================================================== ==*/ // /*-------------------- INCLUDE --------------------*/ /*----------------------------------------*/ #include "typedef.h" #include"main. h" #include"const. h" #include"mcutil. h" #include"gputil. h" #include "ext_var.h" &num include"lib flt. h" #include "lib_lpc.h" /*-------------------------------------------*/ /*-------------------- DEFINE --------------------*/ /*/ #define NBBIS 5 #define MAX LPC ORDER 50 #define RESL 0.005 #define NBIS 6

&num define PI2 6. 283185307179586 /*-------------------------------------------*/ /*-------------------- FUNCTINOS --------------------*/ /*-------------------------------------------*/ /*==================================================== /* FUNCTION : LPC_init_lib (). */ /*----------------------------------------*/ /* PURPOSE: This function performs the initialisation of */ /* global variables of the LPC */ // /* INPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== ==*/ void LPC init lib (void) <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT16 i, 1 ; FLOAT64 x, y; // /* Generate the LPC Hamming */ /*----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> I = LPC/2 ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> for (i = 0; i < 1 ; i++) {

x = cos (i*PI/(FLOAT64) 1) ; lpc_window[i] = 0.54-0.46 * x; for (i = 1 ; i < L LPC ; i++) x = cos((i-1)*PI/(FLOAT64)(L_LPC-1)); lpc_window [i] = 0.54+0.46 * x; <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* Generate the LPC Hamming window for the last */ /*----------------------------------------*/ I = LLPC- (LLPCLHD+LSF4/2-10) ; for (i = 0 ; i < 1 ; i++) x = cos (i*PI/(FLOAT64)1) ; lpc_window1 [i] = 0.54-0.46 * x; for (i = I ; i < L LPC ; i++) x = cos ((i-1)*PI/(FLOAT64)(L_LPC-1)) ; lpc_window1[i] = 0.54+0.46 * x; // /* Generate the window for look */ /*----------------------------------------*/ I = L_LPC-L_LPCLHD/2 ; for (i = 0; i < 1 ; i++) { x = cos (i*PI/(FLOAT64) 1) ; Ipc window2 [i] = 0.54-0.46 * x; }

for (i = 1 ; i < L LPC ; i++) { x = cos ((i-1) *0. 48*PI/(FLOAT64)(L_LPC-1)); Ipc_window2 [i] = x; } // /* Generate the 60 Hz bandwidth expansion */ /* with white noise correction factor */ // bwefactor [0] = 1.0001; x = 2.0*PI*60.0/FS; for (i = 1 ; i < NP+1 ; i++) y =-0.5*sqr (x* (FLOAT64) i); bwefactor [i] = exp (y); } /___________________________________________________________ ________*/ erg = 0.0; Ipcgain = 0. 0 ; /*----------------------------------------*/ subjpcg = 0.0; /___________________________________________________________ ________*/ /* LPC Adaptive Interpolation Coeffcients */ /*----------------------------------------*/ IntLSFC [0] = 0.5; IntLSF_C[1] = 0.6; IntLSF_C[2] = 0.7; IntLSF C [3] = 0. 8; /*----------------------------------------*/ return;

/*----------------------------------------*/ } /*----------------------------------------*/ /*========================================================== ==*/ /* FUNCTION : LPC_analysis (). */ /*----------------------------------------*/ /* PURPOSE: This function performs */ /*----------------------------------------*/ /* INPUT */ /* _ (INT16) I_lpc : LPC frame */ /* _ (FLOAT64 []) sig : input frame. */ /* _(FLOAT64 []) lpc_window : analysis window. */ /* _ (FLOAT64 []) bwe_factor: bandwidth */ /* _(INT16 ) Order: prediction order. */ /* _ (INT16) flag_flat: flat speech */ /*---------*/ /* OUTPUT ARGUMENTS */ /* _(FLOAT64 []) rxx: autocrrelation function. */ /* _(FLOAT64 []) refl: output reflection coeff. */ (FLOAT64 pderr: output LPC prediction */ /* _ (FLOAT64 []) lpc_alpha: output LP filter coeff. */ /* _ (FLOAT64 []) Isf: line spectrum */ (FLOAT64 Ipc_gain : output LPC */ /*---------------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ----------- void LPC analysis (INT16 1_lpc, FLOAT64 sig [], FLOAT64 tpcwindow [], FLOAT64 rxx [], FLOAT64 bwefactor [], FLOAT64 refl [], FLOAT64 *pderr, FLOAT64 ipc_alpha [], FLOAT64 lsf [], INT16 LPC ORDER, FLOAT64 *Ipcgain, INT16 flag_flat)

/*----------------------------------------*/ FLOAT64 w, energy, val ; INT16 i ; /*----------------------------------------*/ energy = 0.0; for (i = 0; i < 1 lpc ; i++) energy += (INT16) sig [i] * (INT16) sig [i]; if (energy == 0.0) { ini dvector (Ipc_alpha, 0, LPC ORDER-1, 0.0); inidvector (rxx, 0, LPC ORDER, 0.0); ini_dvector (refl, 0, LPC ORDER-1, 0.0); (*pderr) = 0.0; (*lpcgain) = -DBL_MAX; } else <BR> <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> <BR> { /* Windowing for Linear Prediction */ // mul dvector (sig, tpcwindow, sigtpc, 0, 1_lpc-1) ; /*----------------------------------------*/ /* Autocorrelation */ /*----------------------------------------*/ LPC autocorrelation (siglpc, 1 (pc, rxx, (INT16) (LPC ORDER+1)) ; /*----------------------------------------*/ /* Bandwidth */ /*----------------------------------------*/

mul dvector (rxx, bwe factor, rxx, 0, LPC ORDER) ; /*----------------------------------------*/ /* Leroux-Gueguen */ // LPC leroux_gueguen (rxx, refl, pderr, LPC ORDER) ; /*----------------------------------------*/ /* PARCOR to prediction coefficient */ /*----------------------------------------*/ LPC_refl2pred(refl, lpc_alpha, LPC_ORDER); /*----------------------------------------*/ /* Bandwith expassion */ /*-----------------------*/ (*lpcgain) = -10.*log10((*pderr)/(rxx[0] + EPSI)); /*---*/ if (flag_nat == 1) { if ((*lpcgain) < 10.0) w =0.995; else if ( (*Ipcgain) < 20.0) w =0.995; else w = 0. 995; } else { if((*lpcgain) < 10.0) w = 0.995; else if ( (*Ipcgain) < 20. 0) w = 0. 99; else

w=0. 98; // val = 1.0; for (i = 0 ; i < LPC ORDER ; i++) val *= w ; lpc alpha [i] *= val ; /*----------------------------------------*/ /*-----------------------*/ /* LPC to LSP */ /*----------------------------------------------*/ LPC_lpctolsf (lpc_alpha, 1sf, LPC_ORDER); /*----------------------------------------------*/ return; /*--------------------------------------------------*/ } /*========================================================== ======================*/ /* FUNCTION : LPC_refl2pred (). */ /*----------------------------------------*/ /* PURPOSE : This function calculate the prediction */ /* using the PARCOR */ /*----------------------------------------*/ /* INPUT ARGUMENTS */ /*- (FLOAT64 []) refl : output reflection coetF */ /*- (INT16) LPC ORDER : LPC */

/*----------------------------------------*/ /*OUTPUT */ /* _ (FLOAT64 []) a: output LP filter coeff. */ /*----------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------*/ /* RETURN */ /* None. */ void LPC_refl2pred (FLOAT64 relf [], FLOAT64 a [], INT16 LPC_ORDER) <BR> <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> <BR> // INT32 m, n, j; FLOAT64 x; /*----------------------------------------*/ for (m = 0; m < LPC ORDER; m ++) // a [m] = -refl[m]; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> for (j=O ; j<m/2 ; j++) n =m-l-j ; x = a[j] + refl [m] * a [n] ; a [n] = a [n] + refl [m] * alj] ; a[j] = x; } /*----------------------------------------*/ /* Update the prediction coefficients every 2 cycles */ /*----------------------------------------*/

if (m& 1) a [m/2] = a [m/2] + refl [m] * a [m/2] ; /*----------------------------------------*/ } /*/ return; /*-------------------------------------------*/ } /*========================================================== ======================*/ /* FUNCTION : LPC_leroux_gueguen (). */ // /* PURPOSE : This function performs Leroux Gueguen */ /* */ /* This subroutine implements a modified form of Durbin's */ /* algorithm for solving a set of auto-correlation equations. */ /* routine uses an intennediate variable which is constrained */ /* be less than the energy of the signal, i. e. r [0]. */ /* variable takes the role of the predictor coefficients */ /* normally are used in Durbin's form of the algorithm. */ /* routine returns only the reflection */ /* Reference: J. Leroux and C. J. Gueguen,"A Fixed */ /* Computation of the Partial */ Coefficients", IEEE Trans. ASSP, June */ /* pp. */ /* */ /* In the case that either numerical instability or */ /* inappropriate auto-correlation vector results in a set of */ /* coefficients corresponding to an unstable filter at some */ /* in the recursion, this routine returns the coefficients as */ /* determined at the previous iteration. This is equivalent */ /* truncating the auto-correlation coefficient at a point */ /* that it is positive */

/*----------------------------------------*/ /* INPUT ARGUMENTS*/ /* _ (FLOAT64 []) r : input autocorrelation. */ /* _ (INT 16) LPC ORDER : LPC */ /*----------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 []) refl : output reflection coeff. */ /* (FLOAT64 re output residual */ /*----------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ None.

/*----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ----------- void LPC leroux_gueguen (FLOAT64 r [], FLOAT64 refl [], FLOAT64 *re, INT16 LPC ORDER) // INT32 k, i; FLOAT64 rf, sum; FLOAT64 *ep, *en; // ep = dvector (0, LPC ORDER-1) ; en = dvector (0, LPC ORDER-1) ; /*----------------------------------------*/ /* Initialisation */ /*----------------------------------------*/ (*re) = r [0], for (i = 0; i < LPC ORDER ; i++) ep [i] = r [i+l] ;

en[i] = r[i]; } /*/ /* Algorithm */ /*----------------------------------------*/ for (k = 0; k < LPC_ORDER; k++) /*/ /* Check for zero prediction */ /*----------------------------------------*/ if ( (en [0] == 0.0) && (ep [k] == 0.0)) rf = 0. 0; else rf= -ep[k] / en[0]; /*/ /* Calculate the error (equivalent to re = re * (1-rf**2)) */ /* A change in sign of PRERR means that rf has a */ /* greater than unity (corresponding to an */ /* synthesis */ /*----------------------------------------*/ en [0] += rf * ep[k]; if (en [0] < 0. 0) break; (*re) = en [0] ; /*----------------------------------------*/ refl [k] = rf; if(k == (LPC_ORDER-1)) return; for (i = k+1 ; i < (LPC ORDER-1) ; i++)

sum = ep [i] + rf * en [i-k] ; en [i-k] += rf * ep[i]; ep [i] = sum ; ep [LPCORDER-1] += rf* en [LPCORDER-k-l] ; <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* Fixup for negative prediction */ /___________________________________________________________ ________*/ printf ("\nLPC_leroux_gueguen - negative error energy\n") ; for (i = k; i < LPCORDER ; i++) ren [i] = 0.0; /*------------------------------------*/ free dvector (ep, 0, LPC ORDER-1) ; free dvector (en, 0, LPC ORDER-1) ; // return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : LPC_pred2refl (). */ /*------------------------------------*/ /* PURPOSE : This function calculate the PARCOR */ /* using the prediction coeff. */ /*------------------------------------*/ /* INPUT */ /* _(FLOAT4 []) a : output LP filter */

/* _ (INT16) LPC ORDER : LPC */ // /* OUTPUT */ /* _ (FLOAT64 []) refl : output reflection coeff. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LPC_pred2refl (FLOAT64 a [], FLOAT64 refl [], INT16 LPC ORDER) /*/ FLOAT64 f[MAX_LPC_ORDER]; INT16 m, j, n; FLOAT64 km, denom, x; /*------------------------------------*/ if (LPC_ORDER > MAX LPC ORDER) nrerror ("LPC order is too large!! !") ; /*------------------------------------*/ /* Initialisation */ /*------------------------------------*/ cpydvector (a, f, 0, LPC ORDER-1) ; /*------------------------------------*/ for (m = LPC ORDER-1 ; m >= 0; m--) { km = f[m]; if (km <=-1. 0 || km >= 1.0) { printf ("Nonstable reflection coeffs!!! \n");

return; } refl [m] =-km ; denom = 1. 0/ (1. 0-km * km); for (j = 0 ; j < m/2 ; j++) n =m-l-j ; x denom flj] + km * denom * fln] ; f[n] = denom * f[n] + km * denom * f[j]; fj] = x ; if(m & 1) f[j] = denom * fb] + km * denom * ftj] ; /*------------------------------------*/ /*-----------------------*/ return; /*-----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTION : LPC_lpctolsf (). */ /*------------------------------------*/ /* PURPOSE : This function onvert predictor coefficients */ /* to LSF's. */ /* */ /* The transfer function of the predictor filter is transformed */ /* into two reciprocal polynomials having roots on the */ /* circle. These roots of these polynomials interlace. It */ /* these roots that detennine the line spectral frequencies. The*/ /* two reciprocal polynomials are expressed as series expansions*/ /* in Chebyshev polynomials with roots in the range-1 to +l. The*/

/* inverse cosine of the roots of the Chebyshev */ /* expansion gives the line spectral frequencies. If NPTS line */ /* spectral frequencies are not found, this routine signals */ /* error condition. */ /* */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) PRCOF: Predictor coefficients. */ /* _ (INT16) LPC ORDER : LPC */ /* (INT16) NPTS: Number of coefficients (at most 50) */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) FRLSF: line spectral frequencies */ /* ascending */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN */ None.

/*======================================================= ============*/ void LPC lpctolsf (TFLOAT64 PRCOF [], FLOAT64 FRLSF [], INT16 NPTS) { { INT16 NC [2], j, i, NF, IP ; FLOAT64 F [ (MAXLPCORDER+1)/2+1], F2 [(MAX_LPC_ORDER+1)/2+1], T [2] [ (MAXLPC-ORDER+I)/2+1] ; FLOAT64 XLOW, XMID, XHIGH, XINT, YLOW, YMID, YHIGH ; /*------------------------------------*/ #ifdef VERBOSE if (NPTS > MAXLPCORDER) nrerror ("PTOLSF-Too many coefficients!!!! !") ; #endif

/*------------------------------------*/ /* Determine the number of coefficients in each of the */ /* with coefficients T(.,1) and T(.,2). */ /*------------------------------------*/ if ( (NPTS % 2)! = 0 { NC [1] = (NPTS+1)/2 ; NC[0] = NC [1] + 1; } else { NC [1] = NPTS/2 + 1; NC[0] = NC[1]; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> /* Let D=z** (-I), the unit delay, then the predictor filter */ /* N coefficients */ /* */ /* N n */ /* P (D) = SUM p (n) D. */ /* n= 1 * /* */ /* The error filter polynomial is A (D) =1-P (D) with N+1 */ /* Two auxiliary polynomials * are formed from the error */ /* */ /* F1 (D) = A (D) + D** (N+1) A (D** (-1)) (N+2 terms, */ /* F2 (D) = A (D)-D** (N+1) A (D** (-1)) (N+2 terms, anti-symmetric) */ /* */ /* Establish the symmetric polynomial F1 (D) and the anti-symmetric */ /* polynomial F2 */ /* Only about half of the coefficients are evaluated since the */ /* polynomials are symmetric and will later be reduced in order */ /* division by polynomials with roots at +1 */ /___________________________________________________________ ________*/ F1 [0] = 1.0; j = NPTS-1; for (i = 1; i < NC [0] ; i++)

{ Fl [i] =-PRCOF [i-1] - PRCOF[j] ; j=j-1 ; } F2 [0] = 1.0; j = NPTS-1; for (i = 1 ; i < NC [1] ; i++) { F2 [i] = -PRCOF[i-1] + PRCOF [j] ; j = j - 1; } } /* N even, F1(D) includes a factor 1+D, */ /* F2(D) includes a factor 1-D */ /* N odd, F2(D) includes a factor 1-D**2 */ /* Divide out these factors, leaving even order */ /* polynomials, M is the total number of terms and Nc is the */ /* of unique terms, /* N polynomial M Nc= (M+1)/2 */ /* even, G1 (D) = FI (D)/ (1+D) N+1 */ /* G2(D) = F2(D)/(1-D) N+1 */ /* odd, G1(D) = F1(D) N+@ (N+1)/2+1 */ /* G2(D) = F2(D)/(1-D**2) N (N+1)/2 */ /*-----------------------------------------*/ if ( (NPTS % 2) ! = 0) for (i = 2 ; i < NC[1] ; i++) F2 [i] = F2 [i] + F2 [i-2] ; else for (i = 1; i < NC [0] ; i++) { F1[i] = F1[i] - F1[i-1]; F2[i] = F2[i] + F2[i-1]; } /*/ /* To look for roots on the unit circle, G1 (D) and G2 (D) */ /* evaluated for D=exp (ja). Since G1 (D) and G2 (D) are */

/* they can be expressed in terms of a series in cos (na) for D */ /* the unit circle. Since M is odd and D=exp (ja) */ <BR> <BR> <BR> <BR> l* *l<BR> <BR> <BR> <BR> <BR> /* M-1 */ /* G1 (D) = SUM fl (n) D (symmetric, fl (n) = fl (M-1-n)) */ /* n=0 */ /* Mh-1 */ /* = exp (j Mh a) [fl (Mh) + 2 SUM fl (n) cos ((Mh-n) a)] */ /* n=0 */ /* Mh */ /* = exp (j Mh a) SUM tl (n) cos */ /* n=0 */ /* */ /* where Mh= (M-1)/2=Nc-1. The Nc=Mh+l coefficients tl (n) are */ /* defined */ /* tl (n) = fl (Nc-1), n=0, */ /* = 2 fl(Nc-1-n), n=1,...,Nc-1. */ /* The next step is to identify cos (na) with the Chebyshev polynomial*/ /* T (n, x). The Chebyshev polynomials satisfy T (n, cos (x)) = cos (nx). */ /* Then omitting the exponential delay term which does not affect the*/ /* positions of the roots on the unit circle, the series expansion in*/ /* terms of Chebyshev polynomials */ /* */ /* Nc-1 */ /* T1 (x) = SUM tl (n) T (n, */ /* n=0 */ /* */ /* The domain of T1 (x) is-1 < x < +1. For a given root of Tl */ /* say x0, the corresponding position of the root of F1 (D) on */ /* unit circle is exp (j arccos (xO)). */ /* */ /* Establish the coefficients of the series expansion in */ /* polynomials */ /*-----------------------------------------*/ T [0] [0] =F1 [NC [0]-1], j = NC [OJ-2 ; for (i = 1; i < NC [0] ; i++) T [O] [i] = 2.;

j = j - 1; } T [l] [0] = F2 [NC [l]-l] ; j = NC[1]-2; for (i = 1; i < NC [1] ; i++) T [l] [i] = 2.0*F2[j] ; j = j - 1; } // /* Sample at equally spaced intervals between-1 and 1 to look */ /* sign changes. RESL is chosen small enough to avoid problems */ /* multiple roots in an interval. After detecting a sign */ /* successive bisections and linear interpolation are used to */ /* roots corresponding to LSF frequencies. Since the roots of */ /* two polynomials interlace, the search alternates between */ /* polynomials T (., 1) and T (., 2). IP is either 1 or 2 depending */ /* which polynomial is being */ /*-----------------------------------------*/ NF = 0 ; IP=0 ; XLOW = 1.0; YLOW = LPC chebyshev (XLOW, T [IP], NC [IP]) ; while ( (XLOW >-1.) && (NF < NPTS)) XHIGH = XLOW; YHIGH = YLOW; if ( (XHIGH-RESL) >-1.

XLOW = XHIGH-RESL ; else XLOW =-1. 0 ; YLOW = LPCchebyshev (XLOW, T [IP], NC [IP]) ; if (YLOW*YHIGH <= 0.0)

{ NF = NF + 1; /*------------------------------------*/ /* Bisections of the interval containing a sign change */ /*------------------------------------*/ for (i = 0 ; i < NBIS; i++) XMID = 0.5* (XLOW+XHIGH) ; YMID = LPC chebyshev (XMID, T [IP], NC [IP]) ; if (YLOW*YMID <= 0.0) { YHIGH=YMID ; XHIGH=XMID ; } else YLOW=YMID ; XLOW=XMID ; } } // /* Linear interpolation in the subinterval with a */ /* change (take care if YHIGH=YLOW=0) */ /*------------------------------------*/ if (YHIGH ! = YLOW) XINT = XLOW-YLOW* (XHIGH-XLOW)/(YHIGH-YLOW) ; else XINT=0. (XLOW+XHIGH); FRLSF [NF-1] = acos (XINT)/PI2; /*------------------------------------*/ /* Start the search for the roots of the next */ /* at the estimated location of the root just */ /*------------------------------------*/

IP = 1 - IP; XLOW = XINT ; YLOW = LPC_chebyshev (XLOW, T [IP], NC [IP]) ; } } // /* Halt if NPTS frequencies have not been */ /*------------------------------------*/ #ifdef VERBOSE if (NF ! = NPTS) nrerror ("LPC lpctolsf-Too few frequencies computed") ; #endif #endif return; /___________________________________________________________ ________*/ /*-----------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : LPC_chebyshev (). */ /*------------------------------------*/ /* PURPOSE : Evaluate a series expansion in */ /* polynomials. */ /* */ /* The series expansion in Chebyshev polynomials is defined */ /* */ /* N-1 */ /* Y (x) = SUM c (i) T (i, */ /* i=0 */ /* */ /* where Y (x) is the resulting value (Y (x) = CHEBPS (...)), */ /* N is the order of the */ /* c (i) is the coefficient for the i'th Chebyshev */

polynomial /* (c (i) = COF (i+l)), */ /* T (i, x) is the i'tli order Chebyshev polynomial */ /* evaluated at x. */ /* The Chebyshev polynomials satisfy the */ /* T (i, x) = 2x T (i-l, x)-T (i-2, */ /* with the initial conditions T (0, x) =1 and T (l, x) =x. */ /* routine evaluates the expansion using a backward */ /* to obtain a numerically stable */ <BR> <BR> <BR> <BR> l* *l<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ /* INPUT */ /* _ (FLOAT64) X: Input */ /* _ (FLOAT64 []) COF : Array of coefficient values. COF [i] */ /* the coefficient corresponding to */ /* i-l'th order Chebyshev */ /* _ (INT16) N: Order of the polynomial and number */ coefficients.

/*------------------------------------*/ /* OUTPUT */ /* None. */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ // /* RETURN */ /* _ (FLOAT64) CHEBPS: Predictor coefficients. */ /*========================================================== =========*/ FLOAT64 LPC chebyshev (FLOAT64 X, FLOAT64 COF [], INT16 N) /___________________________________________________________ ________*/ INT16 i; FLOAT64 B1, B0, B2, CHEBPS; /*------------------------------------*/ /* Consider the backward recursion b (i, x) =2xb (i+l, x)-b (i+2, x) +c */ /* with initial conditions b (N, x) =0 and b (N+l, x) =0. */ /* Then dropping the dependence on x, c (i) =b (i)-2xb (i+1) +b */

/* */ /* N-1 */ /* Y (x) = SUM c (i) T */ /* i=0 */ /* */ /* N-1 */ /* = SUM [b (i)-2xb (i+1) +b (i+2)] T */ /* i=0 */ /* N-1 */ /* = b (0) T (0) +b (1) T (1)-2xb (1) T (0) + SUM b (i) [T (i)-2xT (i-l) +T */ /* i=2 */ /* The term inside the sum is zero because of the */ /* relationship satisfied by the Chebyshev polynomials. */ /* substituting the values T (0) =1 and T (l) =x, Y (x) is expressed */ /* terms of the difference between b (0) and b (2) (errors in b (0) */ /* b (2) tend to */ /* */ /* Y (x) = b(0)-xb(1) = [b(0)-b (2) +c (0)]/2 */ // B2 = 0.0; B1 = 0.0; BO = 0.0; for (i=N-l ; i >= 0 ; i--) B2 = B1; B1 = B0; BO = (2. *X) *B1 - B2 + COF [i]; CHEBPS = 0. 5* (BO-B2 + COF [O]) ; /*------------------------------------*/ return (CHEBPS); /*------------------------------------*/ //

/* FUNCTION : LPC autocorrelation (). */ // /* PURPOSE : Calculate the correlation for a data */ /* */ /* This subroutine calculates the auto-correlation for */ /* given data vector. Rxx (i) gives the auto-correlation */ /* lag i, for i running from 0 to NTERM-1. */ * *l 1* NX */ /* Rxx (i) = SUM X (j) * X (j-i) */ /* j=i */ /* */ This algorithm */ /* (N+1) * (NX+N/2) multiplies */ /* (N+1) * (NX+N/2) */ /* */ /*---------------------------------------------------------- ---------/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) x: Input data vector with NX */ /* _ (INT16) L: Number of data */ /* _ (INT16) ORDER_1 : Order of the polynomial and number */ /* coefficients. */ /*------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) r: Auto-correlation vector with ORDER1 */ /* elements. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LPC autocorrelation (FLOAT64 x [], INT16 L, FLOAT64 r [], INT16 ORDER_1) /*---------------------------------------------------------- ---------/

INT16i; /*------------------------------------*/ for (i = 0; i < ORDER1 ; i++) dot_dvector(x, x+i, r+i, 0, (INT16)(L-i-1)); /*------------------------------------*/ return; return; <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> }<BR> <BR> <BR> <BR> <BR> // /* FUNCTION LPC_ptoa (). */ /___________________________________________________________ ________*/ /* PURPOSE: This function convert the prediction coeff. */ /* tha classical LP filter */ /* */ /___________________________________________________________ ________*/ /* INPUT */ /* _ (FLOAT64 []) p: prediction coeffcients. */ <BR> <BR> <BR> /* (INT 16) LPC-ORDER: order of the */<BR> <BR> <BR> /___________________________________________________________ ________*/ /* OUTPUT */ /* _ (FLOAT64 []) a: LP filter coefficients. */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*------------------------------------*/ /* RETURN */ /* None.

/*======================================================= ============*/ void LPC_ptoa (FLOAT64 p [], FLOAT64 a [], INT16 LPC ORDER) { {

INT16 i; /*------------------------------------*/ #ifdef VERBOSE if (LPC ORDER > MAX LPC ORDER) nrerror ("LPC order is too large in ptoa() ! !!"); #endif &num endif a [O] = 1. ; for (i = 0 ; i < LPCORDER ; i++) a[i+1] = -p[i]; /*------------------------------------*/ return; /*------------------------------------*/ /*/ /*========================================================== =========*/ /* FUNCTION : LPC_Isftop (). */ /*------------------------------------*/ /* PURPOSE : This function convert LSF's to predictor */ /* */ /* The line spectral frequencies are assumed to be */ /* corresponding to roots on the unit circle. Alternate roots on */ /* the unit circle belong to two polynomials. These */ /* are formed by polynomial multiplication of factors */ /* conjugate pairs of roots. Additional factors are used to give */ /* a symmetric polynomial and an anti-symmetric polynomial. */ /* sum (divided by 2) of these polynomials gives the */ /* */ /* */ /*------------------------------------*/

/* INPUT ARGUMENTS */ /* _ (FLOAT64 []) FRLSF: Array of NPTS line spectral */ /* frequencies (in ascending */ /* Each line spectral frequency lies */ /* the range 0 to */ /* (INT16) NPTS: Number of coefficients (at most */ /*------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) PRCOF: predictor */ <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> /* INPUT/OUTPUT */ /* None. */ /*------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void LPC_lsftop( FLOAT64 FRLSF[], FLOAT64 PROCOF[], INT16 NPTS) /___________________________________________________________ ________*/ INT16 NC, i, M, k; FLOAT64 Fl [(MAX_LPC_ORDER+1)/2 +1], F2 [ (MAXLPCORDER/2) +1] ; FLOAT64 A, x ; /___________________________________________________________ ________*/ FI [O] = 1.0; F2 [01= 1.0; /*------------------------------------*/ /* Each line spectral frequency w contributes a second */ /* polynomial of the form Y (D) =1-2*cos (w) *D+D**2. These */ /* are formed for each frequency and then multiplied */ /* Alternate line spectral frequencies are used to form */ /* polynomials with interlacing roots on the unit circle. These */ /* polynomials are again multiplied by 1+D and 1-D if NPTS is */ /* or by 1 and 1-D**2 if NPTS is odd. This gives the symmetric */ /* anti-symmetric polynomials that in turn are added to give the */

/* predictor coefficients. */ /*------------------------------------*/ &num ifdef VERBOSE if (NPTS > MAX-LPC ORDER) nrerror ("LSFTOP-Too many coefficients!! !") ; #endif &num endif /* Form a symmetric F1 (D) by multiplying together second */ /* polynomials corresponding to odd numbered */ /*------------------------------------*/ NC = 0 ; for (i = 0; i < NPTS; i += 2) x = cos (PI2*FRLSF [i]); A =-2. 0 * x; LPC convsm (Fl, &NC, A); } /*------------------------------------*/ /* Form a symmetric F2 (D) by multiplying together second */ /* polynomials corresponding to even numbered */ /*------------------------------------*/ NC = 0 ; for (i = 1 ; i < NPTS ; i += 2) x = cos (PI2*FRLSF [i]) ; A = -2.0* x; LPC convsm (F2, &NC, A); } /*------------------------------------*/ /* Both F1 (D) and F2 (D) are symmetric, with leading coefficient */ /* equal to unity. Exclusive of the leading coefficient, */ /* number of coefficients needed to specify F1 (D) and F2 (D) */ /* NPTS F1 (D) F2 */ /* even NPTS/2 */

/* odd (NPTS+1)/2 (NPTS-1)/2 */ /*------------------------------------*/ if ((NPTS % 2) ! = 0) // /* NPTS */ /* F2 (D) is multiplied by the factor (1-D**2) */ /*--------------------------------*/ M = (NPTS-1)/2 ; for (i = M; i >= 2; i--) F2 [i] = F2 [i]-F2 [i-2] ; /*--------------------------------*/ /* Fonn the predictor filter coefficients */ /* Note that F I (D) is symmetric and F2 (D) is */ /* anti-symmetric. Since only the first half of */ /* coefficients are available, symmetries are used to */ /* the other half. */ /*--------------------------------*/ k = NPTS-1; for (i=0 ; i < M; i++) { PRCOF [i] =-0 5* (Fl [i+1] + F2 [i+l]) ; PRCOF [k] =-0 5* (Flli+l]-F2 [i+1]) ; k=k-1 ; PRCOF[k] = -0.5*Fl[k]; } else /__________________________________________________________* / /* NPTS */ /* F1 (D) is multiplied by the factor (1+D) */ /* F2 (D) is multiplied by the factor (1-D) */ /*--------------------------------*/ M = NPTS/2 ;

for (i=M ; i >= 1; i-- ) FI [i] =Fl [i] +Fl [i-1] ; F2[i]=F2[i]-F2[i-1]; } /*/ /* Form the predictor filter coefficients */ /* Note that F1 (D) is symmetric and F2 (D) is */ /* */ /*------------------------------------*/ k = NPTS-1; for (i = 0; i < M; i++) { PRCOF [i] =-0. 5* (F1 [i+l] +F2 [i+1]) ; PRCOF [k] =-0. 5* (Fl [i+l]-F2 [i+1]) ; k=k-1 ; } <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // return; %/*-----------------------------------------*/ /*-----.-------------.----*/ /*========================================================== =========*/ /* FUNCTION : LPCadptiveinterp (). */ /*-----------------------------------------*/ /* PURPOSE : This function this function generates the */ /* coefficients by interpolating in a NON */ /* way the lsf. */ /*-----------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) lsf_1: first set of lsf. */ /* _(FLOAT64 []) lsf_2 : second set of Isf. */

/* _ (FLOAT64 []) lsf old : Isf from last */ /* (INT16 *) int idx : codebook */ /*-----------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 **) pdcf : predictor coefficients. */ // /* INPUT/OUTPUT */ /* None. */ /*-----------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LPC_adptive_interp (FLOAT64 lsf [], FLOAT64 Isfl FLOAT64 Isf old FLOAT64 **pdcf, INT16 *int_idx) { // FLOAT64 ref Isf [NPI, int-IsW], dis, mindis, delta, vall, val2 ; INT16 i, k; /*-----------------------------------------*/ /* Middle Isf */ /*-----------------------------------------*/ /*/ /* Weights */ /*-----------------------------------------*/ int_lsf[0] = (1. [0]) * (1. 0 - lsf1[1] + Isfl [0]) ; for (i = 1 ; i < NP-1 ; i++) { vall = lsfl [i+l]-lsfl [i]; val2 = lsf1[i] - lsf1[i-1]; delta = MIN (val I, val2); int_lsf [i] = (1. [i]) * (1.0-delta); }

delta = Isfl [NP-l] +lsfl [NP-2] ; int_lsf[NP-1] = (1.0 - lsf1[NP-1]) * (1.0-delta); /*------------------------------------*/ /* Search */ /*------------------------------------*/ mindis = DBLMAX ; for k = 0 ; k<NSF4 ; k++) for (i=O ; i<NP ; i++) reflsfli] = IntLSF_C[k]*lsf[i]+(1-IntLSF_C [k]) *lsf old [i]; dis = 0. 0; for (i = 0; i < NP ; i++) dis += fabs (ref_lsfli]-lsfl [i]) * int_lsf[i]; if (dis < mindis) { mindis = dis ; *int idx = k ; } } // k= *int_idx ; for (i = 0; i < NP; i++) ref Isqil = IntLSF-Cfk] *Isf [i] + (l-IntLSF C [k]) *Isf old [i]; /*------------------------------------*/ /* LSF to prediction coefficients */ /*------------------------------------*/ /*------------------------------------*/ /* Sub-frame #0 */ /*------------------------------------*/ for (i = 0; i < NP; i++)

int_Isf[i] = 0.5*(lsf_old[i]+ref_lsf[i]); LPC_lsftop(int_lsf, pdcf[0], NP); /*------------------------------------*/ /* Sub-frame &num 1 */ /*------------------------------------*/ LPC_lsftop(ref_lsf,pdcf[1], NP); /*------------------------------------*/ /* Sub-frame #2 */ /*------------------------------------*/ for (i = 0; i < NP; i++) int_lf[i] = 0.5* (ref isflil + Isf [i]) ; LPC_lsftop(int_lsf, pdcf[2], NP); /*------------------------------------*/ /* Sub-frame &num 1 */ /*------------------------------------*/ LPC lsftop (lsf, pdcfl3], NP); /*------------------------------------*/ Update the */ /*------------------------------------*/ cpy_dvector (Isf, Isf old, 0, NP-1); // return ; /*------------------------------------*/ <BR> <BR> <BR> //

/*========================================================== =========*/ /* FUNCTION : LPCadptiveinterpdec (). */ /*------------------------------------*/ /*PURPOSE : This function this function generates the */ /* coefficients by interpolating in a NON */ way the Isf /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) lsf_1: first setoflsf. */ /* _ (FLOAT64 []) Isf_old : lsf from last frame. */ /* _(INT16 *) int_idx : codebook */ /*------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 **) pdcf : predictor coefficients. */ /*------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> I, I void LPCadptiveinterpdec (FLOAT64 Isf [], FLOAT64 Isf old FLOAT64 **pdcf, INT16 int-idx) /*/ FLOAT64 ref ! sf [NP], int_lsflNP] ; INT16 i; /*------------------------------------*/ /* Middle */ /*------------------------------------*/ for (i = 0; i < NP ; i++) ref [i] = IntLSF_C[int_idx]*lsf[i] + (1-IntLSF_C[int_idx])*lsf_old[i]; /*------------------------------------*/ /* LSF to prediction coefficients */

/*------------------------------------*/ /*------------------------------------*/ <BR> <BR> <BR> /* Sub-frame &num 0 */<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ for (i = 0; i < NP; i++) int_lsf[i] = 0.5*(lsf_old[i]+ref_lsf[i]); LPC_lsftop(int_lsf, dpcf[0], NP); <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> /* Sub-frame &num 1 */ /*------------------------------------*/ LPC_lsftop(ref_lsf, pdcf[1], NP); /*------------------------------------*/ /* Sub-frame &num 2 */ /*------------------------------------*/ for (i = 0 ; i < NP; i++) int Isfli] = 0.5* (ref [i] + Isfli]) ; LPC_lsflop (int_lsf, pdcfl2], NP); /*------------------------------------*/ <BR> <BR> <BR> /* Sub-frame &num 1 */<BR> <BR> <BR> <BR> // LPC_lsflop (lsf, pdcfl3], NP); /*------------------------------------*/ Update the */ /*------------------------------------*/ cpy_dvector (Isf, lsf_old, 0, NP-1); /*------------------------------------*/

return ; /*------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : LPC interpolate_lpc_4to2 (). */ /___________________________________________________________ ________*/ /* PURPOSE : This function this function generates the */ /* coefficients by interpolating the Isf */ /* (frequency */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Isf_l : first set of lsf. */ /* _ (FLOAT64 []) Isf_2 : second set of lsf. */ /* _ (FLOAT64 []) Isf old : lsf from last */ /* _(INT16 ) flag: switch between interpolation coeff. */ /* for quantized (1) or */ /* (0) */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* _(FLOAT64 **) pdcf : predictor coefficients. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void LPC interpolate lpc 4to2 (FLOAT64 Isf l [], FLOAT64 Isf_2 [], FLOAT64 lsf_old [], FLOAT64 **pdcf, INT16 flag) /*/ INT16 i; FLOAT64 C; FLOAT64 tmpmem [NP] ;

/*------------------------------------*/ /* Sub-frame #1 */ /*------------------------------------*/ if (flag == 1) { C = 60.0 / 160.0; for (i = 0; i < NP ; i++) tmpmem [i] = C*lsf_1[i] + (l-C) *Isf old [i]; } else C =60.0/80.0; for (i = 0; i < NP ; i++) tmpmem [i] = (l-C) *lsf_old[i] + C*lsf 2 [i] ; } LPC_lsftop (tmpmem, pdcf[0], NP); /*------------------------------------*/ /* Sub-frame #2 */ /*------------------------------------*/ if (flag== I) { C = (60.0 + 80.0)/160.0; for (i = 0; i < NP ; i++) tmpmem [i] = C*tsfl [i] + (l-C) *lsf old [i]; else C = 60. 0/80.0; for (i = 0; i < NP; i++) tmpmem[i] = C*lsf_1[i] + (1-C)*lsf_2[i]; LPC_lsftop (tmpmem, pdcfll], NP); LPC_lsftop (tmpmem, pdcf[1], NP);

/*------------------------------------*/ /* Update the Isf for interpolation in the next coding */ /*------------------------------------*/ cpy_dvector (tsfl, tsfold, 0, NP-1); turn, return; /*------------------------------------*/ } /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : LPC_interpolate_lpc_4to3 (). */ /*------------------------------------*/ /* PURPOSE : This function this function generates the */ /* coefficients by interpolating the Isf */ /* (frequency */ // /* INPUT */ /* _(PLOAT64 []) lsf_1 : first set of isf. */ /* _(FLOAT64 []) lsf_2 : second set of Isf.

/* _ (FLOAT64 []) Isf old : Isf from last */ /* _ (INT16) flag : switch between interpolation coeff. */ /* for quantized (1) or */ /* (0) */ /*(0)LSF."7 /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 **) pdcf : predictor coefficients. */ /*------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */

voidLPC_interpolate_lpc_4to3 (FLOAT64 lsf_1 [], FLOAT64 lsf_2 [], FLOAT64 Isf old FLOAT64 **pdcf, INT16 flag) // INT16 i; FLOAT64 C; FLOAT64 tmpmem [NP] ; /*------------------------------------*/ /* sub-frame #1 */ /*------------------------------------*/ if(flatg == 1) C = 46.5/160.0; for (i = 0; i < NP; i++) tmpmem [i] = C*lsf_1[i] + (I-C) *Isf old [i] ; else { C = 46.5/80.0; for (i = 0; i < NP; i++) tmpmem[i] = (1-C)*lsf_old[i] + C*lsf_2[i]; LPC lsftop (tmpmem, pdcfl0], NP); /*------------------------------------*/ /* Sub-frame #2 */ /*------------------------------------*/ if (flag == 1) { C = (46.5 + 53.0)/160.0; for (i = 0; i < NP ; i++) tmpmem [i] = C*lsf_1[i] + (l-C) *lsf_old[i] ; else

{ C=20. 0/80.0; for (i = 0; i < NP ; i++) tmpmem [i] = C*lsf_1 [i] + (I-C) *lsf 2 [i]; LPC_lsftop (tmpmem, pdcf[1], NP); } LPC lsftop (tmpmem, pdcfll], NP); /*------------------------------------*/ /* Sub-frame #3 */ // if (flag == 1) { C = (46.5 + 2.0*53.0)/160.0; for (i = 0; i < NP; i++) tmpmem [i] = C*lsf l [i] + (l-C) *lsf_old [i]; else C = (20.0 + 53.0)/80.0; for (i = 0; i < NP; i++) tmpmem [i] = C*lsf [i] + (I-C) *lsf_2[i] ; } LPC lsftop (tnpmem, pdcfl2], NP); /*------------------------------------*/ /* Update the Isf for interpolation in the next coding frame */ /*------------------------------------*/ cpy_dvector (Isf l, Isf_old 0, NP-1) ; /*------------------------------------*/ return; /*------------------------------------*/

} /*-----------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*=========================================== /* FUNCTION : LPC_convsm (). */ /*------------------------------------*/ /* PURPOSE: This function convolve coefficients for */ /* symmetric */ /*------------------------------------*/ /* INPUT */ /* _(INT16 *) N: number of coefficients. */ /* _(FLOAT64 ) A: cosinusoidal */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) X: input/outuput */ /*------------------------------------*/ /* RETURN ARGUMENTS */ /* _None. */ void LPCconvsm (FLOAT64 X [], INT16 *N, FLOAT64 A) /___________________________________________________________ ________*/ INT16 k, n; // n = (*N); if(n>=2) X[n+1] = X[n-1]; for (k=n+l ; k>=3 ; k--) X [k] = X [k] + A * X [k-1] + X[k-2];

X[2] = X[2] + A*X[1] + 1.0; X[1] = X[1] + A; } else if (n == 1) X [2] =2. 0+A*X [1], X [1] = X[1] + A ; } else if (n == 0) X [l] = A ; n = n + 1 ; (*N) = n ; /*------------------------------------*/ return; /*------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : LPC_ImpulseResponse (). */ /*/ /* PURPOSE : This function calculates the LPC */ filter filter response including */ /* weighting. */ /*------------------------------------*/ /* INPUT ARGUMENTS */ /* (FLOAT64 []) wpdcfzero : precetual filter */ /* coefficients. */ /* (FLOAT64 []) wpdcf_pole : precetual filter */ /* coefficients. */ /* _ (FLOAT64 []) pdcfq: quantized prediction coeff. */ /* _(INT16 )l_sf: sub-frame */ /*------------------------------------*/ /* OUTPUT ARGUMENTS */

/* _(FLOAT64 []) hh : impulse */ /*-------------------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*-------------------------------------------------------*/ /* RETURN ARGUMENTS */ /*None.*/ /*========================================================== ===========*/ voidLPC_ImpulseResponse (FLOAT64 hh[], FLOAT64 wpdcf_zero [], FLOAT64 wpdcfpote [], FLOAT64 [], INT16 I_sf) // FOLAT64 tmpmem[NP]; /*/ inidvector (hh, 0, 1_sf-1, 0.0); LPC_ptoa (wpdcf zero, hh, NP); ini-dvector (tmpmem, 0, NP-1,0.0); FLT_allsyn (hh, l_sf, pdcfq, NP, hh, tmpmem) ; imdvector (tmpmem, 0, NP-1, 0.0); FLT_allsyn (hh, 1_sf, wpdcf_pole, NP, hh, tmpmem); /*-------------------------------------------------------*/ return; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== ==========*/ /*------------------------------------END------------------- ---------------- /*========================================================== ==========*/

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*-------------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ // /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: lib_lpc.h */ /*========================================================== ===========*/ /*--------------------------------------------------------*/ /*------------------------FUNCTIONS------------------------- -----*/ /*--------------------------------------------------------*/ void LPC init lib (void); void LPC analysis (INT16, FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 FLOAT64 FLOAT64 [], INT16, FLOAT64 *, INT16); void LPC autocorrelation (FLOAT64 [], INT16, FLOAT64 [], INT16); void LPC leroux-gueguen (FLOAT64 [], FLOAT64 [], FLOAT64 *, INT16); void LPCrefl2pred (FLOAT64 [], FLOAT64 [], INT16); void LPC_lpctolsf (FLOAT64 [], FLOAT64 [], INT16); FLOAT64 LPC_chebyshev (FLOAT64, FLOAT64 [], INT16); void LPC_ptoa (FLOAT64 [], FLOAT64 [], INT16) ; void LPC_lsflop (FLOAT64 FLOAT64 INT16); void LPC_pred2refl (FLOAT64 [], FLOAT64 [], INT16);

void LPC adptive interp (FLOAT64 [], FLOAT64 [], FLOAT64 [], **, INT16 *); void LPC_adptive_interp_dec (FLOAT64 [], FLOAT64 [], FLOAT64 **, INT16) ; void LPC interpolate lpc 4to3 (FLOAT64 FLOAT64 FLOAT64 FLOAT64 **, INT16); void LPC_interpolate_lpc_4to2 (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 **,INT16); void LPCconvsm (FLOAT64 [], INT16 *, FLOAT64) ; void LPC ImpuIseResponse (FLOAT64 [], FLOAT64 [], FLOAT64 [], [], INT16) ; INT16) ; /*========================================================== ==========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*/ /* Copyright (C) 2000 Conexant System Inc. */ /*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: lib_ltp.c */ /*========================================================== ===========*/ /___________________________________________________________ _________________*/ /*--------------------------INCLUDE------------------------- ---*/ <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num include"typedef. h"<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num include"main. h" #include "const.b" #include "gputil.h" &num include"mcutil. h" #include "ext_var.h" #include "lib_flt.h" #include "lib_ltp.h" #include "lib_pit.h" /*-----------------------------------------------------*/ /*---------------------FUNCTIONS---------------------------- */ /*-----------------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*---------------------------*/ /* FUNCTION: LTP_init_lib 0. */

/*-----------------------------------------------------*/ /* PURPOSE: This function initialise the gloval variable of */ /* library */ /*-----------------------------------------------------*/ /* ALGORITHM */ /*-----------------------------------------------------*/ /* INPUT ARGUMENTS /* None. */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LT'P-init lib (void) /___________________________________________________________ ________*/ ini_dvector(lag_f, 0, NSFMAX-I, 30.0); /*--------------------------------------------*/ min_pit = MINLAG ; max_pit = HILAG ; LTP Init SincWindows 0 ; LTP_generate_PitLagTab(); /*-----------------------------------------------------*/ return ; //

/*-----------------------------------------------------*/ /* FUNCTION : Hwind Q. */ /*----------------------------------------------*/ /* PURPOSE: This function returns a value of a Hamming */ /* centered at */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /'INPUTARGUMENTS:*/ /* (INT16) WinLim: the center of the Hamming */ /* _ (FLOAT64) t: the location of the */ /*/ /* OUTPUT ARGUMENTS*/ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ (FLOAT64) val : hamming window value at */ FLOAT64 Hwind (FLOAT64 t, INT16 WinLim) // FLOAT64 val, x; /*----------------------------------------------*/ val = 0. 0 ; if (fabs (t) <= WinLim) x = cos (t*PI/WinLim); val = 0. 54 + 0. 46 * x ; }

/*----------------------------------------------*/ return val ; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION: (). */ /*----------------------------------------------*/ /* PURPOSE: This function returns returns a value of a */ /* windowed SINC function to interpolate a */ /* digital */ // /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) WinLim: the center of the Hamming */ /* _ (FLOAT64) t: the location of the */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*/ /* RETURN ARGUMENTS */ /* _ (FLOAT64) F: hamming window value at */ /*========================================================== =========*/ FLOAT64 sincFwin2(FLOAT64 t, INT16 WinLim) /*/ FLOAT64 x, num, den, sinc ; FLOAT64 F;

/*----------------------------------------------*/ x = t; if (fabs (t) < 0.000001) F = 1.0; else if (WinLim <= 6) { num = sin (x*PI*0.9); den = PI*x*0.9; sinc = num/den; F = Hwind (t, WinLim) * sinc; else num = sin (x*PI*0.95); den = PI*x*0.95; sinc = num/den; F = Hwind (t, WinLim) * sinc; } } /*----------------------------------------------*/ return F; /*----------------------------------------------*/ } /*-----------------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : sincFwin (). */ /*----------------------------------------------*/ /* PURPOSE: This function returns returns a value of a */ /* windowed SINC function to interpolate a */ /* digital signal. */

/*----------------------------------------------*/ /* ALGORITHM /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT16 ) WinLim: the center of the Hamming */ /* _ (FLOAT64) t: the location of the */ // /* OUTPUT ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------------*/ /* RETURN */ /* _ (FLOAT64) F: hamming window valuea at */ /*========================================================== =========*/ FLOAT64 sincFwin (FLOAT64 t, INT16 WinLim) { // FLOAT64 x, num, den, sinc ; FLOAT64 F; // x = t; if (fabs (t) < 0.000001) F = 1.0; else { num = sin (x*PI) ; den = PI*x ; sinc = num/den ; F = Hwind (t, WinLim) * sinc ; } //

return F; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* */ /* FUNCTION : D2A_InterpWeight 0. */ // /* PURPOSE: This function produces a weighting function w [] */ /* the purpose of interpolating */ /*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) WinLim : half Weighting function */ /* _ (FLOAT64) f: Interpolation fractional */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) w: Weighting */ // /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void D2A InterpWeight (FLOAT64 w [], FLOAT64 f, INT16 WinLim) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> { INT16 k; FLOAT64 C; /*----------------------------------------------*/ Sinc Function /*----------------------------------------------*/

for (k = 0; k < 2*WinLim ; k++) w [k] = sincFwin ((f+WinLim-1-k), WinLim); /*----------------------------------------------*/ /* Normalization */ /*----------------------------------------------*/ C = 0 ; for (k = 0; k < 2*WinLim; k++) C+=w [k], C= 1. 0/MAX (C, 0.1); for (k = 0; k < 2*WinLim; k++) w [k] *= C; /*----------------------------------------------*/ return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : D2AInterpWeight2 (). */ // /* PURPOSE: This function produces a weighting function w [] */ /* the purpose of interpolating */ // /* ALGOR1THM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ _ (INT16) WinLim: half Weighting function */ /* _(FLOAT64 ) f: Interpolation fractional */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* @ (FLOAT64 []) w: Weighting */

/*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void D2A_InterpWeight2 (FLOAT64 w [], FLOAT64 f, INT16 WinLim) /*/ INT16 k; FLOAT64 ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> /* Sinc */ /*----------------------------------------------*/ for (k = 0 ; k < 2*WinLim; k++) w [k] = sincFwin2 ((f+WinLim-l-k), WinLim); <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> /* Normalization */ /*----------------------------------------------*/ C = 0; for (k = 0 ; k < 2*WinLim; k++) C += w [k] ; C= 1. 0/MAX (C, 0. 1); for (k = 0 ; k < 2*WinLim; k++) w [k] *= C ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ }

l*---------------------------------------------------------- ------------------l /*========================================================== =========*/ /* FUNCTION : D2A_interp 0. */ /*----------------------------------------------*/ /* PURPOSE: This function produces a interpolation of */ /* signal to return the signal value between two */ /* */ /*----------------------------------------------*/ /* */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64[]) w : Weighting function. */ /* _ (FLOAT64 []) s : */ /* _ (INT16) WinLim: half Weighting function */ /* _(INT16 ) Len : Length of */ /* _(FLOAT64 ) t : Time point of the signal */ /* between two */ // /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN */ /* _ (FLOAT64) X: Interpolated signal */ <BR> <BR> <BR> l = FLOAT64 D2Ainterp (FLOAT64 w [], FLOAT64 s [], INT16 Len, FLOAT64 t, INT16 WinLim) { /*---------------------------------------------------------- --------- INT16 k, L1, L2, LowL, HighL; FLOAT64 X; /*----------------------------------------------*/ LowL = (INT16) t-WinLim+l ;

LI = MAX (0, LowL); HighL = LowL+2*WinLim ; L2 = MIN (Len, HighL) ; X = 0. 0; for (k = L1 ; k < L2 ; k++) X += s [k] *w [k-LowL] ; /*----------------------------------------------*/ return X; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /* FUNCTION : LTP_lag_to_idx7b (). */ // /* PURPOSE: This function produces the extract the 7 bits */ /* corresponding to the pitch value */ /* */ /___________________________________________________________ ________*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64) pit: pitch value. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* _ (INT16) idx: corresponding */ /*========================================================== =========*/

INT16 LTP_lag_to_idx7b (FLOAT64 pit) { /*/ FLOAT64 Min, D; INT16 i, idx; /*----------------------------------------------*/ if(pit <53) { Min = fabs (PitLagTab7b [0]-pit) ; idx = 0 ; for (i = 1 ; i <= 60 ; i++) { D = fabs (PitLagTab7b [i]-pit); if (D<Min) { Min = D; idx = i; else { idx = (pit-PitLagTab7b [60]) + 0.5; idx= MIN (60 + idx, MAXPITIDX7b) ; } // return (idx) ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTION : LTP!agtoidx8b0*/ /*----------------------------------------------*/ /* PURPOSE: This function produces the extract the 8 bits */ /* corresponding to the pitch */ /* */ /*----------------------------------------------*/ /* ALGORITHM */

/*----------------------------------------------*/ /* INPUT */ /* _(FLOAT64) pit: pitch value. */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* None. */ /*-------------------------------------------*/ /* RETURN ARGUMENTS */ /* _(INT16 ) idx: corresponding */ INT16 LTP) agtoidx8b ( FLOAT64 pit) FLOAT64 Min, D; INT16 i, idx; if (pit <= { idx =(INT16)((pit-MIN_LAG)/0. 2 + 0.5); else { if (pit < { Min = fabs (PitLagTab8b [81]-pit) ; idx = 81 ; for (i=82 ; i <= 121 ; { D = fabs (PitLagTab8b [ij-pit) ; if (D < Min) { Min = D; idx = i ; } } } else { if (pit < { Min = fabs (PitLagTab8b [121]-pit) ; idx=121 ;

for (i = 122; i <=160; i++) { D = fabs (PitLagTab8b [i]-pit) ; if (D < Min) { Min = D; idx = i ; } } else { if( pit < 92) { Min = fabs (PitLagTab8b [160]-pit) ; idx= 160 ; for (i = 161 ; i <= 199 ; { D = fabs (PitLagTab8b [i]-pit); if (D < Min) { Min = D; idx = i; else { idx = (lNT16) ((pit-92) + 199 + 0.5); } } idx = MAX (idx, 0); idx = MIN (idx, MAX_PIT_IDX_8b) ; return(idx); } /*----------------------------------------------*/ /* FUNCTION : LTP_generate_PitLag/Tab (). */ /*----------------------------------------------*/ /* PURPOSE : This function generates the pitch lag */ /* */ // /*ALGORITHM */

/*-.-----.--*/ /*INPUT ARGUMENTS /* None. */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ <BR> /* INPUT/OUTPUT*/ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void LTPgeneratePitLagTab (void) /*----------------------------------------------*/ INT16 i, k; FLOAT64 D; /*----------------------------------------------*/ /* 8 bit table */ /*----------------------------------------------*/ PitLagTab8b [0] = MINLAG ; for (i = 1; i <= MAXPITIDX8b ; { if (PitLagTab8b [i-1] < 33) { PitLagTab8b [i] = PitLagTab8b[i-1] + 0.2; else { if (PitLagTab8b [i-l] < 91) { D = 0.2+0.8* (PitLagTab8b [i-1]-33. 0)/ (91. 0-33.0); PitLagTab8b [i] = PitLagTab8b [i-1] + D; } else { k= (INTI6) (PitLagTab8b [i-1] + 1.1); PitLagTab8b [i] = k; }

/*----------------------------------------------*/ /* bit table /*----------------------------------------------*/ PitLagTab7b [0] = MIN_LAG ; for (i = 1; i <= MAX_PIT_IDX_7b ; { D = MIN (0. 325*PitLagTab7b [i-1]/MIN_LAG, 1); if (D > 0.99) { k = PitLagTab7b [i-1] + D + 0.5; PitLagTab7b [i] = k; } else PitLagTab7b [i] = PitLagTab7b [i-1] +D; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> /* 5 bit */<BR> /* 5 bit table */ /*----------------------------------------------*/ PitLagTab6b[0] = 0.0; for (i = 1; i <= MAXPITIDX5b ; { if (PitLagTab6b[i-1] <= 0.8) D = 1.0/5.0; else { if (PitLagTabSb [i-1] <= 1.8) D = 1.0/4.0; else D = 1.0/3.0; PitLagTab5b [i] = PitLagTab5b [i-1] + D; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // return ;

/*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : LTP-Init SincWindows (). */ /*----------------------------------------------*/ /* PURPOSE: This function initializes the table of Sinc */ /* interpolation */ /* */ // /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT : */ /* None. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void LTPInitSincWindows (void) { // FLOAT64 f ; INT16 i; /*----------------------------------------------*/ for (i=0 ; i<NUM_SINC_WIN ; { f=DELT_F*i ; D2A_InterpWeight2(SineWindows+i*LEN_SINC,f,SINC_LIMIT);

} for (i=0 ; i<NUMSINCWIN ; { f=DELTF*i ; D2AInterpWeight (SincWindowsE+i*LENSINCE, f, SINC_LIMIT_E) ; for (i=0;i<NUM_SINC_WIN;i++) { f=DELTF*i ; D2A_InterpWeight(SincWindows_PP+i*LEN_SINC_PP, f, SINCLIMITPP) ; } /*/ return ; /*----------------------------------------------*/ } /*-----------------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== =========*/ /* FUNCTION : LTPexcitvaripitch (). */ // /* PURPOSE: This function calculates LTP excitation */ /* interpolated pitch */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) SincWindows: table of interpolation */ /* _(FLOAT64 []) PitFun Pitch */ /* _(FLOAT64 []) LTm : Excitation */ /* _ (INT16) L LTm: Length of the excitation memory. */ /* (INT16) Len: Length of the LTP */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _(FLOAT64 []) E: LTP */

/*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ None.

/*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTPexcitvaripitch (FLOAT64 *SincWindows, INT16 Len_Sinc, ENT16 Sinc_Limit, FLOAT64 PitFun [], INT16 L LTm, FLOAT64 LTm [], INT16 Len, FLOAT64 E []) { /*/ FLOAT64 t, f, *Weight; INT16 k, T, m; /*----------------------------------------------*/ for (k = 0 ; k < Len; k++) { (=L_LTm + k - PitFun[k]; T = (INT16) t; f = t- (FLOAT64)T; m = (INT16)(f*(FLOAT64)DELT_F2+0.500001) ; Weight = SincWindows + m*Len_Sine ; E [k] = D2Ainterp (Weight, LTm, (INT16) (L_LTm+Len), t, Sinc-Limit) ; LTm [L_LTm+k] = E [k] ; /*/ return; /*/

/*----------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION: LTPexcitconstpitch (). */ /*----------------------------------------------*/ /* PURPOSE: This function calculates LTP excitation */ /* constant pitch */ // /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64) Pit_f: Pitch lag */ (FLOAT64 LTm: Excitation */ /* _ (INT16) L_LTm: Length of the excitation memory. */ /* (INT16) Len: Length of the LTP */ (INT16) mem-flag memory update flag. */ /*----------------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 []) E: LTP */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTP excit_const_pitch (FLOAT64 Pitf, INT16 LLTm, FLOAT64 LTm [], INT16 Len, FLOAT64 E [], INT16 mem flag) // FLOAT64 t, f, *Weight; INT16 k, T, m; /*----------------------------------------------*/ t = L_LTm-Pit_f ; T=(INT16)t; f = t- (FLOAT64) T;

m = (INT16) (f* (FLOAT64) DELTF2 + 0. 500001); Weight = SincWindows E + m*LEN_SINC E ; for (k = 0 ; k < Len ; k++) { t = L LTm + k-Pitf ; E [k] = D2Ainterp (Weight, LTm, (INT16) (L_LTm+Len), t, SINCLIMITE) ; if (mem flag == 1) LTm [L_LTm+k] = E [k] ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION: LTPFineIndexscarch (). */ /___________________________________________________________ ________*/ /* PURPOSE: This function does the fine search of the correlation. */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) PitTab: table of pitch */ /* _(INT16 ) P1 : sarch minimum */ /* _(INT16 ) P2: sarch maximum */ /* _(INT16 ) LowL : lower pitch */ /* _ (INT16) L_R : length of */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _(INT16 ) index: memory update */ /*----------------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) R: */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTP FineIndex search (FLOAT64 PitTab [J, INT16 PI, INT16 P2, INT16 LowL, INT16 LR, FLOAT64 R [], INT16 *index) // FLOAT64 t, GG, f, MaxR=0, *Weight; INT16 i, T, m; /*----------------------------------------------*/ /* Search for the best precise pitch and */ /*----------------------------------------------*/ for (i = P1 ; i <= P2 ; i++) { t = PitTab [i] - LowL; T = (INT16) t; f = t- (FLOAT64) T; m = (INT16) (f* (FLOAT64) DELTF2 + 0.; Weight = SincWindows + m*LENSINC ; GG = D2A nterp (Weight, R, L_R, t, SINC_LIMIT); if (i == P1 11 GG > MaxR) MaxR = GG; (*index) = i; } T = (INT16) (PitTab [*index] + 0.5-LowL); R [T] = MaxR ; /*/ return ;

/*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION: LTP_PP_pitch_ext 0. */ /*----------------------------------------------*/ /* PURPOSE: This function extracts the adaptive */ /* excitation for pitch pre-processing (Mode 1) at */ /* encoder. */ /*----------------------------------------------*/ /* ALGORITHM */ // /* INPUT */ /* _ (FLOAT64 []) PitFun : Pitch */ (FLOAT64 Tgs : target signal.

(FLOAT64 ext: excitation signal. */ (FLOAT64 hh : impulse */ /* (INT16) isf : sub-frame */ /* _ (INT16) l_sf : sub-frame */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ _ (INT16 *) lag : lag */ /* _(FLOAT64 *) lag_f: fractional lag */ /* _ (FLOAT64 *) R_ltp : pitch */ /* _(FLOAT64 []) unfcod: unfiltered excitation. */ (FLOAT64 fcod: filtered */ /___________________________________________________________ ________*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTP_PP_pitch_xt (FLOAT64 PitFun [], FLOAT64 Tgs [], FLOAT64 [], FLOAT64 hh [], INT16 i_sf,FLOAT64 *unfcod,

FLOAT64 *fcod, INT16 *lag, FLOAT64 *lag f, FLOAT64 *R_ltp, INT16 Isf) /___________________________________________________________ ________*/ FLOAT64 numerator, denominator, eng_Tgs, tmp [L_SF]; FLOAT64 *buf ; /*----------------------------------------------*/ buf= dvector (0, ! sf-l) ; /*----------------------------------------------*/ /* LTP excitation: unfcod [] */ /*----------------------------------------------*/ cpy_dvector (ext + MAXLAG, tmp, 0, L_SF-1) ; LTPexcitvaripitch (SincWindowsE, LENSINCE, SINCLIMITE, PitFun, MAXLAG, ext, 1_sf, unfcod) ; cpy_dvector (tmp, ext+MAXLAG, 0, L SF-1) ; /*----------------------------------------------*/ /* Filter the pitch vector (LTP */ /*----------------------------------------------*/ filter AZ (hh, unfcod, fcod, buf, (INT16) (1_sf-l), l_sf) ; /*----------------------------------------------*/ /* Integer */ /*----------------------------------------------*/ lag [isf) = (INT16) (MIN (PitFun [l_sf/2] +0.5, max_pit)) ; lag_f[i_sf] = PitFun[l_sf/2]; /*----------------------------------------------*/ /* Compute the pitch gain (LTP */ /*----------------------------------------------*/

dot dvector (Tgs, fcod, &numerator, 0, 1_sf-1) ; dot_dvector (fcod, fcod, &denominator, 0, 1_sf-1); dot_dvector (Tgs, Tgs, &eng_Tgs, 0, tsf-l) ; (*R_ltp) = MAX (numerator, 0. 0) /sqrt (MAX (denominator*engTgs, 0.1)); /*----------------------------------------------*/ free-dvector (buf, 0, tsf-l) ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : LTPPPpitchextdecod (). */ /*----------------------------------------------*/ /* PURPOSE: This function extracts the adaptive */ /* excitation for pitch pre-processing (Mode 1) at */ /* decoder. */ *___________________________________________________________ ________*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT */ /* _ (FLOAT64 []) PitFun: Pitch track. */ /* _(FLOAT64 []) ext: excitation signal. */ /* (INT16) isf : sub-frame */ /* _ (INT16) I_sf : sub-frame */ /*----------------------------------------------*/ /* OUTPUT */ /* _ (INT16 *) lag : lag */ /* _ (FLOAT64 *) lag f : fractional lag */ /* _ (FLOAT64 []) unfcod: unfiltered */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */

/*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void LTP PP_pitch ext_decod (FLOAT64 PitFun [], FLOAT64 ext [], INT16 isf, FLOAT64 *unfcod, INT16 *lag, FLOAT64 *lag_f, INT16 @_sf) // FLOAT64 tmp [L_SF] ; /___________________________________________________________ ________*/ LTP excitation : unfcod */ /*----------------------------------------------*/ cpy_dvector (ext+MAXLAG, tmp, 0, LSF-1) ; LTPexcitvaripitch (SincWindowsE, LENSINCE, SINCLIMITE, PitFun, MAX_LAG, ext, 1_sf, unfcod) ; cpy_dvector (tmp, ext_MAX_LAG, 0, LSF-1) ; /*----------------------------------------------*/ /* pitch */ /*----------------------------------------------*/ lag[i_sf] = (INT16) (PitFun [l_sf/2] +0. 5) ; lag_f [i_sfl = PitFun [t sf/2], /*----------------------------------------------*/ return ; <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/

/* FUNCTION : LTPc) ose7bpitch (). */ /___________________________________________________________ ________*/ /* PURPOSE: This function performs the traditional search of */ /* the adaptive codebook in Mode */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Tgs : target */ /* _(FLOAT64 []) ext: excitation */ /* _ (FLOAT64 []) hh : impulse */ /* _ (INT16) i_sf : sub-frame */ /* _ (INT16) I_sf : sub-frame */ /* _(INT16 ) frm_class_pp : pitch pre-proc. classification. */ /___________________________________________________________ ________*/ /* OUTPUT */ /* _(INT16 *) lag : lag */ /* _ (FLOAT64 *) lag f : fractional lag */ (FLOAT64 pgain: pitch */ /* (FLOAT64 *) RJtp : LTP */ /* _ (FLOAT64 []) unfcod: unfiltered */ /* _(FLOAT64 []) fcod: filtered */ /* _(INT16 *) pit-idx : pitch */ // /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void LTP_close_7b_pitch(FLOAT64 Tgs [], FLOAT64 ext [], FLOAT64 hh [], INT16 i_sf, FLOAT64 unfcod [], FLOAT64 fcod [], INT16 *lag, FLOAT64 *lag_f, FLOAT64 *pgain, FLOAT64 *R_1tp, INT16 1_sf, INT16 frm_class_pp, INT16 piu-ide <BR> <BR> <BR> {<BR> <BR> <BR> <BR> <BR> /*---------.--.---.-----....-*/ FLOAT64 pit_f, numerator, denominator, MaxR, eng Tgs ;

FLOAT64 ftmp[L_SF]; INT16 i, k, IP1, IP2, L_Rp, PITCHi ; FLOAT64 *buf ; FLOAT64 Rp [20] = {0. 0} ; /*----------------------------------------------*/ /* Allocate temporary */ /*----------------------------------------------*/ buf= dvector (0, lsf-l) ; /*----------------------------------------------*/ /* Searching range */ /*----------------------------------------------*/ if (lagli_sq < MIN_LAG2) lag [i_sfl *=2; IP1 = MAX (MIN_LAG2, lag [i_sfl-3) ; IP2 = MIN (HI_LAG2, lag [i_sfl + 3); if ((frm_class_pp > 0) && (i_sf==N_SF2-1) && (lag [i_sf] > 1_sf*0. 75)) { IP1 = MAX (MIN_LAG2, lag [i_sfl-l) ; IP2 = MIN (HILAG2,) ag [isf] +l) ; /*----------------------------------------------*/ /* Integer correlation for integer lag */ /*----------------------------------------------*/ L_Rp = IP2 - IP1 + 1 ; #ifdef VERBOSE if (L_Rp >= 20) nrerror ("L_Rp>=20 #endif /*----------------------------------------------*/

for (i = IP1 ; i <= IP2 ; i++) if (i == IP1) filterAZ (hh, ext+MAXLAG-i, ftmp, buf, (INT16) (1_sf-l), l_sf) ; else { for (k = 1_sf-1; k > 0 ; k--) ftmp [k] = ftmp [k-l] + ext [MAX_LAG-i] *hh [k] ; ftmp[0] = ext[MAX_LAG-i]*hh[0]; } dot dvector (Tgs, ftmp, &Rp [i-IPl], 0, 1_sf-1) ; dot dvector (ftmp, ftmp, &denominator, 0, 1_sf-1) ; Rp [i-IPl]/= sqrt (MAX (denominator, 0.1)); } /*-------------------------*/ /* Searching for integer */ /*----------------------------------------------*/ MaxR = Rp[0]; PITCHi = IP1 ; for (i = IP1 + 1 ; i <= IP2 ; i++) if (Rp [i-IPl] > MaxR) MaxR = Rp[i-IP1]; PITCHi = i; if((MaxR < 0) && (i_sf==N_SF2-1) && (frm_class_pp > 0)) PITCHi = lag [i_sf]; /*----------------------------------------------*/ /* Fine index searching */ /*----------------------------------------------*/

pit_idx[i_sf] = PITCHi-MINLAG2 ; pitf= PITCHi ; lag [i sfl = PITCHi ; lag_fli_sfl = PITCHi ; /*----------------------------------------------*/ /* LTP excitation : unfcod [] */ // cpy_dvector (ext+MAXLAG, ftmp, 0, tsf-l) ; LTP_excit_const_pitch (pit_f, MAX_LAG, ext, 1_sf, unfcod, 1); cpy_dvector (ftmp, cxt+MAXLAG, 0, 1_sf-1) ; // /* Filter the pitch vector (LTP */ /*----------------------------------------------*/ inidvector (buf, 0, 1_sf-1, 0.0); filterAZ (hh, unfcod, fcod, buf, (INT16) (1_sf-1), 1_sf) ; /*-*/ /* Compute the pitch gain (LTP */ /*----------------------------------------------*/ dot dvector (Tgs, fcod, &numerator, 0, 1_sf-1) ; dot dvector (fcod, fcod, &denominator, 0, 1_sf-1) ; dot dvector (Tgs, Tgs, &eng_Tgs, 0, 1_sf-1) ; (*pgain) = numerator/MAX (denominator, 0.1); /*----------------------------------------------*/ /* Limit the pitch gain-> 0 <= pgain <= */ /*----------------------------------------------*/ if ((*pgain) < 0.0) (*pgain) = 0. 0 ; if ( (*pgain) > 12) (*pgain) = 1.2; (*R_ltp) = MAX (numerator, 0.0)/sqrt (MAX (denominator*eng_Tgs, 0.1));

/*----------------------------------------------*/ /* Deallocate temporary */ /*----------------------------------------------*/ free dvector (buf, 0, 1_sf-1) ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION: LTPc) ose85kpitch Q */ /*----------------------------------------------*/ /* PURPOSE: This function performs the traditional search of */ /* the adaptive codebook for SMV 8.5 */ /*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Tgs : target signal. */ /* _(FLOAT64 []) ext : excitation */ /* _ (FLOAT64 []) hh : impulse */ /*(INT16)isf:sub-framenumber.*/ /* _ (INT16) tsf : sub-frame */ /* _ (INT16) frm_class_pp : pitch pre-proc. classification. */ /*----------------------------------------------*/ /* OUTPUT */ /* _ (INT16 *) lag: lag */ /* _ (FLOAT64 *) lag f : fractional lag */ /* _(FLOAT64 *) pgain: pitch */ /* _ (FLOAT64 *) R_ltp : LTP */ (FLOAT64 unfcod: unfiltered excitation. */ /* _(FLOAT64 []) fcod: filtered */

/* (INT16 *) pit_idx : pitch */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /*None.*/ /*========================================================== =========*/ void LTP_close_8_5k_pitch (FLOAT64 Tgs [], FLOAT64 ext [], FLOAT64 [], INT16 isf, FLOAT64 unfcod [], FLOAT64 fcod [], INT16 *Iag, FLOAT64 *lag_f, FLOAT64 *pgain, FLOAT64 *R_ltp, INT16 1_sf, INT16 frm class_pp, INT16 pit idx []) { /___________________________________________________________ ________*/ FLOAT64 pit_f, numerator, denominator, MaxR, eng_Tgs ; FLOAT64 ftmp [L_SF], DifPitTab [33] ; INT16 i, k, PP1 = 0, PP2 = 0, IP1, IP2, LowL, HighL, L_Rp, PITCHi ; FLOAT64 *buf ; FLOAT64 Rp [2*SINCLIMIT+40] = {0.; /*----------------------------------------------*/ Allocate temporary */ /*----------------------------------------------*/ buf= dvector (0, 1_sf-1) ; /*----------------------------------------------*/ /* Searching */ /*----------------------------------------------*/ IP1 = MAX (MIN_LAG, lag [i_sfl-3) ; IP2 = MIN (HILAG2, iag [isf] + 3); if ((i_sf == 1) || (i_sf == N_SF4-1)) for (i = 0 ; i < 16; i++) DifPitTab [16+i] = MIN (HI_LAG2,

lag_f[i_sf-1] + PitLagTab5b [i]) ; for (i = 1; i <= 16; i++) DifPitTab [16-ii = MAX (MIN_LAG, lagflisf-l]-PitLagTab5b [i]); PP1 = 0; PP2 = 31; if ((frm_class_pp > 0) && (i_sf == N_SF4-1)) { IP1 = MAX (MINLAG. tag [isf]-l) ; IP2 = MIN (HI_LAG2, lag[i_sf]+1) ; if (DifPitTab [0] >= IP2) PP2 = 0 ; if (DifPitTab [31] <= IP1) PP1 = 31; for (i = 0; i < 32; i++) { if (DifPitTab [ij>=IPl) PP1 = i ; break; } for (i = 31 ; i >= 0 ; i--) { if (DifPitTab [i] <= IP2) { PP2 = i; break ; IP1 = DifPitTab [PPI] + 0.5; IP2 = DifPitTab [PP2] +0.5; } /___________________________________________________________ ________*/ /* Integer correlation for integer lag */ /*----------------------------------------------*/

LowL = IPI - SINC_LIMIT - 1; HighL =IP2+SINCLIMIT+1 ; L Rp = HighL-LowL + 1; &num ifdef VERBOSE if (L_Rp >= 2*SINC_LIMIT + 40) nrerror ("LRp>=2*SINCLIMIT+24 ! ! \n") ; #endif /*----------------------------------------------*/ for (i = LowL ; i <= HighL ; i++) if (i == LowL) filterAZ (hh, ext+MAXLAG-i, ftmp, buf, (INT16)(1_sf-1), 1_sf); else { for (k = 1_sf-1; k > 0 ; k--) ftmp [k] = ftmp [k-1] + ext [MAX_LAG-i] *hh [k]; ftmp [0] = ext [MAXLAG-i] *hh [0] ; } dot dvector (Tgs, ftmp, &Rp [i-LowL], 0, 1_sf-1) ; dot_dvector(ftmp, ftmp, &denominator, 0, 1_sf-1); Rp [i-LowL]/= sqrt (MAX (denominator, 0.1)); /*----------------------------------------------*/ /* Searching for integer */ /*----------------------------------------------*/ MaxR = Rp [IP1 - LowL] ; PITCHi = IP1 ; for (i = IPl+l ; i <= IP2 ; i++)

{ if (Rp [i-LowL] > MaxR) { MaxR = Rp [i-LowL] ; PITCHi = i; } if ( (MaxR < 0) && (frm_class_pp > 0) && (i_sf == N_SF4-1)) PITCHi = lag[i_sf] ; /*----------------------------------------------*/ /* Fine index */ /*----------------------------------------------*/ if ((i_sf == 0) || (i_sf == N_SF4/2)) { PP1 = LTP_lag_to_idx8b (MAX (PITCHi-0.9, MINLAG)) ; PP2 = LTP_lag_to_idx8b(MIN (PITCHi + 0.9, HI_LAG2)) ; LTP_FineIndex_search (PitLagTab8b, PP1, PP2, LowL, L_Rp, Rp, pit_idx_i_sf); pitf= PitLagTab8b [pitidx [isf]] ; lag [i_sfJ = (INT 16) (pit f + 0.5); lag_f[i_sf] = pit ; } else { if (DifPitTab [PPl] >= (PITCHi+0. 9)) PP2 = PP1 ; if (DifPitTab [PP2] <= (PITCHi-0.9)) PP1 = PP2; for (i = PP1 ; i <= PP2 ; i++) if (DifPitTab [i] >= (PITCHi-0.9)) PP1 = i ; break;

} for (i = PP2 ; i >= PP1 ; i--) { if (DifPitTab [i] <= (PITCHi + 0.9)) { PP2 = i; break ; } } PP1 = MIN (PP1, PP2); LTP-FineIndex_search (DifPitTab, PP1, PP2, LowL, L Rp, Rp, pit_idx+i_sf) ; pit_f = DifPitTab[pit_idx[i_sf]]; lag [i_sfl = (INT16) (pitf+ 0.5); lag_f[i_sf] = pit_f; } /___________________________________________________________ ________*/ /* LTP excitation : unfcod [] */ // cpy_dvector (ext_MAX_LAG, ftmp, 0, tsf-l) ; LTPexcitconstpitch (pitf, MAXLAG, ext, 1 sf, unfcod, 1); cpy_dvector (ftmp, ext+MAXLAG, 0,; /*----------------------------------------------*/ /* Filter the pitch vector (LTP */ /*----------------------------------------------*/ ini_dvector (buf, 0, 1_sf-1, 0.0); filterAZ (hh, unfcod, fcod, buf, (INT16) (1_sf-1), I_sf) ; /*----------------------------------------------*/ /* Compute the pitch gain (LTP */ /*----------------------------------------------*/ dot dvector (Tgs, fcod, &numerator, 0, 1_sf-1) ;

dot dvector (fcod, fcod, &denominator, 0, 1_sf-1) ; dot_dvector (Tgs, Tgs, &eng_Tgs, 0, I_sf-1) ; (*pgain) = numerator/MAX (denominator, 0.1); /*----------------------------------------------*/ /* Limit the pitch gain-> 0 <= pgain <= */ /*----------------------------------------------*/ if ( (*pgain) < 0. 0) (*pgain) = 0.0; if ((*pgain) > 1.2) (*pgain) = 1.2; (*R_ltp) = MAX (numerator, 0.0)/sqrt (MAX (denominator*engTgs, 0.1)); /*----------------------------------------------*/ /* Dellocate temporary */ /*----------------------------------------------*/ free dvector (buf, 0, I_sf-l) ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ // /*========================================================== =========*/ /* FUNCTION: LTP_pitch_decodtemp 0. */ /*----------------------------------------------*/ /* PURPOSE: This function perfroms a temporary decoding of */ /* LTP infonnation codebook contribution. */ /*----------------------------------------------*/ /* ALGORITHM */ /*---------------------------------------------------------- ---------/

/*INPUT ARGUMENTS */ /* (FLOAT64 []) ext : excitation */ /*(INT16)isf: sub-frame */ /* (INT16) ! sf : sub-frame size. */ /* (FLOAT64) pit-f-fractional lag value.

/*----------------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) unfcod: unfiltered LTP */ /*/ /* INPUT/OUTPUT ARGUMENTS */ None.

/*----------------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void LTP_pitch_decodtemp (FLOAT64 ext [], INT16 i sf, FLOAT64 unfcod [], FLOAT64 pit_f, INT16 1_sf) { /*----------------------------------------------*/ FLOAT64 LTm [MAXLAG+LSF], /*----------------------------------------------*/ cpy_dvector (ext, LTm, 0, MAX_LAG-1) ; LTPexcitconstpitch (pitf, MAXLAG, LTm, 1 sf, unfcod, 1); /*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : LTP_7b_pitch_decod (). */

/*----------------------------------------------*/ /* PURPOSE: This function decodes the traditional */ /* codebook */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(INT16 ) bfi: bad frame */ /* _ (FLOAT64 []) ext: excitation */ <BR> <BR> <BR> <BR> /* (INT16) isf: sub-frame */<BR> <BR> <BR> <BR> <BR> /*(INT16)!sf: sub-frame */ /* _(INT16 *) pit_idx : pitch index. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (INT16 *) lag : lag */ /* _ (FLOAT64 *) lag_f: fractional lag */ (FLOAT64 unfcod: unfiltered excitation. */ // /* INPUT/OUTPUT ARGUMENTS : */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTP7bpitchdecod (INT16 bfi, FLOAT64 ext [], INT16 isf, FLOAT64 unfcod [], INT16 lag [], FLOAT64 lag_f [], INT16 sf, INT16 pit-idx // FLOAT64 LTm[MAX_LAG+L_SF], pit_f; /*----------------------------------------------*/ /* Decode lag */ <BR> <BR> <BR> <BR> /* Decode lag */<BR> { if (bfi == 0) pitf= pitidx [isf] +MINLAG2 ;

lag[i_sf] = (INT16)(pit_f+0.5); lag_f [isf] =pitf ; else if(i_sf == 0) lag[i_sf] = lag[1]; else lag [i_sfl = MIN (lag [isf-l], HILAG2) ; tagftisf] = (FLOAT64) lag [i_sfl ; pit-f = (FLOAT64) lag [i_sfl ; /*----------------------------------------------*/ /* LTP excitation : unfcod */ /*----------------------------------------------*/ cpy_dvector (ext, LTm, 0, MAX_LAG-1) ; LTPexcitconstpitch (pitf, MAXLAG, LTm, 1 sf, unfcod, 1); /*----------------------------------------------*/ return; /___________________________________________________________ ________*/ } /*----------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : LTP_8_5k_pitch_decod (). */ /________________________________________*/ /* PURPOSE: This function decodes the traditional */ /* codebook contribution in Mode */ /*----------------------------------------------*/ /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _ (INT16) bfi: bad frame */

/* _(FLOAT64 []) ext: excitation */ /* (INT16) isf : sub-frame */ /* _ (INT16) tsf : sub-frame */ /* _(INT16 *) pit_idx : pitch */ /*/ /* OUTPUT ARGUMENTS */ /* _ (INT16 *) lag : lag value. */ /* _(FLOAT64 *) lag_f: fractional lag value. */ /* _ (FLOAT64 []) unfcod : unfiltered */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void LTP85kpitchdecod (INT16 bfi, FLOAT64 ext [], INT16 isf, FLOAT64 unfcod [], INT16 lag [], FLOAT64 lag_f [], INT16 1_sf, INT16 pit_idx []) // FLOAT64 LTm[MAX_LAG+L_SF], pit_f, DifPitTab[33]; INT16 i; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> /* Decode lag */<BR> <BR> <BR> <BR> <BR> // if (bfi == 0) { if ((i_sf == 1) || (i_sf == N_SF4-1)) for (i = 0 ; i < 16 ; i++) DifPitTab [16+1] = MIN (HI_LAG2, lag_f[i_sf- 1]+PitLagTab5b[i]); for (i = 1 ; i <= 16; i++)

DifPitTab [16-i] = MAX (MINLAG, lag_fli_sf-l]- PitLagTab5b [i]) ; pit_f = DifPitTab[pit_idx[i_sf]]; } else pit_f = PitLagTab8b[pit_idx[i_sf]]; lag [i_sfl = (INT16) (pit_f+0. 5); lag_fli_sfl = pitchf } else if(i_sf == 0) lag[i_sf] = lag[3]; else lag[i_sf] = MIN(lag[i_sf-1], HI_LAG2); lagftisf) = (FLOAT64) lag [i_sfl ; pit-f = (FLOAT64) lag [i_sfJ ; /*---------------------------------------------------------- --------- /* LTP excitation : unfcod [] */ /*----------------------------------------------*/ cpy_dvector (ext, LTm, 0, MAX_LAG-1) ; LTP_excit_const_pitch (pit_f, MAX_LAG, LTm, tsf, unfcod, 1); /*----------------------------------------------*/ return; /*----------------------------------------------*/ }

/*----------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION: LTPadapcbkcorrection (). */ /*----------------------------------------------*/ /* PURPOSE: This function extrapolated the adaptive */ /* excitation when a frame erasure */ // /* ALGORITHM */ /*----------------------------------------------*/ /* INPUT */ /* (INT16) fixratem : previous frame */ /* (INT16) bfi: frame # n Bad Frame */ /* _ (INT16) past bfi: frame # n-1 Bad Frame */ /* _ (INT16) ppast_bEi: frame # n-2 Bad Frame */ /* _(FLOAT64 **) qua_gainQ : adaptive and fixed codebook */ /* (INT16) SVSdecim : frame &num n-l mode */ /* _ (FLOAT64 []) lag_f: decoded pitch lags */ /* _(FLOAT64 ) temp_lagf: extrapolated fractional pitch */ /*/ /* OUTPUT ARGUMENTS */ /* _(INT16 *) update: update */ /* _ (INT16 []) lag: extrapolated lag */ /* _ (FLOAT64 **) gainQ: adaptive and fixed codebook */ /* _ (FLOAT64 []) lag_f : extrapolated fract. lag values. */ /* _ (FLOAT64 *) ForPitcladecTEMP: interpolated pitch */ /* (FLOAT64 []) extdec: updated LTP */ /* _ (FLOAT64 **) umcoddec : extrapolated LTP */ /*----------------------------------------------*/ /* INPUT/OUTPUT */ /* _ (FLOAT64 []) pitch f mem: past pitch */ /* _ (FLOAT64 []) tempext-dec: temporary LTP */ /*----------------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. */ /*========================================================== =========*/ void LTP-adap cbk_correction (INT16 fix_rate_m, INT16 bfi, INT16 past bfi, INT16 ppastbfi, FLOAT64 **qua_gainQ, FLOAT64 gainQ [], INT16 SVS deci m,

FLOAT64 tempjagf, INT16 *update, FLOAT64 pitchfmem [], INT16 lag [], FLOAT64 lag f [], FLOAT64 ForPitch_decTEMP [], FLOAT64 tempextdec [], FLOAT64 extdec [], FLOAT64 **unfcod dec, PARAMETER channel) /___________________________________________________________ ________*/ INT16 n_sf, i_s, i_sf, 1_sf; INT16 curr_1sf; FLOAT64 *px, temp_lag ; FLOAT64 FET, PFET, AA; /*__________________________________________________________ _________ if ( (bfi == 0) && (past bfi == 1) && (ppast_bfi == 0) && ((channel.fix_rate == RATE_0K) || (channel.fix_rate == RATE8_5K)) &&((fix_rate_m == RATE4_0K) || (fix_rate_m == RATE8_5K)) && (qua_gainQ [0] [0] > 0.6)) { (*update) = 1; if (fix_rate_m == RATE8_5K) n_sf = N_SF4; else { if(SVS_deci_m == 1) nsf=NSF3 ; else nsf=NSF2 ; if (channel.fix_rate == RATE8_5K) curr_lsf = L SF4 ; else curr_lst = L_SF0; if ((SVS_deci_m == 1) && (channel.idx_SVS_deci == 0))

/*----------------------------------------------*/ /* then LTP /*----------------------------------------------*/ temp_lag = (temp_lagf- pitch_f_mem [0]) *159.0 / ((double) L_FRM + curr_lsf-1. 0) +pitch f mem [O] ; PIT_PitchInterpolat (temp_lag, pitch_f_mem, ForPitch_decTEMP, 0); } /___________________________________________________________ _*/ /* Sub-frame */ /*----------------------------------------------*/ i = 0; for (i_sf = 0; i_sf < n_sf; i_sf++) { /*----------------------------------------------*/ /* Set subframe size */ /*----------------------------------------------*/ if (fix rate m! = RATE4 OK) 1 sf = L SF4 ; else { if(SVS_deci_m == 1) { if (i_sf == N_SF3-1) 1_sf = L-SF3; else Isf=LSFO ; } else if= LSF; }

/*----------------------------------------------*/ /* Adaptive Codebook */ /*----------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> if (SVSdecim== 1)<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* PP then LTP (LTP or PP) */ /*----------------------------------------------*/ LTPPPpitchextdecod (ForPitchdccTEMP+is, tempext_dec, i_sf, unfcod_dec[0], lag, lag_f, I_sf) ; } else if ( (SVS deci m == 0) && (channe!.idxSVSdeci == 1)) { /_______________________________________________*/ /* LTP then PP */ /*----------------------------------------------*/ temp_lag = ((pitchf- lag_f[0])*(i_sf+1.0)*1_sf)/ ((double) L_FRM*2. 0) + tagJIO], else { // /* LTP then PP */ /*----------------------------------------------*/ temp_lag = ((temp_lag - lag_f[0])*(i_sf+1.0)*1_sf) / ((double) L_FRM+curr_1sf) + lag_f[0]; } lag[i_sf] = (short) temp_lag; LTP_pitch_decodtemp(tempext_dec, i_sf, unfcod_dec[0], tempjag, ! sf);

/*----------------------------------------------*/ /* Gains */ /*----------------------------------------------*/ gainQ [0] = qua_gainQ [0] [i_sf] ; gainQ[1] = qua_gainQ[1][i_sf]; /*----------------------------------------------*/ /* RE-Build the */ /*----------------------------------------------*/ waddvector (unfcoddec [0], gainQ [0], qua_unfcod[1]+1_s, gainQ [l], tempext dec+MAX LAG, 0, 1_sf-1) ; dotdvector (tempextdec+MAXLAG, tempextdec+MAXLAG, &FET, 0,1_sf-1); FET += EPSI; if (lag [i_sfl > 0) { if (SVS-deci_m == 1) px = tempext_dec+MAX_LAG-(short)ForPitch_decTEMP[i_s]; else px = tempext_dec+MAX_LAG-lag[i_sf]; dot dvector (px, px, &PFET, 0, tsf-l) ; AA = sqrt (PFET/FET) ; } else px = tempext_dec+MAX_LAG-1_sf; dot_dvector (px, px, &PFET, 0, tsf-l) ; AA = sqrt (PFET/FET); } px = tempext_dec+MAX_LAG; sca dvector (px, AA, px, 0, 1_sf-1) ;

cpy_dvector (tempext_dec+1_sf,tempext_dec, 0, MAX_LAG-1); i_s + = 1_sf; /*========================================================== =========*/ } /*----------------------------------------------*/ /* Replace Adaptive */ /*----------------------------------------------*/ cpy_dvector (tempextdec, extdec, 0, MAXLAG-1) ; /*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /*----------------------------------------------*/ <BR> <BR> /*/<BR> /*______________________---------------END------------------ ----------------*/ /*========================================================== =========*/

/*========================================================== =========*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System Inc. */ /*========================================================== =========*/ /* PROTOTYPE FILE: lib_ltp. */ // /*----------------------------------------------*/ /___________________________________________________________ _________________*/ void LTP_init lib (void); void LTP_Init_SincWindows (void); void LTPgeneratePitLagTab (void); FLOAT64 Hwind (FLOAT64, INT16); FLOAT64 sincFwin2 (FLOAT64, INT16); FLOAT64 sincFwin (FLOAT64, INT16); void D2A_InterpWeight (FLOAT64 [], FLOAT64, INT16); void D2AInterpWeight2 (FLOAT64 [], FLOAT64, INT16); FLOAT64D2AJnterp (FLOAT64 [], FLOAT64 [], INT16, FLOAT64, INT16); INT16 LTP-lagjo_idx5b (FLOAT64); INT16 LTP_lag_to_idx7b (FLOAT64); INT16 LTP_lag_to_idx8b (FLOAT64); void LTPFineIndexsearch (FLOAT64 [], INT16, INT16, INT16, INT16, FLOAT64 [], *) ;

void LTPexcitvaripitch (FLOAT64 *, INT16, INT16, FLOAT64 [], INT16, FLOAT64 [], INT16, FLOAT64 []) ; void LTPexcitconstpitch (FLOAT64, INT16, FLOAT64 [], INT16, [], INT16) ; void LTP PP-pitch ext (FLOAT64 [], FLOAT64 *, FLOAT64 *, *, INT16, FLOAT64 *, FLOAT64 *, *, FLOAT64 *, FLOAT64 *, INT16); void LTP_PP_pitch_ext_decod (FLOAT64 [], FLOAT64 *, INT16, FLOAT64 *, INT16 *, FLOAT64 *, INT16); void LTP_close_8_5k_pitch (FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, FLOAT64 [], FLOAT64 [], INT16 *, *, FLOAT64 *, FLOAT64 *, INT16, INT16, INT16 fl) void LTPdose7bpitch (FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16, FLOAT64 [], FLOAT64 [], INT16 *, FLOAT64 *, FLOAT64 *, FLOAT64 *, INT16, INT16, INT16 []); void LTPpitch decodtemp (FLOAT64 [], INT16, FLOAT64 [], FLOAT64, INT16); void LTP7bpitchdecod (INT16, FLOAT64 [], INT16, FLOAT64 [], [], FLOAT64 [], INT16, INT16 []) ; void LTP85kpitch decod (INT16, FLOAT64 [], INT16, FLOAT64 [], [], FLOAT64 [], INT16, []) ; void LTP_adap_cbk_correction (INT16, INT16, INT16, INT16, FLOAT64 **, FLOAT64 [], INT16, FLOAT64, INT16 *, [], INT16 [], FLOAT64 [], FLOAT64 [], FLOAT64 [],

FLOAT64 [], FLOAT64 **, PARAMETER); /*========================================================== =========*/ /*---------------------END---------------------------*/ /*========================================================== =========*/

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib_pit. */ /*========================================================== =========*/ /*--------------------------------INCLUDE------------------- ----------------*/ /*--------------------------------------------*/ #include"typedef. h" #include"main. h" #include"const.h" #include"gputil. h" #include "ext_var.h" &num include"lib_pit. h" #include "lib_ltp.h" #ifdef DIAGNOSTICS &num include"lib dia. h" #endif /*--------------------------------------------*/

/*-------------------------------FUNCTIONS------------------ -----------/ /*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PIT_LT_Corr_Rmax (). */ /*--------------------------------------------*/ /* PURPOSE: This function performs initialisa the */ /* variables of the PIT */ /*--------------------------------------------*/ /* INPUT ARGUMENTS */ None.

/___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PIT init lib (void) // lagl = 20; /*--------------------------------------------*/ pitchf = MIN_LAG; ini_dvector (pitch_f_mem, 0, PITFMEM-1, MINLAG); /*--------------------------------------------*/ /* PIToI2pitchs */ /___________________________________________________________ ________*/ VUVm=l ; VUVmm = 0;

pitchm=20 ; pitch_mm = 40; Iopt0=0 ; inisvector (PITmaxO, 0, NUM_MAX_SRCH-1, 20); LagCount = 0 ; VadCount = 0 ; Av_lag = MINLAG ; Rp_m = 0.0; ini_svector (ol_lag, O, N_SF_MAX, 30); ini-svector (lag, 0, NSFMAX, 30); /*--------------------------------------------*/ return; // } /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : PIT_LF_Corr_Rmax (). */ /*--------------------------------------------*/ /* PURPOSE : This function performs a first */ /* detennination by finding NUMMAXSRCH maxima */ <BR> <BR> <BR> /* the autocorrelation. */<BR> <BR> <BR> <BR> <BR> /* */<BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ______*/ /* INPUT ARGUMENTS */ /* (INT16) Loworder : lower autocorrelation */ /* _ (INT16) High_order : Higher autocorrelation */ /* _ (INT16) L: length of correlation */ /* _ (INT16) L_r : length of input. */ /* _ (FLOAT64 Q) res: input */ /*--------------------------------------------*/

/*OUTPUT ARGUMENTS*/ /* _(INT16 []) PITma@ : autocorrelation maxima */ /* position. */ /* _ (FLOAT64 []) Rmax: autocorrelation maxima */ /*--------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ---------- void PIT LT CorrRmax (INT16 Low_order, INT16 High_order, INT16 L, INT16 L_r, FLOAT64, res[], INT16 PITmax [], FLOAT64 []) { /*-*/ INT16 i, k, iO, T1, T2, K1, K2, L_R, low, high; FLOAT64 x, y, eng; FLOAT64 R [ (HILAG2-MINLAG+4+2*SINCLIMIT)] ; /*--------------------------------------------*/ <BR> <BR> <BR> <BR> /* Residual Aurocorrelation */<BR> <BR> <BR> <BR> <BR> /**/ low = Low_order-SINC_LIMIT-1; high = High_order_SINC_LIMIT+1 ; LR = lugh-low+1 ; #ifdef VERBOSE if (L_R>=HI_LAG2-MIN_LAG+4+2*SINC_LIMIT) printf (" LR>=HILAG2-MINLAG+4+2*SINCLIMIT !' ! \n"), exit (O) ; #endif iO = L_r-L ; dot dvector (res+iO, res+iO, &eng, 0, L-1) ;

dot_dvector (res+i0-low+1, res+i0-low+1, &y, 0, L-1) ; for (i = low ; i <= high; i++) dot dvector (res+iO, res+iO-i, &R [i-low], 0, L-1) ; y += res [iO-i] *res [iO-il ; y = res[i0-i+L]*res[i0-i+L]; R [i-low]/= sqrt (MAX (y*eng, 0.01)); /*--------------------------------------------*/ /* Determine 4 best */ /*--------------------------------------------*/ T2 = Loworder ; for (k = 0 ; k < 4 ; k++) /___________________________________________________________ ________*/ Initial */ /*--------------------------------------------*/ T1 = T2; T2 = MIN (T1*2, High_order+1) ; PITmax [k] = T1 ; Rmax [k] = R [T1-low] ; for )i = T1 + 1 ; i < T2 ; i++) { if (R [i-lowl > Rmax [k]) { Rmax[k]=R[i-low]; PITmax [k] =i ; /*--------------------------------------------*/ /* Further search with low-pass */ /*--------------------------------------------*/ K1 = MAX (PITmax [k]-l, Loworder) ; K2 = MIN (PITmax [k] +l, High_order) ; x= Kl-low ;

R [K1-low] = D2Ainterp (SincWindows, R, L_R, x, SINCLIMIT) ; PITmax [k] = K1 ; Rmax [k] = R [Kl-lowl ; for (i = K1+1; i <= K2; i++) { x = i-low; R [i-low] = D2A interp (SincWindows, R, LR, x, SINC_LIMIT) ; if (R[i-low] > Rmax [k]) { PITmax [k] = i; Rmax [k] =R [i-low] ; } } } /*--------------------------------------------*/ /* In case of 3 */ /*--------------------------------------------*/ if (Loworder*8 >= High_order) PITmax[3] = PITmax[2]; Rmax[3] = Rmax[2]; } /*--------------------------------------------*/ return; /___________________________________________________________ ________*/ } /*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PIT_FirstPitchLag (). */ /*--------------------------------------------*/

/* PURPOSE : This function performs a first */ /* determination. */ /* */ /*--------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16 Q) PITmax: autocorrelation maxima */ /* position. */ /* (FLOAT64 []) Rmax: autocorrelation maxima */ // /* OUTPUT ARGUMENTS */ /* (INT16 *) lag_opt : optimum lag */ /* _ (FLOAT64 *) R opt : optimum lag */ /* autocorrelation value. */ /* (INT16 *) Iopt: optimum PITmax */ /*--------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN */ /* None. */ */========================================================== =========*/ void PITFirstPitchLag (INT16 PITmax [], FLOAT64 Rmax [], INT16 *lag_opt, FLOAT64 *R_opt, INT16 *Iopt) // FLOAT64 MaxR; INT16 i; /*--------------------------------------------*/ /* First search and correction */ /*--------------------------------------------*/ (*Iopt) = 0; MaxR = Rmax [0] ; for (i = 1; i < NUMMAXSRCH ; i++) if (Rmax [i] > MaxR)

(*Iopt) = i; MaxR = Rmax [i] ; // (*lag_opt) = PITmax [(*Iopt)] ; (*R_opt) = MaxR; /*--------------------------------------------*/ return; /*--------------------------------------------*/ // /*========================================================== =========*/ /* FUNCTION : PIT_PitchLagCorrect () */ /*--------------------------------------------*/ /* PURPOSE : This function corrects the first */ <BR> <BR> <BR> /* detennination. */<BR> <BR> <BR> <BR> /* */ /*--------------------------------------------*/ /* INPUT ARGUMENTS */ /* (INT16) pitchm : pitch of previous */ /* _ (INT16) VUVm : voice/unvoiced decision */ /* previous frame. */ /* (INT16) pitchmm : pitch value of 2 */ /* earlier. */ /* (INT16) VUVmm : voice/unvoiced decision */ /* 2 frames */ /* _(INT16 []) PITmax: autocorrelation */ /* position. */ /* _ (FLOAT64 []) Rmax: autocorrelation maxima */ /*--------------------------------------------*/ /* OUTPUT */ /* _(INT16 *) Iop : optimum PITmax */

/*--------------------------------------------*/ /* INPUT/OUTPUT */ None.

/*--------------------------------------------*/ /* RETURN ARGUMENTS */ /* _ (INT16) PITi : corrected pitch */ /*========================================================== =========*/ INT16 PIT_PitchLagCorrect (INT16 pitchm, INT16 VUVm, INT16 pitchmm, INT16 VUVmm, INT16 hi_lag.INT16 *Iop, INT16 *PITmax, FLOAT64 *Rmax) // INT16 PITi, i, k, PI, P2, PIT_test, Iopt, flag ; INT16 Decism, Decismm ; FLOAT64 D, DO ; /*--------------------------------------------*/ Iopt = *Iop; PITi = PITmax [Iopt] ; /*--------------------------------------------*/ /* Second */ // D0 = 1.0; for (i = Iopt-1 ; i >= 0 ; i--) { // PI = (INT16) MAX (PITmax [i]*0. 7, MINLAG) ; P2 = (INT16) MIN (PITmax [i] *1. 3, hi_lag) ; D = DO ; if (VUVm>3 11 (VUVm>2 && VUVmm>2)) { if (Rmax [il > 0.95) D = 0. 95*D0 ; }

else { if (Rmax [i] > 0.85) D=0. 9*D0 ; /_______________________________________________________*/ Decis_m = (VUVm > 2 && pitch_m >= P1 && pitch_m <= P2); Decismm = (VUVmm > 2 && pitchmm >= PI && pitch mm <= P2); if(Decis_m || Decis_mm) D = 0. 85*D0 ; if (Decis_m && Decis mm) D = 0. 65*D0 ; /*--------------------------------------------*/ Decism = (VUVm > 3 && pitch m >= PI && pitch m <= P2); Decismm = (VUVmm > 3 && pitch_mm >= PI && pitch_mm <= P2); if (Decis_m ++ Decis_mm) D = 0. 75*D0 ; if (Decism && Decis_mm) D = 0. 6*D0 ; /*--------------------------------------------*/ flag = 0 ; for (k = 2 ; k <= 4 ; k++) PIT = PITmax [Ioptl/k ; P1 = (INT16)MAX(PIT_test*0.8, MIN_LAG); P2 = (INT16)MIN(PIT_test*1.2, hi_lag); if (PITmax [il >= PI && PITmax [i] <= P2) flag=l ; } }

if ( (flag == 1) && (Rmax [i] > D*Rmax[Iopt]) && (Rmax [i] > 0.25)) { PITi = PITmax [i] ; *Iop = i; break; /*--------------------------------------------*/ // return PITE ; return PITi; /*--------------------------------------------*/ } /*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION PIT_ol_2pitchs (). */ /*--------------------------------------------*/ /* PURPOSE: This function estimati the 2 pitch per */ /* */ /*--------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) wspeech : weighted input */ /* _(INT16 ) L_ws : input frame size. */ /* _ (FLOAT64 []) Rp: autocorrelation maxima */ /* (INT16) vad: vad */ /*--------------------------------------------*/ /* OUTPUT */ _ (INT16 []) lag : estimated lag */ /*--------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------*/ /* RETURN ARGUMENTS */

None. void PIT ol 2pitclis (FLOAT64 wspeech [], INT16 Lws, INT16 lag [], FLOAT64 Rp [], INT16 frame class, INT16 hi_lag) { // INT16 i, L_corr, L, Iopt, Ioptl, Iopt2, CorrectFlag, PITmaxI [NUMMAXSRCH], PITmax2 [NUMMAXSRCH] ; FLOAT64 Rmax1[NUM_MAX_SRCH], Rmax2[NUM_MAX_SRCH]; /*--------------------------------------------*/ /* Open loop pitch estimation in lookahead */ /*--------------------------------------------*/ Lcorr = LFRM/2 ; lag [0] = lag [2] ; Rp [0] = Rp [2] ; // /* Calculate the autocorrelation */ /*--------------------------------------------*/ L = MIN (L_ws-L_LPCLHD+L_corr, L_ws) ; PIT LT Corr Rmax (NIN_LAG, hi_lag, L corr, L, wspeech, PITmax2, Rmax2); /*--------------------------------------------*/ /* Searching for integer */ // PITFirstPitct) Lag (PITmax2, Rmax2, & (lag [2]), & (Rp [2]), &Iopt2); Iopt = Iopt2; lag [2] = PIT_PitchLagCorrect(pitch_m, VUVm, pitch_mm, VUVmm, hi_lag, &Iopt2, PITmax2, Rmax2); Rp [2] = Rmax2 [Iopt2] ; /*--------------------------------------------*/

/* Open loop pitch in second half */ /*--------------------------------------------*/ if ((VUVmm < 3) && (VUVm < 3)) if (Rp [2] > 0. 5) WVmm=3 ; pitch_mm=lag [2] ; if (Rp [0] >0. 5 && lag [01<lag [2]) pitch_mm=lag[0]; else { if (Rp [0] > 0. 5) { VUVmm = 3; pitch_mm = lag[0]; } } // /* Calculate the autocorrelation */ /*--------------------------------------------*/ L = Lws-LLPCLHD ; PIT_LT_Corr_Rmax(MIN_LAG, hi_lag,L-corr. L, wspeech, PITmaxl, Rmaxl) ; /*--------------------------------------------*/ /* Searching for integer */ /*--------------------------------------------*/ PIT_FirstPitchLag (PITmaxl, Rmaxl, & (lag[1]), & (Rp [l]), &Ioptl); Iopt = Ioptl ; lag[1] = PIT_PitchLagCorrect(pitch_m, VUVm, pitch_mm, VUVmm, hi_lag, &Iopt1, PITmax1, Rmax!); Rp[1] = Rmax1[Iopt1];

/*--------------------------------------------*/ /* Second correction for lag [1] */ /*--------------------------------------------*/ CorrectFlag=0 ; if (abs (lag [2]-pitchm) < 0. (lag [2], pitch_m) && abs (lag [2]-lag [l]) > 0. 25*lag [1] && (Rp[2]>0.5 || Rp_m>0.5)) if (Rp [2] > 0. 5) pitchmm = lag [2] ; else pitch_mm = pitch_m ; CorrectFlag =1; if (abs (lag[2]-lag[0]) < 0.25*MIN (lag [2], lag [0]) && abs(lag[2]-lag[1]) > 0.25*lag[1]) { if ( (Rp [2] > 0.5) && (Rp [0] > 0.5)) { lag [l] = (lag [0] + lag[2])/2; CorrectFlag = 0; else { if (Rp [0] > 0.5) pitch_mm = lag[0]; CorrectFlag =1; } if (Rp [2] > 0. 5) pitch_mm = lag[2]; CorrectFlag = 1; }

if (((lag[1]-lag[2] >= 0.3*MIN(lag[1],lag[2])) && (Rp [2] >1. 25*Rp [l] && Rp [1] <0.75 && Rp [2] || ((lag[2]-lag[1]>0.3*lag[1]) && (Rp [2] >1.25*Rp [l] && Rp [2] >0.5))) { lag [l] = lag [2] ; CorrectFlag = 0 ; } if (CorrectFlag==l) { for (i=O ; i<NUM_MAX_SRCH ; i++) if ((PITmax1[i] > 0.75*pitch_mm) && (PITmaxl [i] < 1. && (Rmaxl [i] > 0.5*Rmaxl [Ioptl]) && (PITmaxl [i] > PITmaxl [Ioptl]/NUM_MAX_SRCH)) { lag[1] = PITmax1[i]; Rp [l] = Rmaxl [i] ; break ; } } // /* Second correction for lag [0] */ /*--------------------------------------------*/ CorrectFlag=O ; if ((lag[0]-lag[1] >= 0.25*MIN(lag[0], lag [l])) && (Rp [l] > l. l*Rp [0]) && (Rp [O] < 0.75) && (Rp [l] > 0.5)) { pitch_mm = lag[1]; CorrectFlag = 1; } if (abs(lag[2]-lag[1]) < 0.25*MIN(lag[2], lag[1]) && abs (lag [O]-lag [l]) > 0. 25*lag [0] && Rp[1] > {

pitch_mm=lag[1]; CorrectFlag=1; if (abs (lag[1]-pitch_m) < 0. (lag[1], pitch_m) && abs (lag [l]-lag [0]) > 0. 25*lag [0]) { if (Rp [1] >0. 5 && Rp_m>0. 5) { lag [O] = (pitch_m_lag[1])/2 ; CorrectFlag=0; } else { if (Rp_m>0. { pitch_mm=pitch_m; CorrectFlag=1; if (Rp [1] { pitch_mm=lag[1]; CorrectFlag=1; } } if (CorrectFlag==1) { for (i=0; i<NUM_MAX_SRCH; i++) { if (PITmaxO [i] > 0. 75* pitch_mm && PITmaxO [i] < 1. && RmaxO [i] > 0.75*RmaxO [IoptO] && PITmaxO [i] > PITmaxO [IoptO]/NUMMAXSRCH) lag [0] =PITmaxO [i] ; Rp [0] =RmaxO [i] ; break; } } // /* Set large */ /* Set large lag */ /*--------------------------------------------*/

if ((frame_class >= 3) && (lag[1] < 50) && (Av_lag > MAX(2.25*lag[1], 50))) { if (PITmaxl [1]>lag[1] && Rmaxl [l] >Rmaxl [2]) { lag [l] = MAX (PITmaxl [l], pitch m) ; Rp [l] =Rmaxl [l] ; } else if (Rmax1[3]>Rmax1[2]) lag [l] = MAX (PITmaxl [3], pitch_m) ; Rp [l] = Rmaxl [3] ; } else { lag[1] = MAX(PITmax1[2], pitch_m); Rp [l] = Rmaxl [2] ; }} } } if ((frame_class >= 3) && (lag [0] < 50) && (Av_lag > MAX(2.25*lag[0], 50))) if ((PITmax0[1] > lag[0]) && (RmaxO [1] > RmaxO [2])) lag [0] = MAX (PITmaxO [l], pitch m) ; Rp[0] = Rmax0[1]; } else if (RmaxO [3] > RmaxO [2]) { lag [0] = MAX (PITmaxO [3], pitch_m) ; Rp [0] = Rmax0[3]; } else

lag [Ol = MAX(PITmax0[2], pitch_m) ; Rp[0] = Rmax0[2]; } } /*/ /* Estimate Average */ /*--------------------------------------------*/ if ((frame_class >=3) && (Rp [1] > 0.5) && (lag [l] > 0. 7*pitch_m) && (lag [l] < 1. 3*pitch_m)) LagCount++; else LagCount = 0; if (LagCount >= 2) Av_lag=(short)((double)Av_lag*0.75+(double)lag[1]*0.25]; if (frame_class <= 0) VadCount++; else VadCount=0 ; if (VadCount > 3) Av_lag = 40/*MIN_LAG*/; /*--------------------------------------------*/ /* Update */ /*--------------------------------------------*/ pitchmm = pitchm ; pitch_m = lag[1]; VUVmm = VUVm; VUVm = 1; if (Rp [l] > 0. 25) VUVm == 2; if (Rp [l] > 0. 5) VUVm = 3;

if (Rp [l] > 0. 75) VUVm = 4; Rp_m = Rp [l] ; IoptO = Iopt2 ; for (i = 0; i < NUM_MAX_SRCH ; i++) PITmaxO [i] = PITmax2 [i] ; RmaxO [i] = Rmax2 [i] ; } /___________________________________________________________ ________*/ /* high limit 8/ /*--------------------------------------------*/ if (hi_lag == HI_LAG) { if (lag [O] > HI_LAG) { if ( (PITmaxO [2] <= HILAG) && (PITmaxO [2] > L_SF)) lag[0] = PITmaxO [2] ; else lag[0] = HI_LAG ; if (lag [1] >HILAG) { if ((PITmax1[2] <= HILAG) && (PITmaxl [2] > L_SF)) lag [l] = PITmax1[2] ; else lag[1] = HI_LAG; } } // return ; } }

/*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PIT_FinePitch (). */ /*--------------------------------------------*/ /* PURPOSE : This function corrects the pitch */ <BR> <BR> <BR> l* *l<BR> <BR> <BR> <BR> <BR> <BR> /*/ /* INPUT */ /* _(INT16 ) bitrate: bitrate value. */ /* _ (INT16) low_pitch : low pitch */ /* _(INT16 ) high_pitch : high pitch */ /* _ (FLOAT64 []) res: weighted */ /* _ (INT16) L_r : length of wspeech. */ /* _ (FLOAT64) Delay_pp : pre-processing */ /*--------------------------------------------*/ /* OUTPUT */ /* (FLOAT64 Rp_max : autocorrelation maximum */ /* _ (FLOAT64 *) pitchf : PitLagTab7b extracted */ /* value */ /* _(INT16 *) index: optimum PitLagTab7b */ /*--------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------*/ /* RETURN */ /* _ (INT16) PITi : pitch */ */========================================================== =========*/ INT16 PIT_FinePitch (INT16 bitrate, INT16 low_pit, INT16 high_pit, FLOAT64 res[].

INT16 L_r, FLOAT64 Delay_pp, FLOAT64 *Rp_max, FLOAT64 *pitchf, INT16 *index) /*/ FLOAT64 MaxR, x, y, z, R [ (20+2*SINCLIMIT)] ; INT16 i0, i, LowL, HighL, L-R, PITi, L, Pi, P2 ; /*--------------------------------------------*/ /* Determine the */

/*--------------------------------------------*/ LowL = owpit-SINCLIMIT-2 ; HighL = high_pit + SINCJLIMIT + 2; LR = HighL-LowL + 1; /*--------------------------------------------*/ L =LFRM/2 ; i0 = Lr-L/2 ; dot dvector (res+iO, res+iO, &x, 0, L-1); for (i = LowL; i <= HighL ; i++) { dot dvector (res+iO-i, res+iO-i, &y, 0, L-1); dot dvector (res+iO, res+iO-i, &z, 0, L-1) ; R [i-LowL] = z/sqrt (MAX (x*y, 0.; } /*--------------------------------------------*/ /* Searching for integer */ /*--------------------------------------------*/ PITi = low_pit ; MaxR = R [low_pit-LowL] ; for (i = low_pit+l ; i <= high_pit ; i++) if (R[i-lowL] > MaxR) { PITi = i; MaxR = R [i-LowL] ; if (bitrate==RATE85K) // /* Search for the best precise pitch and */ /*--------------------------------------------*/

PI = LTP_lag_to_idx8b ((double) (PITi-1.0)); P2 = LTP_lag_to_idx8b ((double) (PITi+1.0)); LTPFineIndexsearch (PitLagTab8b, P1, P2, LowL, L_R, R, index) ; /*--------------------------------------------*/ <BR> <BR> <BR> <BR> /* Estimate Rp_max */<BR> <BR> <BR> <BR> <BR> // PITi = (INT16) (PitLagTab8b [*index] +0.5-LowL); (*Rp_maX) = R [PITi] ; PITi = (INT16) (PitLagTab8b [*index] +0.5); /*--------------------------------------------*/ <BR> <BR> <BR> <BR> /* Modifypitch */<BR> <BR> <BR> <BR> <BR> /*----------------------*/ if (Delay_pp > 10) (*index) = MIN ((*index)+1, MAX_PIT_IDX_8b) ; if (Delay pp <-10) (*index) = MAX ( (*index)-1, 0) ; if (Delay_pp > 15) (*index) = MIN ( (*index) +l, MAXPITIDX8b) ; if (DelayJp<-15) (*index) = MAX ( (*index)-1, 0); (*pitchf) = PitLagTab8b [ (*index)] ; PITi = (INT16) MIN (*pitchf+0. 5, high pit) ; else { // /* Search for the best precise pitch and */ /*--------------------------------------------*/ PI = LTP_lag_to_idx7b((FLOAT64) (PITi-1.0)); P2 = LTP_lag_to_idx7b((FLOAT64) (PITi+1.0)); LTP_FineIndex_search (PitLagTab7b, PI, P2, LowL, L_R, R, index);

/*--------------------------------------------*/ Estimate Rp_max /*--------------------------------------------*/ PITi = (INT16) (PitLagTab7b[*index] + 0.5-LowL); (*Rp_max) = R [PITi] ; PITi = (INT16) (PitLagTab7b [*index] + 0.5); /*--------------------------------------------*/ /* Modify pitch */ // if (Delay_pp > 10) (*index) = MIN ((*index)+, MAX_PIT_IDX_7b) ; if (Delay pp <-10) (*index) = MAX ( (*index)-1,0); (*pitchf) = PitLagTab7b [ (*index)] ; PITi = (INT16) MIN (*pitchf+0. 5, high_pit) ; /*--------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> return PITi ;<BR> return PITi; /*--------------------------------------------*/ } /*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PIT_PitchInterpolat (). */ /*--------------------------------------------*/ /* PURPOSE: This function calculate the interpolated */ /* track. */

/*--------------------------------------------*/ /* INPUT */ /* _ (FLOAT64) pitch: current pitch */ /* _ (FLOAT64) pitch_l : previous frame (n-1) */ /* (FLOAT64) pitch2 : previous frame (n-2) */ /* _(INT16 ) enc_flag : signals encoder (=1) or decoder*/ /* (=0) */ /*--------------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 []) ForPitch: interpolated pitch */ /*--------------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ // /* RETURN */ /* None. */ void PIT_PitchIntcrpolat (FLOAT64 pitch, FLOAT64 pitch_mem [], FLOAT64 ForPitch [], INT16 enc_flag) /___________________________________________________________ ________*/ INT16 i: FLOAT64 pitch_mean; /*--------------------------------------------*/ pitchamean = (pitch_mem [1] + pitch) *0.5; /*--------------------------------------------*/ if ( (fabs (pitchmem [0]-pitch) < 0.2*0.5* (pitch_mem [0] + pitch)) || (fabs(pitch_mem [0]-pitch_mean) < 0.15*pitch_mem [0])) { for (i = 0; i < LFRM ; i++) ForPitch [i] = (i*pitch+ (LFRM-i) *pitchmem [0])/LFRM ; if (enc-flag == 1) for (i = 0 ; i < L_FRM/2 ; i++) ForPitch [i + L_FRM] = pitch;

} else if (enc flag == 1) for (i = 0 ; i < LFRM+LFRM/2 ; i++) ForPitch [i] = pitch; else for (i = 0; i < LFRM ; i++) ForPitch [i] = pitch; // return; // /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : PIT_pitch_track_recons (). */ /*--------------------------------------------*/ /* PURPOSE: This function reconstruct the pitch track */ /* case of frame */ /*--------------------------------------------*/ /* INPUT */ /* _ (INT16) fix rate m : previous frame fixed */ /* _ (INT16) bfi: frame # n Bad Frame */ /* _ (INT16) past bfi : frame &num n-l Bad Frame */ /* (INT16) ppastbfi: frame &num n-2 Bad Frame */ /* _ (FLOAT64 []) lag f : decoded pitch lags */ /* (INT16)SVSdecim : frame # n-1 mode */ /* _ (FLOAT64 **) qua_gainQ : adaptive and fixed codebook */ /* _ (parameter) channel: decoded parameters indexes */ /*--------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) pitchf: extrapolated pitch value. */ /* (FLOAT64 *) ForPitchdecTEMP: interpolated pitch */ /*--------------------------------------------*/

/* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) pitch f mem : past pitch */ /*--------------------------------------------*/ /* RETURN ARGUMENTS : @ */ /* None.

/*======================================================= ============*/ void Pnpitchtrackrecons (INT16 fixratem, INT16 bfi, INT16 past_bfi, INT16 ppastbfi, FLOAT64 lag_f[], INT16 SVS deci m, FLOAT64 **qua_gainQ, PARAMETER channel, FLOAT64 *pitchf, FLOAT64 pitch-f mem FLOAT64 ForPitchdecTEMP []) // FLOAT64 temp_lagf; /*--------------------------------------------*/ if ((bfi == 0) && ((ppast_bfi == 1) || (past_bfi == 0))) pitch_index = channel. idx_pitch [0] ; pitch f mem [1] = pitch_f_mem [0] ; pitch f mem [0] = (*pitchf) ; if (channel.fix_rate==RATE8_5K) (*pitchf) = PitLagTab8b [pitch index] ; else ("'pitchf) = PitLagTab7b [pitch_index]; if ((fix_rate_m == RATE2_0K) || (fix_rate_m == RATE0_8K)) pitch fmem [1] = (*pitchf) ; pitch_f_mem [0] = (*pitchf); else if (SVSdecim==0) if (fix_rate_m @= RATE8_5K) {

pitch f mem [1] = lag_f[N_SF2-1] ; pitch_f_mem [0] = lag_f[N_SF2-1]; else { pitch_f_mem [1] = lag_f[N_SF4-1]; pitch_f_mem [0] = lag_f[N_SF4-1]; } } } else { if ((bfi == 0) && (ppast_bfi == 0) && (past bfi == 1)) { if ((fix_rate_m == RATE2_0K) || (fix_rate_m == RATE0_8K)) { pitch f mem [1] = (*pitchf); pitch_f_mem [0] = (*pitchf); } else if (SVS_deci_m == 0) { if (fix_rate_m != RATE8_5K) { pitch f mem [1] = lag_f SF2-1] ; pitch_f_mem [0] = lag_f[N_SF2-1]; else { pitch_f_mem [1] = lag_f[N_SF4-1]; pitch f mem [0] = lag SF4-1]; } } pitch index = channel. idx_pitch [0] ; if (channel. fiv rate == RATE85K) (*pitchf) = PitLagTab8b [pitch_index]; else (*pitchf) = PitLagTab7b [pitch index] ; temp_lagf = ((*pitchf) - pitch_f_mem [0])* 159.0 / 319.0

+ pitch fmem [0] ; if (SVSdecim==l) PIT_PitchInterpolat (temp_lagf, pitch_f_mem, ForPitch_decTEMP, 0); pitchfmem [1] = pitch_f_mem [0]; if ((SVSdecim == 1) 11 (qua_gainQ [0] [0] >= 0.6)) pitchfmem [0] = temptagf; } else { pitch_f mem [1] = pitch_f mem [0]; pitch_f_mem [0] = (*pitchf); } } /*--------------------------------------------*/ return; /*--------------------------------------------*/ } /*--------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> } /*----------------------END-------------------------*/ /*========================================================== =========*/

l === l /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------*/ /* ALL RIGHTS RESERVED */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* LIBRARY: lib_pit.h */ /*========================================================== =========*/ /*--------------------------------------------*/ /*-------------------FUNCTIONS--------------------*/ /___________________________________________________________ _________________*/ void PIT_init_lib (void); void PITLTCorrRmax (INT16, INT16, INT16, INT16, FLOAT64 [], INT16 *, FLOAT64*); void PITFirstPitchLag (INT16 *, FLOAT64 *, INT16 *, FLOAT64 *, *) ; INT16 PIT_PitchLagCorrect (INT16, INT16, INT16, INT16, INT16, *, INT16 *, FLOAT64 *); void PIT ol_2pitchs (FLOAT64 [], INT16, INT16 [], FLOAT64 0, INT16, INT16) ; INT16 PIT FinePitch (INT16, INT16, INT16, FLOAT64 [], INT16, FLOAT64, FLOAT64 *, FLOAT64 *, *) ; void PIT PitchInterpolat (FLOAT64, FLOAT64 [], FLOAT64 [], INT16);

void PIT_pitch_track_recons (INT16. INT16, INT16, INT16, FLOAT64 [], INT16, FLOAT64 **, PARAMETER, FLOAT64 *, FLOAT64 [], FLOAT64 []); /*========================================================== =========*/ /*-------------------END----------------------*/ /*========================================================== =========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*--------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> l = /* LIBRARY: lib_ppp.c */ /*========================================================== =========*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------------------*/<BR> <BR> <BR> <BR> <BR> /*--------------------------------INCLUDE------------------- --------------*/<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ &num include"typedef. h" #include"main. h" <BR> <BR> <BR> <BR> &num include"coiist. h"<BR> <BR> <BR> <BR> <BR> &num include"gputil. h" #include "ext_var.h" #include "lib_lpc.h" #include "lib_flt.h" #include "lib_ltp.h" &num include"lib_ppp.h" #ifdef DIAGNOSTICS #include "lib_dia.h" #endif

/*--------------------------------------------*/ /*--------------------FUNCTIONS--------------------*/ /*--------------------------------------------*/ /*===================================================== /* FUNCTION : PPP_init_lib (). */ /*--------------------------------------------*/ /* PURPOSE: This function initialise the global variables */ /* the library */ /*--------------------------------------------*/ /* INPUT : */ /* None. */ /*--------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ void PPP_init_lib (void) /*/ /* pitch_preproc */ /*--------------------------------------------*/ Delay_pp = 0.0; framec) assppm = 3; Last_Rp = 0.0; /*--------------------------------------------*/ return; /*--------------------------------------------*/ }

/*--------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PPP mapping residu Q. */ /*--------------------------------------------*/ /* PURPOSE: This function this subroutine maps the */ /* (from TO to T1) to modified */ /* (MapResidu [0,1,...., Len-1]). */ /*--------------------------------------------*/ /* INPUT */ /* (FLOAT64 []) Sinc : table of interpolation weights. */ /* _ (INT16) sinc limit : half interpolation table */ (INT16) len_sinc : interpolation table */ /* (FLOAT64 []) residu: number of */ /* _ (INT16) T0: Original starting time */ /* _ (INT16) T1: Original ending time */ /*--------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) MapResidu: mapped */ /*--------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*--------------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void PPP mapping residu (FLOAT64 sinc [], INT16 sinc_limit, INT16 Iensinc, FLOAT64 residu [], FLOAT64 T0, FLOAT64 TI, INT16 Len, FLOAT64 MapResidu []) { /*/ FLOAT64 *Weight ; FLOAT64 t, f, D; INT16 i, m, T; /*--------------------------------------------*/ D = (T1-T0)/(FLOAT64) Len;

if (fabs (D-1.0) > 0.0001) for (i = 0 ; i < Len; i++) { t = TO+i*D ; T = (INT16) t; f = t- (FLOAT64) T; m = (INT16) (f* (FLOAT64) DELT_F2+0, 500001); Weight = sinc + m*len_sinc ; MapResidu [i] = D2Ainterp (Weight, residu, LOLPIT, t, sinclimit) ; else { T = (INT16) TO ; f = TO- (FLOAT64) T; m = (INT16) (f* (FLOAT64)DELT_F2+0. 500001); Weight = sinc + m*len_sinc; for (i = 0; i < Len; i++) t = TO + i ; MapResidu [il = D2Ainterp (Weight, residu, LOLPIT, t, sinc_limit); } } /___________________________________________________________ ________*/ return; /___________________________________________________________ ________*/ } /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : PPP_update_LT_mem (). */

/*--------------------------------------------*/ /* PURPOSE: This function updates the excitation */ /*--------------------------------------------*/ /* INPUT */ /* (FLOAT64 []) LTm: table of interpolation */ /*- (INT16) L LTm: excitation memory */ /* (INT16) LE: new excitation memory */ /*--------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _(FLOAT64 []) E: new */ /*--------------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*/ /* RETURN ARGUMENTS */ /* None. */ void PPP update LT mem (INT16 L LTm, FLOAT64 LTm [], INT16 L E, FLOAT64 E0) <BR> <BR> <BR> {<BR> // INT16 j; INT16 j; /*--------------------------------------------*/ for (j = 0; j < L_LTm-L_E; j++) LTm[j] = LTm [j+LE] ; /*--------------------------------------------*/ cpydvector (E, LTm+LLTm-LE, 0, LE-1); /*--------------------------------------------*/ return ; //

/*--------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> */============================================== /* FUNCTION : PPP_search_shift_pp () */ /*--------------------------------------------*/ /*PURPOSE : This function find the first sub-optimal shiR */ /* by maximising the intercorrelation between the */ /* target signal and the input */ /*--------------------------------------------*/ /* INPUT */ /* (FLOAT64 []) residu: original */ /* _ (INT16) T0: original starting time */ /* (INT16) i0 : starting index for the intercorr. */ /* _(INT16 ) il: ending index for the */ /* _(INT16 ) Len: input signal length. */ /* _ (FLOAT64 Q) Tg: target signal. */ // /* OUTPUT ARGUMENTS */ /* _(FLOAT64 *) Shift : optimum shift. */ /* _(FLOAT64 *) MaxRp: maximum intercorrelation */ /*--------------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ <BR> <BR> <BR> <BR> <BR> <BR> void PPPsearchshiftpp (FLOAT64 residu [], FLOAT64 TO, INT16 iO, INT16 il,<BR> <BR> <BR> <BR> <BR> INT16 Len, FLOAT64 Tg [], FLOAT64 *Shift, FLOAT64 *MaxRp)<BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> /*---------------------------------------------------------- --------- INT16 L, i, i00, ill, iOL, ilH, t0, Iopt, Idx, L_R; FLOAT64 R, R1, R2, crit, Rp [20+2*SINCLIMIT], DifTab [MAX_DIF_TAB], ShiftRes [MAX_L_TG+301, TT1, TTO ; /*--------------------------------------------*/

(*Shift = 0 ; lopt = 0; dot dvector (Tg, Tg, &R1, 0, Len-1) ; iOO = i0 - SING_LIMIT - 1 ; ill = il + SINC_LIMIT + 1; TT0 = T0 + i00; TT1=TO+ill+Len+1 ; L=ill +Len+ 1-iOO ; /*----------------------------------------------*/ PPPmappingresidu (SincWindowsPP, SINCLIMITPP, LENSINCPP, residu, TTO, TT1, L, ShiftRes); for (i = i0; i <= il; i++) t0 = i-i00 ; dot dvector (Tg, ShiftRes+tO, &R, 0, Len-1) ; dot dvector (ShiftRes+tO, ShiftRes+tO, &R2, Len-1) ; Rp [i-i00] = R/sqrt (MAX (0, 001, R2*R1)) ; crit=Rp [i-iOO] ; if (crit > (*MaxRp)) { (*MaxRp) = crit ; (*Shift) = i; Iopt = i ; } /*----------------------------------------------*/ /* Additional */ /*----------------------------------------------*/ iOL = lopt - SINC_LIMIT - 1 ; ilH = Iopt + SINCLIMIT + 1; for (i = iOL; i < iO ; i++) tO = i-iOO ; dot dvector (Tg, ShiftRes+tO, &R, 0, Len-1) ; dot dvector (ShiftRes+tO, ShiftRes+tO, &R2, Len-1) ;

Rp[i-i00] = R/sqrt(MAX(0. 001, R2*Rl)) ; } for (i = il+1 ; i <= ilH ; i++) { t0=i-i00 ; dot dvector (Tg, ShiftRes+tO, &R, 0, Len-1) ; dot_dvector (ShiftRes+t0, ShiftRes+t0, &R2, Len-1) ; Rp [i-i00] = R/sqrt (MAX (0. 001, R2*R1)) ; <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*---------------------*/ /* Fractional search of the */ /*--*/ for (i = 0 ; i < MAX_DIF_TAB ; i++) DifTab [i] = Iopt-0. 75 + 0. 1*i ; &num ifdefPROGBUGFIX LR=ilH-iOO ; #else L_R = i1H - i0L + 1; #endif LTP_FineIndex_search (DifTab, 0, MAX_DIF_TAB-1, i00, L_R, Rp, &Idx); (*Shift) = DifTab [Idx] ; i = (INT16) (DifTab [Idx] + 0.; (*MaxRp) = MAX (Rp [i], 0) ; /*--------------------------------------------*/ return; /*--------------------------------------------*/ } /*/ /*========================================================== =========*/

/* FUNCTION : PPPsearchoptshiftpp (). */ /*--------------------------------------------*/ /* PURPOSE : This function find the optimal shift */ /* maximising the intercorrelation between the */ /* target signal and the input signal. And if */ /* procedure"fails"the waveform interpolation */ /* performed. */ /*--------------------------------------------*/ /* INPUT */ /* _(INT16 ) frame_class : class of the current */ /* _(FLOAT64 ) PitLag: current pitch lag. */ /* (FLOAT64 []) residu : original */ /* _ (INT16) T0 : starting time */ /* _(INT16 ) Center: segment */ /* (INT16) Isf : sub-frame */ /* (INT16) L_Tg : target */ /* (FLOAT64 []) Tg: target */ /* _(INT16 ) SRCH0 : starting index for max */ /* search. */ /* _(INT16 ) SRCH1 : ending index for max intercorr. */ /* search. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) MapResOpt: wrapped signal. */ /* _(FLOAT64 *) Delay: optimum */ /* _ (FLOAT64 *) Rp_Opt : maximum intercorrelation */ /*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PPPsearch optshiftpp (INT16 frameclass, FLOAT64 PitLag, FLOAT64 residu [], FLOAT64 T0, INT16 Center, INT16 1_sf, INT16 L_Tg, FLOAT64 Tg[], FLOAT64 MapResOpt [], INT16 SRCHO, INT16 SRCH1, FLOAT64 *Delay, FLOAT64 *Rp_Opt) //

FLOAT64 Shift, CRITmax, TT0, T1; FLOAT64 Tgm[MAXLTG] ; INT16 i; /*----------------------------------------------*/ /* Search of the */ /*----------------------------------------------*/ if (frame class >= 3) { CRITmax = 0.3; for (i = 0; i < Center ; i++) Tg_m [i] = (0.25 + 0. *Tg [i]; else CRITmax = 0.4; for (i = 0; i < Center; i++) Tg_m li] = (0.5 + 0.5*i/Center) *Tg [i]; cpy_dvector (Tg, Tgm, Center, L Tg-1) ; PPPsearchshiftpp (residu, TO, SRCHO, SRCHI, LTg, Tgm, &Shift, &CRITmax); (*Delay) = Shift ; (*Rp_Opt) = CRITmax ; <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> /* Wrapped residual */ /*----------------------------------------------*/ T1 = TO + Center + Shift ; PPP_mapping_residu (SincWindows-E, SINC-LMT-E, LEN-SINC-E, residu, T0, Tl, Center, MapResOpt);

if (L_Tg > Center) TTO = T1; T1 = TTO + L_Tg-Center ; PPPmappingresidu(SincWindowsE,SINCLIMITE,LENSINCE, residu, TT0, T1, (INT16) (L Tg-Center), (MapResOpt + Center)); } return ; /*----------------------------------------------*/ } /*----------------------------------------------*/ } /* FUNCTION : PPP_periodicity_detect 0. */ /*/ /* PURPOSE: This function estimate the level of */ /* of the input signal and calculate the */ /* crosscorrelation */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) TgO: target */ /* _ (INT16) L ModiSig: size of the modified */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) Gp: optimum shift. */ /* _ (FLOAT64 *) Rp: normalized crosscorrelation factor. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) ModiSigO: modified */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PPP_periodicity_detect (FLOAT64 ModiSigO [], FLOAT64 TgO [], INT16 LModiSig,

FLOAT64 *Gp, FLOAT64 *Rp, INT16 smv_mode, FLOAT64 nsr) /___________________________________________________________ ________*/ FLOAT64 R0, R1, R2, R3; FLOAT64 Tg[MAX_L_TG], Modisig[MAX_L_TG]; INT16 i; /*----------------------------------------------*/ dot dvector (ModiSigO, ModiSigO, &R0, 0, L ModiSig-1) ; cpy_dvector (TgO, Tg, 0, L ModiSig-1) ; cpy_dvector (ModiSigO, ModiSig, 0, L ModiSig-1) ; dot dvector (ModiSig, Tg, &R1, 0, L ModiSig-1) ; dot_dvector (Tg, Tg, &R2,0, L ModiSig-1) ; dot dvector (ModiSig, ModiSig, &R3,0, L ModiSig-1) ; (*Gp) = R1/MAX (R2,0.; (*Rp) = R1/sqrt (MAX (0. 1, R2*R3)); /*----------------------------------------------*/ if ( (*Rp) > 0. 5) { if (smv_mode >= 1) R1 = MIN (nsr*4 + 0.25,0.4) * MIN ( (*Gp), 1.0); else R1 = MIN (nsr*4 + 0. 125,0.25) * MIN ( (*Gp), 1.0); for (i = 0; i < L ModiSig ; i++) ModiSigO [i] += RI * Tg0[i] ; dot dvector (ModiSigO, ModiSigO, &R3,0, L ModiSig-1) ; R2 = sqrt (RO/MAX (R3,0.0001)); for (i = 0; i < L ModiSig ; i++) ModiSigO [i] *= R2;

/*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /_/ /*========================================================== =========*/ /* FUNCTION : PPP sharpness Q. */ /*----------------------------------------------*/ /* PURPOSE : This function estimate the sharpeness of */ input signal.

/*----------------------------------------------*/ /* INPUT */ /*- (INT16) Len : size of the input */ /* _ (FLOAT64 []) res: target */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS : */ /* None. */ /___________________________________________________________ ________*/ /* RETURN ARGUMENTS */ /* _(FLOAT64 ) P_SHP : sharpness */ /*========================================================== =========*/ FLOAT64 PPP sharpness (INT16 len, FLOAT64 resn) { /*/ FLOAT64 Max, E x, M, PSHP ; INT16 i; /*----------------------------------------------*/

Ex = 0.0; Max = 0.0; for (i = 0 ; i < len ; i++) { M = fabs (res [i]) ; Ex += M ; if(M > Max) Max = M ; P_SHP = E_x/(len * MAX (1. 0, Max)); /*/ return (P_SHP) ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /* FUNCTION : PPP_locat_max_puls (). */ // /* PURPOSE : This function locate the peak of energy into */ /* pitch period. */ /*----------------------------------------------*/ /* INPUT */ /* _ (FLOAT64 []) Res: input signal. */ /* _(INT16 ) Start: starting */ /* (INT16) End: ending */ /* (INT16) npeak : number of */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _(INT16 *) PulsLoc : pulse */ /* (FLOAT64 *) PeakRatio : ration between the peak energy */ /* signal */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */

/*----------------------------------------------*/ /* RETURN ARGUMENTS : */ /* None. l = void PPP_locat_max_puls (FLOAT64 Res [], INT16 Start, INT16 End, INT16 n_peak, INT16 *PulsLoc, FLOAT64 *PeakRatio) <BR> f<BR> { FLOAT64 Eng, MaxEng [MAX_PULS_NUM], AvgEng; INT16 i, k, Loc, PulsLocat[MAX_NUM] ; /*/ for (k = 0; k < n_peak ; k++) PulsLocat [k] = Start; Eng = 0 ; for (k =-HALFP; k <= HALFP ; k++) Eng += Res [Start+k] *Res [Start+kl ; AvgEng =Eng; for (k = 0; k < n_peak ; k++) MaxEng [k] = Eng; /*----------------------------------------------*/ for (i = Start+1 ; i <= End; i++) { Eng = 0. 0; for (k =-HALFP; k <= HALFP; k++) Eng += Res [i+k] *Res [i+k] ; if (Eng < 4*AvgEng) AvgEng = 0. + 0.125*Eng; if (Eng > MaxEng [0]) { MaxEng [0] = Eng; PulsLocat [0] = i; for (k = 1 ; k < n_peak ; k++) if (MaxEng [k-1] > MaxEng [k])

{ Eng = MaxEng [k]; MaxEng[k] = MaxEng[k-1]; MaxEng [k-l] = Eng; Loc = PulsLocat [k] ; PulsLocat [k] = PulsLocat[k-1]; PulsLocat[k-1] = Loc; /*----------------------------------------------*/ Loc = PulsLocat[n_peak-1]; Eng = MaxEng [npeak-l] ; for (k = n_peak-2 ; k >= 0; k--) if ( (MaxEng [k] > 0.75*MaxEng [n_peak-l]) && (AvgEng/MAX (MaxEng [k], 0. 1) < 1/9.0)) Loc = PulsLocat [k]; Eng = MaxEng[k]; break; (*PulsLoc) = Loc ; (*PeakRatio) = AvgEng/MAX (Eng, 0.1); /*----------------------------------------------*/ return ; /*----------------------------------------------*/ /___________________________________________________________ _________________*/ /*========================================================== =========*/ /* FUNCTION : PPP_pitch_preproc (). */ /*----------------------------------------------*/

/* PURPOSE : This function perform the pitch modify the input */ /* signal in order to improve the LTP */ /* and without introducing perceptually */ /* distortions. */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) smv mode : selected SMV */ /* _ (INT16) fiv rate : selected fixed */ /* _ (INT16) flat flag : flat input speech */ /* _ (FLOAT64) nsr: estim. noise to signal */ /* _ (FLOAT64 []) wspeech : input */ /* _ (FLOAT64 ForPitch : forward pitch */ /* (INT16) frameclasspp : class of the current frame */ /* picth preprocessing. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) ModiSig : modified */ /* _(FLOAT64 *) Delay_pp : pitch pre-processing delay. */ /* _ (INT16 *) frame class : class of the current */ /* _(INT16 @*) VUV : voice unvoice */ /* (INT16 []) gp: Pitch */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None.

/___________________________________________________________ ________*/ /* RETURN */ /* None. void PPP_pitch_preproc (INT16 smv_mode, INT16 fix_rate, INT16 flat_flag.

FLOAT64 nsr, FLOAT64 wspeech[], FLOAT64 ModiSig[], FLOAT64 ForPitch [], FLOAT64 *Delay pp, INT16 frameclasspp, INT16 *frameclass, INT16 *VUV, FLOAT64 gp []) /___________________________________________________________ ________*/ INT16 i0, i, is, LTg, L, lsf. Center; FLOAT64 T0, T1, Delay, Delay_tmp, P_SHP, P_SHP_Tg, Rp_Opt ; FLOAT64 LTm [MAX LAG+MAXLTG], Tg [MAXLTG], PitFunc FRM+L_FRM/2];

FLOAT64 ModiRes [MAXLTG], INT16 SRCHO, SRCH1, StartPoint, EndPoint, LocPuls, PulsLen ; INT16 cond abs, cond0, condl, cond2, cond3, cond; FLOAT64 ltp_gain=0, pit_corr=0, avg_Rp, min_Rp; FLOAT64 Rp SF4] = {0. 0} ; /*----------------------------------------------*/ Delay_tmp = (*Delay_pp) ; if ((Frame_class_pp <= 0) || (frm_count == 1)) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> /*----.-----.-.----------*/ /* Reset of the */ /*----------------------------------------------*/ if (frame_class_pp == -1) Delay tmp = 0; TO = LOLPIT-LLPCLHD-LFRM + Delay_tmp ; T1 = T0 + L_FRM; PPPmappingresidu (SincWindowsE, SINCLIMIT E, LENSINCE, wspeech,T0, T1, L_FRM, ModiSig); /*----------------------------------------------*/ /* Memorize the wspeech */ /*----------------------------------------------*/ PPP_update_LT_mem (MAX_LAG, targ_mem, L_FRM, ModiSig); ) tpgain= 0. pit corr= 0.0; avg Rp = 0.0; min Rp = 1; inidvector (gp, 0, N_SF4-1, 0.0); inidvector (Rp, 0, N_SF4-1, 0.0); } else iO = 0 ;

is=0 ; inidvector (gp, 0, N_SF4 - 1, 0.0); inidvector (Rp, 0, N_SF4 - 1, 0.0); avg_Rp = 0.0; min_Rp 1.0; while (iO < L_FRM) // /* Determine some */ /*----------------------------------------------*/ /*/ /* Pulse Length */ // PulsLen = (INT16) MAX (ForPitch [iO] *0.2,5); PuIsLen = MIN (PulsLen, 30); /*----------------------------------------------*/ /* Peak */ /*----------------------------------------------*/ /*----------------------------------------------*/ /* Starting point on the original */ /*----------------------------------------------*/ TO = L_OLPIT - L_LPCLHD - L_FRM + iO + Delaytmp ; StartPoint = (INT16) TO ; EndPoint = (INT16) MIN (StartPoint + ForPitch [iO], LOLPIT-8-SINCL1MIT) ; PPP_locat_max_puls (wspeech, StartPoint, EndPoint, 1, &LocPuls, &P_SHP) ; if ((i0 == 0) && (LocPuls < PulsLen + TO)) LocPuls = (INT16) (PulsLen + TO);

/*----------------------------------------------*/ /* Searching */ /*----------------------------------------------*/ I_sf = (INT16) MIN (LocPuls-TO + PulsLen, LFRM-iO) ; L_Tg = (INT16) (LocPuls-TO + 2*PulsLen) ; if (LocPuls + ForPitch [iO] * 1. 25 > LOLPIT-LLPCLHD + Delay_tmp) StartPoint = (INT16) (LocPuls + ForPitch [iO] *0.5); EndPoint = (INT16) MIN (StartPoint+ForPitch [iO], L_OLPIT - 8 - SINC_LIMIT); PPP_locat_max_puls (wspeech, StartPoint, EndPoint, 1, &L, &P_SHP if (L > LOLPIT-LLPCLHD + Delay_tmp) I sf = L FRM-i0 ; L Tg = (INT16) MAX (lsf, LocPuls-TO + 2*PulsLen) ; } SRCH1 = 5; L = LFRM-iO + MAX (0, LLPCLHD- (INT16) Delay_tmp- SINCLIMITE-SRCH1) ; L_Tg = MIN(L_Tg, L); L_Tg = MIN (LTg, MAXLTG) ; Center = (INT16) MAX (LocPuls-TO-PulsLen, PulsLen/2) ; Center = MIN (1_sf, Center); /*----------------------------------------------*/ /* Calculate the target: Tg [0,.., L_Tg-1], for */ /* wspeech modification */ /*----------------------------------------------*/ cpy_dvector (targ_mem, LTm, 0, MAX_LAG-1) ; L = MIN (L-Tg, LFRM-iO + LFRM/2) ; cpy_dvector (ForPitch + i0, PitFunc, 0, L-1) ; ini dvector (PitFunc, L, L_Tg-l, PitFunc [L-l]) ;

LTPexcitvaripitch (SincWindowsE, LENSINCE, SINC_LIMIT_E, PitFunc, MAX_LAG, LTm, L_Tg, Tg); /*----------------------------------------------*/ /* Searching */ /*----------------------------------------------*/ /*----------------------------------------------*/ /* Peakness */ // StartPoint = (INT16) (LocPuls-ForPitch [iO] *0.5); EndPoint = (INT16) MIN (StartPoint + ForPitch [iO], L_LOPIT - 8 - SINC_LIMIT); PPP_locat_max_plus (wspeech, StartPoint, EndPoint, 1, &L, &PSHP) ; PPP_locat_max_puls (Tg, (INT16) (HALFP+1), (INT16) (L_Tg-HALFP-1), (INT16) 1, &L, &PSHPTg) ; /*----------------------------------------------*/ /* Search */ // SRCHl=MAX (MIN (Center*0. 075 + 0.5, SRCH1), 1) ; SRCHO =-SRCH1 ; /*----------------------------------------------*/ /* Influence ofPSHP */ /*----------------------------------------------*/ if (P_SHP > 1/4.0) { SRCH1 = MIN(SRCH1, 3); SRCHO = MAX (SRCHO,-3) ; } else if (P_SHP > 1/12.0)

{ SRCH1 = MIN(SRCH1, 4) ;.

SRCHO = MAX (SRCHO,-4) ; /*----------------------------------------------*/ /* Influence of P_SHP_Tg */ /*/ if (framec ! asspp >= 3) L=4 ; else L 3 ; if (P_SHP_Tg > 1/3.0) { SRCH1 = MIN (SRCH1, L); SRCHO = MAX (SRCHO,-L) ; } else if (P_SHP_Tg > 1/6.0) SRCH1 = MIN (SRCH1, (L+1)) ; SRCHO = MAX (SRCHO,- (L+1)) ; /*----------------------------------------------*/ Influence of LocPuls and non-voiced */ /*----------------------------------------------*/ if ((L_Tg < LocPuls-TO-HALFP) 11 (ForPitch [iO] < 25) II (LocPuls <= PulsLen + TO)) { if (P_SHP > 1/4.0) SRCH1 = MIN(SRCH1, 1); SRCHO = MAX (SRCHO,-1) ; else SRCH1 = MIN(SRCH1, 2);

SRCHO = MAX (SRCHO,-2) ; } } /*----------------------------------------------*/ /* Influence of Delay_tmp */ /*----------------------------------------------*/ if (Delay_tmp > 5) SRCH1 = MIN (SRCH1, 4); if (Delay_tmp > 10) SRCH1 = MIN (SRCH1, 2); if (Delay_tmp > 15) SRCH1 = 0; if (Delay_tmp <-5) SRCHO = MAX (SRCHO,-4) ; if (Delay_tmp <-10) SRCHO = MAX (SRCHO,-2) ; if (Delay_tmp <-15) SRCHO = 0; /*----------------------------------------------*/ /* Searching for the best delay */ /*----------------------------------------------*/ PPP_search_opt_shift_pp (frame_class_pp, ForPitch[i0+1_sf-1], wspeech, TO, Center, 1_sf, L_Tg, Tg, ModiRes, SRCH0, SRCH1, &Delay, &Rp_Opt) ; /*----------------------------------------------*/ /* Determine the delay at the end point: ModiRes [l_sq /*----------------------------------------------*/ if (Center > I_sf) Delay *= (FLOAT64)1_sf/(FLOAT64) Center; Delay = Delay tmp + Delay ;

if (fabs (Delay) > MAXDELAY) #ifdef VERBOSE if (frame_class_pp >= 3) printf ("Danger!! !, Delay_tmp>MAX DELAY \n") ; else printf ("Danger!!!!, Delay_tmp>MAX_DELAY\n"); #endif T1 = T0 + L_Tg; PPPmapping residu (SincWindowsE, SINCLIMITE, LENSINCE, wspeech, TO,Tl, L_Tg, ModiRes); else Delay_tmp = Delay; /*----------------------------------------------*/ /* Memorize the modified */ /*----------------------------------------------*/ PPP update LT mem (MAX LAG, targ mem, I sf, ModiRes); /*----------------------------------------------*/ /* Periodicity */ /*----------------------------------------------*/ PPP_periodicity_detect (ModiRes, Tg, L_Tg, &Itp_gain, &pitcorr, smvmode, nsr); cpy_dvector (ModiRes, ModiSig+iO, 0, 1_sf-1) ; if (((P_SHP < 1.0/30) II (Itp_gain > 0.7) || (pit_corr > 0.6)) && (L_Tg > LocPuls-TO + HALFP) &&((*VUV) == 2)) (*VUV) = 3 ;

if (pit_corr < min_Rp) min_Rp = pit_corr; pit corr = MAX (pit corr, 0.0); avg_Rp += pit_corr*1_sf; /*----------------------------------------------*/ if (fix_rate == RATE8_5K) for (i=0 ; i < NSF4 ; i++) { L = MIN(i0 + 1_sf, (i+1)*L+SF4) - MAX(i0, i*L_SF4); gp [i] += Itp_gain*MAX (L, 0) ; Rp [i] += pitcorr*MAX (L, 0) ; } } else for (i=0 ; i<NSF3 ; i++) { L = MIN(i0 + 1_sf, (i+1)*L+SF0) - MAX(i0, i*L_SF0); gp [i] += ltp_gain*MAX (L, 0); Rp [i] += pit_corr*MAX (L, 0); } i0 + = 1_sf; } /*/ /* Classification and output LTP */ <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> avg_Rp @= L_FRM;

if (fix_rate == RATE8_5K) { /___________________________________________________________ */ /* RATE 8.5 kbit/s */ /___________________________________________________________ */ /*----------------------------------------------*/ /* gains */ @ /*----------------------------------------------*/ for (i = 0; i < N-SF4 ; i++) Rp [i]/= LSF4 ; for (i = 0; i < NSF4 ; i++) gp [i]/= LSF4 ; if (flat_flag == 1) { for (i = 0; i < NSF4 ; i++) gp [i] = MAX (MIN (gp [i] * (0.75+0.25*Rp [i]), 1.2), 0); else for (i = 0; i < NSF4 ; i++) gp [i] = MAX (MIN (gp [i] * (0.7+0. 3*avg_Rp), 1.2), 0); /*----------------------------------------------*/ /* Correct */ // if ((Last_Rp > 0. 6) && (avg_Rp > 0.6) && (frame_class_pp > 0)) Itp_gain = (gp [0] + gp [l] + gp [2] + gp [3])/4. 0; condO = (fabs (gp [0]-ltp_gain) < 0.25); condl = (fabs (gp [l]-ltp_gain) < 0.25); cond2 = (fabs (gp [2]-ltp_gain) < 0.25); cond3 = (fabs (gp [3]-ltp_gain) < 0.25);

cond abs = condO && condl && cond2 && cond3 condO = (gp [0] > 0.5); condl = (gp [1] > 0.5); cond2 = (gp [2] > 0.5); cond3 = (gp [3] > 0. 5); cond = condO && condl && cond2 && cond3 if ( (cond abs == 1) && (cond == 1) && (ltp_gain > 0.5) && (min Rp > 0.5)) (*frame class) = 6; condO = (Rp [0] > 0.75); condl = (Rp[1] > 0.75); cond2 = (Rp [2] > 0.75); cond3 = (Rp [3] > 0.75); cond = condO && condl && cond2 && cond3 if ((ltp_gain > 0.5) && (cond == 1)) (*frame class) = 6; } Last_Rp = Rp [N_SF4-1] ; else <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> else /* 4.0 kbitls */ <BR> <BR> <BR> <BR> //<BR> // gains /* gains */ /*----------------------------------------------*/ for (i = 0; i < N_SF3; i++) Rp [i]/= LSFO ;

for (i = 0 ; i<NSF3 ; i++) gp [i]/= LSFO ; for (i = 0 ; i < NSF4 ; i++) gp [i] = MAX (MIN (gp [i] * (0.75+0.25*Rp [i]), 1.2), 0); ltp_gain = (gp [O] + gp [l] + gp [2])/3. 0; /*----------------------------------------------*/ /* Correct */ /*----------------------------------------------*/ if ((avg_Rp > 0.6) && (framectasspp > 0)) { condO = (fabs (gp [O]-ltp_gain) < 0.25); condl = (fabs (gp [l]-ltp_gain) < 0.25); cond2 = (fabs (gp [2]-ltp_gain) < 0.25); condabs = condO && condl && cond2; condO = (gp [0] > 0.4); condl = (gp [l] > 0.4); cond2 = (gp [2] > 0.4); cond = condO && condl && cond2; if ( (cond abs == 1) && (cond == 1) && (Itp_gain > 0.5) && (min_Rp > 0.4)) (*frame class) = 6; } Last_Rp = Rp[N_SF3-1]; } /* Reset the delay */ // (*Delay_pp) = Delay_tmp ;

frameclasspp m = frame classpp ; /*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /*========================================================== =========*/ /*--------------------END-------------------------*/ /*========================================================== =========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*----------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: lib_ppp. */ /*========================================================== =========*/ /*----------------------------------------------*/ /*--------------------------FUNCTIONS------------------*/ /*----------------------------------------------*/ void PPP init lib (void); void PPP mapping residu (FLOAT64 [], INT16, INT16, FLOAT64 U, FLOAT64, FLOAT64, INT16, []) ; void PPP update LT mem (INT16, FLOAT64 [], INT16, FLOAT64 []); void PPPsearchshiftpp (FLOAT64 [], FLOAT64, INT16, INT16, INT16, [], FLOAT64 *, FLOAT64 *); void PPPsearch optshiftpp (INT16, FLOAT64, FLOAT64 [], FLOAT64, INT16, INT16, INT16, FLOAT64 FLOAT64 INT16, INT16, FLOAT64 *, FLOAT64 *) ;

void PPP_periodicity_detect (FLOAT64 [], FLOAT64 [], INT16, FLOAT64 *, FLOAT64 *, INT16, FLOAT64); FLOAT64 PPP sharpness (INT16, FLOAT64 []) ; void PPP_locat_max_puls (FLOAT64 [], INT16, INT16, INT16, INT16 *, FLOAT64 *); voidPPP_pitch_preproc (INT16 smv_mode, INT16 fix_rate, INT16 flat_flag, FLOAT64 nsr, FLOAT64 wspeech [], FLOAT64 ModiSig [], FLOAT64 ForPitch [], FLOAT64 *Delay_pp, INT16 frame_class_pp, INT16 *frame class, INT16 *VUV, FLOAT64 gp []) ; <BR> <BR> /* END */ /*--------------------------END-------------------*/

/*========================================================== ==========================*/ /*========================================================== =========*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =============*/ /* LIBRARY : lib_ppr. */ <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------INCLUDE------------------- ----------------*/ /*-------------------INCLUDE------------------*/ /*----------------------------------------*/ #include "typedef.h" #include "main.h" &num include"const. h" #include "ext_var.h" #include"mcutil. h" #include"gputil. h" #include "lib_ppr.h" #include "lib_flt.h" &num include"lib lpc. h" &num include"lib_ltp. h" #include "lib_ppp.h" /*----------------------------------------------*/ /*-----------------FUNCTIONS-------------------------*/ // /*----------------------.-.-*/

/* FUNCTION PPR filters init */ /*----------------------------------------------*/ /* PURPOSE. This function performs the */ /* for the post and pre */ /*----------------------------------------------*/ /* INPUT ARGUMENTS /* None. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN */ /* None. */ void PPR_filters_init (void) { /*----------------------------------------------*/ INT16 i, 1 ; FLOAT64x; // /* Generate the window for Tilt */ // I = LLPC-LSF/3 ; for (i = 0 ; i < 1 ; i++) { x = cos (i*PI/ (FLOAT64) 1) ; tilt window [i] = 0.54-0.46 * x; } for (i = 1 ; i < L LPC ; i++) tilt_window [i] = cos ((i-1) *PI*0.; /*----------------------------------------------*/ /* Pre-processing High-pass */

/*----------------------------------------------*/ pre_flt_num [0] =-0. 92724705/0. 46363718; pre_flt_num [1] = +1. 00000000, pre flt den [0] =-1. 9059465; pre_flt_den [1] =+0.9114024; pre_gain = 0.46363718; /*----------------------------------------------*/ /* Tilt */ <BR> <BR> <BR> // tcmemdec = 0.0; tc_coeff= 0. 0; tcgain =1.0; <BR> <BR> <BR> <BR> <BR> <BR> // /* Post-processing */ /*----------------------------------------------*/ r_zero =0.57; r_pole = 0.75; pstscale = 1.0; pst_hp_mem = 0.0; /*----------------------------------------------*/ /* Post-processing */ /*----------------------------------------------*/ pst_flt_num [0] = -1.8544941/0.92727435; pst_flt_num [1] = +1.00000000, pstfltden [0] =-1. 9059465; pst_flt_den [1] = +0.9114024; pst_gain =0.92727435*2.0;

/*----------------------------------------------*/ return; // } /*========================================================== =========*/ /* FUNCTION PPRsilenceenhaninit 0 */ /*----------------------------------------------*/ /* PURPOSE : This function performs the */ /* for the silence enhancement in the */ /* frame */ // /* INPUT : */ /* None. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS : */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void PPR_silence_enhan_init(void) { /*----------------------------------------------*/ INT16 i; /*----------------------------------------------*/ /* Set-up the initial values */ // zero level = 8.0; min delta = 65534;

for (i = 0 ; i < SEMEMSIZE ; i++) zero_rate [i] = 0.0; low_rate [i] = 0.0; high rate [i] = 0.0; zeroed [i] = 1 ; 12 neg =-24.0; 11_neg = -8.0; 11_pos = 8.0; 12pos= 24.0; lowneg [0] =-32766. 0; low_neg [l] =-32767.0; low_pos [0] = 32767.0; low_pos [l] = 32768.0; /*----------------------------------------------*/ return; /*----------------------------------------------*/ // /*========================================================== =========*/ /* FUNCTION PPR_silence_enhan () */ /*------------------------*/ /* PURPOSE This function perfroms the enhancement of */ /* silence in the input */ // /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) x_in : input speech frame. */ /* _(INT16 ) N: speech frame */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) xout : output speech */ /*----------------------------------------------*/

/* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PPR silence enhan (FLOAT64 xin [], FLOAT64 xout [], INT16 N) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> { INT16 tmp; INT16 i, idlenoise ; INT16 condl, cond2, cond3, cond4; INT16 *hist; INT32 delta; FLOAT64 *min, *max; // hist = svector (0, SEHISSIZE-1) ; max = dvector (0,; min = dvector (0,1); /*/ /* Initialisation */ /*----------------------------------------------*/ min [0] = 32767.0; min [l] = 32766.0; max [0] =-32767. 0; max [1] = -32766. 0; /*----------------------------------------------*/ /* Loop on the input sample */ /*----------------------------------------------*/ for (i = 0; i < N; i++) { /*-------------------------------------------*/ tmp = (INT16) x_in [i];

/*----------------------------------------------*/ /* Find the 2 MAx values in the input frame */ /*----------------------------------------------*/ if (tmp > max[0]) { max [1] = max [0] ; max [0] = tmp ; } else if ( (tmp > max [l]) && (tmp < max [0])) max [l] = tmp ; /*-*/ /* Find the 2 Min values in the input frame */ /*----------------------------------------------*/ if (tmp < min[0]) f min [l] = min [0] ; min [0] = tmp ; } else if ( (tmp < min [l]) && (tmp > min [0])) min [1] = tmp ; /*----------------------------------------------*/ /* Find the 2 Min positive values and the 2 Min */ /* abs. negative values in the input */ // if (tmp >= 0) if (tmp < low_pos [0]) { low_pos [l] = lowpos [0] ; low_pos [0] = tmp; else if ( (tmp < low_pos [l]) && (tmp > low_pos [0])) low_pos [l] = tmp; else

{ if (tmp>low_neg [0]) { low_neg[1] = low_neg[0]; lowneg [0] = tmp; else if ((tmp > low_neg[1]) && (tmp < low_neg[0])) low_neg[1] = tmp; /*----------------------------------------------*/ } /*/ /* Calculate the difference between Max and Min */ /*----------------------------------------------*/ delta = (INT32)(max[0]-min[0]); if ( (delta < min_delta) && (max [0] > min [O])) min delta = delta; if (min delta <= DELTATHRLD) // if ( (max [l] >= 0. 0) && (max [0] > 0. 0)) { ll_pos = max [l] ; 12_pos = max [0] ; } else { if(low_pos[0] < 32767.0) 11_pos = low_pos[0]; if (low_pos [1] < 32767. 0) 12_pos = low-pos [l] ; }

/*----------------------------------------------*/ if ((min[0] < 0.0) && (min [l] < 0.0)) 12_neg= min [0] ; 11_neg = min [l] ; } else { if low_neg[0] >-32766.0) 11_neg = low_neg[0]; if (low_neg [l] >-32766.0) 12_neg = low_neg[1]; // } } // /* Update zero level */ /*----------------------------------------------*/ if (low_pos [0] < zero level) zero_level = low_pos[0]; /*----------------------------------------------*/ /* Update the Histogramm */ // for (i = 0; i < N; i++) { if ((x_in[i] >= 12_neg) && (xin [i] < long)) hist [0] ++ ; else if ((x_in[i] >= 11_neg) && (xin [i] < 0.0)) hist [1] ++ ; elseif ( (xin [i] >= 0.0) && (xin [i] <= 11_pos)) hist [2] ++ ; else if ((x_in[i] > ll_pos) && (xin [i] <=12_pos))

hist [3] ++ ; else hist [4] ++; /*----------------------------------------------*/ /* Update the History */ /*----------------------------------------------*/ for (i = SEMEMSIZE-1 ; i > 0; i--) { zero rate [i] = zerorate [i-1] ; low-rate [i] = low_rate [i-1]; high_rate [i] = high_rate [i-1]; zeroed [i] = zeroed [i-1]; } } /* Current Frame Rate */ /*----------------------------------------------*/ if (hist [2] == N) zerorate [0] = 1.0; else zero_rate[0] = (FLOAT64) hist [2]/ (FLOAT64) N; if ( (hist [l] + hist[2]) == N) low rate [0] = 1.0; else lowrate [0] = (FLOAT64) (hist [1] + hist [2])/ (FLOAT64) N; if (hist [4] == N) high rate [0] = 1. 0; else high_rate[0] = (FLOAT64) hist [4]/ (FLOAT64) N; /*----------------------------------------------*/ /* Silence Frame */ /*----------------------------------------------*/

idle_noise = 1; for (i = 0 ; i < SEMEMSIZE ; i++) { if ((zero+rate [i] < 0.55) 11 (low rate [i] < || (high rate [i] > 0.07)) idle_noise = 0; condl = ((zero_rate[0] >= 0.95) && (high rate [0] <= 0.03)); cond2 = ((low_rate[0] >= 0.90) && (low_rate [l] >= 0.90) && (high_rate[0] <= 0.030)); cond3 = ((low_rate[0] >= 0.80) && (lowrate [l] >= 0.90) && (highrate [0] <= 0.010) && (zeroed [l] == 1)); cond4 = ((low_rate[0] >= 0.75) && (low_rate[1] >= 0.75) && (high rate [0] <= 0.004) && (zeroed [l] == 1)); /*----------------------------------------------*/ /* Modify the dignal if is a silence frame */ /*----------------------------------------------*/ if (condl 11 cond2 || cond3 11 cond4 idle_noise) if (zeroed [1] == 1) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> { /* Keep the Signal */ /*----------------------------------------------*/ ini_dvector(x_out, 0, N-1, zero level) ; else { /* Ramp Signal Down */ /*----------------------------------------------*/

for (i = 0 ; i < SERAMPSIZE ; i++) x out [i] = ((FLOAT64)(SE_RAMP_SIZE - 1 - i) * x in [i] + (FLOAT64)i * zero_level) @ (FLOAT64) (SERAMPSIZE-1) ; ini_dvector (x_out, SE_RAMP_SIZE, N-1, zero_level); } zeroed [0] = 1; } else if (zeroed [l] == 1) { { /* Ramp Signal */ /*----------------------------------------------*/ for (i = 0 ; i < SERAMPSIZE ; i++) x_out [i] = ((FLOAT64) i * xin [i] + <BR> <BR> (FLOAT64)(SE_RAMP_SIZE - 1 - i) * zero_level) @<BR> <BR> <BR> (FLOAT64) (SERAMPSIZE-1) ; zeroed [0] = 0; else zeroed [0] = 0; zeroed[0] = 0; /*----------------------------------------------*/ free_svector (hist, 0, SE_HIS_SIZE-1); free dvector (max, 0,1); free dvector (min, 0,1); /*----------------------------------------------*/ return; /*----------------------------------------------*/

/*---------------------------------------------------------- */ /* FUNCTION. PPR lowpass Q */ /*----------------------------------------------*/ /* PURPOSE. This function perfroms the lowpass */ /* of the input */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) I_frm : speech frame */ /* _(INT16 ) smv_mode : SMV running */ /* _ (INT16) flat flag: flat input speech */ /*-------------------------*/ /* OUTPUT ARGUMENTS /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* (FLOAT64 []) xin: input/output speech */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void PPR lowpass (FLOAT64 xin [], INT16 1_frm, INT16 smv_mode, INT16 flat flag) // FLOAT64x; INT16 i; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> if (flat_flag==0)<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> if (flat flag==0) switch (smv mode) case 0: Ip fltnum [0] = 0.0; break; case 1: lpfltnum [0] = 0.05; break;

case 2: lp_flt_num[0] = 0.075; break; } } else { switch (smv_mode) case 0: lp_flt_num [0] =-0. 1; break; case 1: Ipfltnum [0] = 0.0; break; case 2: lp_fit_num[0] = 0.0; break; /*----------------------------------------------*/ for (i = 0; i < 1 frm ; i++) { x = xin [i] + lp_flt_buff[0]*lp_flt_num[0] ; lp_flt_buff[0] = x_in[i]; x in [i] = x; /*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /*----------------------------------------------*/ <BR> <BR> <BR> <BR> <BR> } /* FUNCTION PPR highpass 0 */ /*----------------------------------------------*/ /* PURPOSE: This function perfroms the highpass filtering */ /* of the input */

/*----------------------------------------------*/ /* INPUT ARGUMENTS */ /*- (INT16) 1 frm : speech frame */ /*----------------------------------------------*/ /* OUTPUT : */ None.

/*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /*- (FLOAT64 []) x: input/output speech frame. */ /*---------------.-.-----------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void PPRhighpass (INT16 1_frm, FLOAT64 x []) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> /*--------------.---------*/ PPR_ZeroPoleFilter (1_frm, x, pre_flt_buf_z, pre_flt_buf_p, prefltnum, preiltden, pregain, PPRFLTORDER) ; /*----------------------------------------------*/ return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : PPR_pitch_postfilter O */ /*----------------------------------------------*/ /* PURPOSE. This function perfroms the */ /* postfiltering in order to enhance the */ /* periodicity. */ /*----------------------------------------------*/ /* INPUT ARGUMENTS : */ /* _(FLOAT64 ) lag_f: decoded lag */

/* _ (FLOAT64) PSF: pitch gain scale factor. */ /* _(INT16 ) 1sf: sub-frame */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* (FLOAT64 []) ext : input excitation signal. */ /*-----------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void PPR_pitch_postfilter (FLOAT64 ext [], FLOAT64 lag f, FLOAT64 PSF, INT16 1_sf) { FLOAT64 Rp [2*SINT_LIMIT+8], x, y, gain, pit step, pit tab [25], tmp[L_SF]; INT16 i, IP1, IP2, P1, P2, pit idx, LowL, HighL, L_R[ ; /*----------------------------------------------*/ /* Searching range */ // pitstep = 1.0/8.0; P1 = 0 ; P2 = 24; pittab [0] = MAX (min_pit, lag_f-1. 5); for (i = 1; i <= P2; i++) pit tab [i] = pittab [i-l] + pitstep ; pittab [i] = MIN (HI LAG2, pittab [i]) ; IP1 = (INT16) pittab [Pl] ; IP2 = (INT16) (pit tab [P2] +1. 0) ; IP2 = MAX (IP1, IP2) ;

LowL = IP1-SINCLIMIT-1 ; LowL = MAX (0, LowL); HighL = IP2 + SINCLIMIT + 1; L_Rp = HighL-LowL + 1; #ifdef VERBOSE if (L_Rp >= 2*SINCLIMIT + 8) nrerror ("Memory Error: LRp>=2*SINCLIMIT+8 ! l\n"); #endif /*----------------------------------------------*/ /* Integer correlation */ /*----------------------------------------------*/ cpy_dvector (ext, buff LTpost+MAX_LAG, 0, lsf-l) ; dot_dvector (buff_LTpost+MAX_LAG-LowL+1, buff_LTpost+MAX_LAG-LowL+1, &y, 0,1_sf-1); for (i = LowL; i <= HighL ; i++) { dot dvector (ext, buff LTpost+MAX LAG-i, &x, 0, 1_sf-1) ; y += buff LTpost [MAX_LAG-i] * buff_LTpost[MAX_LAG-i] ; y = buff_LTpost[MAX_LAG-i+1_sf]*buff_LTpost[MAX_LAG-i+1_sf]; Rp [i-LowL] = x/sqrt (MAX (y, 0.1)); // /* Fine index */ /*----------------------------------------------*/ LTP FineIndex search (pit tab, P1, P2, LowL, L Rp, Rp, &pit_idx) ; /*----------------------------------------------*/ /* LTP excitation */ // LTP_excit_const_pitch (pit_tab[pit_idx], MAX_LAG, buff_LTpost, 1_sf, tmp, 0) ; /*----------------------------------------------*/

/* Update residual buffer */ /*----------------------------------------------*/ PPP_update_LT_mem (MAX_Lag, buff_LTpost, 1_sf, ext); /*----------------------------------------------*/ /* Compute the harmonic filter coefficient */ /*----------------------------------------------*/ dot dvector (ext, tmp, &x, 0, isf-l) ; dot dvector (tmp, tmp, &y, 0, I_sf-l) ; gain = x/MAX (y, 0.001); gain = MIN (1. 0, gain); gain*= PSF; /*----------------------------------------------*/ /* Perform the harmonic */ /*----------------------------------------------*/ for (i = 0; i < I_sf ; i++) tmp [i] = ext [i] + gain*tmp [i]; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> /* AGC */<BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ dot dvector (ext, ext, &x, 0, 1_sf-1) ; dot dvector (tmp, tmp, &y, 0, I_sf-l) ; gain=sqrt (x/MAX (y, 0.; for (i = 0; i < 1_sf; i++) ext [i] = tmp [i] *gain ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // return;

/*----------------------------------------------*/ } /*----------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PPR_post_process () */ /*----------------------------------------------*/ /*PURPOSE : This function perfroms post-filtering */ /* (harmonic + formant) in order to enhance */ /* speech */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _(FLOAT64 []) pdcfq: decoded prediction */ /* _(FLOAT64 []) lag_f: decoded lag */ /* _ (INT16) I_sf: sub-frame */ // /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT */ /* (FLOAT64 []) sigsyn: synthetised */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ void PPR_post_process (FLOAT64 sigsyn [], FLOAT64 pdcfq [], FLOAT64 r_0, FLOAT64 r_p, FLOAT64 lag_f, INT16 1_sf, INT16 flat_flag, INT16 fix rate) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { /* Adaptive (weighted) postfilter variables /*----------------------------------------------*/ FLOAT64 wpdcf_pole[NP], wpdcf_zero[NP], ai_zero[NP+1]; FLOAT64 tmpmem [NP], hh [L_SF], after_syn [L_SF] ; FLOAT64 vall, val2; /*----------------------------------------------*/

/* Harmonic Filtering variables */ /*----------------------------------------------*/ INT16 i, Lh, L2; FLOAT64 gain, numerator, denominator; FLOAT64 residu_w [L_SF] ; /*----------------------------------------------*/ /* Tilt compensation */ /*----------------------------------------------*/ FLOAT64 rO, rl, kl, coeff, after_tilt [L_SF] ; /*----------------------------------------------*/ /* Compute the weighted LPC */ // r zero = 0. + 0.; vall = 1.0; val2 =1.0; for (i = 0; i < NP; i++) { val1*= r_pole; val2 *= r_zero; wpdcf_pole [i] = pdcfq [i] * vall ; wpdcf zero [i] = pdcfq [i] * val2; /*----------------------------------------------*/ /* Compute the residual */ /*----------------------------------------------*/ LPC_ptoa (wpdcfzero, aizero, NP); FLTconv (sigsyn, aizero, NP+1, lsf, residuw) ; /*----------------------------------------------*/ /* Update the */ /*----------------------------------------------*/

cpy_dvector (sigsyn+l_sf, sigsyn, 0, NP-1) ; // /* Pitch post-filter */ /*----------------------------------------------*/ if(1_sf == L_SF) L2=LSF/2 ; for (i = 0; i < NSF2 ; i++) PPR_pitch_postiflter (residu_w+i*L2, lag_f.r_p.L2); else PPR_pitch_postifilter(residu_w, lag_f, r_p, 1_sf); /*----------------------------------------------*/ Tilt compensation <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* Compute the impulse response of the zero-pole */ /*----------------------------------------------*/ Lh = 22 ; inidvector (hh, 0, 1_sf-1, 0.0); LPC_ptoa (wpdcf zero, hh, NP); ini_dvector (tmpmem, 0, NP-1,0.0); FLT allsyn (hh, (INT16) (Lh+l), wpdcfpole, NP, hh, tmpmem); /*----------------------------------------------*/ /* Compute the first reflection */ /*--*/ dot dvector (hh, hh, &r0, 0, Lh-1) ; dot dvector (hh, hh+1, &rl, 0, Lh-2); kl =-rl/MAX (rO, 0.0001); coeff = MAX(MIN(0.5*k1, 0.0),-0.1); if (k1 < 0.0)

{ if (flat_flag == 0) coeff 0.1; else coeff 0.05; // /* Perform the tilt */ /*----------------------------------------------*/ after_tilt [0] = residuw [0] + coeff*pst_hp_mem ; for (i = 1; i < I sf ; i++) aftertilt [i] = residuw [i] + coeff*residu_w[i-1]; /*----------------------------------------------*/ /* Update the */ /*----------------------------------------------*/ pst_hp_mem = residu_w[1_sf-1]; // /* Synthesis */ /*----------------------------------------------*/ FLT allsyn (after tilt, 1 sf, wpdcf pole, NP, after_syn, PF_mem_syn) ; /*----------------------------------------------*/ /* Adaptive gain control */ /*----------------------------------------------*/ /*----------------------------------------------*/ /* Compute the gain factor for the current */ /*------------------------*/ dot dvector (sigsyn+NP, sigsyn+NP, &numerator, 0, 1_sf-1) ; dot_dvector (after_syn, after_syn, &denominator, 0, lsf-l) ;

gain = sqrt (numerator/MAX (denominator, 0.001)); if (flat flag == 0) gain *= 1. 1; <BR> <BR> <BR> else<BR> gain *= 1. 15 ; gain *= 1.15; /*----------------------------------------------*/ /* Prform the gain control */ /*----------------------------------------------*/ for (i = 0; i < 1_sf; i++) { pstscale = 0. + 0.; after_syn [i] *= pstscale ; /*--------.-.------------.--*/ /* High-pass */.

/*----------------------------------------------*/ PPR_post_highpass (1_sf, after_syn); cpy_dvector (after syn, sigsyn+NP, 0, lsf-l) ; /*----------------------------------------------*/ return; /*------------------------*/ } /*========================================================== =========*/ /* FUNCTION : PPR_ZeroPoleFilterO */ /*----------------------------------------------*/ /* PURPOSE. This function perfroms the pole and */ /* filtering. */

/*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (INT16) Len: signal */ (FLOAT64 Zz zero filter */ /* _ (FLOAT64 []) Zp : pole filter */ /* _ (FLOAT64 []) b : numerator coefficients. */ (FLOAT64 a denominator coefficients. */ /* _ (FLOAT64) K : filter */ /* _ (INT16) order: filter */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT */ /* (FLOAT64 []) InOut: input output */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PPRZeroPoleFilter (INT16 Len, FLOAT64 InOut [], FLOAT64 Zz [], FLOAT64 Zp [], FLOAT64 b [], FLOAT64 a [], FLOAT64 K, INT16 order) { /*-*/ INT16 i, k; FLOAT64 S; /*----------------------------------------------*/ for (i = 0; i < Len; i++) { S = InOut [i]; for (k = 0; k < order; k++) S += b [k] *Zz [k]; for (k = order-1 ; k > 0; k--) Zz [k] = Zz [k-1] ; Zz [0] = InOut [i] ; InOut [i] = S; }

/*----------------------------------------------*/ for (i = 0; i < Len; i++) S = InOut [i]; for (k = 0; k < order; k++) S-= a [k] *Zp [k]; for (k = order-1 ; k > 0; k--) Zp[k] = Zp[k-1]; Zp[0] = S; InOut [i] = S*K; // return; return; /*----------------------------------------------*/ } /*----------------------------------------------*/ /*========================================================== =========*/ /* FUNCTION : PPR_post highpass 0 */ /*-------------------------*/ /* PURPOSE: This function perfroms G. 729 high */ /* filtering. */ // /* INPUT ARGUMENTS */ /* (INT16) Len: signal */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) InOut: input output */ /*----------------------------------------------*/ /* RETURN */ /* None. */

/*========================================================== =========*/ void PPRposthighpass (INT16 Len, FLOAT64 InOut []) // PPR ZeroPoleFilter (Len, InOut, pst_flt_buf_z, pst_flt_buf_p, pst_flt_num, pst_flt_den, pst_gain, PPR FLTORDER) ; /*----------------------------------------------*/ return ; <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== =========*/ /*----------------------END------------------*/

/*========================================================== =======================*/ /*========================================================== =========*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ // /* Copyright (C) 2000 Conexant System */ // /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* PROTOYPE FILE : lib_ppr. */ /*========================================================== =========*/ /*----------------------------------------------*/ /*----------------------FUNCTIONS-------------------*/ /*----------------------------------------------*/ void PPR_filters_init (void); void PPR silence enhaninit (void); void PPR silence enhan (FLOAT64 [], FLOAT64 [], INT16) ; void PPR_ZeroPoleFilter (INT16, FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64, INT16); void PPR lowpass (FLOAT64 INT16, INT16, INT16); void PPRhighpass (INT16, []) ; voidPPRposthighpass (INT16, FLOAT64 []);

void PPR_post_process (FLOAT64 [], FLOAT64 [], FLOAT64, FLOAT64, FLOAT64, INT16, INT16, INT16); void PPR_pitch_postfilter (FLOAT64 [], FLOAT64, FLOAT64, INT16); /*========================================================== =========*/ <BR> /*--------------------END------------------*/

/*========================================================== =======================*/ /*========================================================== =========*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*----------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*-----------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib_prc. */ /*========================================================== =========*/ /*----------------------------------------------*/ // /*----------------------------------------------*/ #include "typedef.h" #include "main.h" #include"const. h" #include"gputil. h" &num include"mcutil. h" #include "ext_var.h" &num include"lib_flt. h" &num include"lib_lpc. h" #include "lib_prc.h" /*----------------------------------------------*/ <BR> <BR> /*__________---------------------FUNCTIONS------------------ ----------------*/<BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* FUNCTION : PRC_init_lib (). */

/*----------------------------------------------*/ /* PURPOSE : This function performs initialise the PRC */ /* library global */ // /* INPUT ARGUMENTS : */ /* None. */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ voidPRC_init_lib (void) { /*----------------------------------------------*/ <BR> <BR> <BR> /* PRColclGainNorm */<BR> <BR> <BR> <BR> /*------------------------*/ cl_Eg = -1; olEg--l ; m Ipc_gain = 0.8; /*----------------------------------------------*/ return ; /*/ } /*========================================================== =========*/ /* FUNCTION : PRC_GainsNorm_Gc_Gp (). */

/*----------------------------------------------*/ /* PURPOSE : This function performs the Mode 0 */ /* manipulation. */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* (FLOAT64) nsr: Noise to Signal Ratio. */ /* (FLOAT64) subeng : sub-frame */ (FLOAT64 res : excitation */ (FLOAT64 unfcod: excitation vectors (ALG */ /* LTP). */ /* _ (FLOAT64 **) fcod: filtered excitation */ /* (ALG and LTP). */ /* _ (FLOAT64 []) Tgs : target */ /* (INT16) excmode : excitation */ /* (FLOAT64) betasub : smoothing */ - (INT16) lsf : sub-frame */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _(FLOAT64 []) gainQ : quantizied */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/ void PRC_GainsNorm_Gc_Gp (FLOAT64 nsr, FLOAT64 subeng, FLOAT64 res[], FLOAT64 gainQ [], FLOAT64 **unfcod, FLOAT64 **fcod, FLOAT64 [], INT16 excmode, FLOAT64 beta_sub, <BR> <BR> <BR> INT16 I-sf)<BR> <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { FLOAT64 Ipc_gain, ol_g, cl_g, gain, x, y, E_ex, E_Tgs, Temp SF]; /*----------------------------------------------*/ if (nsr > 0.125)

{ /*----------------------------------------------*/ /* Energy */ /*----------------------------------------------*/ Eex = subeng/LSF ; dot dvector (Tgs, Tgs, &E_Tgs, 0, lsf-l) ; E_Tgs @= 1_sf; /*----------------------------------------------*/ /* Energy */ // if (cl_Eg < 0) { ol_Eg = Eex ; cl_Eg = E_Tgs ; else ol_Eg = beta_sub*ol_Eg + (1.0-beta_sub)*E_x; cl_Eg = betasub*clEg + (1. 0-beta_sub)*E_Tgs ; /*----------------------------------------------*/ /* Open-loop */ /*----------------------------------------------*/ wad dvector (unfcod [0], gainQ [0], unfcod [l], gainQ [1], Temp, 0, 1_sf-1) ; dot dvector (Temp, Temp, &x, 0, 1_sf-1) ; x/= lsf ; x ** sqrt(MAX(ol_Eg-5. 0, (x, 0.1)); gain = MIN (0. 75*x, (1. (gainQ [0], 0.01)));

else { /*----------------------------------------------*/ /* LPC gain */ // dot_dvector (res, res, &E_ex, 0, 1_sf-1); E_ex @=1_sf; dot dvector (Tgs, Tgs, &E_Tgs, 0, lsf-l) ; E_Tgs @= 1_sf; lpc_gain = sqrt(E_ex/MAX(E_Tgs, 0.1)); lpc_gain = MIN (lpc_gain, mlpcgain) ; /*----------------------------------------------*/ /* Energy smooth */ /*----------------------------------------------*/ if (cl_Eg < 0) if (cl_Eg < 0) ol Eg = Eex ; cl_Eg = E_Tgs; } else { ol_Eg = betasub*otEg + (1. *E ex; cl_Eg = beta_sub*cl_Eg + (1.0-beta_sub)*E_Tgs; } /*----------------------------------------------*/ /* Open-loop */ /*----------------------------------------------*/ wad dvector (unfcod [0], gainQ [0], unfcod [l], gainQ [l], Temp, 0, 1_sf-1) ; dot dvector (Temp, Temp, &x, 0, sf-l);

x @=1_sf; ol_g = sqrt (MAX (ol_Eg-5. 0,0)/MAX (x, 0.1)); /*----------------------------------------------*/ /* Close-loop */ // wad dvector (fcod [0], gainQ [0], fcod [l], gainQ [1], Temp, 0, 1_sf-1) ; dot dvector (Temp, Temp, &y, 0, 1_sf-1) ; y/= Isf ; cl_g = sqrt (MAX (cl_Eg-5. 0,0.1)); /*----------------------------------------------*/ /* Apply the gain */ // if (exc_mode ! = 0) { x = lpc_gain/MAX(m_lpc_gain, 0.1); y = 1.0-x; gain = x*ol_g + y*cl_g ; gain = MIN(0.75*gain, 1.2/MAX (gainQ [0], 0.01)); gain = MIN ( (1 + lpc_gain), gain); } else gain = 0. (ol_g, cl_g) ; gain = MIN (gain, 1.2/MAX (gainQ [0], 0.01)); /*----------------------------------------------*/

gain = MAX (1. 0, gain); gainQ [0] *= gain ; gainQ [lj *= gain ; // return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : PRColclGainNormGcQ. */ /*----------------------------------------------*/ /* PURPOSE : This function performs the Mode 1 */ /* manipulation. */ /*/ /* INPUT ARGUMENTS */ - (FLOAT64 []) res2 : excitation */ /* _ (FLOAT64 **) unfcod : excitation vectors (ALG */ /* LTP). */ /* _ (FLOAT64 **) fcod: filtered excitation */ /* (ALG and */ /* _ (FLOAT64 []) Tg: target */ /* (INT16) excmode : excitation */ /* _(INT16 ) 1_sf: sub-frame */ /*----------------------------------------------*/ /* OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT */ /* _ (FLOAT64 []) gainQ : quantizied gains. */ /*----------------------------------------------*/ /* RETURN */ /* None. */ <BR> <BR> <BR> <BR> ---------- void PRCGainNormGc (FLOAT64 res2 [], FLOAT64 gainQ [], FLOAT64 **unfcod,

FLOAT64 **fcod, FLOAT64 Tg [], INT16 1_sf) <BR> <BR> <BR> f<BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ FLOAT64 lpcgain, olg, clg, gain, E_ex, E_Tg ; FLOAT64 val; /*----------------------------------------------*/ /* LPCgain */ /*----------------------------------------------*/ dot_dvector (res2, res2, &E_ex, 0, 1_sf-1); dot_devctor (Tg, Tg, &E_Tg, 0, 1_sf-1); lpc_gain = sqrt (E_ex/MAX(E_Tg, 0.; lpc_gain = MIN (lpc_gain, 0.8); /*----------------------------------------------*/ /* Open-loop */ /*----------------------------------------------*/ dot dvector (unfcod [l], unfcod [l], &val, 0,; ols = gainQ [1] * gainQ [l] * val; ol-g = sqrt (E_ex/MAX (ol_g, 0.1)); /*----------------------------------------------*/ /* Close-loop */ // dot dvector (fcod [l], fcod [l], &val, 0,; cl_g = gainQ [l] * gainQ [1] * val; cl_g = sqrt (E_Tg/MAX (cl_g, 0.1)); /*----------------------------------------------*/ /* Apply the */ /*----------------------------------------------*/

lpcgain *= 0.75; gain = lpc_gain*ol_g + (1-lpc_gain) *cl_g ; gain = MAX (1. 0,0.5*gain); gain = MIN (l+lpc_gain, gain); gainQ [1] *= gain ; /*---------------------------------------------------------- ---------/ return; // } /*========================================================== =========*/ /* FUNCTION : PRCIdealExcit (). */ // /* PURPOSE : This function calculates the ideal */ /* codebook excitation. */ /*---------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) Tg: target */ /* _(FLOAT64 []) pdcfq : quantized prediction coeff. */ /* _(FLOAT64 []) wpdcf_den : precetual filter denominator */ /* coefficients. */ /* (FLOAT64 wpdcf num : precetual filter */ /* coefficients. */ /* (INT16) lsf : sub-frame */ /*----------------------------------------------*/ /* OUTPUT */ /* (FLOAT64 0) res2: ideal excitation */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== =========*/

void PRC Ideal Excit (FLOAT64 Tg [], FLOAT64 pdcfq [], FLOAT64 wpdcf den FLOAT64 wpdcf num [], FLOAT64 res2 [], INT16 I_sf) /*/ FLOAT64 ai_zero [NP+l], tmpmem [NP+l], tmp [L_SF+NP] ; /*----------------------------------------------*/ inidvector (tmp, 0, NP-1, 0.0); cpy_dvector (Tg, tmp+NP, 0, 1_sf-1) ; LPC_ptoa (pdcfq, ai-zero, NP); FLTconv (tmp, ai_zero, NP+1, 1 sf, res2); ini_dvector (tmpmem, 0, NP-1,0.0); FLT_allsyn (res2, 1_sf, wpdcf_num, NP, tmp+NP, tmpment); LPCptoa (wpdcfden, ai zero, NP); FLTconv (tmp, ai-zero, NP+1, 1 sf, res2); // return; /*----------------------------------------------*/ } /*========================================================== =========*/ /* FUNCTION : PRC_TargetSignal (). */ /*----------------------------------------------*/ /* PURPOSE : This function calculates the target */ // /* INPUT ARGUMENTS */ (FLOAT64 wpdcf num : precetual filter */ /* coefficients. */ /* _(FLOAT64 []) wpdcf_den : precetual filter */

/* coefficients. */ (FLOAT64 pdcfq: quantized prediction coeff. */ (FLOAT64 OriSig: original */ (FLOAT64 dif mem : memory for synthesis */ /* _(INT16 ) target_mem : memory for taget */ /* (INT16)Isf: sub-frame */ /*----------------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) res : residual */ /* _ (FLOAT64 []) Tgs : target */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*----------------------------------------------*/ /* RETURN : */ /* None. */ <BR> <BR> <BR> <BR> ---------- void PRC_TargetSignal (FLOAT64 wpdcf num [], FLOAT64 wpdcfden [], FLOAT64 pdcfq [], FLOAT64 OriSig [], FLOAT64 res [], FLOAT64 Tgs [], FLOAT64 dif mem FLOAT64 target mem [], INT16 lsf) { FLOAT64 ai_zero [NP+l], tmpmem [NP] ; /*----------------------------------------------*/ /* The residual signal is located at ext+MAX LAG for use in */ /* close-loop pitch */ /*----------------------------------------------*/ LPC_ptoa (pdcfq, aizero, NP); FLTconv (OriSig, ai-zero, NP+1, lsf, res); /*----------------------------------------------*/ /* Filter the residual signal with the synthesis */ /* NOTES : reverse the order of the */ /*----------------------------------------------*/

rev_dvector (dif mem, tmpmem, 0, NP-1); FLT allsyn (res, 1 sf, pdcfq, NP, dif mem+NP, tmpmem); /*----------------------------------------------*/ Perceptual weighting filter */ /*----------------------------------------------*/ LPCptoa (wpdcfnum, aizero, NP); FLT_conv (dif_mem, ai_zero, NP+1, 1_sf, Tgs); // /* NOTES : reverse the order of the */ /*----------------------------------------------*/ rev_dvector (target mem, tmpmem, 0, NP-1); FLT allsyn (Tgs, Isf, wpdcfden, NP, Tgs, tmpmem); /*----------------------------------------------*/ return; /*-------------------------*/ <BR> <BR> <BR> <BR> <BR> <BR> } /*FUNCTION : PRC_average_rate (). */ /*----------------------------------------------*/ /* PURPOSE : This function calculates the SMV average */ /* bit rate. */ // /* INPUT ARGUMENTS */ /*- (INT 16) codec rate : current frame */ // /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT */

/* _ (FLOAT64 *) avgrate : average bit */ // /* RETURN ARGUMENTS : */ /* None. */ void PRC_average_rate (INT16 codec rate, FLOAT64 *avg_rate) { { INT16 bits = 0; // /* Set bits incl. overhead in order to measure */ /* average SMV */ /*--.----------------------*/ switch(codec rate) { case RATE85K : bits = RATE11 ; break; case RATE4OK : bits = RATE12 ; break; case RATE2OK : bits = RATE 14 ; break; case RATEO8K : bits = RATE18 ; break; default: nrerror ("Invalid codec rate!! ! \n") ; break; // (*avg_rate) = ((*avg_rate)*(FLOAT64)(frm_count-1)+(FLOAT64)bits)/(double)f rm_count; /*----------------------------------------------*/

return; /*----------------------------------------------*/ } /*----------------------------------------------*/ /*========================================================== =========*/ /*------------------------END------------------------*/ /*========================================================== =========*/

=<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*/ /* Copyright (C) 200ยฐ-t, Sgystem */ /*----------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =========*/ /* PROTOTYPE FILE : lib_prc. */ /*========================================================== =========*/ /*----------------------------------------------*/ /*------------------------FUNCTIONS-----------------*/ void PRC_init_lib (void); void PRCGainsNonnGcGp (FLOAT64, FLOAT64, FLOAT64 [], FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 [], INT16, FLOAT64, INT16) ; void PRCGainNormGc (FLOAT64 [], FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 [], INT16); void PRCJdealJExcit (FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], FLOAT64 [], INT16); void PRCTargetSignal (FLOAT64 *, FLOAT64 *, FLOAT64 *, FLOAT64 *,

FLOAT64 *, FLOAT64 *, FLOAT64 *, FLOAT64 t INT16) ; void PRCaveragerate (INT16, FLOAT64 *); /*========================================================== =========*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*----------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*----------------------------------------------*/ /* ALL RIGHTS RESERVED */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of France Telecom */ /* Conexant System */ /*========================================================== =========*/ /* LIBRARY: lib_pwf.c */ <BR> <BR> <BR> /*----------------.-----------. */ /*----------------------------------------------*/ &num include"main. h" /*----------------------------------------------*/ #include "main.h" #include "typedef.h" #include "const.h" #include"gputil. h" #include "ext_var.h" #include "lib_lpc.h" #include "lib_flt.h" &num iEdef DIAG_SMV #include "lib_dia.h" #endif &num endif /*----------------------FUNCTIONS--------------------------- *

/*----------------------------------------------*/ /*================================================== /* FUNCTION : PWF_init_lib (). */ /*----------------------------------------------*/ /* PURPOSE: This function initialise the global */ /* of the PWF */ /*----------------------------------------------*/ /* INPUT : */ /* None. */ /*----------------------------------------------*/ /* OUTPUT */ /* None. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN */ /* None. */ void PWF_init_lib (void) // /* wspeech_to_speech */ /*----------------------------------------------*/ rpolews = 0.55; Zl_ws_1 = 0. 0 ; Zl_ws_2 = 0.0; /*----------------------------------------------*/ return; /*----------------------------------------------*/ <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/

/*========================================================== =========*/ /* FUNCTION : PWF_speech_to-residu (). */ // /* PURPOSE: This function perform a filtering operation */ /* pass from the input signal domain to */ /* perceptually weighted domain */ /*----------------------------------------------*/ /* INPUT ARGUMENTS */ /* _ (FLOAT64 []) sigpp: input */ /* _ (FLOAT64 **) pdcf : prediction coeff. */ /* (FLOAT64) r zero: band-expantion oefficient */ /*----------------------------------------------*/ /* OUTPUT */ /* _ (FLOAT64 []) residu: perceptually weigthed */ /* residual. */ /* _ (FLOAT64 **) wpdcf zero: band-expanded prediction */ /* matrix. */ /*----------------------------------------------*/ /* INPUT/OUTPUT */ /* None. */ /*----------------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void PWF_speech_to_residu (FLOAT64 sigpp [], FLOAT64 residu [], FLOAT64 **pdcf, FLOAT64 **wpdcf_zero, FLOAT64 r_zero) // INT16 i, j, is ; FLOAT64 ai-zero [NP+l], val; /*----------------------------------------------*/ /* Generate the perceptual weighting filter zeros coefficients */ /*----------------------------------------------*/ for (i = 0; i <= NSF4 ; i++) { val = 1.0;

for (j = 0 ; j < NP ; j++) { val *= r zero ; wpdcf zero [i] [j] = pdcf[i][j]*val ; } } // /* Generate the weighted residual */ /*----------------------------------------------*/ i_s= 0; for (i = 0; i < N_SF4 ; i++) LPC_ptoa (wpdcf zero [i], ai-zero, NP); FLT conv (sigpp+LPP-LFRM-L LPCLHD+is-NP, aizero, NP+1, LSF4, residu+L OLPIT-LFRM-LLPCLHD+i s) ; is += LSF4 ; } /*----------------------------------------------*/ LPC_ptoa (wpdcf zero [i], aizero, NP); FLTconv (sigpp + L PP-L LPCLHD-NP, ai_zero, NP+1, LLPCLHD, residu + L OLPIT- L_LPCLHD); /*----------------------------------------------*/ return; /*----------------------------------------------*/ //

/* FUNCTION : PWFresidutowspeech (). */ /*----------------------------------------------*/ /* PURPOSE : This function perform a filtering operation */ /* pass from the perceptually weighted */ /* residual to the perceptually weighted */ /* signal */ // /* INPUT ARGUMENTS */ /* _ (INT16) flat flag : flat input speech */ /* _ LOAT64 []) residu : residual */ /* _ (FLOAT64 **) refl : partial corr. coeff. */ /* _ (FLOAT64) r_zero : band-expantion oefficient */ /*----------------------------------------------*/ /* OUTPUT */ /* _(FLOAT64 []) wspeech : perceptually weigthed */ /* signal. */ /* _ (FLOAT64 **) pdcf : prediction coeff */ /* _ (FLOAT64 **) wpdcf_pole : band-expanded prediction */ /* matrix. */ /* (FLOAT64 []) LPCF : first adaptive order */ /* coefficient. */ /*----------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 wspeech-mem : synthesis filter */ /* _(FLOAT64 *) Zl_ws : first adaptive order */ /* memory. */ /*----------------------------------------------*/ /* RETURN */ /* None. */ /*========================================================== =========*/ void PWFresidutowspeech (INT16 flat flag, FLOAT64 residu [], FLOAT64 wspeech [], FLOAT64 **refl, FLOAT64 **pdcf, FLOAT64 **wpdcf_pole, FLOAT64 *LPCF, FLOAT64 wspeech mem [], FLOAT64 *Zlws) // INT16 i, k, j, i_s, i0 ;

FLOAT64 val, x, y, tmpmem [NP] ; /*----------------------------------------------*/ /* Generate the perceptual weighting filter poles */ /*----------------------------------------------*/ for (i = 0; i <= NSF4 ; i++) val = 1.0; for (j = 0 ; j < NP ; j++) { val *= 0. 5; wpdcfpole [i] [j] = pdcfli] [j] *val ; } // if (flat_flag==0) y = 0.2; else y = 0.0; else for (i = 0; i <= NSF4 ; i++) LP_CF [i] = y; /*----------------------------------------------*/ /* Generate the weighted speech for openloop pitch lag */ /*----------------------------------------------*/ ils = 0 ; for (i = 0; i < NSF4 ; i++) { FLT_allsyn (residu + LOLPIT-LFRM-LLPCLHD + i_s, L_SF4, wpdcf_pole [i], NP, wspeech + LOLPIT-LFRM- LLPCLHD + i s, wspeech mem) ; is += LSF4 ;

cpy_dvector (wspeech mem, tmpmem, 0, NP-1); FLT_allsyn (residu _ L_OLPIT - L_LPCLHD, L_LPCLHD, wpdcf_pole[i], NP, wspeech+LOLPIT-LLPCLHD, tmpmem); /*----------------------------------------------*/ Adaptive low */ /*/ ils = 0 ; for (i = 0; i < NSF4 ; i++) { for (k = 0 ; k < L_SF4 ; k++) { iO = LOLPIT-L FRM-LLPCLHD + is ; x = wspeech [i0 + k] + LPCF [i] * (*Zlws) ; (*Zlws) = wspeech [i0 + k]; wspeech [i0 + k] = x; is += LSF4 ; y = (*Zl_sw); for (i = 0; i < LLPCLHD ; i++) x = wspeech [LOLPIT-LLPCLHD+i] + LP_CF[N_SF4] *y; y = wspeech [L OLPIT-LLPCLHD+i] ; wspeech [L_OLPIT-L_LPCLHD+i] = x; /*----------------------------------------------*/ return ; /*----------------------------------------------*/ } /*---------------------------------------------------------- -*/

/* FUNCTION : PWFwspeechtospeech (). */ /*---------------------------------------------------------* / /* PURPOSE : This function perform a filtering operation */ /* pass from the perceptually weighted */ /* signal to the */ /*---------------------------------------------------------* / /* INPUT */ /* _ (FLOAT64 **) wpdcf zero : band-expanded prediction */ /* matrix numarator. */ /* _ (FLOAT64 **) wpdcf pole : band-expanded prediction coeff. */ /* matrix */ /* _ (FLOAT64 []) LP_CF : first adaptive order lowpass */ coefficient.

// /* OUTPUT ARGUMENTS */ /* (FLOAT64 []) ModiSig: pitch preprocessed */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* _ (FLOAT64 *) Z1 ws 2 : first adaptive order */ /* memory. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ===================================*/ void PWFwspeech tospeech (FLOAT64 ModiSig [], FLOAT64 **wpdcf zero, FLOAT64 **wpdcf pole, FLOAT64 LPCF [], FLOAT64 *Zl_ws_2) { /*/ FLOAT64 tmpws [LFRM+NP], aizero [NP+l] ; INT16 i, k, is ; /*---------------------------------------------------------* / cpy_dvector (tmpwsm, tmpws, 0, NP-1); i = 0 ;

for (i = 0; i < NSF4 ; i++) { for (k = 0; k < LSF4 ; k++) { tmpws [NP + i_s + k] = ModiSig [is + k]- LPCF [i] * (*Zlws2) ; (*Zlws2) = tmpws [NP + is + k] ; } is += LSF4 ; cpydvector (tmpws+LFRM, tmpwsm, 0, NP-1); /*---------------------------------------------------------* / i = 0 ; for (i=0 ; i<NSF4 ; i++) { LPC_ptoa (wpdcfpole [i], ai_zero, NP); FLT_conv (tmp_ws+i_s, ai_zero, NP+1, L_SF4, ModiSig+i_s); FLT allsyn (ModiSig+i s, L SF4, wpdcf zero [i], NP, ModifiSig+i_s, ModiSig_m) ; is += LSF4 ; /*---------------------------------------------------------* / return ; /*---------------------------------------------------------* / <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /*---------------------------END---------------------------- --*/ /*========================================================== ====================================*/

l =/ /*========================================================== =========================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of France Telecom */ /* Conexant System */ /* PROTOTYPE FILE: lib_pwf. */ /*---------------------------------------------------------* / /* IMPLEMENTATION : [26/05/2000] */ /* Conexant System */ /* Media Access */ /* Speech Technology */ /*-------.----------------*/ /* Last Version [26/05/2000] */ /* C. */ /*---------------------------------------------------------* / /* PURPOSE: Perceptuel Weighting Filter */ /*========================================================== =========================*/ /*---------------------------------------------------------* / /*--------------------------------FUNCTIONS----------------- ----------------*/ /*---------------------------------------------------------* / void PWFinitlib (void); void PWF_speech_to_residu (FLOAT64 [], FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64); void PWFresidutowspeech (INT16, FLOAT64 [], FLOAT64 [], **, FLOAT64 **, FLOAT64 **, FLOAT64 *, FLOAT64 [],

FLOAT64 *); void PWF_wspcech_to_speech (FLOAT64 [], FLOAT64 **, FLOAT64 **, FLOAT64 [], FLOAT64 *); /*========================================================== ===========================*/ <BR> /*------------------------------END------------------------- */<BR> = =

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*-----------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*-----------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: lib_qlsfc /*========================================================== ======================*/ /*---------------------------------------------------------* / #include"typedef. h" /*---------------------------------------------------------* / #include "typedef.h" #include "main.h" #include"const. h" #include"gputil. h" #include"mcutil. h" &num include"ext_var. h" &num include"lib_qlsfh" /*---------------------------------------------------------* / /*----------------------FUNCTIONS--------------------------- ---*/ /*---------------------------------------------------------* / /*========================================================== ======================*/ /* FUNCTION LSF-Q-init-lib 0.

/*------------------------------------------------------* / /* PURPOSE : This function initialise the global */ /* for the LSF-Q */

/*----..------..-------------*/ /*INPUT ARGUMENTS /* None. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* None. */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void LSF_Qinit_lib (void) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { INT16 i, j, k; /*---------------------------------------------------------* / MS_08k[0]=LMS1_08k; MS_08k[1]=LMS2_08k; MS_08k[2]=LMS3_08k; MS40k [0] = LMS1_40k ; MS_40k[1]=LMS2_40k; MS 40k [2] = LMS3_40k ; MS_85k [0] = LMS1_85k ; MS_85k[1]=LMS2_85k; MS_85k[3]=LMS3_85k; MS_85k[4]=LMS4_85k; /*---------------------------------------------------------* / last_qlsf [0] = 0.049793355045123; last_qlsf[1] = 0.071543733408561; last_qlsfl2] = 0.115002634382656;

last_qlsft3] = 0.164845365833111; last_qlsf[4] = 0.211800568342986; last_qlsf [5] = 0. 252341845504398; last_qlsf [6] = 0.303571730115036; last_qlsfl7] = 0.341160910229804; last_qlsf [8] = 0. 387682253964778; last_qlsf [9] = 0. 418740763446287; // Mean [0] = 0.049793355045123; Mean [l] = 0.071543733408561; Mean [2] = 0.115002634382656; Mean [3] = 0.; Mean [4] = 0. 211800568342986 ; Mean [5] = 0.252341845504398; Mean [6] = 0.303571730115036; Mean [7] = 0.341160910229804; Mean [8] = 0.387682253964778; Mean [9] = 0.418740763446287; /*---------------------------------------------------------* / /* Table of candidates for 0.8k LSF */ /*---------------------------------------------------------* / ini_svector(stage_cand_08k,0,2,8); /*---------------------------------------------------------* / /* Table of candidates for 4. LSF */ /*---------------------------------------------------------* / ini_svector (stagecand40k, 0,3,10); /*---------------------------------------------------------* / /* Table of candidates for 8. LSF quantization */ /*---------------------------------------------------------* / ini_svector (stage_cand_85k, 0,3,10); /*---------------------------------------------------------* /

/* Copy the MA-VQ */ /*---------------------------------------------------------* / for (i = 0; i < MAXLTT_08k ; i++) for (j = 0 ; j < LMSMAX_08k ; j++) for (k = 0; k < MAXLNp ; k++) Isf cb 08k [i] [j] [k]=CBec_08k [i] [j] [k]; for (i = 0; i < MAXLTT_40k ; i++) for (j = 0; j < LMSMAX_40k ; j++) for (k = 0; k < MAXLNp ; k++) Isf cb 40k [i] [j] [k] = CBes40k [i] [j] [k]; for (i = 0; i < MAXLTT85k ; i++) for (j = 0; j < LMSMAX85k ; j++) for (k = 0; k < MAXLNp ; k++) lsf cb 85k [i] lj] [k] = CBes_85k [i] [j] [k]; /*---------------------------------------------------------* / for (i = 0; i < NP ; i++) lsf new [i] = (i+0. 5) *0.; for (i = 0 ; i < NP ; i++) lsf mid [i] = (i + 0.5) *0.5/NP; for (i = 0; i < NP; i++) lsf old [i] = (i+0.5) *0.5/NP; for (i = 0 ; i < NP ; i++) Isfqotd [i] = (i+0.5) *0.5/NP; for (i = 0 ; i < NP ; i++) lsfq_old_dec[i]= (i+0.5) *0.5/NP; /*---------------------------------------------------------* / return ; /*---------------------------------------------------------* /

} /*========================================================== ======================*/ /*FUNCTION : LSF_Q_lsfqnt. (). */ /*---------------------------------------------------------* / /* PURPOSE : This function quntize the LSF unsig an */ /* residual quntization */ /*---------------------------------------------------------* / /* INPUT */ /* _(FLOAT64 []) lsf: LSF vector. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* _(FLOAT64 []) qntlsf : quantized LSF */ /* _(INT16 []) channel_idx: bitstream buffer. */ /* (INT16 []) stagecnd : prooning */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void LSF_QlsEqnt (FLOAT64 Isf [], FLOAT64 qntlsf [], INT16 channel_idx [], INT16 rate) // INT16 flip total ; INT16 k, 1, p; INT16 Pbest [l] ; INT16 indices [LTT_85k] ; FLOAT64 weight [NP] ; FLOAT64 e-lsf[LP_40k*NP]; FLOAT64 tmp_qe_qlsf[NP];

/*---------------------------------------------------------* / /* Weights */ /*---------------------------------------------------------* / LSF to_weight (lsf, weight, rate); /*---------------------------------------------------------* / /* Mean subtraction from lsf */ /*---------------------------------------------------------* / dif_dvector (lsf, Mean, lsf, 0, NP-1); /*---------------------------------------------------------* / /* Vector Prediction and Quantization */ /*---------------------------------------------------------* / switch (rate) { case RATEO 8K : for (p=0 ; p < LP08k ; { for(1=0;I<NP 1++){ e_lsf[p*NP+1]=lsf[I]; for (k=0 ; k < LQMA_08k ; k++) { e_lsflp*NP+I]-= B_08k [p] [k] [1] *qes [k] [1] ; } LSF_QQnt_e (e_lsf, weight, LP 08k, tmp_qe_qlsf, Pbest, 1, indices,lsf_cb_08k,MS_08k,stage_cand_08k,LTT_08k); for (I = 0; 1 < LTT_08k ; 1++) channelidx [l] = (INT16) indices [l] ; break; case RATE4_0K : for (p=0 ; p < LP40k ; { for (1=0 ; < NP; I++) {

e_lsflp*NP+I] = lsfll] ; for (k=0 ; k < LQMA_40k ; { e_lsf[*NP+1] -=B_40k [p] [k] [l] *qes [k] [1] ; } } } LSFQQnte (eIsf, weight, LP 40k, tmp_qe_qlsf, Pbest, l, indices,lsf_cb_40k,MS_40k,stage_cand_40k,LTT_40k); for (I = 0; 1 < LTT_40k ; 1++) channel_idx[1] = (INT16) indices [1] ; channel_idx[LTT_40k] = (INT16)Pbest[0]; break; case RATE85K : case RATE2 OK : for (p=O ; p < LP85k ; { for (1=0 ; 1 < NP ; I++) { e_lsf[p*NP+1] = lsf[1]; for (k=0 ; k < LQMA_85k ; k++) { e_lsf[p*NP+1] -= B_85k[p][k][1]*qes[k][I]; } LSF_Q_Qat_e(e_lsf,weight,LP_85k,tmp_qe_qlsf,Pbest,1, indices,lsf_cb_85k,MS_85k,stage_cand_85k,LTT_85k); for (l = 0; l < LTT_85k; l++) channel idx [l] = (INT16) indices [l]; break; default: printf (" Invalid rate ! ! \n") ; exit(0); } /___________________________________________________________ ________*/

/* Note : all the delayed decision information are */ /*---------------------------------------------------------/ * ini_dvector (qntlsf, 0, NP-1,0.0); switch (rate) { case RATEO 8K : for (1=0; 1 < NP; I++) { for (k=0 ; k < LQMA_08k ; { qntlsf[l] += B_08k[0][k][l]*qes [k] [1] ; } } break; case RATE4OK : for (1=0; 1 < NP; 1++) { for (k=0 ; k < LQMA40k ; { qntlsf[l] += B_40k [Pbest [0]] [k] [l] *qes [k] [1] ; break; case RATE85K : case RATE2OK : for (1=0; 1 < NP ; l++) { for (k=0 ; k < LQMA_85k ; k++) { qntlsfl] +=B_85k [0] [k] [1] *qes [k] [1] ; } break; default: printf (" Invalid rate!! \n") ; exit (0) ; add_dvector(qntlsf, tmp_qe_qlsf, qntlsf, 0, NP-1); add_dvector(qntlsf, Mean, qntlsf, 0, NP-1);

flip_total = 0; if (qntlsfl0] <= 0. 0) flip_total++; for (k= l; k < NP ; k++) if(qntlsf[k] < qntlsf[k-1]) flip_total++ ; } } /* simulate decoder lsf-crasure */ /*---------------------------------------------------------* / if(flip_total > 1) if (flip total > 1) wad_dvector(last_qlsf, 0.9, Mean, 0. 1, qntlsf, 0, NP-1); #ifdef VERBOSE printf ("\nWARNING frame % ld: Encoder flipped % d lsf pairs\n", frm_count, flip_total); #endif } // LSF-QOrder (qntlsf) ; LSF_Q_Space lsf (qntlsf, 0); /*---------------------------------------------------------* / /* Shifting the prediction */ /*---------------------------------------------------------* / switch (rate) { case RATEO8K : case RATE4_0K:/*MA order is 4 for 0.8k and 4. */ for (k = LQMA_40k-1 ; 0 < k; k--) cpy_dvector (qes [k-l], qes [k], 0, NP-1); break;

case RATE85K : case RATE2OK :/*MA order is 2 for 8. and 2. */ for (k=LQMA 40k-1 ; LQMA_85k <= k ; k--) { ini_dvector (qes [k], 0, NP-1,0.0); } for (k=LQMA_85k-1 ; 0 < k; k--) { cpy_dvector (qes [k-1], qes [k], 0, NP-1) ; } break; default: printf (" Invalid rate!! \n") ; exit (0) ; cpy_dvector (tmp_qe_qlsf, qes [0], 0, NP-1); /*---------------------------------------------------------* / /* Add the Mean vector to the */ // adddvector (Isf, Mean, lsf, 0, NP-1); /*-----*/ return ; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : LSF_Q_lsf_decode (). % /*---------------------------------------------------------* / /* PURPOSE : This function decodes the LSF */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _ (INT16 []) channel_idx : */

/* _ (INT16) bfi: Bad Farme */ /* (INT16) count: Bad Farme */ /* _ (FLOAT64 []) bfijpcg : lpc gain of previous frame. */ /*---------------------------------------------------------* / /* OUTPUT */ /* _ (FLOAT64 []) qntlsf: decoded LSF */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ // /* RETURN */ /* None. */ /*========================================================== ======================*/ void LSF_Q-lsf_decode(INT16 bfi_caution, INT16 *exp_flg, FLOAT64 qntlsf [], INT16 channel-idx 0, INT16 bfi, INT16 count, INT16 rate) <BR> <BR> <BR> <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT16 prd_idx ; INT16 flip total ; INT16 lsf_caution; INT16 k, 1 ; FLOAT64 tmp_qe_qlsflNP] ; /*---------------------------------------------------------* / /* Not frame erasure */ <BR> <BR> <BR> <BR> /*---------------------------------------------------------* /<BR> prd_idx=0;<BR> if(bfi==0)<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> prd-idx = 0; if(bfi==0) f lsf_caution=0; if (rate == RATE4_OK) prd_idx=channel_idx[3]; /*----------------------------------------------------*/ /* Generate the codebook */ /*---------------------------------------------------*/

ini dvector (tmp_qe_qlsf, 0, NP-1,0.0); switch (rate) { case RATEO8K : for (I = 0 ; 1 < LTT_09k ; 1++) k = channel_idx [l] ; add_dvector(tmp_qe_qlsf,lsf_cb_08k[1][k], tmp_qe_qlsf, 0, NP-1); break; case RATE4OK : for (I = 0; 1 < LTT_40k ; 1++) k = channel idx [1] ; add dvector (tmp_qe_qlsf, lsf cb 40k [1] [k], tmp_qe_qisf, 0, NP-1); } break; case RATE85K : case RATE2 OU : for (1=0; 1<LTT_85k 1++) { k = channelidx [l] ; add_dvector (tmp_qe-qlsf, lsf_cb_85k[1][k], tmp_qe_qlsf, 0, NP-1); break;

default: nrerror (" Invalid rate!! \n") ; break; } /__________________________________________________________* / /* Generate the predicted Isf */ /*---------------------------------------------------------* / ini_dvector(qntlsf, 0, NP-1,0.0); switch (rate) { case RATEO8K : for (I=0 ; 1<NP ; I++) for (k = 0; k < LQMA_08k ; k++) qntlsf[1] += B_08k[0][k][l]*qes_dec [k] [1] ; break; case RATE4 OK : for (I = 0; 1 < NP; 1++) for (k = 0; k < LQMA_40k ; k++) qntlsf[1] += B_40k[prd_idx] [k] [1] *qesdec [k] [1] ; break; case RATE85K : case RATE2OK : for (I = 0; 1 < NP ; 1++) for (k = 0; k < LQMA_85k ; k++) qntlsf[1] += B_85k[0][k][l]*qes_dec[k][l]; break; default: nrerror ("Invalidrate ! !") ; break; } add_dvector (qntlsf, tmp_qc_qlsf, qntlsf, 0, NP-1); add_dvector (qntlsf, Mean, qntlsf, 0, NP-1);

flip_total=0; if(qntlsf[0] <= 0.0) flip_total++; for (k = 1 ; k < NP ; k++) if (qntlsf[k] < qndsf [k-l]) flip total++ } // /* Isf-erasure, synchronized with */ /*---------------------------------------------------------* / if(flip_total > 1) { wad_dvector (last_qlsf, 0.9, Mean, 0. qntlsf, 0, NP-1); #ifdef VERBOSE printf ("WARNING frame %ld : Decoder flipped %d Isfpairs\n", frm_count, flip total) ; #endif // LSF_QOrder (qntlsf) ; LSFQSpace Isf (qntlsf, lsfcaution) ; if (count <= 2 && count>=l && bficaution == 1) { Isfcaution = 0; *exp_flg=0; for (k =0 ; k< NP-1 ; k++) if (8000.0* (qntlsf[k+1]-qntlsf[k]) < 75.0) Isf caution = 2; *exp_flg=1; #ifdef VERBOSE printf ("LSF_CAUTION1 HAPPENED at FRAME %ld %hd %f\n",

frm count, k, 8000.0* (qntslf[k+1] - qntlsf[k])); #endif } } else lsf caution = 0; *exp_flg=0; } /__________________________________________________________* / LSF_Q_Space_lsf(qntlsf,lsf_caution); } else // /* Frame */ <BR> <BR> <BR> /*-----.--.--------------*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*-*/ /* Generate the average past error Isf */ /*---------------------------------------------------------* / (*exp_flg) = 0; /*---------------------------------------------------------* / /* Shift previous LPC slightly towards */ /*---------------------------------------------------------* / wad_dvector (last_qlsf, 0.9, Mean, 0.1, qntlsf, 0, NP-1); LSF_QOrder (qntlsf) ; Isf caution = 5; LSF_Q_Space_lsf (qntlsf, Isf caution) ; ini dvector (tmp_qe_qlsf, 0, NP-1,0.0); switch (rate)

case RATEO8K : for (I = 0; 1 < NP; 1++) for (k = 0; k < LQMA_08k ; k++) tmp_qe_qlsf[1] += B_08k[0] [k] [1] *qesdec [k] [1] ; break; case RATE4OK : for (I = 0; 1 < NP; 1++) for (k = 0; k < LQMA_40k ; k++) tmp_qe_qlsf[1] += 40k [0] [k] [1] *qes_dec [k] [1]; break; case RATE85K : case RATE2OK : for (I = 0; 1 < NP; 1++) for (k = 0; k < LQMA_85k ; k++) tm_qe_qlsf[1] += B_85k[0] [k] [1] *qesdec [k] [1] ; break; default: nrerror ("Invalid ! !") ; break; // dif dvector (qntlsf, tmp_qe_qlsf, tmp_qe_qlsf, 0, NP-1); dif dvector (tmp_qe_qlsf, Mean, tmp_qe_qlsf, 0, NP-1); /*---------------------------------------------------------- ------*/ /* Shifting the prediction */ /*---------------------------------------------------------- ------*/ cpy_dvector (qntlsf, last_qlsf, 0, NP-1); switch (rate) { {

/* MA order is 4 for 0.8k and 4. */ /*---------------------------------------------------------* / case RATEZ 8K : case RATE4OK : for (k = LQMA_40k-1 ; 0 < k; k--) cpydvector (qesdec [k-l], qesdec [k], 0, NP-1) ; break; <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*__________________________________________________________ _*/<BR> <BR> <BR> <BR> <BR> /* MA order is 2 for 8. 5k and 2. 0k */ /*---------------------------------------------------------* / case RATE85K : case RATE2OK : for (k = LQMA 40k-1 ; LQMA_85k <= k; k--) ini-dvector (qes dec [k], 0, NP-1, 0.0); for (k = LQMA_85k-1 ; 0 < k ; k--) cpy_dvector (qesdec [k-l], qesdec [k], 0, NP-1); break; default: nrerror ("Invalid ! !") ; break; cpy_dvector (tmp_qe_qlsf, qes dec [0], 0, NP-1); /*---------------------------------------------------------- ------*/ return; /*---------------------------------------------------------- ------*/ <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> *=========================================================== =====================*/<BR> /

/* FUNCTION: LSF_Q_Order (). */ /*---------------------------------------------------------* / /* PURPOSE: This function reorder the decoded LSF */ // /* INPUT : */ /* None. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ None.

/*------------------------------------------------------- --*/ /* INPUT/OUTPUT */ /* _(FLOAT64 []) qlsf : decoded LSF */ // /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void LSF_Q_Order (FLOAT64 qlsf []) // INT16 i. j; FLOAT64 temp; /*---------------------------------------------------------* / for (i=NP-1 ; i >= 0 ; i--) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { for (j=0;j<ij++) { if(qlsf[j] > qlsf[j+1]) temp = qlsfj] ; qlsf[j] = qlsf[j+1]; qlsf[j+1] = temp; }

/*-------------------------------------------------*/ } /*---------------------------------------------------------* / return ; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : LSF_QSpace_lsf 0. */ // /* PURPOSE: This function preserve the minimum */ /* between the decoded LSF */ <BR> <BR> <BR> <BR> /* (range: */<BR> <BR> <BR> <BR> <BR> // /* INPUT */ /* _ (INT16 []) Isf caution: flag for LSF */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* None. */ // /* INPUT/OUTPUT ARGUMENTS */ /* _ (FLOAT64 []) lsf : decoded LSF */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void LSF_QSpace_lsf (FLOAT64 Isf [], INT16 Isf caution) { /*/ INT16 i; FLOAT64 Isf min, min dist; /*---------------------------------------------------------* /

lsf_min = 0.0; mindis = 0.0; /*---------------------------------------------------------* / if (lsfcaution == 0) Isf min = min_dist = 0.00625;/* At least 50 Hz Spacing */ else if (lsf caution == 1) lsf min = mindis-0. 01250;/* At least 100 Hz Spacing */ else if (lsf caution == 2) lsf min = min dist = 0.;/* At least 125 Hz Spacing */ else if (lsf caution == 3) Isfmin = min dist = 0.;/* At least 150 Hz */ else if (Isf caution == 4) lsf min = min_dist = 0.03125;/* At least 250 Hz Spacing */ else if (lsf caution == 5) Isf min = min_dist = 0.0075;/* At least 60 Hz Spacing */ /*---------------------------------------------------------* / for (i = 0; i < NP; i++) { if(lsf[i] < lsf_min) Isf [i] = If min ; Isf min = lsf[i] + min dist ; } /___________________________________________________________ ________*/ return; // } // /*========================================================== ======================*/ /* FUNCTION : LSF_Q_lsf_to_weight (). */ /*---------------------------------------------------------* /

/* PURPOSE : This function calculates the proper */ /* factor of each LS */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _(FLOAT64 []) lsf: LSF */ /*---------------------------------------------------------* / /* OUTPUT */ /* _(FLOAT64 []) weight: error */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN */ /* None. */ voidLSF_Q_lsf_to_weight (FLOAT64 lsf[], FLOAT64 weight[], INT16 rate) // INT16 j, i; INT16 idxl, idx2; FLOAT64 p [NP+l], q [NP+1]; FLOAT64 ppoly, qpoly ; FLOAT64 invpowspect ; FLOAT64 p_coeff, q_coeff, pi_arg, x; /*------------------------*/ pi_arg= 2*PI ; p [0] = 1. 0; q [0] = 1. 0; p [2]=1. 0; q [2]=1/ 0; p [1] = cos (lsf[1] * pi_arg) ; p [1] =-2-0 * p [l] ; q [1] = cos (lsf[0] * piarg) ; q[1] = -2.0*q[1];

/*---------------------------------------------------------* / for (i = 2; i <= NP/2; i++) idx1 = 2*i-1; idx2 = 2 * i; p_coeff=cos(lsf[idx2-1] * piarg) ; p_coeff=-2. 0 * p coeff ; coeff= cos (lsf[idx2-2] * pi arg) ; q_coeff=-2.0*q_coeff; for (j=i ; j>=2 ; j-) q [j] = q + q U-1] * qcoeff+ q [j-2]; p[j]=p[j]+p[j-1]*p_coeff+p[j-2]; q [idx2-j] = q G ; p[idx2-j]=p[j]; } p[1] =p[1]+p_coeff; p [idxl] = p [1] ; q [1] = q [1] + q_coeff; q [idxl] = q [1] ; p [idx2] = 1.0; q [idx2] = 1. 0; /*---------------------------------------------------------* / /* Calculating the (1/ (power spectrum)) and the proper */ /*---------------------------------------------------------* / for (i=0; i<NP i += 2) { p_poly=LSF_Q_cosine_polynomial(p,pi_arg*lsf[i]); x = cos (piarg*lsf [i]);

inv_pow_spect = 4*sqr (ppoly) * (2.-2. *x); weight [i] = pow (invpowspect/4.,-0. 4); } for (i = 1; i < NP ; i += 2) { qpoly = LSF Qcosinepo ! ynomial (q, pi_arg*lsf[i]) ; x=cos(pi_arg*lsf[i]); invpow spect = 4*sqr (qpoly) * (2. +2. *x); weight [i] = pow (invpowspect/4.,-0. 4); } if(rate==RATE0_8K) { /* different weights for different frequencies. 10/24/99, */ for (i=4; i < NP ; i++) { weight [i] *=-0. 16* (FLOAT64) i+1. 64;/* 1.0 at i=4 an 0.2 at */ } // return ; // /*---------------------------------------------------------- -----*/ <BR> <BR> <BR> <BR> <BR> } /* FUNCTION : LSF_Qcosine_polynomial 0. */ /*---------------------------------------------------------* / /* PURPOSE : This function calculates the cosine */ /* Note that coefp)] should be */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _ (INT16 []) coef : coefficients. */ /* _(INT16 ) omega: */ /*---------------------------------------------------------* / /* OUTPUT */

/* None. */ // /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* _ (FLOAT64) sum: polynomial cosinus modulated */ FLOAT64 LSF_Qcosine_polynomial (FLOAT64 coefl], FLOAT64 omega) { // INT16 j; FLOAT64 sum, x; /*---------------------------------------------------------* / sum=coel[NP/2]/2.; for (j=0 ; j < NP/2 ; { x = cos ((NP/2j) *omega); sum += coefTj] * x; /*---------------------------------------------------------* / return (sum) ; /*---------------------------------------------------------* / /*/ /*========================================================== ======================*/ /* FUNCTION : LSF_QQnt_e 0. */ /*---------------------------------------------------------* / /* PURPOSE : This function quantizes the prediction error */ /* the lsf prediction. */ /*---------------------------------------------------------* /

/*INPUT ARGUMENTS */ /* _ (FLOAT64 []) e: prediction residual. */ /* _ (FLOAT64 []) w: LSP weight */ /* _ (INT16) DIn : number of input */ /* (always 1 in the ITU-T rkbit/s). */ /* _(INT16 ) DOut: number of output */ /* (always 1 in the ITU-T 4kbit/s), */ /* (FLOAT64 [] [] []) CBe: */ /* _(INT16 []) MS: size of */ /* (INT16 []) stagecnd : prooning */ /*---------------------------------------------------------* / /* OUTPUT */ /* (INT16 *) Pptr : best */ /* _ (FLOAT64 Q) qe: quantized prediction */ /* (INT16 cluster : best */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> <BR> ------------ void LSF_QQnt_e (FLOAT64 e [], FLOAT64 w [], INT16 DIn, FLOAT64 qe [], INT16 *Pptr, INT16 DOut, INT16 cluster [], FLOAT64 ***CBe, INT16 MS [], INT16 *stage_cnd, INT16 Itt) /*---------------------------------------------------------* / INT16 ptr_back [LTT_85k] [MAX_CAND_LSFQ] ; INT16 best_indx[LTT_85k][MAX_CAND_LSFQ]; INT16 N indx [LTT_85k] ; INT16 ptr; INT16 i; FLOAT64 d_data [LTT_85k][MAX_CAND_LSFQ*NP]; /*---------------------------------------------------------* /

LSF_Q_New_ML_search (e,w, DIn, d_data[0], (INT16)stage_cnd[0], bestindx [0], ptr back [0], CBe [0], MS [0]) ; for (i = 1 ; i<ltt-1 ; i++) { LSFQNewMLsearch (ddata [i-l], w, (INT16) stage_cnd [i-1], d data [i], (INT16) stage_cnd [i], bestindx [i], ptrback [i], CBe [i], MS [i]) ; LSF_Q_New_ML_search (d_data[ltt-2], w, (INT16) stagecnd [Itt-2], d_data[ltt-1], DOut, best_indx[ltt-1], ptr_back[ltt-1], CBe[ltt-1], MS [ltt-l]) ; // N_index[ltt-1] = best_indx[ltt-1][0]; ptr=ptr_back[ltt-1][0]; for (i=ltt-2; i >= 0 ; i--) { Nindx [i] = bestindx [i] [ptr] ; ptr = ptrback [i] [ptr]; /* this is the pointer to the best */ *Pptr = ptr ; for (i=0 ; i < ltt ; { cluster [i] = N_indx [i] ; inidvector (qe, 0, NP-1,0.0); for (i=0 ; i < Itt ; i++) { adddvector (qe, CBe [i] [N_indx [i]], qe, 0, NP-1); /___________________________________________________________ ________*/

return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : LSF_QNew_ML_search 0. */ /*---------------------------------------------------------* / /* PURPOSE : This function performs the ML search. The */ /* pointer points to a J vectors array (each */ /* length NP, concatenated), the diff data */ /* pointer points to a J*K vectors array (each */ /* lengts NP, concatenated). The diff data */ /* for each vector in data, the K */ /* quantization error vector, using the */ /* code */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* (FLOAT64 []) ddata : prediction */ /* _ (FLOAT64 []) weight: LSP weight */ /* _(INT16 ) J: number of input */ /* _(INT16 ) K: number of output */ /* _ (FLOAT64 [] []) code: */ /* (INT16) MQ: size of */ /*---------------------------------------------------------* / /* OUTPUT */ /* (FLOAT64 []) newddata : new prediction */ /* _ (INT16 []) best_indx : array of the optmisaed */ /* indexes. */ /* (INT16 []) ptrback : best candidates of */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> -----------

void LSFQNewMLsearch (FLOAT64 d-data [], FLOAT64 weight [], INT16 J, FLOAT64 new_d_data [], INT16 K, INT16 best_indx [], INT16 ptr_back [], FLOAT64 **code, INT16 MQ) { { INT16 idxl, idx2; INT16 m, l, p, q; FLOAT64 sum[LMSMAX_85k*MAX_CAND_LSFQ]; FLOAT64 min [MAXCANDLSFQ], INT16 min_indx_p [MAX_CAND LSFQ] ; INT16 min_indx_m[MAX_CAND_LSFQ]; /*---------------------------------------------------------* / /* Initialisation */ /*---------------------------------------------------------* / for (q = 0; q < K; q++) min[q] = DBLMAX ; /*---------------------------------------------------------* / for (p=0 ; p < J ; p++) { for (m=0 ; m < MQ; m++) { sum [p*MQ+m] = 0.0; for (l=0 ; 1 < NP ; 1++) sum [p*MQ+m] += weight [l] *sqr (d_data [p*NP+l]-code [m] [l]) ; } // for (q = 0; q < K; q++) {

/*-----------------------------------------------------*/ for (p 0; p < J; p++) { for (m=0 ; m < MQ; m++) { <BR> <BR> <BR> if (sum [p*MQ+m] < min [q])<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> min [q] = sum [p*MQ+m] ; min indx_p [q] = p; min indxm [q] = m; } idx1=min_indx_p[q]*MQ+min_indx_m[q]; sum [idxl] = DBLMAX ; /*-----------------------------------------------------*/ // for (q = 0; q < K; q++) // for (l=0 ; zip ; 1++) idxl = min indxp [q] *NP +1 ; idx2 = min indx-m [q]; new_d_data[q*NP+1] = d_data[idx1]-codc[idx2][1]; } /*---------------------------------------------------------* / ptr_back[q]=min_indx_p[q];

best_indx[q]=min_indx_m[q]; /*---------------------------------------------------*/ } /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*---------------------------------------------------------* / /*========================================================== ======================*/ /*---------------------------END---------------------------* / /*========================================================== ======================*/

/* Conexant System Inc. */ /*4311 Jamborcc Road */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE : lib_q_lsf. h */ /*========================================================== =============*/ /*---------------------------------------------------------* / /___________________________________________________________ _________________*/ void LSF_Qinit_lib (void); void LSF_Qlsfqnt (FLOAT64 [], FLOAT64 [], INT16 *, INT16) ; void LSF-Q_Order (FLOAT64 []) ; void LSFQJsftoweight (FLOAT64 [], FLOAT64 [], INT16); FLOAT64 LSF_Qcosine_polynomial (FLOAT64 0, FLOAT64); void LSF_Q_Space_lsf (FLOAT64 [], INT16); void LSF_Q_lsf_dccode (INT16,INT16*, FLOAT64 [], INT16 [], INT16, INT16, INT16); voidLSFQQnte (FLOAT64 [], FLOAT64 0, INT16, [], INT16 [], INT16, INT16 [], FLOAT64 ***,

INT16 [], INT16 *, INT16) ; void LSF_QNew_ML_search (FLOAT64 [], FLOAT64 [], INT16, FLOAT64 [], INT16, INT16 [], INT16 [], FLOAT64 **, INT16); /*========================================================== ======================*/ /*--------------------------END----------------------------* / /*========================================================== ======================*/

/*========================================================== ===============================*/ /*========================================================== ======================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : lib_smo. */ /*========================================================== ======================*/ /*---------------------------------------------------------- ----*/ /*--------------------------------INCLUDE------------------- ----------------*/ /*---------------------------------------------------------- ------*/ &num include"typedef. h" #include"main. h" #include"const. h" #include"gputil. h" &num include"ext_var. h" #include"lib_smo.h" /*---------------------------------------------------------- ----*/ /*---------------------------FUNCTIONS---------------------- --------*/ /*---------------------------------------------------------- ----*/ /*========================================================== ========== /* FUNCTION : SMO_init_lib (). */ /*---------------------------------------------------------* / /* PURPOSE: This function initialisa the global */ /* for the library */

/*---------------------------------------------------------* / /* INPUT ARGUMENTS : */ /* None. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /*None.*/ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /___________________________________________________________ ________*/ /* RETURN ARGUMENTS */ /* None. */ /*========================================================== ======================*/ void SMO_init_lib(void) <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> { /* SMO_lsf_smooth_est */ /*---------------------------------------------------------* / N modesubest = 0 ; N_mode_frm = 0 ; // /* SMOinitialanalysis */ // consec_low-0; consec high = 0 ; consec vad 0 = 0 ; updates noise = 0 ; updates_speech = 0 ; calls = 0 ; lev_reset = 0 ; ma max_noise = 0.0; mamaxspeech = 0.0; ma_cp = 0.0; buffer_p = buffer smo+HI LAG2 ;

/*---------------------------------------------------------* / /* SMO refined analysis */ /*---------------------------------------------------------* / Nmodesubref= NMODESUBSTART ; consec = 0; updates = 0; ma_max = 0.0; /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : SMO_lsf_smooth_est0. */ /*---------------------------------------------------------* / /*PURPOSE : This function classify teh input signal */ /* file. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* (INT16) Vad: VAD of current */ /* _(INT16 ) PastVad: VAD of previous */ /* _(FLOAT64 ) refl : first reflection cocfficient. */ /* _ (FLOAT64 []) lsf : curent frame LSF coefficients. */ /*---------------------------------------------------------* / /* OUTPUT */ /* (FLOAT64) betafrm : estimated LSF */ /* factor. */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* None. */

/*========================================================== ======================*/ void SMO_lsf_smooth_est (INT16 Vad, INT16 PastVad, FLOAT64 refl, FLOAT64 lsf [], FLOAT64 beta_frm []) /___________________________________________________________ ________*/ INT16 i, i_sf; INT16 modefrm, Nsub and; FLOAT64 dSP, dSP avg, dSP int ; /*---------------------------------------------------------* / /* Algorithm initialisation */ /*---------------------------------------------------------* / if (frm_count == 1) { cpy_dvector (Isf, tsfoldsmo, 0, NP-1); cpy_dvector (Isf, ma lsf, 0, NP-1); ini_dvector (dSP_buf, 0, DSP_BUFF_SIZE-1, 0.0); } /*---------------------------------------------------------* / /* Calculate subframe */ /*--------------------------------------------------------*/ for (i_sf= 0; isf< NSF4; i_sf++) { if (Vad ==1||PastVad == 1) /_______________________________________________________*/ /* Speech/spike mode */ /*-----------------------------------------------*/ N mode sub est = 0; Nsub [isf] = Nmodesubest ; if (Vad == 0 && PastVad == 0)

/*----------------------------------------------*/ /* Unvoiced/non-speech mode */ /*----------------------------------------------*/ Nmodesubest++ ; if (Nmode sub est > 4) Nmode subest = 4; } } /* Calculate frame */ // for (dSP = 0. 0, dSPavg = 0.0, i = 0; i < NP; i++) dSP += (lsf[i]-lsf_old_smo[i])*(lsf[i]-lsf_old_smo[i]); dSP=_avg += (lsf[i]-ma-lsf[i])*(lsf[i]-ma_lsf[i]); } for (dSP int = 0.0, i = DSP BUFF-SIZE-1 ; i > 0; i--) { dSP_buf[i] = dSP_buf[i-1]; dSP_int += dSP_buf[i]; dSP_buf[0] = dSPavg ; dSP_int += dSP_buf[0]; /*---------------------------------------------------------* / mode frm = 0; Nsuband = 1; for (i = 0; i < N SF4 ; i++) if(Vad==1||PastVad==1) mode frm = 3; if (N_sub [i] == 0)

Nsuband = 0; /*---------------------------------------------------------* / <BR> <BR> <BR> <BR> <BR> <BR> if (modefrm == 3 | N_sub_and == 0 11 refl > Rllim)<BR> <BR> <BR> <BR> { Nmodefrm = 0; *betafrm = 0.0; ini_dvector (dSP_buf, 0, DSP_BUFF_SIZE-1,0.0); } else if ( (dSP > dSPl 11 dSP_int > dSP_int1) && N_mode_frm > 0) N mode frm = 0; *beta_frm = 0.0; ini_dvector (dSP_buf, 0, DSPBUFFSIZE-1, 0.0); else if (dSP > dSP2 && Nmodefrm > 1) N_Mode_frm=1; /*---------------------------------------------------------* / if(mode from ==0) if (mode_frm == 0) Nmodefrm++ ; if(N_mode_frm > 5) Nmodefrm = 5; *beta_frm=(FLOAT64)((N_mode_frm_1)*(N_mode_frm-1))/ 16.; } // /* Buffer */ /*---------------------------------------------------------* / cpy_dvector (lsf, lsf old-smo, 0, NP-1);

for (i = 0; i < NP; i++) ma_1sf[i]=(*beta_frm)*ma_lsf[i] + (1. 0- (*betafrm)) *lsfli], /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : SMO refined analysis Q. */ /*---------------------------------------------------------* / /* PURPOSE : This function performs the refined analysis */ /* the energy evolution and calculates */ /* smoothing factor for the energy */ /*---------------------------------------------------------* / /* INPUT */ /* _ (FLOAT64 []) res : input */ /* _ (INT16) speech mode : result of the */ /* analysis. */ /* (FLOAT64 pitch-corr : pitch correlation */ /* _ (FLOAT64 []) lsf : curent frame */ /* coefficients. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) excmode : smoothing */ /*- (FLOAT64 *) betasub : estimated smoothing factor. */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN */ /* None. */ /*========================================================== ======================*/ void SMO refinedanalysis (FLOAT64 res [], INT16 speech mode, FLOAT64 pitchcorr [], INT16 *encode,

FLOAT64 *beta_sub, INT16 I_sf) // INT16 i; FLOAT64 max, max mes, val; /*---------------------------------------------------------* / /* Find the max excitation */ /*---------------------------------------------------------* / for (max =-DBL MAX, i = 0; i < 1_sf; i++) { val = (res [i] > 0.0? res [i] :-res [il) ; if (val > max) max = val; } // max_mes=max/(ma_max+EPSI); if (speech mode == 1) /*--.-.------------------*/ /* speech/spike */ /*--------.--------------*/ N_mode_sub_ref=N_MODE_SUB_START; (*beta_sub) = 0.0; (*encode) = 1; else { /*----------------------------------------------------*/ if (max_mes < 1.75) /*________________________________________________________*/

/* Unvoiced/non-speech */ /*-----------------------------------------------------*/ N_mode_sub_ref++; if (Nmodesubref > 4) Nmodesubref= 4; /*-----------------------------------------------------*/ /* Smooth energy if sustained */ /*-----------------------------------------------------*/ if (Nmodesubref> 0) (*beta_sub) = BETASUB* (FLOAT64) ((N_mode_sub_ref-1) * (N_mode_sub_ref-1))/9.0; else (*beta_sub) = 0.0; (*encode) = 0; else /*---------------------*/ /* speech/spike */ /*-----------------------------------------------------*/ Nmodesubref= NMODESUBSTART ; (*beta_sub) = 0.0; (*encode) = 1 ; } if (max_mes <= 0.5) { if (consec < CONSEC_MAX) consec++ ; } else consec = 0; /*-----------------------------------------------------*/

/* Update moving average of */ /*-----------------------------------------------------*/ if ( (*excmode == 0 && (max_mes > 0.5 || consec > CONSEC_MAX-1))|| (updates <= UPDATEMAX && pitch_corr[1] < 0.60 && pitchcorr [0] < 0.65)) mamax = 0. 9*ma_max + 0.; if (updates <= UPDATE_MAX) updates++; /*-----------------------------------------------------*/ } // return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : SMO_initial_analysis (). */ // /* PURPOSE : This function performs the initial analysis */ /* the energy */ // /* INPUT ARGUMENTS */ /* (FLOAT64 []) signal: input */ /* (INT16) Vad : VAD of current */ /* _(FLOAT64 ) lag : sub-frame lag */ /* (FLOAT64) refl : first reflection */ /* analysis. */ /* _ (FLOAT64 []) lsf : curent frame LSF coefficients. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : */

_ (FLOAT64 pitch-corr : pitch correlation values. */ /* _ (FLOAT64 *) speech mode : smoothing mode */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> None. void SMO initial analysis (FLOAT64 signal [], INT16 Vad, FLOAT64 lag, FLOAT64 refl, INT16 *speech_mode, FLOAT64 *pitch corr, INT16 I_sf) { // INT16 i, j; INT16 lagl, lag2, start; INT16 condl, cond2, cond3, cond4; FLOAT64 max, maximes, val, energy; FLOAT64 cpl, cp2, cp, SNR max, alpha speech ; FLOAT64 decimaxmes, decimacp ; FLOAT64 update maxmes ; FLOAT64updatemacpspeech ; FLOAT64 max_group [MAX_GRP_SIZE], min max, end max ; FLOAT64 y, yx, slope, sum; FLOAT64 vall, val2, val3; /___________________________________________________________ ________*/ /* Update counter for consecutive non-speech subframes */ /*---------------------------------------------------------* / if (Vad == 0) { // /* Counts to max 2 frames (8 subframes) */ /*---------------------------------------------------*/ if (consec vad 0 < 8)

consec vad 0++ ; } else consec vad 0 = 0; /*---------------------------------------------------------* / /* Estimate speech to noise ratio for adaptation of */ /*---------------------------------------------------------* / if (updates noise >= 20 && updates speech >= 20) { SNR_max=ma_max_speech/(ma_max_noise + EPSI); SNR_max=(SNR_max > 32.0? 32.0: SNR ma) ; } else SNR max = 3. 5; if (SNR_max < 1.75 && ADAPTTHRESHOLDS) { deci_max_mes=1.30; decimacp = 0.70; updatemaxmes = 1.10; update_ma_cp_speech=0.72; } else if (SNR_max < 2.5 && ADAPT_THRESHOLDS) deci max-mes = 1.65; deci_ma_cp=0.73; updatemaxmes = 1.30; update_ma_cp_speech = 0.72; } else { /*/ /* Start-up and non-adaptive */ /*----------------------------------------------------*/

decimaxmes =1. 75; deci_ma_cp = 0.77; updata_max_mes= 1.30; update ma_cp_speech = 0.77; } /*---------------------------------------------------------* / /* Update signal */ /*---------------------------------------------------------* / for (i = 0; i < HI_LAG2 ; i++) buaersmo [i] = buffer_smoli+l_sf] ; for (i = 0; i < 1_sf; i++) buffer_p [i] = signal [i]; // /* Calculate pitch correlation of the speech signal */ // energy = 0.0; for (i = 0 ; i < lsf ; i++) energy += (INT16) buffer_p [i] * (INT16) buffer p [i]; lagl = (INT16) lag ; if(lag1==HI_LAG2) lag2 = lagl-l ; else lag2 = lag1+1 ; if (energy == 0.0) cp = 0. else dot_dvector (buffer_p, buffer_p-lag1, &vall, 0,; dot dvector (buffer-p, buffer-p, &val2,0, lsf-l) ; dot_dvector(buffer p-lag1, buffer_p-lag1. &val3, 0.1_sf-1);

cpl = val l/ (sqrt (val2 * val3) + EPSI); dot dvector (buffer p, buffer p-lag2, &vall, 0, 1_sf-1) ; dot_dvector (buffer_p, buffer_p, &val2, 0, 1_sf-1); dot_dvector (buffer p-lag2, buffer_p-lag2, &val3,0, Isf-l) ; cp2=vall/ (sqrt (val2 * val3) + EPSI); cp = (cpl > cp2)? cpl: cp2; ma_cp = 0. + 0. l*cp ; /*---------------------------------------------------------* / /* Find the max in pitch */ // start =(lag2 > l_sf) ? (l_sf-lag2) : 0; sum = 0. 0; max=-MAXFLT; for (i = start ; i < I_sf ; i++) val = (buffer-p [i] > 0.0)? buffer_p [i] :-buffer [i] ; /*---------------------------------------------------*/ /* Mean */ /*---------------------*/ sum += val; /*---------------------------------------------------*/ /* Max */ /*---------------------------------------------------*/ if (val > max) max = val;

max mes = max/(ma_max_noise+EPSI) ; /*---------------------------------------------------------* / /* Update buffer of maxima */ // for (i = 0 ; i < SMO_BUFF_SIZE-1 ; i++) { buffer max-smo [i] = buffer_max_smo[i+1] ; buffer sum smo [i] = buffer_sum_smo [i+l]; buffer_sum_smo[SMO_BUFF_SIZE-1] = sum; buffer_max_smo [SMO_BUFF_SIZE-1] = max; /*---------------------------------------------------------* / /* Find sum excluding current subframe, and max in groups */ /* 3 subframes */ /*---------------------------------------------------------* / sum = 0.0; for (i = 0 ; i < MAXGRPSIZE ; i++) max_group[i]=buffer_max_smo[3*i]; for (j=l ; j<3 ; j++) /_______________________________________________________*/ /* sum */ /*--------------------------------------------------*/ if(3*i+j<SMO_BUFF_SIZE-1) sum += buffer_sum_smo [3*i+j]; // /* Update subgroup */ /*-------------------------------------------------*/

max_group [i] = maxsmo [3*i+j] ; } // sum *= 1.7857e-03; sum *= 1.7857e-03; /*---------------------------------------------------------* / /* Find minimum among first 4 subgroups */ /*---------------------------------------------------------* / <BR> <BR> <BR> <BR> <BR> <BR> <BR> min max = max_group [0] ;<BR> <BR> <BR> <BR> <BR> for (i = 1; i < MAX_GRP_SIZE-1 ; i++)<BR> <BR> <BR> <BR> <BR> { if (max_group [i] < min max) min_max=max_group[i]; } // /* Extract the maximum of last */ /*---------------------------------------------------------* / end_max=max_group[MAX_GRP_SIZE-1]; /*---------------------------------------------------------* / /* Find slope of MSE linear fit to the 5 maximums */ /*---------------------------------------------------------* / yx = 0.0; y = 0.0; for (i = 0 ; i < MAXGRPSIZE ; i++) yx += (FLOAT64) i * max_group [i] ; y += max-group [i] ; } slope 0.1*(yx-2. 0*y);

/*---------------------------------------------------------* / /* Classify */ /*---------------------------------------------------------* / if (((max_mes < decimaxmes && ma_cp < deci_ma_cp)|| (Vad == 0))) *speech mode = 0; else *speech-mode = 1; /*---------------------------------------------------------* / /* Measure consecutive low level (compared to noise) subframes */ /*---------------------------------------------------------* / if (updates noise == 21 && max_mes <= 0.3) if (consec low < HLCOUNTMAX) consec low++ ; else consec low = 0; // /* Reset noise update if significant decrease compared */ /* the noise */ /*---------------------------------------------------------* / if (consec low == HL_COUNT_MAX) updates noise = 0; lev_reset =-1; } /*---------------------------------------------------------- --------- /* Measure consecutive stationary high level (compared to */ /* Subframes likely to be */ /*---------------------------------------------------------* / if ( (updates-noise >= 20 Il levreset ==-1) && maximes > 1.5 && ma_cp<0.70 && cp<0.85 && refl < -0.40 && end max < 50. max && max < 35.0*sum && slope >-100.0 &&

slope < 120.0) { if (consec-high < HLCOUNTMAX) consechigh++; else consec-high = 0; /*---------------------------------------------------------* / /* Reset noise update if significant stationary increase */ /* in noise level subframes likely to be */ /*---------------------------------------------------------* / if ( (consec high == HLCOUNTMAX) && (end-max < 6. && (max < 5.0*sum)) updates-noise = 20 ; lev_reset=1; } /*---------------------------------------------------------* / /* Update of noise max */ /*---------------------------------------------------------* / /*---------------------------------------------------------* / /* 1. condition: regular update */ /*---------------------------------------------------------* / condl = ( (maximes < update max_mes) && (ma_cp < 0.60) && (cp < 0.65) && (maximes > 0.3)); /*---------------------------------------------------------* / /* 2. condition: vad conditioned */ /*---------------------------------------------------------* / cond2 = (consec vad 0 == 8); /*---------------------------------------------------------* / /* 3. condition: start-up/reset */

/*---------------------------------------------------------* / cond3 = (updates noise <= 20 && ma_cp < 0.70 && cp < 0.75 && refl <-0.40 && end-max < 5.

(lev_rest != -1||(lev_reset == -1 && max_mes < 2.0))); /*---------------------------------------------------------* / /* 4. condition : pitch correlation */ // cond4 =(ma_cp > update_ma_cp_speech) ; if (calls == 3 && (condl 11 cond2 || cond3)) /* _____________________________________________________ _____*/ /* Update moving average of noise maximum */ /*---------------------------------------------------------* / ma max_noise = 0. + 0.; if (updates noise <= 20) updates_noise++ ; else lev_reset=0; /*---------------------------------------------------------* / } /* Update of speech */ /*/ else if (calls == 3 && cond4) { /* Update moving average of speech */ /*---------------------------------------------------------* / if (updates speech <= 60)

alpha_speech = 0.95; else alpha_speech = 0.999; mamaxspeech = alpha_speech*ma_max_speech + (1.0- alpha speech) *max; if (updates_speech <= 60) updates speech++ ; /*----------------------------------------------------*/ /*/ if (calls < 3) calls++ ; pitch corr [0] = cp; pitch_corr[1] = ma_cp ; /*---------------------------------------------------------* / return ; /*---------------------------------------------------------* / <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== ===============================*/ /*--------------------------------END----------------------- --------*/ <BR> <BR> <BR> -----------------------END------------

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ======================*/ /* PROTOTYPE FILE: lib_smo. h */ /*========================================================== ======================*/ /*---------------------------------------------------------* / /*--------------------------FUNCTIONS----------------------- -------*/ /*---------------------------------------------------------* / void SMO init lib (void); void SMOIsfsmoothest (INT16, INT16, FLOAT64, FLOAT64 [], FLOAT64 []) ; void SMO initial analysis (FLOAT64 [], INT16, FLOAT64, FLOAT64, *, FLOAT64 *, INT16); void SMO refined analysis (FLOAT64 *, INT16, FLOAT64 *, INT16 *, *, INT16) ; INT16) ; /*========================================================== ==============================*/

l = /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ======================*/ /* LIBRARY:lib_sur.c */ /*========================================================== ======================*/ /*---------------------------------------------------------- ----*/ /*------------------------------INCLUDE--------------------- --------*/ /*---------------------------------------------------------- ----*/ #include "typedef.h" #include "main.h" #include"const. h" #include"gputil. h" &num include"ext_var. h" #include "lib_sur.h" #ifdef DIAGNOSTICS &num include"lib_dia. h" #endif &num endif

/*------------------------------FUNCTIONS------------------- --------*/ /*---------------------------------------------------------- --*/ /*========================================================== ======================*/ /*FUNCTION : SNR_Calc_NSR_des (). */ /*---------------------------------------------------------* / /* PURPOSE : This function performs the initialisation */ /* the global variables of the SNR library */ /*---------------------------------------------------------* / /* INPUT : */ /* None. */ /*-------------------------*/ /* OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ void SNR init lib (void) /___________________________________________________________ ________*/ NoiseGainFactor= 1.0; /*---------------------------------------------------------* / /* SNRCalcNSRenc */ /*---------------------------------------------------------* / NoisEng_enc =-1.0; snr_ count = 0; snrcountvad = 0; eng_m_enc = 0.0; diff_lsf_m_enc = 0.0; diff_eng_m_enc = 0.0; nnoisextenc = 0;

/*---------------------------------------------------------* / return; <BR> <BR> <BR> <BR> <BR> <BR> /*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*.--------*/ /*========================================================== ======================*/ /* FUNCTION : SNR_Calc_NSR_enc (). */ /*/ /* PURPOSE : This function performs the SNR estimation */ /* the */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _(FLOAT64 []) syn : synthetized */ /* (FLOAT64 []) Isfq : quntised LSF */ /* _(INT16 ) Vad: vad */ /* _ (INT16) fame_class : input frame fame class. */ /* _(INT16 )1-frm : frame */ /*-----------------------*/ /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) NSR: estimated NSR at the */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ // /* RETURN ARGUMENTS */ /* None. */ <BR> <BR> <BR> ---------- void SNRCalcNSRenc (FLOAT64 syn [], FLOAT64 Isfq [], INT16 Vad, INT16 frame_class, FLOAT64 *NSR, INT161_frm) { /*---------------------------------------------------------- --------- FLOAT64 snr, eng, diff_lsf, diff eng, vall, val2; INT16 i, vad nsr ;

/*---------------------------------------------------------* / if (frame < 3) n_nois_ext_enc++; else nnoisextenc=0 ; if (Vad == 0) snr_count_vad++; else snr count vad=0 ; dot_dvector (syn, syn, &eng, 0, lfrm-l) ; /*---------------------------------------------------------* / if (snr frm-count==0) { (*NSR) = 0.0; vad nsr = 1; eng_m-enc = eng; else <BR> <BR> <BR> <BR> else<BR> <BR> <BR> <BR> { diff_lsf=0; for (i = 0; i < NP; i++) diff Isf += fabs (lsfq [i]-lsfq_mem enc [i]) ; diff_lsf*=100; diff_lsf_m_cnc=diff_lsf_m_enc*0.75+diff_lsf*0.25: /*----------------------------------------------------*/ diff eng = fabs (eng-eng_old_enc)/(MAX(eng+eng_old_end, 50*1_frm) ; diffengmenc = diff eng_menc*0. 75 + diff eng*0. 25; /*---------------------------------------------------*/

snr = eng/MAX (eng_m_enc, 0.1); if(Vad==0) { if (eng_m_enc < 0.1) eng_m_enc=eng; else engmenc = 0. 75*eng_m_enc + 0.25*eng; /___________________________________________________________ _*/ vad nsr = 1; if ((snr_count_vad > 15) && (snr count vad < 30) && (diff_lsf_m_enc < 10) && (diff_lsf<10) && (diff_eng_m_enc < 0.25) && (diff_eng < 0.25) && (snr < 10)) vad nsr=0 ; else { if ( ( (snr count vad > 15) 11 (snr_frm_count < 100)) && (n_nois_ext_enc>10 && (diff_lsf_m_enc<7) && (diff lsf<7) && (diff_eng_m-enc<0. 2) && (diff eng<0. 2) && (snr<8)) vad nsr0 ; /___________________________________________________________ _*/ if ((NoisEng_enc < 0.0) && (snrfrmcount > 500)) vad_nsr=Vad; /*------------------------------------------------------*/ if (vad nsr == 0) f if NoisEng_enc < 0.0) NoisEng_enc = eng; else

NoisEng_enc = NoisEng_enc*0. 85 + eng*0. 15; NoisEng_enc = MIN (NoisEng_enc, eng); } /*----*/ vall = MAX (NoisEng_enc-100*1_frm, 0); val2=MAX (eng, 0.1); (*NSR) = MIN (sqrt (val1/val2). 1.0); /*----------------------------------------------------*/ // snr frm count = MIN (snrfrmcount+l, 1000); for (i = 0; i < NP; i++) lsfq_mem_enc[i] = lsfq [i]; eng oldenc = eng; /*---------------------------------------------------------* / return ; /*---------------------------------------------------------* / } /*========================================================== ============================*/ /*-------------------------------END------------------------ -----*/

/*========================================================== ================================*/ /*========================================================== ======================*/ /* Conexant System Inc. */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE :lib_snr.h */ /*========================================================== ======================*/ /*---------------------------------------------------------- ---*/ /*---------------------------FUNCTIONS---------------------- -------*/ /*---------------------------------------------------------- ---*/ void SNR init lib (void); void SNR Calc NSR enc (FLOAT64 [], FLOAT64 [], INT16, INT16, FLOAT64 *, INT16) ; /*========================================================== ===============================*/

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: libswb. */ /*========================================================== ======================*/ /*---------------------------------------------------------- ---*/ /*---------------------------INCLUDE------------------------ ----------*/ /*---------------------------------------------------------- ---*/ #include "typedef.h" #include "main.h" &num include"lib swb. h" /*---------------------------------------------------------- ---*/ /*--------------------------FUNCTIONS----------------------- ----------*/ // /*========================================================== =================================*/ /* FUNCTION : byte swap_intl6 0. */ /*---------------------------------------------------------* / /* PURPOSE: Byte swap a 16 bit integer */ /*---------------------------------------------------------* / /* INPUT */ _ (INT16) input: data to be */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */

/* None */ /___________________________________________________________ ________*/ /* INPUT/OUTPUT */ /* None */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* (INT16) output: data to be */ /*========================================================== ======================*/ INT16 byte_swap_intl6 (INT16 input) <BR> <BR> <BR> {<BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT16 output;<BR> INT16 output: /*---------------------------------------------------------* / output=(input >> 8 & 0x00ff)^(input << 8); /*---------------------------------------------------------* / return output; <BR> <BR> <BR> <BR> <BR> <BR> /____________________________________*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*---------------..-----.-------*/ /* FUNCTION : byteswapint320. */ /*---------------------------------------------------------* / /* PURPOSE: Byte swap a 32 bit integer point */ /* Verified for swapping between SGI Unix and PC */ /*---------------------------------------------------------* / /* INPUT */ _ (INT32) input: data to be */ /*---------------------------------------------------------* / /* OUTPUT */ /* None */ /*---------------------------------------------------------* /

/* INPUT/OUTPUT ARGUMENTS */ /* None */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS */ /* (INT32) output: swapped */ /*========================================================== ======================*/ INT32 byteswapint32 (INT32 input) /___________________________________________________________ ________*/ INT16 i ; INT32 output; /*---------------------------------------------------------* / for (i = 0 ; i < 4 ; i++) * ( (char *) (&output) + i) = * ( (char *) (&input) + 3-i); /*---------------------------------------------------------* / return output; /*---------------------------------------------------------* / /___________________________________________________________ _________________*/ /*========================================================== ======================*/ /* FUNCTION : byte_swap_int64 O. */ /*---------------------------------------------------------* / /* PURPOSE: Byte swap a 64 bit integer point */ /* Verified for swapping between SGI Unix and PC */ /*/ /* INPUT ARGUMENTS */ /* _ (INT64) input: data to be */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : */ /* None */ /*---------------------------------------------------------* /

/* INPUT/OUTPUT */ /* None */ // /* RETURN ARGUMENTS */ /* _ (INT64) output: swapped */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> INT64 byteswapint64 (INT64 input)<BR> <BR> <BR> <BR> <BR> f<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/ INT16 i ; INT64 output; /*---------------------------------------------------------* / for (i = 0 ; i < 8 ; i++) * ( (char *) (&output) + i) = * ( (char *) (&input) + 3-i); /___________________________________________________________ ________*/ return output; /*---------------------------------------------------------* / /___________________________________________________________ _________________*/ /*========================================================== ======================*/ /* FUNCTION : byte swap_float32 n. */ /*_____________________,____________________________________ ______*/ /* PURPOSE: Byte swap a 32 bit floating point */ /* Verified for swapping between SGI Unix and PC */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS /* _ (FLOAT32 *) input: data to be */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* _ (FLOAT32 *) output: swapped */ /*---------------------------------------------------------* /

/* INPUT/OUTPUT ARGUMENTS*/ /* None */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS*/ /* None. */ void byte_swap_float32 (FLOAT32 *input, FLOAT32 *output) // INT16 i ; /*---------------------------------------------------------* / for (i = 0 ; i < 4 ; i++) * ( (char *) (output) + i) = * ( (char *) (input) + 3-i); /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*.------------------------*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTION : byte_swap_float64 O. */ /*---------------------------------------------------------* / /* PURPOSE: Byte swap a 64 bit floating point */ /* Verified for swapping between SGI Unix and PC */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : */ /* _ (FLOAT64) input: data to be */ /*---------------------------------------------------------* / /* OUTPUT */ /* _ (FLOAT64) output: swapped */ /*---------------------------------------------------------* / /* INPUT/OUTPUT*/

/* None */ // /* RETURN ARGUMENTS */ /*None.*/ void byte_swap_float64 (FLOAT64 *input, FLOAT64 *output) { // INT16 i; /*---------------------------------------------------------* / for (i=0; i < 8; i++) * ( (char *) (output) + i) = * ( (char *) (input) + 7-i); /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*========================================================== =============================*/ /*--------------------------------ENd----------------------- ------*/

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOYPE FILE: Iibswb. h */ /*========================================================== ======================*/ /*---------------------------------------------------------* / /*----------------------------FUNCTIONS--------------------- ------------*/ /*---------------------------------------------------------* / INT16 byte swap_intl6 (INT16) ; INT32 byte_swap_int32 (INT32) ; INT64 byte swap_int64 (INT64) ; void byte swap_float32 (FLOAT32 *, FLOAT32 *) ; void byte_swap_float64 (FLOAT64 *, FLOAT64 *) ; /*========================================================== ===============================*/ <BR> <BR> <BR> <BR> /*-----------------------------END-------------------------- -----*/

= == == /*========================================================== ======================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ======================*/ /* LIBRARY: lib vad. */ /*========================================================== ======================*/ /*---------------------------------------------------------- ----*/ /*-----------------------------INCLUDE---------------------- ---------*/ /*---------------------------------------------------------- ----*/ &num include"typedef. h" #include"main. h" #include"const. h" #include"gputil. h" #include"mcutil. h" &num include"ext_var. h" #include "lib_lpc.h" #include "lib_vad.h" /*---------------------------------------------------------- ---*/ <BR> <BR> <BR> <BR> /*___________----___--------------FUNCTIONS----------------- ----------------*/<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== ======================*/ /* FUNCTION : VAD_init_lib (). */ /*---------------------------------------------------------* /

/* PURPOSE : This function performs initialisation of */ /* global variables of the VAD */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS None.

/___________________________________________________________ ________*/ /* OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*---------------------------------------------------------* / /* RETURN */ /* None. */ void VAD_init lib (void) /___________________________________________________________ ________*/ INT16 i, j; /*---------------------------------------------------------* / ini_svector(lag_buf, 0,LTP_BUFF_SIZE-1,20); inidvector (pgainbuf, 0, LTPBUFFSIZE-1, 0.7); /*---------------------------------------------------------* / Vad = 1; ini_svector (flag_vad_mem, 0,1,1); /*---------------------------------------------------------* / flag=1; countsil = 0 ; count ext 0; dec3_flg_mem = 0;

pitch gain mean = 0.5; for (i = 0 ; i < VAD_MEM_SIZE ; i++) for (j=l ; j<NP ; j++) vad_lsf_mem [i][j]=vad_lsf_mem [i] [j-1] + 0. 05; min_energy = MAXENERGY ; mean-energy = 0.0; mean max = 0; mean_s_energy= 0.0; ini-dvector (prev_cml lsf diff, 0, VADMEMSIZE-1, 0.0); ini-dvector (prev_energy, 0, VAD-MEM SIZE-1, 0.0); snr = 0.0; onset_flg= 0; count onset = 0; count noise = 0; /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : VAD voice detection Q. */ /*---------------------------------------------------------* / /* PURPOSE : This function performs Voice Activity */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ (FLOAT64 x : input frame.

/* -(FLOAT64 []) rc: reflection coefficients. */ /* _ (FLOAT64) pderr : energy of */ /* _ (INT16 Q) lag mem : history of pitch */

/* _(FLOAT64 []) pitch_gain_mem : history of pitch */ /* _ (FLOAT64 []) Isf : lsf */ /* _ (FLOAT64 [1) rxx : autocorrelation coefficients. */ /* (INT64) frmcount : frame */ /* _(INT16 )flag_vad_mem_1: past vad decision (n-1). */ /* _(INT16 )flag_vad_mem_2 : past vad decision */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* _(INT16 *) flag vad : vad */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /___________________________________________________________ ________*/ /* RETURN ARGUMENTS */ None. void VAD voice detection (FLOAT64 x [], FLOAT64 rc [], FLOAT64 pderr, INT16 lag mem [], FLOAT64 pitchgain mem [], FLOAT64 Isf [], FLOAT64 rxx [], INT64 frm_count, INT16 *flag vad, INT16 flag_vad_mem []) /___________________________________________________________ ________*/ FLOAT64 pitch gainavg ; INT16 decision; INT16 i; INT16 pflag, pflagl, pflag2 ; INT16 dec3_flg; FLOAT64 lags_std ; FLOAT64 max frame, val; FLOAT64 wl, w2; FLOAT64 norm_energy ; FLOAT64 nnormenergy ; FLOAT64 *sum2_p, *sum2 a, *temp; FLOAT64 norm_cml_lsf_diff; FLOAT64 spd;

FLOAT64vad_partial_lpc_gain, vad_lpc_gain; FLOAT64nthrs; FLOAT64 cml_lsf diff= 0.0; FLOAT64*sum1-lsf, *sum2_lsf; /*---------------------------------------------------------* / Memory allocation /*---------------------------------------------------------* / suml lsf = dvector (0, NP-1); sum2_lsf= dvector (0, NP-1); /*---------------------------------------------------------* / decision = NOISE; dec3_flg = 0; maxframe =- (FLOAT64) INTMAX ; for (i = 0 ; i < LFRM ; i++) val = fabs (x [i]) ; if (val > max frame) max-frame = val ; /*---------------------------------------------------------* / /* Calculate the oder VADNP prediction */ // vad_partial_lpc_gain = 1.0; for (i = 0; i < VAD LPC ORDER ; i++) vad_partial_lpc_gain *= (1.0-rc [i] *rc [i]) ; vad lpc_gain = vad_partial_lpc_gain ; for (i=VADLPCORDER ; i<NP ; i++) vad_lpc_gain *= (1.0-sqr (rc [i])) ;

vad lpc_gain =-10. (vad_lpc_gain+ESPI) ; /*---------------------------------------------------------* / /* Calculate the average prediction gain and the lag */ /* standard */ /*---------------------------------------------------------* / VAD_mean_std_calc(lag_mem, pitch_gain_mem, &lags_std, &pitch_gain_avg); pitchgainmean = 0. 8*pitch_gain_mean + 0.; /*---------------------------------------------------------* / /* Set-up the classification flags */ // if (pitch-gain mean > 0.7) pflag2 = 1 ; else pflag2 = 0; if ( (lags std < 1.30) && (pitch_gain_mean > 0. pflagl = 1; else pflagl = 0; pflag = (flag_vad_mem [0] || pflag2) && pflagl ; /*---------------------------------------------------------* / /* Calculate the signals */ /*---------------------------------------------------------* / val = rxx [0]/ (FLOAT64) L LPC ; normenergy = 10.0 * loglO (vad_partial_lpc_gain * val + EPSI); normenergy = MAX (0.0, normenergy) ; nnormenergy = 10.0 * loglO (val + EPSI); miormenergy = MAX (10.0, nnormenergy) ;

/*---------------------------------------------------------* / /* Calculate the weighted sum of lsf coefficeints */ /*---------------------------------------------------------* / add_dvector (lsf, &vad_lsf_mem[0][0], sum1_lsf, 0, NP-1); add dvector (suml lsf, &vad lsf mem [l] [0], suml_lsf, 0, NP-1); wad dvector (suml lsf, 0.25, &vad_lsf_mem [2] [0], 0.25, suml lsf, 0, NP-1); add_dvector (&vad_lsf_mem[0][0], &vad_lsf_mem[1][0], sum2_lsf, 0, NP-1); wad_dvector (sum2_lsf, 0.3333, &vad lsf mem [2] [0], 0.3333, sum2_lsf, 0, NP-1); /*---------------------------------------------------------* / /* min_energyimum energies */ // if (frm_count < 65) if (normenergy < min_energy ) min energy = norm energy ; prev_min_energy = norm_energy; if ((frm_count % VADMINMEMSIZE) == 0) i = frmcount/VADMINMEMSIZE-1 ; min_energy_mem [i] = min_energy; min_energy =MAX_ENERGY;

if ( (frmcount % VADMINMEMSIZE) == 0) prevminenergy = minenergymem [0] ; for (i = 1; i < VADMINMEMSIZE ; i++) if (min_energy_mem[i] < prevmin energy) prev_min_energy = min_energy_mem[i]; } if (frm-count >= 65 { if ( (frmcount % VADMINMEMSIZE) == 1) { min_energy = prevminenergy ; next_min_energy = MAXENERGY ; if(norm_energy < min_energy) min energy = normenergy ; if(norm_energy< next_min_energy) next_min_energy = normenergy ; if ( (frmcount % VADMINMEMSIZE) == 0) for (i = 0 ; i < VADMINMEMSIZE-1 ; i++) min_energy_mem[i] = min_energy_mem[i+1]; minenergymem [VADMINMEMSIZE-l] == nextminenergy ; prevminenergy = minenergymem [0] ; for (i = 1; i < VADMINMEMSIZE ; i++) if (min energy-mem [i] < prev minenergy) prev_min_energy = min_energy_mem[i]; }

/*---------------------------------------------------------* / /* First INIT FRAME frames parameters */ /*---------------------------------------------------------* / if (frm_count <= INIT FRAME) if(pflag==0 && ( ((max_frame/mean_max < 12.0) && (nnorm_energy <= 30. 0) && (nnormenergy-normenergy < 9.0) && ( (rc [0] <-0.55 && vadjpcgain < ! j (vadjpcgain) < 2.75)) 11 (nnormenergy <= ( (nnorm_energy <= 25.0) && ( (rc [0] <-0.55 && vad_lpc_gain < 5.0) 11 (vad_lpc_gain) < 2.75) && (max_frame/mean_max < 12. decision = NOISE; else decision = VOICE; mean_energy = (mean_energy* ( (FLOAT64) (frm_count-1)) + norm-energy)/ (FLOAT64) (frm count) ; mean_max=(mean_max* ( (FLOAT64) (frm_count-1)) + max frame)/ (FLOAT64) (frmcount) ; w1=(FLOAT64)(frm_count -1); w2 = 1.0; wad dvector (mean_lsf, wl, lsf, w2, mean_lsf, 0, NP-1); wl = 1.0/ (FLOAT64) frm_count ; sca_dvector (mean_lsf, w1, mean_lsf, 0, NP-1); cpy_dvector (mean_lsf, norm_mean_lsf, 0, NP-1); } //

/* First INIT FRAME frames final VAD flag set-up */ /*---------------------------------------------------------* / (*flag vad) = decision; /*---------------------------------------------------------* / /* Parameterscalculation */ /*---------------------------------------------------------* / if (frm-count >= INITFRAME) { if (frm_count == INITFRAME) meansenergy = MAX (mean energy-12. 0,0.0); /*---------------------------------------------------*/ /* Spectral Distortion */ /*---------------------------------------------------*/ sum2_p= dvector (0, NP-1); sum2 a = dvector (0, NP); temp = dvector (0, NP-1); /*----------------------------------------------------*/ LPC_lsftop(sum2_lsf, sum2_p, NP); LPC_ptoa (sum2_p, sum2 a, NP); /*--------.------------*/ VAD itakurasaito (rxx, sum2 a, &spd, NP); spd/= (EPSI + pderr); /*---------------------------------------------------*/ dif dvector (lsf, norm mean_lsf, temp, 0, NP-1); dot dvector (temp, temp, &norm cml lsf diff, 0, NP-1); dif dvector (suml lsf, mean lsf, temp, 0, NP-1);

dot dvector (temp, temp, &cml_lsf_diff, 0, NP-1); /*---------------------------------------------------*/ free_dvector (sum2_p, 0, NP-1); free dvector (sum2 a, 0, NP); free dvector (temp, 0, NP-1); /*---------------------------------------------------*/ if ((frm_count == INTT_FRAME)||((prev_cml_lsf_diff[0] < 0.5e-4) && (cml_lsf_diff > 0.1c-3))) <BR> <BR> <BR> <BR> <BR> <BR> cml lsf diff filt = cml lsf diff<BR> else cml_lsf_diff_filt=0.4*cml_lsf_diff + 0.; /*---------------------------------------------------*/ dec3_flg = 0; /___________________________________________________________ */ if (snr <= 5.0) nthrs = 3.0; else if (snr <= 10.0) nthrs = 4.7; else nthrs = 5.5; /*----------------------------------------------------*/ if(pflag == 1 && nnorm_energy > 10.0) decision = VOICE; else if ( (norm energy >= mean_s_energy + || (cml_lsf_diff > 1000. 0e4)) decision = VOICE;

count ext = 0 ; } else if ( (normenergy-meansenergy) < nthrs) decision = NOISE; else { decision = VOICE; dec3_flg = 1; count ext = 0 ; } // if (snr <= 5. 0) onsettrhsd = 6.0; else if (snr <= 10.0) onsettrhsd = 8.0; else onsettrhsd = 10.0; /*---------------------------------------------------------* / if ((nnorm_energy > 0.5* (prev_energy[1] + prev_energy [0]) + onset_trhsd)||((nnorm_energy > 35.0) && ( (spd > 2.5) ||(norm_cml_lsf_diff> || (norm_energy-mean_s_energy>10.0)))) { onset_flg=1; flag =1 ; } else { if (nnorm_energy <= { onset_flg=0; } if (onsetflg) { count onset++ ; if (count_onset == 4) { onsetflg = 0;

count onset = 0 ; count ext = 4; /*---------------------------------------------------------* / if (onsetf ! g == 0 && pflag ==0 && (((max_frame/mean_max < 12.0) && (nnormenergy <= 30.0) && (nnormenergy-norm energy < 9.0) && ( (rc [0] <-0.55 && vad_lpc_gain < 5.0) 11 (vad ! pcgain) < 2.75)) 11 (nnormenergy <= 10.0) 11 ( (nnorm-energy <= 25.0) && ( (rc [0] <-0.55 && vad_lpc_gain < 5.0) 11 (vad_lpc_gain) < 2.75) && (maxframe/meanmax < 12.

{ decision = NOISE; flag =0; else { if ( (prevenergy [0]-nnormenergy > 10.0) && (nnorm_energy < 20.0) && (maxframe/meanmax < 12.0)) { decision = NOISE; flag =0; } else if (frm_count <= 65) decision = VOICE; if (pflag ==0 && count noise > 8 && (nnormenergy < 30.0) && (max_frame/mean_max < 15.0) && (normenergy-meansenergy < 6.5)) decision = NOISE; flag =0 ;

else if (pflag ==0 && count noise > 4 && cml_lsf_diff< 900.

&& (norm-cml-lsf diff < 3500. && (onsetflg == 0) && (max frame/mean max < 15.0) && (norm energy-meansenergy < 6.0)) decision = NOISE; flag =0; else if ((nnorm_energy 25.0) && (flag_vad_mem [1] == VOICE) && (flag vad mem [0] == VOICE) && (decision == NOISE) && (nord diff > 4000. 0e-6)) decision = VOICE; // if (decision == NOISE) count noise++ ; else count noise=0 ; /*---------------------------------------------------------* / if ((norm_cml_lsf_diff> 0.0003) && (nnormenergy-prevenergy [2] <-12.0)) count ext = 4; /*---------------------------------------------------------* / if (flag == 1) /_______________________________________________________*/ if (((nmorm_energy> 25.0) && (flagvadmem [1] == VOICE) && (flagvadmem [0] == VOICE) && (decision == NOISE)) 11 (onsetflg))

{ count_ext++; decision = VOICE; if (count ext <= 26-0 && snr <= 0.0) flag =1 ; else if (count ext <= 22-0 && snr <= 5.0) flag =1 ; else if (count_ext <= 20-0-0 && snr <= 6.5) flag =1 ; else if (countext <= 16-0-2 && snr <= 8.0) flag =1 ; else if (count_ext <= 14-2-2 && snr <= 11.0) flag =1 ; else if (count_ext <= 10-2-2 && snr <= 14.0) flag =1 ; else if (countext <= 8-2-2 && snr <= 17.0) flag =1 ; else if (count_ext <= 3 && snr <= 21.0) flag =1 ; else if (countext <= 1 && snr > 21.0) flag=1; else { flag = 0 ; count ext=0 ; } } // else { flag = 1; count_ext= 0; } /*__________________________________________________________ _*/ if (decision == NOISE)

count ext=0 ; /*---------------------------------------------------------* / /* Compute mean_energy */ // if (norm-energy > min_energy + 12.0) mean energy = 0.9 * mean energy + 0.1 * normenergy ; /*---------------------------------------------------------* / /* Compute snr */ /*----.-----------------*/ snr = mean energy-means energy ; /*---------------------------------------------------------* / /* Compute the new mean s energy */ /*---------------------------------------------------------* / if ( ( (normenergy < MAX (mean s energy, min energy) + 3.5) &&(!pflag))||decision = NOISE) { mean max = MAX (EPSI, 0.95 * mean max + (1.95) * max frame) ; countsil++ ; if (count-sil < INITCOUNT) { wl = 0. 75; w2 = 0.60; } else if (countsil < INITCOUNT + 10) wl = 0. 85; w2 = 0.65; } else if (count sil < INITCOUNT + 20) {

wl = 0. 85; w2 = 0. 65; else wl =0. 65; w2 = 0. 65; } wad_dvector(mean_lsf, w2, lsf, (1.0-w2), mean_lsf, 0, NP-1); if (nnorm_energy > 18.0) mean-s energy = wl * mean_s_energy + (1. * norm_energy ; means energy = MAX (mean_s_energy, 0.0); /*---------------------------------------------------------* / wad dvector (norm_mean lsf, 0.85, Isf, (1.0-0.85), norm-mean-lsf, 0, NP-1); /*---------------------------------------------------------* / /* Current frames final VAD flag */ // (*flag vad) = decision; /*---------------------------------------------------------* / if ((frm_count >64) && (mean_s_energy +10.0 < min energy) && (!pflag)) { mean-s energy = MAX (0. 5* (min_energy+mean_s_energy),0.0) ; meansenergy = 0. + 0.; mean-s energy = MAX (mean s energy, 0.0);

countsil = 0; } else if ( (frmcount >64) && (mean-s energy > min_energy + 4. mean_s_energy = MAX (min energy, 0.0); count sil = 0; } // } // /* Save parameters for the processing of the next */ /*---------------------------------------------------------* / sfrdvector (prevenergy, prevenergy, 1, VADMEMSIZE-1) ; prev_energy [0] = nnorm energy ; sfr_dvector (prev_cml_lsf_diff, prev_cml_lsf_diff, 1, 0, VAD_MEM_SIZE-1); prev_cml_lsf_diff]0]=cml_lsf_diff; cpy_dvector (vad_lsf_mem [l], vad_lsf_mem [2], 0, NP-1); cpy_dvector (vad_lsf mem [0], vad Isf mem [l], 0, NP-1); cpy_dvector(lsf, vad_lsf_mem[0,] 0, NP-1); dec3_flg_mem = dec3_fig ; /*---------------------------------------------------------* / free_dvector (sum1_lsf, 0, NP-1); free_dvector (sum2_lsf, 0, NP-1); /*------------------------*/ return; /*---------------------------------------------------------* / }

/*---------------------------------------------------------- -----*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> l = /* FUNCTION : VADitakurasaito () */ /*---------------------------------------------------------* / /* PURPOSE : This function calculate the Itakura Saito */ /* distance. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _(FLOAT64 []) r : input signal autocorrelation. */ /* _(FLOAT64 []) a :LPC filter coefficients. */ /* (INT16) P: filter */ // /* OUTPUT ARGUMENTS */ /* _(FLOAT64 *) isd: output Itakura Saito */ /*---------------------------------------------------------* / /* INPUT/OUTPUT ARGUMENTS */ /* None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void VAD_itakura_saito (FLOAT64 r [], FLOAT64 a [], FLOAT64 *isd, INT16 P) { // INT16 k, m ; FLOAT64 sum; FLOAT64 ra [20] ; /*---------------------------------------------------------* / for (k = 0; k <= P; k++) sum = 0.0; for (m = 0 ; m <= P-k; m++) sum = sum + a [m] *a [m+k] ; r a [k] = sum ;

/*---------------------------------------------------------* / sum = 0.0; for (m = 1; m <= P ; m++) sum = sum + r [m] *r_a [m]; /*---------------------------------------------------------* / (*isd) = (r [0] *r_a [0] + 2*sum); /*---------------------------------------------------------* / return; /*---------------------------------------------------------* / } /*========================================================== ======================*/ /* FUNCTION : VAD_mean_std_calc (). % /*---------------------------------------------------------* / /* PURPOSE : This function calculate average */ /* gain and the lag standard */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS */ /* _ (INT16 []) lags mem : history of pitch */ /* (FLOAT64 []) pitchgain mem : history of pitch */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS */ /* _ (FLOAT64 *) I_std : lag standard */ /* (FLOAT64 pg_mean : average prediction */ /*---------------------------------------------------------* / /* INPUT/OUTPUT */ /* None. */ /*---------------------------------------------------------* / /* RETURN */ /* None. */

/*========================================================== ======================*/ void VAD_mean_std_calc (INT16 lagsmem [], FLOAT64 pitchgainmem [], FLOAT64 *1 std, FLOAT64 *pg_mean) /___________________________________________________________ _________*/ INT16 i; FLOAT64 val, suml, sum2; /*---------------------------------------------------------* / suml = 0.0; sum2 = 0.0; for (i = 0 ; i < LTP_BUFF_SIZE ; i++) suml += (FLOAT64) lags-mem [i]; sum2 += pitch_gain_mem [i]; } suml = suml/ (FLOAT64) LTP_BUFF_SIZE ; /*---------------------------------------------------------* / (*pg_mean) = sum2/ (FLOAT64) LTPBUFFSIZE ; /*---------------------------------------------------------* / (*1_std) = 0.0; for (i = 0 ; i < LTPBUFFSIZE ; i++) val =(FLOAT64) lags_mem [i] - sum1; (*1_std)+= val*val; } (*1_std)= sqrt ( (*lstd)/ (FLOAT64) (LTP_BUFF_SIZE-1)) ;

/*---.---------------------*/ return ; /*/ } /*========================================================== =======================================*/ /*-END */<BR> /*------------------------------------END------------------- ----------------*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA 92660 */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: lib_vad. */ /*========================================================== ======================*/ /*---------------------------------------------------------- -----*/ /*-----------------------------FUNCTIONS-------------------- -------------*/ /*---------------------------------------------------------- -----*/ void VAD-init lib (void); void VAD voice detection (FLOAT64 [], FLOAT64 [], FLOAT64, INT16 [], FLOAT64 *, FLOAT64 [], FLOAT64 [], INT64, INT16 [], INT16 []); void VADitakurasaito (FLOAT64 [], FLOAT64 [], FLOAT64 *, INT16); void VAD_mean_std_calc (lNT16 [], FLOAT64 [], FLOAT64 *, FLOAT64 *); /*========================================================== ========================================*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* PROTOTYPE FILE: main. */ /*========================================================== ======================*/ /*--------------------------------INCLUDE------------------- ----------------*/ /*---------------------------------------------------------- ---*/ &num include<stdio. h> #include <stdlib.h> #include <math. h> #include string. h> #include <malloc. h> #include <errno.h> #include <memory. h> #include <float. h> &num include <limits. h> /*---------------------------------------------------------- ---*/ <BR> /*---------------------------------DEFINE------------------- ----------------*/<BR> /___________________________________________________________ _________________*/ #define nint (x) ((x>=O) ? (INT16) (x+0. 5): (INT16) (x-0. 5)) #define MAX_n (x, y) ( (x) > (y))? (x): (y) &num define MIN n (x, y) ( (x) < (y))? (x): (y)

#define ABS_n (x) ((x)<0) ? (-x): (x) /*---------------------------------------------------------- -*/ /*------------------------------DEFINE---------------------- ---------*/ /*---------------------------------------------------------- -*/ #define EXIT_FAILURE1 &num define NBMAXCHAR 128 &num define NBALGOMAX 100 &num define MAXSENTENCE 100 &num define NBMAXVEC 100 /* &num define PI 3.141592653589793115997963468544185161590576171875 &num define TWOPI 6. 28318530717958623199592693708837032318115234375 #/ &num define PI 3. 141592654 /*========================================================== ====================================*/

/*========================================================== ===================================*/ /*========================================================== =========================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS RESERVED */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* MAIN PROGRAM: maindec. */ /*========================================================== ============================*/ /*---------------------------------INCLUDE------------------ ----------------*/ /*-------------------------------INCLUDE-------------------- -------------* /*---------------------------------------------------------- -------*/ #include "typepdef.h" #include "main.h" #include"const. h" #include "glb_var.h" #include"mcutil. h" #include"gputil. h" #include"decoder. h" #include "lib_io.h" #include "lib_ini.h" #include "lib_cpr.h" &num ifdef DIAG_SMV #include "lib_dia.h"

#endif /*========================================================== ==================================*/ /*----------------------------------MAIN-------------------- --------*/ /*========================================================== ==================================*/ int main (int argc, char *argv []) { /___________________________________________________________ ________*/ /* Pointers to I/O */ /*---------------------------------------------------------* / FILE *fp_speech out; FILE *fp_bitstream ; /*---------------------------------------------------------* / /* buffers /*---------------------------------------------------------* / FLOAT64 dec sigout [L_FRM] ; INT16 i, switch_flag=1 ; INT16 *s_y; <BR> <BR> <BR> <BR> <BR> INT16 serial [PACKWDSNUM],<BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* Print copyright information */ /*/ #ifdef VERBOSE print copyright 0 ; #endif /*---------------------------------------------------------* / /* Check the number of input */ /*---------------------------------------------------------* / if (argc < 3)

#ifdef VERBOSE printf ("\n%s bitstreamfile decodedspeechfile \n\n", argv[0]); #endif exit (1); /*---------------------------------------------------------* / /* Open 10 files */ // fp_bitstream = file_open_rb (argv [1]); ipspeechout = file_open_wb (argv [2]); switch_flag- atoi (argv [3]) ; #ifdef VERBOSE printf ("\nExecutable : % s\n", argv [0]) ; printf ("Inputbitstream : % s\n", argv [l]) ; printf ("Output speech :%s\n", argv [2]) ; #ifdef BYTE_SWAP_OUTPUT printf ("Output is byte-swapped\n") ; #endif #endif #ifdef DIAGNOSTICS /*---------------------------------------------------------* / /* Open DIAGNOSTICS files */ /*---------------------------------------------------------* /

DIA_dec_open_files (); #endif <BR> <BR> <BR> <BR> <BR> /___________________________________________________________ ________*/<BR> <BR> <BR> /* Memory */ /*---------------------------------------------------------* / s_y = svector (0, LFRM-1) ; TNI_allocate memory () ; /*---------------------------------------------------------* / /* AlgorithmInitialization */ /*---------------------------------------------------------* / INI_init_decoder(); /* SYNTHESIS */ while ( (i = fread (serial, sizeof (short), PACKWDSNUM, fp_bitstream)) == PACKWDSNUM) { frm-count++ ; &num ifdef VERBOSE printf("[%Id frame(s), %6.3f sec.]\r", frm_count, (FLOAT64) (frm_count*L_FRM)/(FLOAT64) FS); #endif /*---------------------------------------------------------* / /* Decoding Bitstream */ /*---------------------------------------------------------* /

dec_smv_frame(serial, dec_sigout, switch_flag); IO_writesamples (fp_speech_out, dec_sigout, s_y, L_FRM); /___________________________________________________________ ________*/ /* Memory */ /*---------------------------------------------------------* / free_svector (s_y, 0, L_FRM-1); INI_dcallocate_memory (); /*---------------------------------------------------------* / /* Close IO */ /*---------------------------------------------------------* / fclose (fp_bitstream) ; fclose(fp_speech_out); #ifdef DIAGNOSTICS /*---------------------------------------------------------* / /* Close DIAGNOSTICS */ /*---------------------------------------------------------* / DIAdecclosefiles 0; <BR> <BR> <BR> <BR> <BR> <BR> <BR> &num endif<BR> printf ("\n") ; printf("\n"); /*---------------------------------------------------------* / return 0; // /*---------------------------------------------------------* / /*========================================================== =========================*/ /*-----------------------------END-------------------------- -----*/ 5/*========================================================= =========================*/

/* conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* MAIN PROGRAM : main_enc.c */ /*========================================================== ======================*/ /*---------------------------------------------------------- -----*/ /*-----------------------------INCLUDE---------------------- ----------*/ /*---------------------------------------------------------- -----*/ #include "typedef.h" #include "main.h" #include"const. h" #include "glb_var.h" #include"mcutil. h" #include"gputil. h" &num include"encoder. h" #include "lib_ini.h" #include "lib_io.h" #include "lib_cpr.h" &num include"lib_ppr. h" &num include"lib_sns. h" #ifdef DIAG_SMV #include "lib_dia.h"

#endif #endif /*----------------------------MAIN-------------------------- ------*/ int main (int argc, char *argv []) { { /* Files /*---------------------------------------------------------* / FILE *fp_speech_in ; FILE *fp_bitstream; FILE *fp_signaling ; FILE *fp_mode ; // /* Variables */ /*---------------------------------------------------------* / FLOAT64*px; FLOAT64 avgrate ; // INT16 flat_flag=0; INT16 switch_flag=1; INT16 input_samples; char signaling; INT16 VoicingClass=0; /*---------------------------------------------------------* / /* buffers /*---------------------------------------------------------* / FLOAT64*sig_in, *signn_buf, *sig_ppr, *sig_out; INT16 *sx, *sy ; INT16*serial;

/*---------------------------------------------------------* / /* Print copyright */ /*---------------------------------------------------------* / #ifdef VERBOSE print copyright 0 ; #endif /*__________________________________________________________ _________*/ /* Parameters */ /*---------------------------------------------------------* / INIparameterssetup (argc, argv, &fp_speech_in, &fp_bitstream, &fp_mode, &fp_signaling, &smv_mode) ; #ifdef DIAG_SMV /___________________________________________________________ ________*/ /* Open DIAGNOSTICS */ /*---------------------------------------------------------* / DIA_enc_open_files () ; #endif /*__________________________________________________________ _________*/ Memory Allocation /*---------------------------------------------------------* / s_x = svector (0, LFRM-1) ; s_v = svector (0, LFRM-1) ; sig_in = dvector (0, LFRM-1) ; signnbuf = dvector (0, LFRM+ENHDELAY-1) ; sigppr = dvector (0, LPP-1) ; sigout = dvector (0, LFRM-1) ;

serial = svector (0, PACKWDSNUM-1); INI_allocate_memory (); /*---------------------------------------------------------* / /* Algorithm */ /*---------------------------------------------------------* / INI_init_encoder(); // /* Read the input */ /*---------------------------------------------------------* / px = sigin+LFRM-LLPCLHD-ENHDELAY ; IO readsamples (fp_speech in, s x, px, LLPCLHD+ENH DELAY) ; // /* Silence enhancement of the Input signal */ /*-----------------------*/ PPRsilenceenhan (px, px, LLPCLHD+ENHDELAY) ; /*---------------------------------------------------------* / /* High pass filter at 80 */ /*---------------------------------------------------------* / PPR_highpass (L_FRM, sig_in); cpy_dvector (sig_in, signn_buf+ENH_DELAY, 0, LFRM-1) ; // /* Input Speech Enhancement */ /*---------------------------------------------------------* / SNS_modified_noise_suprs (VoicingClass, sig_in) ; SNS_modified_noise_suprs(VoicingClass, sig_in+L_FRM/2);

cpy_dvector (sigin+LFRM-LLPCLHD, sigppr+LPP-LLPCLHD, 0, L LPCLHD-1) ; /*---------------------------------------------------------* / /* Low pass filter for tilt */ /*---------------------------------------------------------* / px = sig_ppr+L PP-L LPCLHD; PPR_lowpass (px, (INT16)(L_IPCLHD), smv_mode, FlatSp_Flag); <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== ================================*/<BR> /*##################################ANALYSIS PART############################ */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== ==================================*/ input samples = LFRM ; while (input samples == L_FRM) /*/ frm_count++ ; /*-----------------------------------------------------*/ #ifdef VERBOSE printf (" [% Id frame (s), %6. 3fsec.] \r", frmcount, (FLOAT64)(frm_count*l_FRM)/FS); #endif /*__________________________________________________________ _*/ /* Reading the signaling */ /*-----------------------------------------------------*/ if (fp_signaling ! = NULL) fread (&signaling, sizeof (char), 1, fp_signaling) ; else signaling = (char) 0;

/*---------------------------------------------------------* / /* Read the input */ /*---------------------------------------------------------* / input_samples=(INT16)IO_readsamples (fp_speech_in, s_x, sig_in, L_FRM); /*---------------------------------------------------------* / /* Silence enhancement of the Input signal frame */ /*---------------------------------------------------------* / PPR_silence-enhan (sig_in, sig_in, input_smaples); /*---------------------------------------------------------* / /* Zero Padding if necessary for the last */ /*---------------------------------------------------------* / ini dvector (sig_in, input samples, L FRM-1, 0.0); PPR-highpass (L_YW, sig_in) ; cpy_dvector (signn_buf+L_FRM, signn_buf, 0, ENHDELAY-1) ; cpy_dvector (sigin, signnbuf+ENHDELAY, 0, L FRM-1) ; if (FlatSp_Flag == 1) MIN_GAIN =-14.0; /*---------------------------------------------------------* / /* Input Speech */ /*---------------------------------------------------------* / SNS modified_noise suprs (VoicingClass, sig_in) ; SNS_modified_noise_suprs(VoicingClass, sig_in+L_FRM/2); /*---------------------------------------------------------* / /* Update the pre-processed speech buffer */ /*---------------------------------------------------------* /

cpy_dvector (sig_ppr+L_FRM, sig_ppr, 0, LPP-LFRM-1) ; cpy_dvector (sig_in, sig__ppr+L_PP-L_FRM, 0, LFRM-1) ; /*----------------------------------------------------*/ /* Low pass filter for tilt compensation */ // px = sig_ppr+L_PP-L_FRM ; PPR_lowpass (px, LFRM, smvmode, FlatSpFlag) ; #ifdef SCRATCH_PAD_MEM ini-dvector (sig_in, 0, LFRM-1,-1. 0); ini_dvector(signn_buf, 0, L_FRM-1, -1.0); #endif encsmvframe (sigppr, serial, sigout, smvmode, switch flag, &FlatSp Flag, signaling, &avg_rate, &VoicingClass) ; #ifdef DIAG_SMV 10 writesamples (fdiasp enc, sigout, sy, LFRM) ; #endif fwrite (serial, sizeof (short), PACKWDSNUM, fpbitstream) ; /*---------------------------------------------------------* / /* Print the Average bit */ /*---------------------------------------------------------* / printf ("\n\t\t\taverage_rate = %f\n", avgrate) ; /*---------------------------------------------------------* / /* Memory */

/*---------------------------------------------------------* / free svector (s x, 0, LFRM-1) ; free_svector (s_y, 0, LFRM-1) ; free dvector (sig in, 0, LFRM-1) ; free_dvector (signn_buf, 0, LFRM+ENHDELAY-1) ; free-dvector (sigppr, 0, LPP-1) ; free_dvector (sig_out, 0, LFRM-1) ; free svector (serial, 0, PACKWDSNUM-1); INI-deallocate memory () ; /*---------------------------------------------------------* / /* Close IO files */ /*---------------------------------------------------------* / fclose (fpspeechin) ; fclose (fp_bitstream) ; if (fp_signaling ! = NULL) fclose (fp_signaling) ; #ifdef DIAG_SMV // /* Close DIAGNOSTICS files */ /*---------------------------------------------------------* / DIA_enc_close_files (); #endif /*__________________________________________________________ _________*/ #ifdef VERBOSE printf ("\n") ;

#endif /*--------------------------------------------------*/ return 0; /*--------------------------------------------------*/ } /*---------------------------------------------------------* / <BR> <BR> } /*------------------------------END------------------------- ---*/ /*========================================================== =================================*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : mcutil. c */ /*========================================================== ===========================*/ /*---------------------------------------------------------* / /*--------------------------------INCLUDE------------------- ----------------*/ /*---------------------------------------------------------* / &num include"typedef. h" #include <malloc. h> #include <stdio. h> #include <stdlib. h> /*---------------------------------------------------------* / <BR> /*--------------FUNCTIONS----------------------------------- /<BR> /___________________________________________________________ _________________*/ /* FUNCTIONS nrerror 0 /*-------------------------------------------------*/ /* PURPOSE : Standard error */ // /* INPUT ARGUMENTS : _ (char*) error text : output */ /*-------------------------------------------------*/ /* OUTPUT ARGUMENTS : None. */ /*-------------------------------------------------*/

/* RETURN ARGUMENTS : None. */ void nrerror (char errortext []) { fprintf (stderr,"Run-time error... \n") ; fprintf (stderr,"ยฐ/Os\n", error_text) ; fprintf (stderr,"... now exiting to system... \n") ; exit (l) ; } /*---------------------------------------------------------- ------*/ /* FUNCTIONS : vector () */ /*-------------------------*/ /* PURPOSE. Allocate a float vector with subscript */ /* v [nl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nl. */ /* _ (INT32) */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (FLOAT32*): pointer to the allocated vector. */ <BR> <BR> <BR> /*========================================================== ===========================*/ FLOAT32 *vector(INT32 nl, INT32 nh) { FLOAT32 *v; v= (FLOAT32 *) calloc ((unsigned) (nh-nl+1), sizeof (FLOAT32)); if ( ! v) nrerror ("allocation failure in vector0") ; return v-nl; /___________________________________________________________ _________________*/ /*========================================================== ===========================*/ /* FUNCTIONS : svector Q */

/*---------------------------------------------------------* / /* PURPOSE. Allocate a short vector with subscript */ /* v [nl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) */ /* _ (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: _ (INT16*): pointer to the allocated */ <BR> <BR> <BR> <BR> = INT16 *svector (INT32 nl, INT32 nh) INT16 *v; v= (INT16 *) calloc ( (unsigned) (nh-nl+l), sizeof (INT16)); if ( ! v) nrerror ("allocation failure in svector0") ; <BR> <BR> <BR> <BR> return v-nl ;<BR> <BR> <BR> <BR> <BR> <BR> } /*========================================================== ===========================*/ /* FUNCTIONS ivector 0 */ /___________________________________________________________ ________*/ /* PURPOSE: Allocate an int vector with subscript */ /* v [nl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nl. */ /* _(INT32)nh. */z /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /___________________________________________________________ ________*/ /* RETURN ARGUMENTS : _(INT32*) : pointer to the allocated */ <BR> <BR> <BR> /*========================================================== ==========================*/ INT32 *ivector(INT32 nl, INT32 nh) { INT32 *v;

v= (INT32 *) calloc ((unsigned)(nh-nl+1), sizeof (INT32)); if ( ! v) nrerror ("allocation failure in ivector ()"); return v-nl; } /*---------------------------------------------------------- -------*/ /* FUNCTIONS : Ivector 0 */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a long vector with subscript */ /* v [nl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT32) nl. */ /* _(INT32) nh. */ // /* OUTPUT ARGUMENTS : None. */ /*/ /* RETURN ARGUMENTS : _(INT64*) : pointer to the allocated */ <BR> <BR> <BR> /*========================================================== ==================================*/ INT64 *lvector(INT32 nl, INT32 nh) INT64 *v; v= (INT64 *) calloc ((unsigned)(nh-nl+1), sizeof (INT64)); if ( ! v) nrerror ("allocation failure in lvector ()") ; return v-nl; <BR> <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTIONS : dvector 0 */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a double vector with subscript */ /* v [nl,..., nh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT32) */

/* _(INT32) nh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS (FLOAT64*): pointer to the allocated vector. */ <BR> <BR> <BR> <BR> /*========================================================== =================================*/ FLOAT64 *dvector(INT32 nl, INT32 nh) { FLOAT64 *v; v= (FLOAT64 *) calloc ((unsigned) (nh-nl+l), sizeof (FLOAT64)) ; if ( ! v) nrerror ("allocation failure in dvectorQ") ; return v-nl; } // /*========================================================== =================================*/ /* FUNCTIONS : matrix 0 */ /*---------------------------------------------------------* / /* PURPOSE: Allocate a float matrix with subscript */ /* m [nrl,..., nrh] [ncl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nrl (low */ /* _ (INT32) nrh (high */ /* _ (INT32) ncl (low */ /* _ (INT32) nch (high */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (FLOAT32**): pointer to the */ /* matrix. */ <BR> <BR> <BR> <BR> /*========================================================== ================================*/ FLOAT32 **matrix(INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) INT32 i; FLOAT32 **m;

m= (FLOAT32 **) calloc ( (unsigned) (nrh-nrl+1), sizeof (FLOAT32*)) ; if ( ! m) nrerror ("allocation failure 1 in matrix ()") ; m-=nrl; for (i=nrl; i<=nrh ; { m [i] = (FLOAT32 *) calloc ((unsigned)(nch-ncl+1), sizeof (FLOAT32)) ; if ( ! m [i]) nrerror ("allocation failure 2 in matrix0") ; m [i]-= ncl ; } return m; /*---------------------------------------------------------- ------*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTIONS smatrix 0 */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a short matrix with subscript */ /* m [nrl,..., nrh] [ncl,..., nch]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT32) nrl (low row). */ /* _ (INT32) nrh (high */ /* _ (INT32) ncl (low column). */ /* _ (INT32) nch (high */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (INT16**): pointer to the allocated */ <BR> <BR> <BR> /*========================================================== =========================*/ INT16 **smatrix(INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) INT32 i; INT16 **m; m= (INT16 **) calloc ( (unsigned) (nrh-nrl+1), sizeof (INT16*)); if ( ! m) nrerror ("allocation failure 1 in smatrixQ") ; m-=nrl; for (i=nrl; i<=nrh; i++) {

m [i] = (INT16 *) calloc ((unsigned)(nch-ncl+1), sizeof (INT16)) ; if (! m [i]) nrerror ("allocation failure 2 in smatrix ()") ; m [i]-= ncl; return m; } /*---------------------------------------------------------- ------*/ /*========================================================== ======================*/ /* FUNCTIONS dmatrix Q */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a double matrix with subscript */ /* m [nrl,..., nrh] [ncl,..., */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nrl (low */ /* _ (INT32) nrh (high */ /* _ (INT32) ncl (low */ /* (INT32) nch (high */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (FLOAT64**) : pointer to the */ /* matrix. */ FLOAT64 **dmatrix (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) INT32 i; FLOAT64 **m; m= (FLOAT64 **) calloc ( (unsigned) (nrh-nrl+l), sizeof (FLOAT64*)) ; if ( ! m) nrerror ("allocation failure 1 in dmatrix0") ; m = nrl; for (i=nrl; i<=nrh; { m [i] = (FLOAT64 *) calloc ((unsigned) (nch-ncl+l), sizeof (FLOAT64)) ; if ( ! m [i]) nrerror ("allocation failure 2 in dmatrix0") ; m [i]-= ncl; }

return m; } /*========================================================== ========================*/ /* FUNCTIONS imatrix /*---------------------------------------------------------* / /* PURPOSE : Allocate an int matrix with subscript */ /* m [nrl,..., nrh] [ncl,..., */ /*--------------.-------*/ /* INPUT ARGUMENTS : _ (INT32) nrl (low */ /* _(INT32) nrh (high */ /* _ (INT32) ncl (low */ /* _(INT32) nch (high */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : _ None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: _ (INT32**) : pointer to the allocated */ INT32 **imatrix (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) { INT32 i, **m; m= (INT32 **) calloc ( (unsigned) (nrh-nrl+1), sizeof (INT32*)); if ( ! m) nrerror ("allocation failure 1 in imatrix0") ; m-= nrl; for (i=nrl; i<=nrh; { m [i] = (INT32 *) calloc ( (unsigned) (nch-ncl+1), sizeof (INT32)) ; if ( ! m [i]) nrerror ("allocation failure 2 in imatrix0") ; m[i]-=ncl; } return m; } /*========================================================== ========================*/

/* FUNCTIONS submatrix Q */ /*---------------------------------------------------------* / /* PURPOSE : Allocate a float matrix with subscript */ /* m [nrl,..., nrh] [ncl,..., nch].*/ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nrl (low */ /* _ (INT32) nrh (high */ _ (INT32) ncl (low */ /* _ (INT32) nch (high */ // /* OUTPUT ARGUMENTS : None. */ /*/ /* RETURN ARGUMENTS : _ (FLOAT32**) : pointer to the */ /* matrix. */ FLOAT32 **submatrix(FLOAT32 **a, INT32 oldr1, INT32 oldrh, INT32 oldcl, \ INT32 newrl, INT 32 newel) { INT32 ij ; FLOAT32 **m; m= (FLOAT32 **) calloc ((unsigned) (oldrh-oldrl+l), sizeof (FLOAT32*)); if ( ! m) nrerror ("allocation failure in submatrix0") ; m-= newrl ; for (i=oldrlj=newrl ; i<=oldrh ; i++J++) m [j] =a [i] +oldcl-newcl ; return m; } /*========================================================== ==================================*/ /* FUNCTIONS s3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE : Allocate a short tensor with subscript */ /* t [nrl,..., nrh] [ncl,..., nch] [ndl,..., ndh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) */

/* _(INT32)nrh. */ /* _ (INT32) ncl. */ /* _(INT32)nch. */ /* _ (INT32) ndl. */ /* _(INT32)ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: _ (INT16***) : pointer to the allocated tensor. */ INT16 ***s3tensor (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { INT32 ij, nrow=nrh-nrl+l, ncol=nch-ncl+l, ndep=ndh-ndl+1 ; INT16 ***t; t= (INT16***) calloc ( (unsigned) (nrow+1), sizeof (INT16**)); if ( ! t) nrerror ("allocation failure 1 in s3tensor0") ; t-=nrl; t [nrl] = (INT16**) calloc ( (unsigned) (nrow*ncol+l), sizeof (INT16*)) ; if ( ! t [nrl]) nrerror("allocation failure 2 in s3tensor0") ; t [nrl] +=1 ; t[nrl]-=ncl; t [nrl] [ncl] = (INT16*) calloc ((unsigned)(nrow*ncol*ndep+1), sizeof (INT16)); if ( ! t [nrl] [ncl]) nrerror ("allocation failure 3 in s3tensor0") ; t [nrl] [ncl]+=1 ; t [nrl] [ncl]-=ndl ; for (j=ncl+l ; j<=nchj++) t [nrl] [j]=t[nrl][j-1] +ndep; for (i=nrl+l ; i<=nrh; i++) { t[i]=t[i-1]+ncol; t [i] [ncl]=t[i-1][ncl]+ncol*ndep ; for (j=ncl+l ; j<=nch ; j++) t [i] [j] =t [i] [j-1] +ndep; return t; }

/*---------------------------------------------------------- -----*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> l = /* FUNCTIONS : i3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE: Allocate an int tensor with subscript */ /* t [nrl,..., nrh] [ncl,..., nch] [ndl,..., ndh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT32) nrl. */ /* _(INT32)nrh. */ /* _ (INT32) ncl. */ /* _ (INT32) */ /* _ (INT32) ndl. */ /* _(INT32)ndh. */ /___________________________________________________________ ________*/ /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (INT32***): pointer to the */ /* tensor. */ <BR> <BR> <BR> <BR> /*========================================================== ==========================*/ INT32 ***i3tensor (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) INT32 ij, nrow=nrh-nrl+l, ncol=nch-ncl+l, ndep=ndh-ndl+1 ; INT32 ***t; t= (INT32***) calloc ( (unsigned) (nrow+1), sizeof (INT32**)); if ( ! t) nrerror ("allocation failure 1 in i3tensor0") ; t-=nrl ; t[nrl]=(INT32**)calloc((unsigned)(nrow*ncol+1), sizeof(INT32*)); if ( ! t [nrl]) nrerror ("allocation failure 2 in i3tensor()"); t [nrl] +=l ; t [nrl]-=ncl ; t [nrl] [ncll= (INT32*) calloc ((unsigned)(nrow*ncol*ndep+1), sizeof (INT32)); if ( ! t [nrl] [ncl]) nrerror ("allocation failure 3 in i3tensor0") ; t [nrl] [ncl] +=l;

t[nrl][ncl]-=ndl; for (j=ncl+l ; j<=nchj++) t [nrl] [j]=t[nrl][j-1]+ndep ; for (i=nrl+l ; i<=nrh ; i++) { t[i]=t[i-1]+ncol; t [i] [ncl]=t[i-1][ncl]+ncol*ndep ; for(j=ncl+1;j<=nch;j++) t [i] [j] =t [i] [j-1] +ndep; } returnt; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTIONS 13tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a long tensor with subscript */ /* t [nrl,..., nrh] [ncl,..., nch] [ndl,..., ndh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) nrl. */ /* _(INT32)nrh. */ (INT32) ncl.

/* _(INT32)nch. */ /* _ (INT32) ndl. */ /* _(INT32)ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (INT64***) : pointer to the */ /* tensor. */ INT64**l3tensor (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { INT32 ij, nrow=nrh-nrl+l, ncol=nch-ncl+l, ndep=ndh-ndl+l ; INT64***t; t= (INT64***) calloc ( (unsigned) (nrow+1), sizeof (INT64**)); if ( ! t) nrerror ("allocation failure 1 in 13tensor0") ;

t+=l; t-=nrl; t [nrll= (INT64**) calloc ((unsigned) (nrow*ncol+l), sizeof (INT64*)); if ( ! t [nrl]) nrerror ("allocation failure 2 in 13tensor ()") ; t [nrl] +=l; t[nrl]-=ncl; t [nrl] [ncl] = (INT64*) calloc ((unsigned) (nrow*ncol*ndep+l), sizeof (INT64)); if ( ! t [nrl] [ncl]) nrerror ("allocation failure 3 in 13tensor0") ; t [nrl] [ncl] +=1 ; t [nrl] [ncl]-=ndl ; for (j=ncl+lj<=nchj++) t [nrl] [j]=t[nrl][j-1]+ndep ; for (i=nrl+l ; i<=nrh; i++) { t[i]=t[i-1]+ncol; t [i] [ncl]=t[i-1][ncl]+ncol*ndep ; for (j=ncl+lj<=nchj++) t [i] [j]=t[i][j-1]+ndep ; return t; } <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*---------------------------------------------------------* /<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTIONS : f3tensor () */ /*---------------------------------------------------------* / /* PURPOSE: Allocate a float tensor with subscript */ /* t [nrl,..., nrh] [ncl,..., nch] [ndl,..., ndh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) */ /* _(INT32)nrh. */ /* _ (INT32) ncl. */ /* _(INT32)nch. */ /* _(INT32)ndl. */ /* (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS None. */ /*---------------------------------------------------------* /

/* RETURN ARGUMENTS : _(FLOAT32***) : pointer to the */ /* tensor. */ FLOAT32 ***f3tensor (INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { INT32 ij, nrow=nrh-nrl+l, ncol=nch-ncl+l, ndep=ndh-ndl+l ; FLOAT32***t; t= (FLOAT32***) calloc ( (unsigned) (nrow+1), sizeof (FLOAT32**)); if ( ! t) nrerror ("allocation failure 1 in f3tensor()") ; t+=l ; t-=nrl ; t [nrll= (FLOAT32**) calloc ((unsigned)(nrow*ncol+1), sizeof (FLOAT32*)) ; if ( ! t [nrl]) nrerror("allocation failure 2 in f3tensor()"); t [nrll+=l ; t[nrl]-=ncl; t[nrl][ncl]=(FLOAT32*)calloc((unsigned)9nrow*ncol*ndep+1), sizcof(FLOAT32)); if ( ! t [nrl] [ncl]) nrerror ("allocation failure 3 in f3tensor()"); t [nrl] [ncl]+=1 ; t[nrl][ncl]-=ndl; for (j=ncl+lj<=nchj++) t [nrl] [j] =t [nrl] jj-l] +ndep; for (i=nrl+l; i<=nrh; i++) { t[i]=t[i-1]+ncol; t [i] [ncl]=t[i-1][ncl]+ncol*ndep ; for (j=ncl+lj<=nch ; j++) t [i][j]=t[i][j-1]+ndep ; return t; } <BR> <BR> <BR> <BR> <BR> /*---------------------------------------------------------- -----*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTIONS. d3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE: Allocate a double tensor with subscript */

/* t [nrl,..., nrh] [ncl,..., nch] [ndl,..., ndh]. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT32) */ /* _ (INT32) nrh. */ (INT32) ncl.

/* (INT32) */ /* _(INT32)ndl. */ /* _(INT32)ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : _ (FLOAT64***): pointer to the */ /* tensor. */ <BR> <BR> <BR> <BR> /*========================================================== =================================*/ FLOAT64 ***d3tensor(INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { INT32 ij, nrow=nrh-nrl+l, ncol=nch-ncl+l, ndep=ndh-ndl+l ; FLOAT64 ***t; t= (FLOAT64***) calloc ((unsigned)(nrow+1), sizeof (FLOAT64**)); if ( ! t) nrerror ("allocation failure 1 in d3tensorO") ; t-=nrl ; t [nrl]= (FLOAT64**) calloc ((unsigned) (nrow*ncol+l), sizeof (FLOAT64*)); if ( ! t [nrl]) nrerror ("allocation failure 2 in d3tensor0") ; t [nrl] +=l; t [nrl]-=ncl ; t [nrl] [ncl]=(FLOAT64*)calloc((unsigned)(nrow*ncol*ndep+1), sizeof (FLOAT64)); if ( ! t [nrl] [ncl]) nrerror ("allocation failure 3 in d3tensor0") ; t [nrl] [ncl] +=1; t [nrl] [ncl]-=ndl ; for =ncl+l ; j<=nch ; j++) t [nrl][j]=t[nrl][j-1]+ndep ; for (i=nrl+1;i<=nrh ; i++) { t[i]=t[i-1]+ncol; t [i] [ncl]=t[i-1][ncl]+ncol*ndep ; for =ncl+l ; j<=nchj++) t [i] [j]=t[i][j-1]+ndep ;

return t ; return t ; <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTIONS : free vector 0 */ /*---------------------------------------------------------* / /*PURPOSE : free a float vector allocated with vector 0. */ <BR> <BR> <BR> <BR> //<BR> <BR> <BR> <BR> <BR> <BR> <BR> /* INPUT ARGUMENTS : _ (FLOAT32*) */ /* _(INT32)nl. */ /* _(INT32)nh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ <BR> <BR> <BR> <BR> <BR> /*========================================================== ==============================*/ void free_vector(FLOAT32 *v, INT32 nl, INT32 nh) free ( (char*) (v+nl)); } /*========================================================== ===============================*/ /* FUNCTIONS : free svector 0 */ // /* PURPOSE: free a short vector allocated with svector (). */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT16*) */ /* _(INT32)nl. */ /* _(INT32)nh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS None. */

/*========================================================== =====================================*/ void free svector (INT16 *v, INT32 nl, INT32 nh) { free ( (char*) (v+nl)); } /*========================================================== ====================================*/ /* FUNCTIONS : free_ivector () */ /*---------------------------------------------------------* / /* PURPOSE : free an int vector allocated with ivector 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT32*) */ /* (INT32) nl. */ /* _(INT32)nh. */ /*/ /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: None. */ void free ivector (INT32 *v, INT32 nl, INT32 nh) { free((char*)(v+nl)); <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTIONS : free-lvector 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a long vector allocated with Ivector 0. */ /___________________________________________________________ ________*/ /* INPUT ARGUMENTS : _ (INT64*) */ /* _ (INT32) */ _ (INT32) nh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */

/*---------------------------------------------------------* / /* RETURN ARGUMENTS: None. */ <BR> <BR> <BR> /*========================================================== =============================*/ void free_lvector(INT64 *v, INT32 nl, INT32 nh) { free ( (char*) (v+nl)) ; <BR> <BR> <BR> }<BR> /*---------------------------------------------------------- -*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== =============================*/ /* FUNCTIONS : free_dvector () */ /*---------------------------------------------------------* / /* PURPOSE: free a double vector allocated with dvector 0. */ // /* INPUT ARGUMENTS: _ (FLOAT64*) v. */ /* _(INT32)nl. */ /* _(INT32)nh. */ /*/ /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void free dvector (FLOAT64 *v, INT32 nl, INT32 nh) free ((char*) (v+nl)); <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTIONS : free_matrix 0 */ /*---------------------------------------------------------* / /* PURPOSE: free a float matrix allocated with matrix 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _(FLOAT32**) */ /* _(INT32)nrl. */ /* _(INT32)nrh. */

/* _ (INT32) ncl. */<BR> <BR> <BR> <BR> <BR> /* _ (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: _None. */ /*========================================================== ===================================*/ void free matrix (FLOAT32 **m, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) { INT32 i; for (i=nrh; i>=nrl; i--) free ( (char*) (m [i] +ncl)); free ((char*) (m+nrl)) ; } /*---------------------------------------------------------- -----*/ /* FUNCTIONS : free_smatrix 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a short matrix allocated with smatrix 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT16**) */ /* _(INT32)nrl. */ <BR> <BR> <BR> /* _ (INT32) */<BR> <BR> <BR> <BR> /* _ (INT32) */<BR> <BR> <BR> <BR> <BR> /* _ (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void free smatrix (INT16 **m, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) { INT32 i; for (i=nrh; i>=nrl ; i--) free ( (char*) (m [i] +ncl)) ; free((char*)(m+nrl));

/*---------------------------------------------------------- -----*/ /* FUNCTIONS free dmatrix Q */ /*---------------------------------------------------------* / /* PURPOSE : free a double matrix allocated with (). */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (FLOAT64**) */ /* _(INT32) nrl. */ /* (INT32) */ (INT32) ncl.

/* _(INT32) nch. */ /*/ /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void free dmatrix (FLOAT64 **m, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) INT32i; for (i=nrh; i>=nrl; i--) free ( (char*) (m [i] +ncl)) ; free ((char*) (m+nrl)) ; /*---------------------------------------------------------- -----*/ <BR> <BR> <BR> <BR> <BR> <BR> <BR> } /* FUNCTIONS : free_imatrix () */ /*---------------------------------------------------------* / /* PURPOSE : free an int matrix allocated with imatrix 0. */ /___________________________________________________________ ________*/ /* INPUT ARGUMENTS : _ (INT32**) */ (INT32) nrl.

/* _(INT32) nrh. */ /* _ (INT32) ncl. */ /* _(INT32) nch. */

/*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ <BR> <BR> <BR> <BR> /*========================================================== =================================*/ void free_imatrix(INT32 **m, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) INT32 i; for (i=nrh; i>=nrl ; i--) free ( (char*) (m [i] +ncl)) ; free ((char*) (m+nrl)) ; } /*---------------------------*/ /* FUNCTIONS: free submatrix n */ /*---------------------------------------------------------* / /* PURPOSE: free a float submatrix allocated with submatrix 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (FLOAT32**) */ /* (INT32) */ /* (INT32) */ (INT32) ncl.

/* _ (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS: None. */ void free-submatrix (FLOAT32 **b, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) { free ( (char*) (b+nrl)); } /=========================================================== ==================================*/

/* FUNCTIONS : free-i3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE : free an int tensor allocated with i3tensor 0. */ /*/ /* INPUT ARGUMENTS : _ (INT32***) */ /* _(INT32) nrl. */ _ (INT32) nrh. */ (INT32) ncl.

/* _(INT32) nch. */ /* _ (INT32) ndl. */ /* _(INT32) ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void freei3tensor (INT32 ***t, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { free ( (char*) (t [nrl] [ncl]+ndl-1)) ; free ( (char*) (t [nrl] +ncl-l)) ; free ( (char*) (t+nrl-1)) ; } /*========================================================== ======================*/ /* FUNCTIONS: frees3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a short tensor allocated with s3tensor0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS: _ (INT16***) */ /* _(INT32) nrl. */ /* _(INT32) nrh. */ <BR> <BR> <BR> /* _ (INT32) */<BR> <BR> <BR> <BR> <BR> /* _ (INT32) */ /* _(INT32) ndl. */ /* _(INT32) ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */

/*---------------------------------------------------------* / /* RETURN ARGUMENTS: None.

/*======================================================= ============================*/ void frees3tensor (INT16 ***t, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) { free ( (char*) (t [nrl] [ncl] +ndl-l)) ; free ( (char*) (t [nrl] +ncl-l)) ; free ( (char*) (t+nrl-1)) ; } <BR> <BR> <BR> <BR> <BR> <BR> // /* FUNCTIONS : free l3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE: free a long tensor allocated with l3tensor (). */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (INT64***) */ /* _(INT32) nrl. */ /* _ (INT32) nrh. */ /* _ (INT32) ncl. */ /* _(INT32) nch. */ /* (INT32) ndl. */ /* _(INT32) ndh. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ <BR> <BR> <BR> /*========================================================== ==========================*/ void free_l3tensor(INT64 ***t, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) free ((char*) (t [nrl] [ncl] +ndl-l)) ; free ( (char*) (t [nrl] +ncl-l)) ; free ( (char*) (t+nrl-1)); /* ____________________________________________________________ ________________*/

/* FUNCTIONS : free_รŸtensor 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a float tensor allocated with f3tensor 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (FLOAT32***) */ /* _(INT32) nrl. */ /* _(INT32) nrh. */ /* _ (INT32) ncl. */ /* _(INT32) nch. */ /* _(INT32) ndl. */ /* _(INT32) ndh. */ // /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void free_f3tensor (FLOAT32 ***t, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) free ( (char*) (t [nrl] [ncl]+ndl-1)) ; free ( (char*) (t [nrl] +ncl-1)) ; free ( (char*) (t+nrl-1)) ; } /*========================================================== ===============================*/ /* FUNCTIONS : free_d3tensor 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a double tensor allocated with d3tensor0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (FLOAT64***) */ /* _(INT32) nrl. */ /* _(INT32) nrh. */ (INT32) ncl.

/* _(INT32) nch. */ /* _(INT32) ndl. */ /* _(INT32) ndh. */ /*---------------------------------------------------------* /

/* OUTPUT ARGUMENTS: None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ /*========================================================== ==============================*/ <BR> <BR> <BR> <BR> <BR> <BR> void free_d3tensor (FLOAT64 ***t, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch, INT32 ndl, INT32 ndh) free ( (char*) (t [nrl] [ncll+ndl-1)) ; free ( (char*) (t [nrl] +ncl-l)) ; free ( (char*) (t+nrl-1)) ; <BR> <BR> <BR> <BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*/ /* FUNCTIONS: convert matrix Q */ /*---------------------------------------------------------* / /* PURPOSE: allocate a float matrix m [nrl,..., nrh] [ncl,..., */ /* that points to the matrix declared in the standard */ /* C manner as a [nrow] [ncol], where nrow=nrh-nrl+1 */ /* ncol=nch-ncl+l. The routine should be called */ /* the address &a [0] [O] as the first */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (FLOAT32*) */ /* _(INT32) nrl. */ /* _ (INT32) */ /* _ (INT32) */ /* _ (INT32) nch. */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS _ (FLOAT32**) pointer to array of pointers */ /* rows. */ /*========================================================== ==============================*/ FLOAT32 **convert_matrix(FLOAT32 *a, INt32 nrl, INT32 nrh, INT32 ncl, INF32 nchy) { INT32 ij, nrow, ncol; FLOAT32 **m ;

nrow=nrh-nrl+l ; ncol=nch-ncl+l ; m = (FLOAT32 **) calloc ( (unsigned) (nrow), sizeof (FLOAT32*)); if ( ! m) nrerror ("allocation failure in convert matrix ()") ; m -= nrl; for (i=OJ=nrl ; i<=nrow-l; i++J++) m [j] =a+ncol*i-ncl; return m; } /*__________________________________________________________ __________________*/ /* FUNCTIONS : free_convert_matrix () */ /*---------------------------------------------------------* / /* PURPOSE : free a matrix allocated by convert matrix 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (FLOAT32**) */ /* _(INT32) nrl. */ /* _(INT32) nrh. */ /* _ (INT32) ncl. */ /* (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */ /*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ void free convert matrix (FLOAT32 **b, INT32 nrl, INT32 nrh, INT32 ncl, INT32 nch) free ((char*) (b+nrl)) ; } /*========================================================== ==============================*/ /* FUNCTIONS : pdvector () */ /*---------------------------------------------------------* / /* PURPOSE. Allocate a double a vector of pointers */ /* double datawith subscript */

/* v [nl,..., nh]. */<BR> <BR> <BR> <BR> // /* INPUT ARGUMENTS : _ (INT32) nl. */ /* _ (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS: None. */ // /* RETURN ARGUMENTS : _ (FLOAT64*) : pointer to the allocated vector. */ FLOAT64 **pdvector (INT32 nl, INT32 nh) FLOAT64 **v; // v = (FLOAT64 **) calloc (unsigned) (nh-nl+1), sizeof (FLOAT64 *)) ; if ( ! v) nrerror ("allocation failure in pdvector0") ; /*---------------------------------------------------------* / return v-nl; /*---------------------------------------------------------* / } /*========================================================== =============================*/ /* FUNCTIONS : free_pdvector 0 */ /*---------------------------------------------------------* / /* PURPOSE : free a vector of pointer to double */ /* with pdvector 0. */ /*---------------------------------------------------------* / /* INPUT ARGUMENTS : _ (FLOAT64 **) */ /* (INT32) */ /* (INT32) */ /*---------------------------------------------------------* / /* OUTPUT ARGUMENTS : None. */

/*---------------------------------------------------------* / /* RETURN ARGUMENTS : None. */ /*========================================================== ============================*/ void free_pdvector (FLOAT64 **v, INT32 nl, INT32 nh) { /*/ free ( (char*) (v+nl)); /*---------------------------------------------------------* / return ; // /*/ /*========================================================== ========================================*/ /*------------------------------END------------------------- -----*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ /*========================================================== ================================*/ /* PROTOYPE FILE : mcutil. */ /*========================================================== ===============================*/ /*---------------------------------------------------------* / /___________________________________________________________ _________________*/ void nrerror (char []) ; INT16 *svector (INT32, INT32) ; FLOAT32 *vector (INT32, INT32); INT32 *ivector (INT32, INT32) ; INT64 *Ivector (INT32, INT32); FLOAT64 *dvector (INT32, INT32) ; FLOAT32 **matrix (INT32, INT32, INT32, INT32); INT16 **smatrix (INT32, INT32, INT32, INT32); FLOAT64 **dmatrix (INT32, INT32, INT32, INT32) ; INT32 **imatrix (INT32, INT32, INT32, INT32); FLOAT32 **submatrix (FLOAT32 **, INT32, INT32, INT32, INT32, INT32); INT16 ***s3tensor (INT32, INT32, INT32, INT32, INT32, INT32); INT32 ***i3tensor (INT32, INT32, INT32, INT32, INT32, INT32); INT64 ***13tensor INT32, INT32, INT32, INT32, INT32, INT32); FLOAT32 ***f3tensor (INT32, INT32, INT32, INT32, INT32, INT32); FLOAT64 ***d3tensor (INT32, INT32, INT32, INT32, INT32, INT32); void free vector (FLOAT32 *, INT32, INT32); void free-svector (INT16 *, INT32, INT32); void free ivector (INT32 *, INT32, INT32);

void free-lvector (INT64 *, INT32, INT32) ; void free dvector (FLOAT64 *, INT32, INT32); void free matrix (FLOAT32 **, INT32, INT32, INT32, INT32) ; void free smatrix (INT16 **, INT32, INT32, INT32, INT32); void free dmatrix (FLOAT64 **, INT32, INT32, INT32, INT32); void free_imatrix (INT32 **, INT32, INT32, INT32, INT32); void free submatrix (FLOAT32 **, INT32, INT32, INT32, INT32); void free_i3tensor (INT32 ***t , INT32, INT32, INT32, INT32, INT32, INT32); void free_s3tensor (INT16 ***t, INT32, INT32, INT32, INT32, INT32, INT32); void freel3tensor (INT64 ***t, INT32, INT32, INT32, INT32, INT32, INT32); voidfreef3tensor (FLOAT32 ***t, INT32, INT32, INT32, INT32, INT32, INT32); voidfreed3tensor (FLOAT64 ***t, INT32, INT32, INT32, INT32, INT32, INT32); FLOAT32 **convert matrix (FLOAT32 *, INT32, INT32, INT32, INT32); void free_convert_matrix (FLOAT32 **, INT32, INT32, INT32, INT32); FLOAT64 **pdvector (INT32, INT32); void free_pdvector (FLOAT64 **, INT32, INT32); <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*========================================================== ======================*/ /*--------------------------------END----------------------- -------*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* FILE : typedef. h */<BR> /*========================================================== =============================*/ #if defined(_BORLANDC_)||defined(_WATCOMC_)||defined(_MSC_VER)|| defined(_ZTC_)|| defined(_HIGHC_)||defined(_CYGWIN32_) typedef long int INT64 ; typedef long int INT32; typedef short int INT16; typedef unsigned short int UNSINT16 ; typedef short int FLAG; typedef double FLOAT64; typedef float FLOAT32; &num elif defined (_sun) typedef long INT64; typedef long INT32; typedef short INT16; typedef unsigned short UNSINT16 ; typedef int FLAG; typedef double FLOAT64; typedef float FLOAT32; #elif defined(_unix_)||defined(_unix) typedef long INT64; typedef int INT32; typedef shortINT16; typedefunsignedshort UNS_INT16 ;

typedef int FLAG; typedef double FLOAT64; typedef float FLOAT32; #elif defined (VMS) 11 ! defined (VMS) typedef long INT64; typedef long INT32; typedef short INT16; typedef unsigned short UNSINT16 ; typedef int FLAG; typedef double FLOAT64; typedef float FLOAT32; #else #error COMPILER NOT TESTED typedef.h needs to be updated, see readme #endif /*========================================================== ==========================================*/ /*-------------------------------END------------------------ ------*/ APPENDIX B

/* Conexant System inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY: gain vq. */ /*========================================================== ================================*/ /*---------------------------------------------------------- -------*/ /*------------------------------TABLES---------------------- -------------*/ /*---------------------------------------------------------- -------*/ /*========================================================== ==========================================*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ l ===== l /* FILE : FLOAT64 gp4 tab */ /*========================================================== ====================================*/ FLOAT64 gp4tab [TABSIZEGVQ4D] [GVQVECSIZE4D] = {

{0. 60699869,0.59090763,0.64920781,0.

{0. 68101613,0.65403889,0.64210982,0.

{0. 63010482,0.56235514,0.65643759,0.

{0. 68659859,0.57330071,0.58744429,0.

{0. 64851060,0.64851060,0.71451327,0.

{0. 77682415,0.68550346,0.63967832,0.

{0. 60611942,0.63785293,0.74037768,0.

{0. 70282156,0.70854395,0.71397421,0.

{0.60640355,0.64369532,0.78733321,0.

{0. 79313256,0.75678142,0.67673117,0.

{0. 78871769,0.78871769,0.67719160,0.

{0. 78750339, 0.65818283,0.74410403,0.

{0. 68666216,0.71349168,0.80131080,0.

{0. 81564295,0.77007419,0.73645773,0.

{0. 87690114,0.83990779,0.69391460,0.

{0. 78900835,0.72676490,0.88398786,0.

{0. 93272369,0.74226864,0.62990265,0.

{0.76976621,0.76976621,0.78405048,0.

{0.87041644,0.83542384,0.72726860,0.

{0. 98828812,0.57828812,0.70041292,0.

{0. 78642005,0.77917927,0.79153969,0.

{0.72998353,0.72998353,0.80237917,0.

{0. 84850899,0.79316290,0.76406702,0.

{0.86473350,0.82733618,0.78603639,0.

{0.86598073,0.86598073,0.76672185,0.

{0.75717804,0.76443058,0.87026008,0.

{0. 82990895,0.82866571,0.84344056,0.

{0. 73643129,0.73643129,0.93179791,0.

{0. 84091377,0.84091377,0.84549563,0.

{0. 96705390,0.93530253,0.75329477,0.

{0.82417511,0.88417511,0.90242800,0.

{0. 90565081,1.00565081,0.73784063,0.

{0. 93696854,0.89908568,0.80488500,0.

{0. 88864729,0.87038965,0.85073556,0.

{0. 91005475,0.86005510,0.85177958,0.

{0.73978618,0.82370630,0.94989275,0.

{0. 90821062,0.90821062,0.84367096,0.

{0. 82123084,0.84572475,0.91624881,0.

{0. 84262163,0.90568020,1.05247535,0.

{0.89073030,0.89054064,0.90204609,0.

{0. 93915442,0.91935059,0.88462629,0.

{0. 94939652,0.86939652,1.02255193,0.

{1. 02270617,0.90270617,0.75324621,0.

{1. 06002553,0.97431233,0.80897117,0.

{0. 97983378,0.97983378,0.87774763,0.

{0. 93569159,0.93248467,0.93336567,0.

{1. 01454689,0.97991575,0.89630971,0.

{0. 90992070,0.90992070,0.98329006,0.

{0. 88442519,0.91454256,0.99448626,1.

{0. 84818392,0.87818392,1.06200101,1.

{0. 97346962,0.96872528,0.96372065,0.

{0. 97243125,0.97243125,0.96175669,0.

{1. 10743055,0.93511480,94874981,0.

{1. 08620375,1.04782334,0.98763661,0.

{1. 01282321,1.01771063,1.03454061,1.

{1. 13502856,1.06918208,0.95687290,0.

{0. 95295916,0.98532512,1.09705441,1.

{1. 03699487,1.03699487,1.05224994,1.

{0. 93430309,0.93430309,1.15479496,1.

{1. 10604686,1.08604686,1.00380677,1.

{1. 04618964,1.07135141,1.13934841,1.

{1. 13404806,1.11671807,1.10434958,1.

{1. 04548516,1.11455931,1.17914527,1.

{1. 18984056,1.19371846,1.19065201,1.

/* conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA 92660 */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE : FLOAT64 gainVQ-4-1024 */ /*========================================================== ====================================*/ FLOAT64 gainVQ4_1024 [MSMAX-4_1024] [GVQVEC SIZE_4D] = { {0. 32430000,0.14200000,0.08030000,0.

{0. 36890000,0.29580000,0.19540000,0.

{0. 44279383,0.24252909,0.20377341,0.

{0. 51880000,0.18810000,0.13810000,0.

{0. 45280000,0.35830000,0.26890000,0.

{0. 29830000,0.31750000,0.37570000,0.

{0. 69840000,0.17180000,0.11820000,0.

{0. 67440000,0.31330000,0.27020000,0.

{0. 37190000,0.55970000,0.40410000,0.

{0. 60470000,0.47560000,0.33640000, {0. 44840000,0.41050000,0.52590000,0.

{0. 85080000,0.26840000,0.

{0. 22760000,0.51290000,0.47640000,0.

{0. 38560000,0.29260000,0.65040000,0.

{0. 78280000,0.33410000,0.33740000,0.

{0. 60340000,0.67610000,0.39840000,0.

{1. 02390000,0.18590000,0.12790000,0.

{0. 60076348,0.54890494,0.49683860,0.

{0. 77820000,0.47490000,0.50310000, {0. 61880000,0.56990000,0.54730000,0.

{0. 95840000,0.42240000,0.33690000,0.

{1. 06343087,0.38532917,0.30216593,0.

{1. 12280000,0.32130000,0.20780000,0.

{0. 57490000,0.48290000,0.51640000,0.

{0. 29490000,0.65830000,0.67120000,0.

{0. 81590000,0.42290000,0.69880000,0.

{0. 79240000,0.70420000,0.39600000,0.

{0. 62280000,0.93010000,0.45110000,0.

{0. 71130000,0.86330000,0.55250000,0.

{1. 05480000,0.33040000,0.51770000,0.

{1. 02600000,0.62390000,0.40110000,0.

{0. 51780000,0.85420000,0.57490000,0.

{0. 51250000,0.62920000,0.86850000,0.

{1. 10550000,0.47540000,0.42340000,0.

{0. 68250000,0.62950000,0.90900000,0.

{1. 26220000,0.37640000,0.34070000,0.

{1. 29670000,0.44760000,0.23550000,0.

{0. 71590000,0.73030000,0.74280000,0.

{0. 90340000,0.53960000,0.70500000,0.

{0. 94510000,0.75910000,0.56230000,0.

{0. 27540000,0.71640000,0.60050000,1.

{1. 12840000,0.55510000,0.69720000,0.

{0. 18930000,0.48280000,0.78730000,1.

{0. 64500000,0.62070000,0.64830000,1.

{0. 20740000,0.50100000,0.81480000,1.

{1. 47870000,0.23150000,0.16690000,0.

{0. 47060000,0.86040000,0.80580000,0.

{0. 67860000,1.12680000,0.50270000,0.

{0. 96731581,0.75394827,0.71442682,0.

{1. 35010000,0.45980000,0.58980000,0.

{1. 35030000,0.45470000,0.60810000,0.

{0. 61140764,0.86453614,0.79724552,0.

{0. 77440000,0.93360000,0.81210000,0.

{1. 05750000,0.63760000,0.90530000,0.

{1. 42720000,0.51010000,0.36410000,0.

{1. 41080000,0.63500000,0.32840000,0.

{1. 30280000,0.60240000,0.50470000,0.

{0. 86310000,0.59840000,0.85430000,0.

{1. 35490000,0.60220000,0.61180000,0.

{1. 29950000, 0.26780000,0.90600000,0.

{1. 18350000,0.90230000,53350000,0.

{0. 96680000,0.76470000,0.65440000,0.

{1. 38390000,0.71660000,0.56500000,0.

{1. 44150000,0.63080000,0.46800000,0.

{1. 65950000,0.27920000,0.23040000,0.

{0. 44480000,1.19650000,0.69940000,0.

{0. 68310000,0.95110000,0.98140000,0.

{0. 69990000,0.71050000,1.21380000,0.

{1. 22750000,0.82230000,0.0.

{1. 50050000,0.59740000,0.59240000,0.

{1.45128760,0.0.57587383,0.

{1. 13050000,0.70160000,1.01710000,0.

{1. 14200000,1.01440000,0.63490000,0.

{0. 86640000,1.00810000,0.74410000,0.

{0. 44500000,0.77610000,0.89920000,1.

{0. 91890000,0.76170000,1.02990000,0.

{0. 37840000,0.95900000,1.06580000,1.

{1. 58210000,0.73680000,0.43700000,0.

{0. 85980000,0.65090000,0.55700000,1.

{1. 70680000,0.61080000,0.38940000, {0. 49260000,1.05000000,0.77620000,1.

{0.93960000,1.25930000,0.88510000,0.

{0.50170000,1.05780000,1.0.

{1. 06890000,1.05570000,0.94840000,0.

{1. 53540000,0.60810000,0.70450000,0.

{0. 52570774,0.88028826,0.98275945,1.

{0. 95020000,1.23000000,0.70460000,0.

{1. 85160000,0.37420000,0.37290000,0.

{1. 86507422,0.42602318,0.33349988,0.

{1.25050000,0.69770000,0.78500000,1.

{0. 52900000,1.32630000,1.00830000,0.

{1. 19690000,1.35160000,0.70440000,0.

{0.80740000,0.66150000,1.07080000,1.

{1.27090000,0.89000000,1.06410000, {0. 95280000,0.93720000,1.37500000,0.

{0. 78310000,0.92700000,0.

{0. 88230000,1.10330000,0.98310000,1.

{1. 08538360,1.26958825,0.91376555,0.

{0. 64900000,1.09760000,0.85080000,1.

{0. 53500000,0.84810000,1.

{1. 92030000,0.48420000,0.55650000,0.

{0. 80070000,1.37500000,1.17260000,0.

{1. 63540000,0.74520000,0.83340000,0.

{1. 12160000,0.81130000,1.

{0. 79188218,0.96816938,1.40843300,1.

{1. 37600000,0.99530000,0.78270000,1.

{1. 08890000,1.17530000,1.17350000,0.

{1. 88390000,0.64200000,0.55420000,0.

{1. 00670000,1.03950000,1.43910000,0.

{0. 51050000,1.25330000,1.23130000,1.

{1. 77890000,0.88140000,0.70760000,0.

{1. 53260000,1.17190000,0.72100000,0.

{0. 96260000,1.10560000,1.16360000,1.

{1. 25210000,1.35480000,0.75350000,0.

{0. 33240000,0.71980000,0.92090000,1.

{1. 52927093,94387728,0.98718908,0.

{0. 64397105,1.46149914,1.05233363,1.

{1. 09258166,1.02600551,1.01307653,1.

{2. 19580000,0.34580000,0.20740000,0.

{0. 88180000,1.46700000,0.90060000,1.

{0.25120000,0.97960000,1.20030000,1.

{1. 33380000,1.14500000,1.21420000,0.

{0. 82950000,0.99190000,1.07290000,1.

{0. 61390000,1.55190000,0.97270000,1.

{0.62410000,0.95810000,1.63870000,1.

{0. 61080000,1.94840000,0.85150000,0.

{1. 15510000,1.46050000,1.16890000,0.

{1. 24210000,1.15240000,0.87600000,1.

{1. 14580000,1.48500000,1.15940000,0.

{1. 15560000,1.49260000,1.16800000,0.

{1. 39280000,0.85790000,1.39110000,1.

{0. 99230000,1.16470000,1.51240000,1.

{0. 77640000,1.29010000,1.

{1. 98670000,1.04510000,0.75130000,0.

{1. 45950000,1.55160000,1.06300000,0.

{0. 50750000,1.29680000,1.35350000,1.

{0.59059745,1.09122768,1.02782035,1.

{0. 34540000,0.94370000,0.87040000,2.

{0.45610000,1.40740000,0.92180000,1.

{1. 75360000,1.24960000,0.94140000,0.

{0. 99480000,1.64830000,1.30450000,0.

{0. 25740000,1.40250000,0.1.

{0. 48270000,0.85850000,1.53020000,1.

{0. 80110000,1.29470000,1.25350000,1.

{1. 14950000,1.79370000,0.87410000,1.

{1. 60460000,0.83720000,97480000,1.

{2. 20380000,0.99360000,0.62840000,0.

{2. 06250000,0.78580000,0.94360000,0.

{1. 44230000,1.23800000,1.18820000,1.

{1. 85530000,0.96690000,0.99110000,1.

{2. 16456006,0.95165953,0.75498856,0.

{1. 09320000,1.32460000,1.35680000,1.

{2. 36170000,0.75890000,0.50860000,0.

{0. 60630000,1.70190000,1.23140000,1.

{0. 50230000,1.19030000,1.25370000,1.

{0. 99930000,1.02630000,1.00470000,1.

{2. 50910000,0.51800000,0.39210000,0.

{0. 78960000,1.21760000,1.93660000,0.

{1. 09740000,1.33800000,1.15750000,1.

{0. 71933291,1.26280819,1.52180112,1.

{1. 04546726,1.64917411,1.40294177,1.

{1. 34690000,1.65670000,1.03860000,1.

{0. 50090000,1.30040000,1.57560000,1.

{2. 56780000,0.64210000,0.

{0. 31740000,1.37100000,1.85150000,1.

{0. 63090000,1.39620000,1.79550000,1.

{1. 40330859,1.13498021,1.62829863,1.

{2. 69822802,0.53749854,0.40876870,0.

{2. 78430000,0.22190000,0.20170000,0.

{1. 70740000,1.07100000,1.51480000,1.

{0. 64810000,1.43980000,1.06370000,2.

{1. 09190000,0.93920000,1.34240000,2.

{2. 00280000,1.22590000,1.13890000,1.

{1. 15600000,1.10170000,1.83630000,1.

{0. 36520000,1.11520000,1.31280000,2.

{0. 62980000,1.79830000,1.12150000,1.

{1. 67550000,1.63840000,1.32570000,1.

{0. 26770000,1.28180000,0.18830000,2.

{2. 05420000,1.33040000,1.33120000,0.

{0. 36900000,1.54200000,1.30330000,2.

{1. 53350000,1.44230000,1.51650000,1.

{0. 92410000,1.48880000,1.64380000,1.

{1. 32010000,1.46880000,1.46620000,1.

{0. 84550000,1.25590000,1.59020000,1.

{2. 20280000,0.62690000,1.38210000,1.

{2. 62860000,0.86670000,0.84090000,0.

{1. 74521323,1.68473201,1.17310799,1.

{1. 51660000,1.31360000,1.88260000,1.

{0. 79670000,1.90030000,1.73850000,1.

{0. 98680000,1.96410000,1.16900000,1.

{2. 49300000,0.93570000,0.82930000,0.

{1. 03560000,2.49260000,0.94040000,0.

{0. 56790000,1.71420000,1.55150000,1.

{0. 44640000,1.28630000,1.81120000,2.

{1. 05501900,1.35801114,1.27260523, {1.13112081,1.67490345,1.49138960,1.

{1.54680000,2.19610000,1.21040000,0.

{2. 96060000,0.49720000,0.51650000,0.

{1. 20280000,1.53980000,1.23680000,2.

{1. 21350000,1.88360000,1.72810000,1.

{2. 30360000,0.95850000,21350000,1.

{0. 59556365,1.84799025,1.42610766,1.

{0. 83321592,1.40566585,2.15888097,1.

{2.54450000,1.24210000,0.91270000,0.

{2. 26382744,1.11917483,1.39125540,1.

{0. 70850000,0.89840000,1.26410000,2.

{2. 14970000,2.02550000,0.85480000,0.

{1. 98930000,1.70300000,1.46450000,1.

{1. 64300000,1.07540000,1.77540000,1.

{0. 54818095,1.29470060,1.81506779,2.

{0. 92708840,2.44326143,1.24275146,1.

{0. 37490000,1.30980000,1.52320000,2.

{1. 39060000,1.65500000,1.48990000,1.

{0. 85390000,1.46700000,1.67710000,2.

{0. 32570000,1.00200000,2.09300000,2.

{2. 21400000,1.30480000,1.19010000,1.

{0. 62790000,1.82040000,1.36740000,2.

{1. 14380000,2.56880000,1.16950000,1.

{1. 35690000,1.50710000,1.94870000,1.

{0. 53382826,1.34692112,1.33846227,2.

{0. 91950000,1.87320000,1.63080000,1.

{1.41370000,1.99910000,1.54820000,1.

{0. 57330000, 1.55750000,2.19030000,1.

{1. 06640000,1.19880000,1.09660000,2.

{2. 87763286,1.17630394,87725081,0.

{1. 89720000,1.52950000,1.72370000,1.

{0. 49710000,2.07990000,1.74510000,1.

{2. 27530000,1.30140000,1.61000000,1.

{1. 05320000,2.98950000,0.94780000,0.

{1. 82500000,0.89410000,2.29520000,1.

{1. 99440000,2.02900000,1.25500000,1.

{2. 72010000,1.23850000,1.31850000,0.

{1. 04180000,1.03520000,2.39880000,1.

{1. 01960000,1.70500000,2.27600000,1.

{0. 69140000,1.07550000,2.71090000,1.

{1. 11170000,1.33550000,1.82040000,2.

{0. 38540000,1.18850000,3.11230000,0.

{1. 73090000,1.33730000,1.05690000,2.

{0. 72310000,2.46130000,1.27490000,1.

{1. 77267981,1.53066279,1.77476873,1.

{0. 20970000,2.49020000,0.95900000,2.

{3.42700000,0.58010000,0.48280000,0.

{3.32030000,0.99090000,0.54120000,0.

{0.73390000,1.90270000,19690000,1.

{1. 42540000,1.79240000,1.59520000,2.

{1. 45050000,1.62280000,2.53820000,1.

{1. 34900000,2.51420000,1.32760000,1.

{3. 00300000,1.08510000,0.79270000,1.

{2. 04850000,1.78870000,2.04840000,1.

{3.27310000,0.80220000,0.90830000,0.

{3. 57010000,0.30230000,0.14250000,0.

{0. 66950000,2.05640000,1.59920000,2.

{1. 23889924,1.37970849,2.03314994,2.

{0. 54840000,1.39700000,2.05660000,2.

{1. 01880000,2.21560000,1.85000000,1.

{0.42680000,1.62100000,1.50320000,2.

{1. 36709992,1.92118067,2.22931649,1.

{2. 17150000,1.72310000,1.62620000,1.

{0.34030000,60550000,2.19540000,1.

{0. 80558445,1.92562060,1.92905300, {0. 86223532,2.45299816,2.09373970,1.

{1. 46710000,2.28960000,1.90360000,

{2. 06030000,2.53950000,1.37030000,1.

{1. 39681009,2.23624337,1.59579505,2.

{0. 70220000,1.77930000,1.86580000,2.

{1. 59210000,1.65920000,2.13170000,2.

{2. 81710000,1.21130000,1.56300000,1.

{3. 11440000,1.62880000,1.05310000,0.

{3. 68599039,0.60027243,0.45011433,0.

{1. 13830000,1.64660000,2.11410000,2.

{0. 61210000,1.89580000,2.17130000,2.

{0. 82010000,1.75570000,1.49690000,2.

{1. 57880000,2.22260000,1.38510000,2.

{2. 45254708,1.52077343,1.66535997,1.

{1. 17305500,1.30821566,3.02978788,1.

{0. 66534571,1.41610565,2.49625697,2.

{0.29560000,1.14340000,1.43040000,3.

{2. 12390000,2.11310000,1.34410000,2.

{1. 63091403,1.31355448,1.36763493,2.

{1. 09370000,1.1.62170000,3.

{2. 16730000,1.93040000,2.27320000,1.

{1. 53630000,1.19450000,2.13630000,2.

{2. 53430000,1.14700000,2.18010000,1.

{1. 77780000,1.73710000,1.84070000,2.

{1. 20260000,2.24720000,57010000,2.

{0. 48600000,1.61790000,2.67430000,2.

{1. 43140000,1.96990000,2.52130000,1.

{2. 09620000,2.25920000,1.87530000,1.

{1. 15910000,2.57100000,2.26780000,1.

{1. 05110000,1.59620000,3.13560000,1.

{3. 99570000,0.36520000,27530000,0.

{3. 77120000,0.70730000,0.95870000,0.

{1. 40570000,2.26260000,2.2.

{0. 65045973,1.51699407,2.01006662,3.

{0. 96940000,1.94710000,2.52800000,2.

{3.07564375,1.96246650,1.34859928,1.

{0.70370000,2.90160000,1.58210000,2.

{0. 37930000, 1.39650000,2.33010000,3.

{3.21830000,1.50100000,1.57160000,1.

{0. 81130000,2.10070000,1.89350000,2.

{1. 24050000,1.51440000,1.77690000,3.

{1. 67270000,1.55850000,2.55210000,2.

{0. 43120000,2.29240000,2.37580000,2.

{0. 91179847,2.20528942,1.69591433,2.

{0. 76980000,1.47560000,3.08920000, {0. 84540000,1.46810000,2.49510000,2.

{0. 74922509,1.32090681,1.27684752,3.

{0. 46110000,1.39270000,1.65670000,3.

{1. 36650000,1.44440000,1.3.

{3. 67050517,1.23688828,1.20357381,1.

{1. 12660000,2.68590000,2.10440000,2.

{1. 89750000,1.58590000,2.82200000,1.

{2. 24697910,2.38873518,1.97435359,1.

{0. 38450000,2.16850000,1.74270000,3.

{4. 20690000,0.42420000,0.42380000,0.

{4. 11470000,0.71740000,0.68790000,0.

{1. 70090000,1.85320000,2.32140000,2.

{2. 04930000,2.25220000,2.13630000,2.

{2. 84720000,1.82540000,1.67010000,1.

{1. 40590000,1.39600000,3.16130000,2.

{0. 96535206,2.12754427,2.68415919,2.

{1. 48550000,2.21360000,2.04320000,2.

{0. 40140000,3.23100000,2.12180000,1.

{3. 42710000,1.05860000,2.28540000,0.

{0. 18650000,3.17660000,0.82310000,2.

{0. 78310000,85280000,2.63020000,1.

{0. 51340000,1.68440000,1.91020000,3.

{0. 99250000,2.07730000,2.42260000,2.

{1. 52534714,1.2.95395695,2.

{1. 57610859,2.18452774,2.25616952,2.

{0. 89851630,2.76341067,2.10694623,2.

{2. 97550000,2.50580000,1.72340000, {1. 35510000,1.77910000,3.65410000,1.

{1. 53930000,3.26830000,1.77780000,2.

{0.95750000,2.91210000,2.26980000,2.

{0.62880000,2.55740000,2.45470000,2.

{4.17300000,1.06450000,1.04760000,0.

{1. 14310000,2.37170000,1.82320000,3.

{1. 58370199,2.96836003,2.27706073,2.

{2. 43176411,1.82966247,2.78432482,1.

{1. 86490000,2.69770000,2.52130000,1.

{2. 10760000,1.56670000,3.54160000,1.

{3. 75830000,26570000,1.94980000,1.

{0. 86350000,2.57800000,3.12820000,1.

{1. 51580000,1.60850000,2.22840000,3.

{3. 94730000,1.77810000,1.28310000,0.

{3. 42344413,1.55540578,1.09618002,2.

{0. 66041540,2.18915841,2.58578828,3.

{0.60980000,2.59460000,1.37490000,3.

{0.62668390,1.92562803,2.11258815,3.

{0. 74780000,1.72330000,1.88370000,3.

{1. 61350000,1.00520000,4.01880000,1.

{3. 23495541,1.72163945,2.59655973,1.

{0. 38850000,1.39810000,2.51490000,3.

{0. 62870000,1.89250000,2.70220000,3.

{3. 18290000,2.25710000,1.91820000,1.

{0. 96400000,1.24870000,2.82850000,3.

{1. 77380000,2.07210000,2.52890000,2.

{1. 50940000,2.24310000,3.07870000,2.

{2. 11150000,55510000,1.75050000,2.

{1. 26400000,2.77440000,2.62980000,2.

{2. 61330000,1.45850000,1.97670000,3.

{2. 13990000,1.94870000,2.85930000,2.

{3. 23675679,1.72320543,1.97852723,2.

{4. 76008462,0.33310464,0.27903439,0.

{1. 19760000,2.39550000,2.64150000,3.

{0. 73033089,1.53066461,3.39605347,2.

{0.64980000,4.55530000,1.04050000,0.

{2.16740000,1.56460000,3.43890000,2.

{0. 82740000,1.57650000,3.51060000,2.

{2.72160000,3.10920000,2.08700000,1.

{1. 31790000, 1.12640000,1.24000000,4.

{0. 69324727,2.26567608,1.45969963,4.

{0. 50530000,2.16930000,1.40940000,4.

{1. 11210000,2.87040000,1.88010000,3.

{0. 66630000,2.82910000,2.45110000,3.

{1. 33590000,2.89490000,3.68240000,0.

{2. 93090000,2.38840000,2.07860000,2.

{1. 28667958,2.04826107,2.65566781,3.

{3. 94810000,1.80510000,1.66920000,1.

{2. 62115775,1.36101297,2.48365661,3.

{0. 96340000,2.19290000,2.

{2. 22410000,3.34520000,1.92750000,2.

{1. 34990000,2.55940000,3.38100000,2.

{3. 98355945,1.62050242,1.86586909,1.

{1. 45670000,1.96900000,2.46570000,3.60150000}, {3. 29180000,0.57080000,0.94640000,3.

{1. 14401268,2.35151050,3.56543838, {2. 05950000,3.34370000,2.61720000,1.

{1. 87540000,1.98800000,1.73030000,3.

{3. 38890000,1.81050000,1.78110000,2.

{3. 29220000,1.36330000,3.16320000,1.

{3. 18027283,1.45944882,1.71626835,3.

{1. 93300775,2.95380479,2.14151386,3.

{0. 81990000,2.46050000,2.15850000,3.

{1. 14122290,3.68786928,1.67502304,2.

{4. 55780000,1.41040000,1.67570000,1.

{2. 04350000,2.88820000,2.26570000,3.

{0. 73210000,1.30000000,2.88790000,4.04000000}, {0.68450000,3.63810000,2.57410000,2.

{1. 25130000,2.48210000,80700000,3.

{1. 22334247,2.93218987,2.87129861,2.

{4. 15430000,2.62750000,1.52140000,0.

{4.00998503,2.44785350,1.91086193,1.26495926}, {0. 96334199,3.67493280,2.53065106,2.

{1. 86980000,2.73670000,3.53870000,1.

{2. 09590000,2.38780000,2.88250000,3.

{0. 51105028,0.95473004,4.82149731,1.

{0. 79809573,1.73747912,3.08641885,3.

{0. 61920315,1.56245166,2.03613905,4.

{0. 80690000,2.93290000,2.85130000,3.

{5. 07533511,1.11492899,0.76600689,0.

{0. 88400000,2.94980000,3.38330000,2.

{0. 83560000,2.01790000,2.22550000,4.

{3. 26488329,2.53220768,2.39822027,2.

{5.15360000,1.03590000,0.69850000,0.

{0.47680000,2.01850000,2.88800000,3.

{1. 86250000,3.63570000,2.53310000,2.

{2. 32650000,1.64910000,3.97760000,2.

{1. 31220000, 2.84950000,2.52880000,3.

{3. 73900000,3.03360000,1.57910000,1.

{1. 03140000,1.76600000,4.09070000,2.

{2. 55040000,3.02110000,3.03810000,2.

{1. 56630000,2.27920000,2.12510000,4.

{0. 80128484,3.20209641,2.11458149,3.

{2. 75810000,2.61700000,2.52250000,3.

{1. 56170520,2.51828258,2.37504668,3.

{1. 32800000,2.01560000,3.37940000,3.

{0. 81991044,2.74699922,2.83105528,3.

{2. 58517545,2.41831906,3.32046360,2.

{1. 22610000,3.16100000,1.83930000,3.

{0. 58860000,3.34140000,1.53090000,4.

{3. 21800000,2.89890000,2.62590000,2.

{1. 53063335,2.00389576,3.74615530,3.

{0. 73982063,2.57762397,4.

{2. 78358948,3.74601756,2.30742134,1.

{5. 43400000,1.00760000,0.56080000, {0. 62260000,3.56230000,4.22540000,0.

{1. 02070000,2.48650000,2.65140000,4.

{2. 19711701,1.95745934,3.03561042,3.

{1. 27560000,3.48400000,2.79200000,3.

{2. 38060000,2.13400000,3.69000000, {4. 05209972,2.97601237,1.05845013, {1. 41410000,3.00250000,3.56970000,2.

{0. 78509386,2.56013083,3.49976941,3.

{0. 32550000,3.48650000,3.46410000,2.

{0. 59520000,2.45070000,2.79830000,4.

{3. 87180000,1.52880000,2.96370000,2.

{1. 40848596,4.29965314,2.83277234,1.

{0. 86360000,2.02710000,4.

{2. 08470000,3.65530000,2.68660000,2.

{1. 29520000,2.61240000,2.78910000,4.

{1. 33671645,3.62780768,3.60451483,2.

{0. 58190000,0.85490000,5.50760000,1.

{1. 83990000,3.33240000,2.04680000,3.

{1. 37853169,4.85910095,2.17229283,1.

{0. 57161173,1.94082970,4.37862081,3.

{1. 75980000,4.12590000,2.83200000,2.

{4. 82590000,2.25190000,2.00940000,0.

{1. 69460000,3.02990000,3.65540000,2.

{2. 09890000,3.08470000,3.54600000,2.

{0. 87630000,2.93340000,3.12870000,3.

{2. 18650000,1.79660000,4.22310000,2.

{1. 67344150,0.81455177,5.43940756,0.

{0. 72940000,1.75350000,1.50550000,5.

{2. 00440000,2.88580000,3.10610000,3.

{1. 41916748,2.63672001,3.30211908,3.

{0. 53660000,1.74370000,4.91290000,2.

{3.99540000,3.24990000,2.19120000,2.

{331361447, 1.99125651,2.36964801,3.

{1. 23957085, 1.68046134,2.76294455,4.

{0. 64230000,2.47180000,3.96360000,3.

{0. 30620000,1.85530000,2.54970000,5.

{4. 93780000,1.02110000,1.07490000,3.

{5. 08416611,2.69266311,1.

{1.06202757,3.23024339,3.98737130,3.

{1.85270000,3.64740000,3.59020000,2.

{0. 42090000,2.28950000,3.00040000,4.

{6.02390000,0.55130000,0.43540000,0.

{2. 45192326,5.09054783,1.

{2. 36859242,2.87308793,2.34889970,4.

{6. 06878102,0.52032041,0.27836222,0.

{0. 79655073,3.61273913,3.09842639,3.

{0. 83310000,2.82610000,2.57390000,4.

{5. 73680000,1.78970000,0.96460000,0.

{0. 58407500, 1.84587724,5.51249561,1.

{5. 90110000,1.47060000,82040000,0.

{5. 27372066,1.95474391,2.08813292,1.

{4. 29324640,0.99574963,3.67595988,2.

{1. 58583128,3.50477846,85482397,3.

{2. 92780000,2.06760000,2.60230000,4.

{2. 95790000,3.14450000,2.62950000,3.

{0. 81834272,2.87245938,2.75295959,4.

{2. 06730000,3.19430000,2.99680000,3.

{0. 69103962,2.09490823,2.07533947,5.

{1.06787758,2.54948360,4.93249276,2.

{0. 84177292,2.34414462,4.25769786,3.

{2. 82920000,2.28550000,3.94430000,3.

{2. 36390000,1.86180000,5.07850000,2.

{0. 65489458,2.25669250,4.

{1. 25106359,4.65043045,3.52244164,2.

{1. 82056859,4.33030509,2.86284938,3.

{4. 37190892,3.22778677,1.92061395,2.

{2. 83983941,1.25029093,3.74029839,4.

{6. 33440000,0.20610000,0.18340000,0.

{1. 96460000,4.14700000,2.89830000,3.

{2. 68902407,3.36225081,4.46315484,1.

{1. 42930000,3.63160000,3.30210000,3.

{0.70630000,3.54960000,4.

{2.84011995,1.63505747,4.61551440,2.

{3. 65141071,1.33548270,1.58514901,4.

{0.71878761,3.18202357,2.11465505,5.

{1. 75150000,1.18490000,2.

{4.73153889,3.11406144,2.33970423,1.

{4.65127395,2.01181917,3.25468045,2.

{3. 61183309,3.54603755,2.63541011,2.

{0.92680000,2.20390000,3.19860000,5.

{2.56503216,1.58975653,2.60967534,5.

{3.34320000,4.03360000,2.12130000,3.

{2. 91820207,3.26652531,3.22688812,3.

{1. 14890000,2.56140000,3.95150000, {2. 33193530,2.78844872,4.85525658,2.

{1. 70380383,1.89138318,2.

{1. 29468463,2.48073368,3.68984850,4.

{0. 75150000,2.30010000,5.12440000,3.

{2. 43660000,4.03490000,2.78280000,3.

{1. 39571596,2.98717298,1.

{0. 42260000,2.03090000,2.70920000,5.

{2. 28560000,3.06910000,4.07370000,3.

{1. 54900000,3.36760000,4.40450000,3.

{0. 54330000,2.32260000,1.63890000,5.

{0. 52120000,1.69440000,4.77190000,4.

{1. 13533825,4.21336258,3.35039205,3.

{4. 76010000,2.53950000,3.16580000,2.

{2. 19344627,3.43219256,4.03262765,3.

{2. 07480000,3.62880000,2.53270000,4.

{1. 48670000,1.58540000,4.75710000,4.

{3.94542427,1.66762709,4.60522500,1.

{0. 98170000,3.19900000,3.54280000,4.

{3.47310000,3.85340000,3.04650000,2.

{0.96020000,3.35330000,2.66210000,4.

{1. 75470000,2.91190000,4.25020000,3.

{3. 23533192,1.78075003,13125190,2.

{2. 98960000,3.27590000,3.47410000,3.

{3. 71170000,3.12140000,2.24830000,4.

{0. 83160540,2.34385364,3.

{0. 87220000,3.25440000,1.70760000,5.

{5. 88160000,1.96120000,1.98250000,1.

{3. 74031025,2.84627624,4.31810366,2.

{2. 52374471,2.53443727,2.06814049,5.

{0. 86920000,2.05700000,3.87540000,5.

{0.89340000,4.19870000,3.46330000,3.

{1. 04736786,3.28184828,3.80030221,4.

{3.13043324,4.41084229,3.63023782,2.

{0. 65966102,2.16674527,4.18144183,4.

{6. 57983288,1.40124660,0.96786416,0.

{3. 35074877,2.75183379,4.48829525,2.

{1. 27764018,3.34726470,2.68655894,5.

{0. 75751911,1.75396851,2.25633391,6.

{1. 25000000,4.62890000,4.33260000,2.

{0. 62940000,3.16160000,3.43410000,5.

{2. 45350000,3.75020000,3.84530000,3.

{4. 87626497,2.56036558,2.45779634,3.

{0. 98093726,2.08646156,5.44679975,3.

{2. 33936922,2.45815422,3.16505020,5.

{3. 95671149,4.35419644,2.86804508,2.

{2. 35120000,2.74980000,3.49010000,4.

{2. 53763044,2.47313728,5.71954141,1.

{1. 74477118,3.08104358,4.47236303,4.

{0. 80260000,2.59630000,4.23390000, {4.25070000,2.52830000,3.79050000,3.

{1. 06014378,4.48295498,4.21073676,3.

{1. 25800000,5.14240000,3.

{3.00991094,4.38850915,2.93409343,3.

{0. 83779322,3.91360870,3.29054241,4.

{0.94729704,2.69844817,4.97688102,4.

{0. 95990000,3.11660000,4.86420000,4.

{2.65720000,2.50210000,4.66650000,4.

{2. 39358827,4.23570202,2.73723567,4.

{4.82560000,3.23690000,3.64730000,2.

{3.35848505,2.07937403,4.26952516,4.

{7. 13930000,0.63680000,0.68290000,0.

{0. 86360000,3.41520000,2.41750000,5.

{0. 88786330,2.31985683,3.30707266,5.

{1. 35105752,2.25352076,6.13801118,2.

{6. 46725843,2.59934414,1.22993150,1.

{2. 83080000,3.78080000,3.01180000,4.

{1. 98640000,3.49750000,3.49800000,4.

{1. 25427821,4.14099769,5.12550743,2.

{1. 79632249,4.12473829,3.90350471,4.

{1. 74950000,4.45070000,3.52330000, {3. 36830000,2.47820000,1.86270000,5.

{1. 16340000,2.94620000,4.03690000,5.

{6. 08168511,2.06159119,2.

{6. 00380000,3.17760000,2.26150000,1.

{1. 87097762,1.66186174,5.66704574,4.

{1. 13942515,4.92995903,3.01265234,4.

{1. 13599002,3.76458773,4.85215715,3.

{2. 43338062,4.56185058,4.30232241,3.

{0. 98210000,3.51220000,4.36150000,4.

{2. 21852398,4.32542442,5.24655839,2.

{1. 89539186,3.62961827,3.34033346,5.

{1. 55167113,97316140,2.36098436,6.

{1. 27760000,2.87500000,3.61290000,5.

{5. 08750000,3.98500000,3.30870000,1.

{7. 27884130,0.43634440,1.19087294,1.

{5.04580000,2.67300000,2.90250000,3.

{0.95598487,3.57483341,5.79884845,3.

{2. 00200000,2.84520000,5.57680000,3.

{0. 75802169,3.49915542,3.41138838,5.

{0.67849510,2.00708481,6.98162116,2.

{7.39726170,1.0.78634411,0.

{1. 32780000,1.33310000,5.67880000,4.

{3. 96910000,2.51670000,3.41660000,4.

{0.80357940,2.88161482,4.14131463,5.

{0.91250000,2.10780000,3.51560000,6.

{0.60779465,2.80880035,2.98099351,6.

{2.72247506,3.12542020,4.16791135,4.

{1. 46740000,3.82300000,5.06350000,3.

{0.83620000,1.59670000,46550000,3.

{0. 57500818,0.94499890,7.23442796,2.

{2. 41430000,5.02900000,3.54340000,3.

{3. 83043148,3.53651179,4.26399631, {0. 40580662,1.69759804,2.09269962,7.

{7. 62126692,0.0.49868253,0.

{1. 80006813,1.51991392,1.18641710,7.

{0. 78890077,3.49779039,2.52692026,6.

{1. 14190000,2.39680000,5.54210000,4.

{6. 43706349,2.32429301,2.13960614,2.

{4. 63790156,3.35933359,3.90938881,3.

{7. 64850000,0.75530000,0.82330000,0.

{1. 68271536,2.27970327,4.51399560,5.

{4. 66340000,1.92330000,4.92400000,3.

{0. 76463354,1.11363357,6.04482209,4.

{0. 50380000,2.46800000,2.66820000,6.

{2. 85130000,3.28510000,5.56670000,3.

{0. 90860000,4.61770000,2.32590000,5.

{1. 69079978,3.16486754,4.18771878,5.

{2. 82496638,3.59337709,2.48811001, {0. 93202861,3.91025719,4.24521168,5.

{1. 21270000,95180000,5.57880000,4.

{0. 55659530,2.91938894,1.93771385,7.

{2. 32410000,4.45640000,4.91380000,3.

{6. 56354517,3.45828242,2.40487691,1.

{1. 39481420,1.95864980,3.39553636,6.

{6. 06147968,2.30430262,3.85349629,2.

{3. 31308290,3.93501851,5.24822818,3.

{1. 28189201,3.49630780,4.91269656,5.

{1. 87110000,4.81960000,2.42370000,5.

{3. 29160000,1.88870000,6.52260000,2.

{1. 02577027,6.26717017,3.02097770,3.

{1. 08889792,4.76053318,3.12725908,5.

{0. 94890142,2.64725255,5.18459808,5.

{0. 60869645,1.66104147,4.96642227,6.

{2. 32501156,4.85889731,4.09460333,4.

{2. 33124361,4.13115147,5.03832451,4.

{5. 62670000,3.57940000,3.63050000,2.

{4. 19700000,2.15840000,1.59240000,6.

{3. 23570000, 2.28700000,3.77150000,5.

{2. 35500000,1.31420000,7.47490000,1.

{3. 51240000,3.22170000,5.28090000,3.

{1. 71041317,2.21460454,4.07049629,6.

{2. 11300000,3.85200000,4.84450000,4.

{1. 69840000,2.54980000,5.29430000,5.

{2. 18880000,4.56550000,3.92940000,5.

{4. 47398373,4.50340956,3.58449025,3.

{1. 62780000,4.09750000,3.93600000,5.

{2. 32854646,4.37697399,3.44268627,5.

{1. 05221393,5.00173427,4.36603813,4.

{2. 68874890,2.25631323,2.77983225,6.

{2. 83360000,4.55100000,5.06100000,3.

{0.76750000,5.49700000,2.76150000,5.

{1. 05210876,5.90140772,3.95237833,4.

{1. 41379518,4.56902792,5.73150822,3.

{1. 56540000,4.22360000,2.95510000,6.

{3. 46482515,2.69167159,5.57198957,4.

{0. 32788487,4.92846336,1.00250413,6.

{8. 01610000,1.01500000,1.24210000,1.

{1. 40965071,24859511,3.79414337,6.

{3. 34300000,5.07500000,3.52970000,4.

{4. 36383328,0.52545936,7.03324499,1.

{1. 43053111,3.42535818,6.06395491,4.

{1. 52553424,4.69652916,3.97731977,5.

{0. 78785547,3.40374091,6.81701971,3.

{1. 99643828,1.56993227,7.74196039,2.

{3. 59059653,1.10493742,2.43114793,7.

{0. 59157348,2.33388011,3.11138786,7.

{1. 60134200,4.96999648,5.00033777,4.

{1. 64715460,3.02527827,3.09226268,7.

{4. 14762195,5.66690873,3.93081195,2.

{7. 30991321,2.34282240,2.01737109,3.

{1.81813544,5.81146695,5.04057775,3.

{2. 72500000,4.18810000,4.01950000,5.

{0. 72434022,4.46930762,5.73036749,4.

{1. 12271355,2.49240949,6.45401174,4.

{8.18580000,1.25740000,1.11490000,2.

{7.03134055,1.64326599,2.00461569,4.

{8. 63372164,0.59648853,0.25332698,0.

{2. 88343302,5.24472346,3.57891079,5.

{0. 63238137,2.96357169,4.46461341,6.

{0. 79300000,3.08870000,5.52690000,5.

{1. 83841929,3.89459053,4.37188474,6.

{0. 91034777,7.34639828,3.96714020,2.

{5. 63760000,1.89710000,2.94260000,5.

{0. 78936768,4.34413774,4.12190400,6.

{7. 96615945,2.19625988,1.99605833,2.

{1. 98143078,1.73449291,4.93402285,6.

{3. 14640000,5.61260000,4.79230000,3.

{1. 69972168,2.08214425,3.63080163,7.

{1. 32483125,3.17048114,5.51070206,6.

{0. 70967677,3.49808735,3.43704395,7.

{4. 62297428,2.82356685,3.59430579,6.

{4. 53330000,4.73910000,3.55300000,4.

{1. 22840000,3.70640000,4.28130000,6.

{1. 34928961,1.92196756,1.70876240,8.

{1. 42498187,7.16423478,4.12999496,3.

{2. 40047727,3.16623823,4.84382122,6.

{2. 48100000,5.33260000,4.42190000,5.

{2. 50150000,6.67730000,3.64890000,4.

{4. 74551033,2.15867910,5.37583194,5.

{1. 82390000,4.57140000,4.45490000,6.

{1. 72228501,5.90465699,4.91117534,4.

{3. 20810000,4.45020000,3.31560000,6.

{1. 56708064,4.57070311,3.02755847,7.

{0. 68148307,2.60453842,5.94508113,6.

{0. 86744786,5.67480038,3.78103456,6.

{8. 27156126,3.36082584,1.46801232,1.

{1. 40032892,4.30054766,5.19078747,6.

{2. 60722692,4.12078931,5.

{0. 64930000,4.10450000,6.95650000,4.

{2.28980000,4.66040000,4.02230000,6.

{1. 27230000,3.49690000,5.94890000,6.

{1. 37639266,5.00782932,5.07692743,5.

{8. 84097806,2.00111843,1.73112804,1.

{0. 77910000,4.47790000,2.17170000,7.

{1. 43196785,5.12906569,5.66872837,5.

{1. 39041995,2.4.99406517,7.

{3. 08580000,6.88330000,3.84090000,4.

{8. 42319800,2.05509723,3.29452524,1.

{0. 92688007,4.04050755,5.16138576,6.

{8.07521848,3.43824000,2.71793398, {0. 76947542,2.08881931,4.45080288,8.

{2. 39837942,5.13450154,4.89299397,5.

{2. 85605118,4.97967334,5.92350670,4.

{7. 22200000,1.88540000,1.76530000,5.

{2. 71980000,4.01000000,6.88780000,4.

{2. 51716590,3.98307107,6.51702084,5.

{0. 94537419,6.88451592,2.39514517,6.

{1. 09245706,4.16002330,6.22830437,5.

{2. 35093743,5.86161935,3.78206776,6.

{0. 94850000,5.31470000,5.66010000,5.

{1. 18755839,2.46547989,7.47799145,5.

{0. 72777489,3.06658013,4.30110855,7.

{3. 82981518,2.52393877,7.76001968,3.

{3. 61010000,4.27680000,5.84660000,5.

{0. 53551137,3.15274769,2.55147392,8.

{0. 97926023,2.55946697,3.12285282,8.

{0. 55532941,2.19165307,6.72824320,6.

{1. 83760000,2.31470000,2.84280000,8.

{1. 83760000,2.31470000,2.84280000,8.

{3. 32083951,4.75174962,4.49785660,6.

{0. 65130649,6.90970999,5.25399243,4.

{3. 11438237,5.83427486,5.23631431,4.

{2. 28429836,3.03809429,7.56678149,4.

{1. 08165983,3.09801020,6.00229530,6.

{3. 08790000,2.42480000,5.68320000,6.

{0. 80320364,4.88645184,3.23307075,7.

{2. 82470000,5.50430000,5.11480000,5.

{9. 66457469,0.72241715,0.73603961,0.

{2. 99327170, 5.54300234,6.26703953,3.

{1. 62140000,5.94360000,4.16200000,6.

{1. 78410000,5.15330000,5.85290000,5.

{0. 78120200,1.63672160,8.38575221,4.

{1. 31678939,8.01834598,4.34605541,3.

{0. 97820851,4.26692920,4.31887746,7.

{5. 06340000,4.17620000,6.01510000,4.

{3. 51597902,6.08494491,4.29446519,5.

{3. 36139114,3.91637920,5.72115014,6.

{6. 08830000,5.43630000,3.61600000,4.

{2. 39830000,6.44330000,3.75540000,6.

{1. 11147149,4.30328685,1.82271108,8.

{1. 63871436,3.95275142,5.45264894,7.

{2. 02855085,5.65075047,4.64130877,6.

{1. 94580000,3.61490000,5.67930000,7.

{1. 59700000,5.26450000,68320000,6.

{6. 68990000,1.12770000,5.68740000,4.

{1. 47240000,6.58020000,7.51260000,0.

{1. 43605682,3.57129694,4.86798865,7.

{1. 35082975,4.79978242,5.08229820,7.

{6.59810000,5.16070000,4.99920000,2.

{0.85804042,2.66036181,79617269,8.

{0. 57752720,3.85584150,2.82063576,8.

{2.76601934,2.14587280,8.29033879,4.

{2. 27580364,4.89175504,6.71997795,5.

{3. 47641496,4.79028162,6.81795681,4.

{0. 93039801,2.35470380,2.03067856,9.

{5. 24280269, 5.87342961,5.03715168,4.

{3. 33721370,2.67548096,6.40789015,6.

{1. 56216251,3.93947215,00708175,6.

{1. 34391255,7.73137752,5.14339005,4.

{7. 41750178,3.73637944,3.08194778,5.

{7. 32120000,6.00560000,3.62490000,2.

{2.19962531,6.52325907,5.40432758,5.

{4. 93620000,4.72110000,4.68730000,6.

{0. 73187601,6.21119149,4.09183251, {1. 79253652,3.77408073,7.68580382,5.

{1. 13078036,5.25850420,6.01079823,6.

{2. 43485111,5.68917861,6.85232992,4.

{0. 67366505,5.02560379,3.47361526,8.

{6.86360000,5.21520000,4.96220000,3.

{2.16212799,1.53191572,7.40567293,6.

{3.73873971,3.92260064,5.06203969,7.

{2. 10942410,3.14277918,4.37038407,8.

{1. 59757456,6.22510211,4.05319557,7.

{3. 25559742, 4.73046932,6.86808354,5.

{4. 52622292,2.85841971,8.69240887,2.

{1. 26056004,6.38198672,4.94052448,6.

{2. 27077447,3.23092900,3.31767289,9.

{4. 64362250,5.54476344,4.24857384,6.

{0. 87778876,6.21262913,3.32501727,7.

{2. 75102335,4.16448628,6.81864507,6.

{1. 03724763,4.46209680,3.36610756,9.

{10. 61430744,1.25248983,0.79488974,0.

{1. 70130689,5.21562264,3.88195218,8.

{2. 43120000,3.76240000,5.84110000, {1. 02946661,3.90428545,6.27275391,7.

{1. 65699034,8.74949369,2.90585411,5.

{2. 58759134,6.43089846,4.54053428,6.

{4. 90500000,4.89560000,5.64060000,6.

{0. 55686275,9.28114166,4.00477472,3.

{0. 61038329,4.81204953,6.88326204,6.

{1. 71815125,4.85510539,7.30381518,6.

{1. 08169894,2.89362957,5.80959118,8.

{2. 37142070,7.51711915,4.55736525,5.

{3. 94834328,2.68050954,7.56836449, {0. 54564044,3.87758027,3.78915025,9.

{2. 58081047,2.92320529,8.86926268,5.

{5. 02738528,6.32462173,4.26820623,6.

{0. 72903170,3.65300944,7.51390394,7.

{8. 17356086,5.10349515,2.83298496,4.

{1. 97532238,4.91565205,7.

{4. 55151377,5.92192617,6.06545553,5.

{1. 39045819,5.61386640,8.47073728, {3.03632675,4.64320306,6.10075658,7.

{0. 79977125,3.95429196,4.90566833,9.

{1. 85265733,6.14864006,6.64512400,6.

{0. 85921269,2.57878725,6.54695825,8.

{5. 33913754,4.58169580,6.78995113,5.

{1. 61137513,4.23667418,4.59640634, {0. 77773039,5.42284598,3.34374173, {0. 92001029,75573266,4.85671240,8.

{0. 82972835,2.10488103,10.90536338,1.

{1. 68184517,7.80682195,6.38121141,4.

{1. 00885512,5.17437788,6.03487798,7.

{7. 37866048,5.56609740,4.51195592, {1. 82483053,3.67395636,7.54960019,7.

{2. 81360015,3.43055611,8.08047384,6.

{9. 30274846,3.31031206,4.83883820,2.

{2.02215437,8.54068625,5.46996516,4.

{1. 25579314,5.90596091,6.42340888,7.

{3. 16855201,1.96299080,9.27163800,5.

{1. 12197104,3.47627070,6.03946668,9.

{2. 31795965,4.61985356,5.71764273,8.

{0. 86830400,3.48560358,2.79081647,10.

{1. 32731682,4.35604190,5.57674297,8.

{1. 36907020,6.03370451,7.31392598,6.

{0. 81461105,5.91799246,7.21449418,6.

{0.77676785,8.61742544,4.51391237,6.

{0. 96955818,2.29484854,9.56821601,6.

{2. 86384706,4.56902790,56249623,9.

{9. 74533365,1.73357571,1.57835884,5.

{2.79767056,8.79170726,3.56330502,6.

{2.28836879,2.75465096,5.61332411,9.

{2.72413650,6.18191018,5.53391462,7.

{11. 76160020,0.63134542,0.47546805,0.

{1. 91094350,6.07895552,5.48544428,8.

{1. 21370233,4.32335055,6.66457502,8.

{1. 18594424,2.78138448,5.45502842,10.

{2. 22929878, 6.14469068,7.46699295,6.

{2.79591683,2.83135167,4.33735740,10.

{0.78747333,6.39393375,5.81692357,8.

{0.76370119,2.78809390,3.14370946,11.

{1. 11723835,4.71483644,4.66368120,9.

{0. 93916682,6.88785336,6.

{1. 60276368,3.30514684,8.77524914,7.

{0.92251764,3.39023345,4.43048766,10.

{5. 79340376,2.36312960,9.56320308,3.

{2.71241676,3.49872684,3.53303480,10.

{0.67386409,6.69675668,2.95976231,9.

{2.49519916,7.29936215,6.10335316,7.

{0.99832686,2.40880100,6.42354357,9.

{4.01387376,6.6.09807071,7.

{3.49608352,4.71858106,8.28710217,6.

{2. 27787473,4.95617707,6.63521261,8.

{4.14506250,3.64127269,3.89205582,10.

{0.97399178,6.33869199,4.56383367,9.

{4.15984043,9.54777210,5.48922705,3.

{2.40056464,5.81852817,5.71816354,8.

{2. 35045777,6.73328445,7.98562753,6.

{0.85625841,6.72016523,8.18650368,6.

{4. 19542367,5.39098152,8.

{1. 27547780,5.76620603,4.99258436,9.

3.68529387,4.15915911,9.86937700,5.

0. 71107447,4.70978679,3.77271030,10.

0.66877494,5.93834796,2.38106951,10.

1. 33751968,5.13029803,6.53386722,9. <BR> <BR> <P>@ 12.56307254, 0.93468157, 084920832, 042348664}, [1. 23085824,25341291, 0. 82949585, 3. 82074178, 6. 17543646, 10. 36898905}, {1. 10644169,3.89956692,5.41639199,10.

1. 75701769,4.30332918,9.57778642,6.

{2. 58670629,3.61601573,9.40930720,7.

{1. 11711964,33961164,7.26247097,8.

{1. 12884095,6.31375030,6.51816011,8.

{1. 31484974,2.18370089,12.27551106,2.

{1. 01443115,2.54877355,11.73818233,4.

{0. 34774385,1.82783722,1.62876661,12.

{0. 97994586,7.28869946,5.89794637,8.

{12. 11453168,2.95318899,2.36450881,2.

{3. 20328426,2.91523634,4.79849243,11.

{0.39407780,4.99498194,2.57332231,11.

{1. 99022794,6.13419229,7.38379789,8.

{1. 40306662,2.69579878,10.61501684,6.

{0. 74186835,7.70994201,4.64414578,9.

{4. 89704263,5.35918710,8.09906544,6.

{0. 92288588,4.09518940,3.92972179,11.

{2. 42897489,4.64757197,7.89471050,8.

{1. 38902492,5.96627182,7.94008793, 8.35998654), {1. 86051693,7.14098385,7.09990896,8.

{1. 96359013,5.27636059,7.41503586,9.

{2. 24507052,8.53059177,5.42855859,8.

{1. 36089784,7.72918602,7.98738655,6.

{4.98127968,8.23828278,7.66412694,4.

{0.81803441,3.64700350,10.77046446,6.

{2.64396095,6.64740820,5.36249272,9.

{0. 85721046,8.97648757,5.41140639,8.

{1. 42735279,4.50433704,8.27851263,9.

{0. 58781859,1.49262189,4.

{2.65351582,2.42853441,11.17485949,6.

{2.04620521,6.60779533,7.14834362,8.

{0.80439323,3.85181763,2.26196590,12.

{2. 92145764,4.34267811,6.43522260,10.

{2. 33482997,5.15803099,6.46659454,10.

{1. 65316504,7.47331814,9.05799951,6.

{0. 41531975,6.32611792,7.81048780,9.

{0. 72163873,5.22495540,3.45639623,11.

{2. 09052746,5.11789887,3.52197500,11.

{0. 64174199,7.23509890,3.49107988,10.

{0. 58136635,6.03319986,3.77340852,11.

{1. 88847880,4.00700903,7.34681808,10.

{1. 40901082,5.45959436,4.73007662,11.

{0. 73776988,4.83606269,9.18284567,8.

{3. 96879248,2.18603979,2.84762095,12.

{3. 15568267,6.13406295,6.90737855,9.

{0. 80374107,4.65769736,39948760,11.

{2. 09661987,3.39005710,10.38768437,7.

{0. 88332189,3.59791465,3.82394388,12.

{1. 08942200,3.27182927,5.96210209,11.

{1. 55847253,6.22902600,6.74851950,10.

{0. 60905689,3.35885813,12.06024258,5.

{1. 08382049,5.48905940,6.05852153,10.

{3. 34331887,6.47396440,9.59220445,6.

{1. 59318007,2.09545050,7.16202899,11.

{1. 03897082,4.38732526,4.70222853,12.

{1. 92798261,5.11639063,8.09865625,9.

{0. 93720103,8.05063136,3.78686375,10.

{0. 91119552,1.81953111,6.03538728,12.

{2. 16380492,7.70566504,8.84913274,7.

{1. 76924750,7.78185077,5.10.

{1. 15987388,9.05765050,8.75415366,6.

{1. 21371823,4.84729610,7.22481775,11.

{1. 38288988,7.46133933,6.82601120,9.

{1. 29664362,4.30129589,6.03512857,12.

{0. 52458287,7.00147036,5.23429062,11.

{1. 33509209,6.23521497,9.42836940,8.

{1. 37643962,4.17636451,8.02931336,11.

{6. 43419688,7.68704523,7.96430106,6.

{1. 72236359,7.06395633,9.

{1. 56927388,10.37173887,5.72851106,8.

{1. 45839622,5.78397321,4.50445026,12.

{3. 02747083,4.17525110,32314067,6.22746505}, {2. 05146571,4.41343489,9.23736091,10.

{5. 66453026,9.06175578,5.41182386,8.

{1. 66093555,5.57904772,9.05000208,10.

{3. 18681036,7.89504069,8.51476704,8.

{1. 40298641,5.16091442,8.03962112,11.

{1. 41520071,10.44754810,9.48927862,4.

{1. 26011031,5.96100155,8.35697698,11.

{4. 83543487,11.84478099,7.29747421,4.

{0. 87323832,5.89116239,7.64276889,11.

{1. 99570001,8.78756782,9.06747983,8.

{1. 02235503,7.76639722,6.94261495,11.

{1. 04732053,6.97494232,7.32229666,11.

{0. 73854685,8.17096188,5.40060392, {2. 20843937, 7.9.57229093,9.

{1. 77535285,9.00145328,8.05075125,9.

{2.68551656,6.70379889,6.01662021,12.

{1. 24885269,9.81972571,6.75838303,10.

{0. 66894325,4.60403323,8.62708990,12.

{1. 51766960,4.82660767,8.14967773,12.

{1. 86877729,4.64809996,9.05742322,12.

{2. 76648261,64942870,9.22799940,12.

{1. 61202857,8.63397367,8.87509927,10.

{1. 82511547,6.22777413,10.73435912,10.

{1. 38093430,71588232,9.28350958,12.

{1. 80444067,6.76445168,8.12958854,12.

{3. 47440527,7.88500975,8.59696339,11.

{2. 32572109,7.77723715,8.46668374,12.

{1. 33688750,10.89975644,6.29384729,11.

{2. 64792469,9.15374122,8.45512575,11.

{2. 83404531,9.18932276,9.77927438,10.

{1. 47207345,9.63668301,6.51404099,12.

{2. 01073179,8.11557312,9.57967353,11.

{1. 52741425,6.98063061,9.30346179,12.

{2. 15975449, 11.64209182,6.12475536,11.

{3. 66580372,9.64803926,7.39415298, {2. 14898470,7.40531177,10.12399765,12.

{1. 65172109,9.12415911,10.26071926,12.

{11. 37380673,6.17262402,10.98932460,7.

{1. 93257054,9.82814492,10.03906878,12.

{3. 30729405,11.02212306,12.58337589,8.

) {4. 93277768,12.49805088,10.53402702,11.

{7. 46673668,9.95870339,11.92110909,11.

{1. 79166482,12.16424221,11.50508223,12. <BR> <BR> <BR> <BR> <BR> <BR> <BR> <P>} ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*---------------------------------------------------------* / /* Copyright (C) 2000 Conexant System */ /*---------------------------------------------------------* / /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> l == l /* FILE: FLOAT64 gain VQ_2_128_8_5 */ /*========================================================== ========================*/ FLOAT64 gainVQ2_128_8_5 [MSMAX_2_128] [GVQVEC_SIZE_2D] = { {1. 13718400,2.

{1.15061100,0.

{0.98207800,0.

{1. 10500000,0.15447500,}, {0. 11378400,9.

{0. 94094200,0.

{0. 80243560,0.

{0. 13515300,11.

{0. 75909900,2.

{0. 82919900,1.

{0. 54780000,0.

{0. 64942200,0.

{0. 66705400,2.

{0. 63880400,1.

{0. 22345900,0.

{ 0.27085500, 0.04820600,}, {1. 15294600,4.

{1. 16686600,2.

{1. 18999500,1.

{1. 11778400,0.

{1. 18887200,3.

{1. 05657500,2.

{1. 13064700,1.

{1. 04200000,0.

{1. 04338300, 5. 44336600,}, {0. 88449000,3.

{0. 72784500,1.

{0. 70959500, {0.65729500,4.

{0. 70740000,2.

{0. 57385300,1.

{0. 47064300,0.

{0.88597700,2.

{1. 05926600,1.

{0. 12943500,13.

{0. 85623100,0.

{0. 69171100,1.

{0. 91399200,0.

{0. 10358200, 16.

{0. 68111100,0.

{0. 31958000,3.

{0. 62654300, {0. 16217000, 0.

{0. 38586700,0.

{0. 25176000,2.

{0. 43364500,1.

{0.05389400,0.

{0.10640600,0.

{0. 84213600,4.

{1. 14440800,3.

{0. 80336500,1.

{0. 55854300,0.

{0. 89434200,3.

{1.01672700,2.

{0.84586000,1.

{0.90643900,0.

{0. 33732200,5.

{0.62728700,3.

{1. 05076300,1.

{0. 48097400,1.

{0. 31390400,4.

{0. 55670200,3.

{0. 38080300,1.

{0. 42559800,0.

{1. 09926500,2.

{0. 95508100,1.

{0. 78678600,0.

{0. 95358200,0.

{0. 92961200,1.

{0. 75708000,0.

{0.68356300,0.

{0. 51043900,0.

{0. 53942900,3.

{0. 57837000,1.

{0. 35109200,1.

{0. 45661300,0.

{0. 61108400,2.

{0. 49322600,1.

{0. 24345900,0.

{0. 05047600,0.

{1. 16051300,5.

{0. 99243800,3.

{0. 99072500,1.

{1. 02200000,0.

{1. 09807600,4.

{0. 94571700,2.

{0. 88639400,1.28403400,}, {0. 85020100,0.

{0. 80787100,5.

{0.75617700,3.

{0.51556400, {0.60559000,1.

{0.46290200,5.

{0.72930000,3.

{0.33557200,1.

{0. 37945600,0.

{0. 81490800,3.

{0. 86360200,1.

{0. 58850100,0.88940500,},

{0. 74833100,0.

{0. 80934600, {0. 67389000,1.

{0. 63538600,0.

{0.57660000,0.

{0. 12176500,4.

{0. 37830600,2.

{0. 21637000,1. <BR> <BR> <BR> <BR> <P>{0. 31155400,. 0. 54434500,}, {0. 10000000,3.

{0.14343300,1.

{0. 11508100,0.

{0. 10320100,0.

{0. 90839600,5.

{0. 96277000,3.

{0. 77146900,2.

{0. 95915800,0.

{0. 91656900, {0.87191100,2.

{0. 70257400,1.

{0. 73999100,0.

{0. 11899700,7.

{0.48773200,4.

{0.39770600,2.

{0.46171900,1.

{0. 04775300,5.

{0. 24515600,3.

{0. 07214400,2.

{0.22776900,1.

/* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE : FLOAT64 gp3 tab */ FLOAT64 gp3tab [TABSIZEGVQ3D] [GVQVECSIZE3D] = { {1. 16184904,1.16859789,1.

{1. 14613289,1.06371877,0.

{1. 00344711,0.90488701,0.

{0. 89898517,0.86585984, {0. 99149439,0.97843157,0.

{0. 89739798,0.86130891,0.

{0. 86598496,0.78195693,0.

{0. 79213167,0.68469714,0.

{0. 99928691,1.06213737,1.

{0. 91946603,0.92523551,0.

{0. 78015244,0.80748131,0.

{0. 72123502,0.75183948,0.

{0. 71467869,1.00925302,1.

{0. 57918595,0.91509645,0.

{0. 58059384,0.63848156,0.

{0. 61528823,0.59858664,0.

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> /*FILE : FLOAT64gainSQl32 */<BR> <BR> <BR> FLOAT64 gainSQ_1_32[MSMAX_1_32]={ 0.35254579, 0.25370548, 0.02227783, 0.01000000, 0.96400353, 0.75700023, 0.19593419, 0.15817945, 0.55403371, 0.44012518, 0.17369569, 0.

2.00929650, 1.35393237, 0.28748898, 0.22267504, 3.05406901, 2.75461276, 0.

0.30225533, 6.52227783, 5.48564881, 1.00617023,

0.86949491, 4.51286186, 3.52957861, 0.66628545, 0.50710786, 8.51290000, 7.51286186, 2.

1.83583729, <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ // /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ FILE : FLOAT64 gainSQl_64 */ FLOAT64 gainSQl64 [MSMAXl64] = { 0.00500000, 0.01000000, 0.01613892, 0.02227783, 0.08039343, 0.13850902, 0.14834423, 0.15817945, 0.16593757, 0.17369569, 0.18481494,

0.19593419, 0.20930461, 0.22267504, 0.23819026, 0.25370548, 0.27059723, 0.28748898, 0.29487215, 0.30225533, 0.32740056, 0.35254579, 0. 37160684, 0.39066788, 0.41539653, 0.44012518, 0.47361652, 0.50710786, 0.53057078, 0.55403371, 0.61015958, 0.66628545, 0.71164284, 0.75700023, 0.81324757, 0.86949491, 0.91674922, 0.96400353, 0.98508688, 1.00617023, 1.18005130, 1. 35393237, 1.59488483, 1.83583729, 1.92256690, 2.00929650, 2.

2.31398228, 2.53429752, 2.75461276, 2.90434088,

3.05406901, 3.29182381, 3.52957861, 4.02122024, 4.51286186, 4.99925533, 5.48564881, 6.00396332, 6.52227783, 7.01756985, 7.51286186, 8.01288093, 8.51290000 <BR> <BR> <BR> <BR> <BR> <BR> <BR> } ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /___________________________________________________________ ________*/ /* Copyright (C) 2000 Conexant System Inc. */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE: FLOAT64 gain VQ_2_128 */ /*========================================================== =======*/ FLOAT64gainVQ2128 [MSMAX2128] [GVQVECSIZE2D] = { {0. 04775300,5.

{0. 05047600,0.

{0. 05389400,0.

{0. 07200000,1.

{0. 07214400,2.

{0. 10000000,3.

{0. 10320100,0.30653900}, {0. 10640600,0.

{0. 11508100,0.

{0. 11899700,7.

{0. 12176500,4.

{0. 14343300,1.

{0. 16217000,0.

{0. 21637000, 1.

{0. 22345900,0.

{0. 22776900,1.

{0. 24345900, 0.

{0. 24515600,3.

{0. 25176000,2.

{0. 27085500,0.

{0. 31155400,0.

{0. 31390400,4.

{0. 31958000, {0. 33557200,1.

{0. 33732200,5.

{0. 35109200, {0. 35586700,0.

{0. 37830600,2.

{0. 37945600,0.

{0. 38080300,1.

{0. 39770600,2.

{0. 40290200,4.

{0. 42559800,0.

{0. 42706300,2.

{0. 43364500, {0. 45661300,0.

{0. 46171900,1.

{0. 47064300,0.

{0. 48097400,1.

{0. 48773200,4.

{0. 49322600,1.

{0. 50338300,7.

{0. 51043900,0.

{0. 51556400,2.

{0. 53942900,3.

{0. 54660000,0.

{0. 54780000,0.

{0. 55670200,3.

{0. 57385300,1.

{0. 57837000,1.

{0. 58850100,0.

{0. 60358200,0.

{0. 60559000,1.

{0. 61108400,2.

{0. 62654300,1.

{0. 62728700,3.

{0. 63538600,0.

{0. 63880400,1.

{0. 64942200,0.

{0. 65729500,4.

{0. 66705400,2.

{0. 67111100,0.

{0. 67389000,1.

{0. 68356300,0.

{0. 69171100,1.

{0. 69515300,0.

{0. 70257400,1.

{0. 70740000,2.

{0. 70959500, 0.

{0. 72784500,1.

{0. 72930000,3.

{0. 73999100,0.

{0. 74833100,0.

{0. 74943500,0.

{0. 75617700,3.

{0. 75708000,0.

{0. 75909900,2.

{0. 77146900,2.

{0. 78678600,0.

{0. 80243560,0.

{0. 80336500,1.

{0. 80787100,5.

{0. 80934600,2.

{0. 81490800,3.

{0. 82919900,1.

{0. 84213600,4.

{0. 84586000,1.

{0. 85020100,0.

{0. 85623100,0.

{0. 86360200,1.

{0. 87191100,2.

{0. 88449000,3.

{0. 88597700,2.

{0. 88639400,1.

{0. 89434200,3.

{0. 90643900,0.

{0. 90839600,7.

{0. 91399200,0.

{0. 91656900,4.61102600}, {0. 92961200,1.

{0. 94094200,0.

{0. 94108100,1.

{0. 94571700,2.

{0. 95358200,0.

{0. 95915800,0.

{0. 96277000,3.

{0. 97378400,1.

{0. 98207800,0.

{0. 99072500,1.

{0. 99243800,3.

{1. 01672700,2.

{1. 03854300,0.

{1. 04200000,0.

{1. 05657500,2.13161600}, {1. 05926600,1.

{1. 09807600,4.16487000}, {1. 09926500,2.

{1. 10500000,0.

{1. 11778400,0.

{1. 13064700,1.

{1. 13718400,2.

{1. 14440800,3.

{1. 15061100,0.

{1. 15294600,4.

{1. 16051300,5.

{1. 16686600,2.

{1. 18887200,3.

{1. 18999500,1.

} ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /* FILE : FLOAT64 gainVQ 3 256 */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FLOAT64 gain VQ_3_256[MSMAX_3_256][GVQ_VEC_SIZE_3D]={ { 0.18423671, 0.06523999, 0.13390472}, {0. 27552690,0.09702324,0.

{0. 43928408,0.09916646,0.

{0. 30334933, 0.18716016,0.

{0. 41418666,0.

{0. 37873043,0.42174574,0.

{0. 29147613,0.29845310,0.

{0. 43405077,0.35567807,0.

{0. 53415143,0.29394379,0.

{0. 50717581,0.11896112,0.

{0. 66212668,0.19329986,0.

{0. 54479938,0.42417890,0.

{0. 72548595,0.35772887,0.

{0. 60787704,0.60357108, {0. 44866082,0.50410116,0.

{0. 63617079,0.44004655,0.

{0. 60380713,0.57881179,0.

{0. 57147613,0.32845310,0.

{0. 58377105,0.62781041,0.

{0. 84962970,0.34766924,0.

{0. 70304065,0.42216057,0.

{0. 56733319,0.77096928,0.

{0. 67739743,0.55274660,0.

{0. 50377105,0.59781041,0.

{1. 02493622,0.30657679,0.

{0. 89224001,0.44816208,0.

{0. 78742879,0.65575239,0.

{0. 86962970,0.52766924,0.

{0. 70147613,0.70845310,0.

{0. 56375176,0.54331588,0.

{0. 56880138,0.85878106,0.

{0. 89237889,0.63875680,0.

{1. 21640268,0.51021986,0.

{1. 10769596,0.60105476,0.

{0. 92783571,0.90203672, {0. 91304065,0.82216057,0.

{0. 73462016,0.87102291,0.

{0. 51415143,0.49394379,1.

{0. 80147613,0.80845310,0.

{0.65577617,0.84190122,1.

{1. 04057248,0.81830130,0.

{1. 50153717,0.23078537,0.

{0. 61337482,1.28879057,0.

{0. 92002052,0.66569019,1.

{0. 86113057,1.00464835,0.

{1. 30843346,0.78609255,0.

{0. 68218806,1.10235747,1.

{0. 80147613,0.80845310,1.

{1. 07221236,1.07266347,0.

{1. 04005621,0.92340675,1.

{1. 67199089,0.43317129,0.

{0. 80769819,1.03723493,1.

{0. 65537261,0.88560134,1.

{0. 84912716,1.37797097,0.

{0.38727281,0.81106102,1.

{0. 97653020,1.24782107,0.

{1. 68437217,0.69187863,0.

{1. 31480645,0.82070608,1.

{1. 40769819,0.60723493,1.

{1. 06758231,0.90166400,1.

{1. 41916427,0.61926269,1.

{0. 76932084,1.68403889,0.

{1. 53994895,0.92045545,0.

{1. 17434557,1.25676753,1.

{0. 71281086,1.31583463, {1. 50787704,1.35357108,0.

{1. 28870929,1.43696572,0.

{1. 34769819,1.23723493,1.

{1. 80304065,0.92216057,0.

{1. 59276987,1.19748085,0.

{0. 84678170,1.14114978,1.

{2. 09205535,0.42435557, {1. 07739708,1.25581010,1.

{2.03213590,0.68376401,0.

{2. 01481852,0.45383006,0.

{0. 61943236,1.95135273,0.

{1. 04773632,1.59531164,1.

{0. 88978466,0.85386113,1.

{1. 29776536,0.96049994,1.

{1. 72645587,0.69770038,1.

{0. 52462760,1.59032755,1.

{1. 00705056,1.38018864,1.

{2. 27773340,0.42174080,0.

{1. 33914079,1.44432940,1.

{1. 86798260,1.23959629,1.

{1. 60300067,1.45834785,1.

{1. 17075928,1.17666852, {1. 41613105,1.75303586,1.

{0. 92063093,1.92289980,1.

{0. 73106711,1.10141804,2.

{1. 78833214,1.08633166,1.

{0. 93493402,1.72883883,1.

{0. 83214354,1.44720912,1.

{1. 54501647,1.16781309,1.

{1. 11904841,1.57436071,1.

{1. 53104237,1.66544824,1.

{1. 14438336,1.79996622,1.

{1. 47409522,1.21483017,2.

{0. 76523771,2.00844105,1.

{2. 04771424,1.67904043,0.

{0. 54181758,0.98357105,2.

{1. 58307521,1.51532393,1.

{2. 43500575,1.09257895,0.

{0. 97756624,1.44705987,2.

{1. 89166746,1.35363713,1.

{1. 18415143,2.59394379,0.

{1. 36028189,1.68437713,2.

{0. 91784174,2.60471655,1.

{0. 80520427,1.92410272,2.

{2. 98285984,0.68934076,0.

{1. 50266600,2.22699291,1.

{1. 82265397,1.87159390,1.

{1. 09905937,2.18713881,1.

{2. 33704557,1.33227401,1.

{2. 35241303,1.69726111, {1. 04808551,1.49066820,2.

{1. 46152881,1.57356066,2.

{2. 72968460,1.23697995,1.

{2. 83739322,0.72272909,1.

{0. 82555146,1.04009950,3.

{1.42045226,1.95032360,2.

{1. 80302484,1.44216516,2.

{2. 06483654,1.93254106,1.

{0. 67917774,2.63766396,2.

{1. 02634826,1.92879555,2.

{1. 51872521,2.44014313,1.

{2. 30877821,2.

{0. 79031450,2.45814359,2.

{1. 32523818,2.24315629,2.

{0. 98940812,2.84402782,1.

{1.31665565,1.82304671,2.

{1.34359003,3.

{2. 20904779, 1.71167907,2.

{1.74638332,2.10399175,2.

{2. 91613501,1.69537591,1.

{2. 59027791,. 1.77278764,1.

{1. 88338778,1.81263020,2.

{0. 74785364,1.55314315,3.

{1. 84605625,2.72422494,1.

{1. 38835853,2.41996170,2.

{1. 08143706,2.79353362,2.

{1. 69818444,1.73420492,2.

{3. 43403868,1.33204645,1.

{0. 97007105,2.32342882,2.

{1. 00567140,1.89901787,3.

{0. 87244421,3.43184209,1.

{1. 67492020,1.53714034,3.

{2. 55479938,2.

{134771672, 2.01099296,3.

{2. 14304065,3.02216057,1.

{2. 59002574,1.78610442,2.

{1. 32123069,1.59807627,3.

{1. 14300592,2.57639730,2.

{0. 92574076,2.92308627,2.

{1. 57092315,2.78635648,2.

{3. 67927168,1.24912102,1.

{2. 62956938,2.75787484,1.

{1. 95505014,2.52412798,2.

{0. 76806683,1.46836387,3.

{1. 26068455,2.40119239,3.

{1. 25882021,3.10377934,2.

{2. 30050748,2.41997639,2.

{2. 30779695,1.37761745,3.

{1. 38704503,3.71229947,1.

{1. 74924880,3.12919645,2.

{3. 49911398,1.82501924,1.

{1. 22345576,2.06177866,3.

{1. 63398319,2.49769986,3.

{1. 05262452,2.67912301,3.

{0. 93657527,1.56288763,4.

{2. 13113770,3.61726093,2.

{1. 33438889,3.20149678,3.

{0. 94607152,3.97866725,2.

{1. 93477378,2.25684162,3.

{0. 94330124,2.16329723,4.

{1. 33319181,3.67449053,2.

{2. 27147613, 2.74845310,3.

{3. 02616395,3.21716252,1.

{2. 10687315,3.16506001,2.

{4. 11022232,1.91121298,1.

{1. 18276551,2.80005028,3.

{1. 09284910,3.35693149,3.

{2. 12671584,3.78197824,2.

{2. 74764121,2.89026903,3.

{1. 37550113,2.20827333,4.

{2. 11778891,2.95016434,3.

{1. 28935019,2.59852102,4.

{1. 05655533,3.86933199,3.

{3. 05325444,2.26440201,3.

{3. 55488807,3.33969512,2.

{3. 17581401,3.51831382,2.

{1. 86521202,2.09247637,4.

{1. 39255334,3.07667470,4.

{1. 60100173,2.00209967,4.

{1. 79953418,4.38145628,2.

{1. 20655613,1.79195012,4.

{1. 85141571,3.85261166,3.

{0. 87797111,2.46051806,4.

{2. 24150619,2.50592028,4.

{0. 92794754,0.81807103,5.

{2. 07018808,1.55683902,4.

{1. 00141951,3.09506090,4.

{2. 19703965,4.54754188,2.

{1. 68611482,3.39861080,4.

{2. 40798222,3.84057596,3.

{4. 23562265,2.98668784,2.

{3. 35095885,2.87943539,3.

{1. 34643194,4.30772377,3.

{1. 30196206,3.00084122,4.

{1. 16458645,2.77589093,5.

{2. 42328760,3.86555792,4.

{1. 62105343,1.41238279,5.

{1. 87537181,4.29252889,4.

{1. 94915259,3.75474761,4.

{2. 50906157, 3.56636387,4.

{1. 88366421,2.94629459,5.

{2. 41081739,5.11659616,2.

{1. 57313722,3.07734699,5.

{1. 79523161,4.34349109,4.

{2. 31312398,4.51584051,4.

{2. 12061524,3.13076579,5.

{3. 91709002,3.99447396,3.

{1. 09473208,3.48204765,5.

{3. 71693971,4.77440840,2.

{1. 94787704,2.45357108,6.

{1. 43082216,5.35753324,3.

{2. 07996690,3.37146297,5.

{5. 27319185, 3.85749737,1.

{1. 50998753,4.13463484,5.

{0. 94796341,5.95733241,3.

{2. 78377105,2.79781041,5.

{1. 20436564,2.53343719,6.

{4. 87726112,4.61271729,2.

{1. 52759187,5.17921822,4.

{1. 39911614,5.70091947,4.

{3. 27962970,4.44766924,4.

{2. 07790477,4.96770690,5.

{3. 52060468,5.55065264,3.

{2. 80842248,4.77477568,5.

{1. 28666983,3.38891971,6.

{0. 84228383,3.37245381,6.

{2. 02498925,6.

{1. 60165594,2.32140376,7.

{1. 97479938,5.85417890,5.

{1. 84694789,3.62386827,7.

{2. 30906157,7.06636387,3.

{1. 20894988,4.11824820,7.

{2. 23724030,4.38107866,6.

{5. 05892405,3.39578378,6.

{2. 89229838,6.11530388,5.

{3. 45717581,3.84896112,7.

{5. 44334933,5.88716016,4.

{1. 32060468,5.05065264,7.

{1. 52060468,7.25065264,6.

{5. 97620545,6.67676201,3.

{4. 53928408,6.49316646,6. <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <P>} ;<BR> <BR> <BR> <BR> <BR> <BR> // /*--------------------- END --------------------------*/ /*========================================================== =========================*/

/*========================================================== =======*/ /*========================================================== */ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : gaussbv. */ /*--------------------------------------------------*/ /*========================================================== =======*/ /*--------------------------------------------------*/ /*----------------- TABLES ------------------------------*/ /___________________________________________________________ _________________*/

/* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ // /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> l =<BR> <BR> <BR> <BR> <BR> /* FILE: double bv */ /*--------------------------------------------------*/ <BR> <BR> <BR> <BR> /*===================================================== double bv[32][40]=( { 0.129991, 0.064760, -0.002124, 0.031397, -0.095657, 0.194382,-0.004066,0.020785,0.094439, -0.186531,-0.096221,0.139813,-0.088682,0.058761, -0.054868,-0.027660,-0.174793,-0.165230,0.108125, -0.016666,-0.103980,0.093234,-0.018041, 0.051019,0.036860,0.080444,0.037322,-0.173828, 0.034237,0.125167,0.077101,-0.299421,-0.044413, -0.050372,0.027321,-0.073190,-0.011473,0.

{0. 097175,0.029658,-0.109162,-0.009789,0.015654, -0.066477,-0.040802,0.046798,0.179909,-0.286337, -0. 129516,0.129213,0.066188,-0.033189,0.046677, -0.115491,-0.120577,0.035435,0.175051,0.085733, -0.060723,0.101562,-0.030479,-0.086184,-0.053423, -0.072980,-0.025941,0.063914,-0.125523,0.039384, 0.130419,0.015899,0.080340,-0.007682,0.233579, 0.106089,-0.212920,0.212192,0.

{0. 035485,0.065157,0.093618,200062,-0.051137, -0.029000,0.062292,0.106185,-0.147534,-0.079012, -0.007510,-0.313287,0.128095,-0.136738,0.127468, -0.107670,0.064600,0.087097,-0.033680,0.055832, -0.027791,0.054826,-0.145352,-0.100984,0.157922, -0.087520,0.016400,-0.204684,-0.061008,-0.105759,

-0.044183,0.106015,0.106175,0.129473,0.006966, 0.048202,-0.140265,-0.066978,0.141637,0.

{0. 032834,-0.117642,0.022656,0.028494,-0.042477, 0.019769,0.222683,-0.047178,-0.150082,-0.244569, -0.074121,-0.066537,-0.110890,0.175115,0.080115, 0.053503,0.031178,-0.262706,0.144141,-0.003827, -0.086824,-0.189568,0.001631,0.179950,0.026267, 0.069194,-0.022789,0.085670,-0.142656,0.079799, 0.040639,-0.022782,0.011422,0.135623,-0.003446, 0.073037,-0.122266,0.099223,0.155886,-0.

{-0.119203,-0.113097,0.087872,-0.088533,-0.008026, -0.167421,0.129201,-0.088686,0.110136,0.096386, -0.016415,0.040387,-0.035463,-0.041054,0.143447, 0.008815,-0.129834,0.194409,-0.123796,0.055210, -0.098973,-0.034145,0.052178,0.131509,-0.037693, 0.044694,-0.023161,0.005800,-0.141310,-0.012245, 0.184772,-0.098049,-0.154527,0.195311,0.145655, 0.099465,-0.174075,0.192918,-0.068933,-0.

{-0. 060778,0.055740,0.088327,0.040254,-0.012506, 0.214823,-0.054211,0.062578,0.062803, -0.195928,0.089170,-0.104766,0.005199,-0.100068, -0.119735,-0.191318,-0.090582,0.039863,0.070813, 0.186740,0.087480,-0.219826,-0.096662,0.000951, -0.261450,-0.017906,-0.048780,0.053088,0.078009, 0.115528,-0.005575,-0.009188,0.176039,0.218530, -0.025600,0.033588,-0.089599,0.020791,0.

{-0.076643,-0.003437,-0.013056,-0.079689,-0.071113, 0.173296,-0.117988,-0.066838,-0.168547,-0.026234, 0.023480,-0.069835,0.018212,-0.089650,0.111504, -0.019748,0.062012,0.203651,0.027630,0.118083, 0.008768,-0.047952,-0.109822,-0.055457,0.100392, 0.070526,-0.121105,-0.036054,-0.147873,0.014376, 0.081282,-0.092077,-0.299010,0.053782,0.307327, 0.037548,0.013553,0.012098,0.080340,0.

{0. 145778,-0.035171,-0.012813,0.011288,-0.104526, 0.107178,0.002405,0.149185,-0.034991,0.159099, -0. 214392, 0.177113,-0.174376,-0.125208,-0.009375, -0.167677,0.034455,0.042755,0.124278,-0.057184, 0.029397,0.011394,0.059449,0.051856,-0.119031, 0.171241,-0.054828,-0.110516,-0.119424,0.111108,

-0.031403,0.269853,-0.035512,-0.029505,0.028640, -0.138673,-0.043852,-0.180966,0.095736,0.

{-0. 156350,-0.007272,-0.060885,0.144463,0.141658, 0.060423,0.041233,0.076823,-0.103529,0.026638, -0.061046,0.084132,-0.035707,0.200313,0.004552, 0.130998,-0.019343,-0.187960,0.026747,-0.038128, -0.175123,0.011099,0.015914,-0.057416,0.143100, -0.107010,-0.123022,-0.015558,0.030280,-0.073788, -0.046136,-0.139745,0.216388,0.208324,-0.190284, 0.207782,-0.118317,-0.050262,0.048587,-0.

{0. 165122,0.151676,-0.173564,-0.112602,-0.077080, 0.059202,-0.039395,0.092122,0.036914,-0.106747, 0.026758,-0.075714,-0.061968,0.171587,-0.179532, -0.221919,0.067364,-0.168832,-0.005609,0.038886, -0.020248,-0.055190,-0.010993,0.150090,-0.063108, 0.080500,-0.061449,0.076655,-0.072982,0.148202, 0.032169,0.194680,0.047698,0.110655,0.159702, 0.060739,-0.033952,-0.002372,-0.100670,-0.

{-0.004884,0.039917,0.007048,-0.057134,-0.069690, 0.107883,0.022693,0.161403,0.072354,0.146004, -0.179598,-0.051756,0.091652,0.187559,-0.218109, -0.012090,0.201459,-0.003574,-0.093868,-0.186445, -0.029635,020643,0.002809,-0.042532,-0.019091, 0.051347,0.083461,-0.199734,0.053807,-0.091675, 0.042568,-0.091821,0.118660,0.091599,-0.113841, -0.089584,0.171276,0.086920,-0.242580,0.

{0. 063443,-0.111705,-0.161460,0.057088,-0.150777, 0.100319,0.0.119079,-0.112969, -0.058934,0.266023,-0.023775,-0.013164,0.142328, 0.184226,-0.061167,-0.083061,-0.105554,0.081692, -0.020353,0.061163,0.175058,0.158439,-0.104639, -0.0.104562,0.075431,0.119800,0.054572, -0. 203585,-0. 113775,-0.072451,-0.034755,0.021198, 0.003955,-0.072513,0.042772,0.027221,-0.

{-0.035894,-0.147947,0.130019,0.151861,0.063417, -0.099816,0.059408,-0.133444,0.037317,0.055950, 0.126182,0.145038,0.096625,-0.125091,0.121556, -0.107565,-0.111177,0.334839,-0.046918, 0.055746,-0.075661,0.073101,-0.007925,-0.009413, -0.060847,0.117516,0.057020,

-0.048908,-0.102843,-0.041116,0.193840,0.068291, -0.231657,-0.087831,-0.039631,-0.108096,-0.

{-0.067140,0.115233,-0.056616,-0.133510,0.037545, -0.141381,0.016872,0.159134,0.023496,0.094566, 0.028914,-0.039531,0.140349,-0.185376,0.329690, 0.027097,0.079849,-0.040461,-0.119043,-0.198733, 0.161095,-0.082065,-0.014902,-0.116972, 0.026419,0.009974,-0.071289,0.056791,-0.111439, -0.068277,0.095871,0.021713,0.050967,0.148007, 0.056072,-0.006431,0.039573,0.

{-0.021627,-0.127239,0.057710,0.094173,0.114361, -0.093565,-0.053670,0.119475,0.019379,-0.038257, -0.019357,0.016154,0.080195,-0.048479,-0.084186, 0.005792,0.006798,0.

0.119032,-0.133580,-0.042929,-0.189572,-0.092819, 0.118637,0.163395,0.235459,-0.084208,0.085962, -0.059652,0.137989,0.116113,-0.039734,-0.243977, -0.009411,-0.125925,-0.111694,-0.046045,-0.

{0. 202529,-0.022764,-0.087492,-0.001779,-0.180078, 0.144326,-0.070131,0.052585,-0.014719,-0.180407, -0.105484,0.022611,0.112231,0.048219,0.096614, -0.100258,0.182341,0.259642,0.139998,-0.161151, 0.057568,0.049277,-0.053023,-0.002871,-0.071218, 0.032438,0.019060,0.092027,0.018050,0.007029, 0.044412,-0.205987,0.069402,-0.034018, 0.024287,0.102516,-0.065164,-0.

{-0. 086428,0.126977,0.015658,0.078085,0.169923, -0.042330,0.080504,0.184454,-0.116599,-0.101825, -0.019898,0.029187,-0.086805,-0.065623,-0.227098, -0.161420,0.020457,0.178183,-0.054298,0.217385, -0.023337,-0.090671,0.092256,-0.118044,0.226933, -0.067590,-0.013062,0.009296,-0.133427,0.089791, -0.016346,0.227444,-0.105377,0.011219,-0.103441, -0.063450,-0.008793,-0.016484,-0.086660,0.

{0. 288967,-0.002823,-0.181016,0.139797, -0.058906,-0.107586,-0.145766,0.093240,0.029793, -0.217238,0.181808,-0.058832,-0.080496,-0.060148, 0.080336,0.044204,0.092757,0.053558, 0.068310,0.054278,0.069427,-0.185461,-0.034244, -0.020880,0.144972,-0.173171,-0.003225,-0.046869,

0.031356,0.072274,0.090069,-0.072320,-0.068152, -0.102144,0.113796,-0.002896,-0.084489,0.

{-0.004676,0.012451,-0.068412,-0.050948,0.094113, -0.137877,0.163079,0.072970,-0.073769,-0.001954, -0.079508,0.132505,0.085707,-0.066978,-0.009364, 0.

-0.027935,0.214683,-0.175540,0.129600,0.152334, -0.171772,0.110761,-0.080756,0.109677,-0.064781, 0.0.083756,0.084066,-0.154640,-0.126653, 0.170413,-0.001756,-0.266171,-0.080608,0.

{-0. 142812,0.178916,0.030481,-0.018707,-0.014087, -0.178494,0.057415,-0.072685,0.036600,0.123870, -0.160648,0.053520,-0.049866,-0.076900,0.146260, 0.121778,-0.002098,-0.102769,-0.145513,-0.094709, 0.014600,0.150337,0.129071,-0.215866,-0.068744, -0.032681,0.158858,-0.167257,0.043318,0.160275, -0.149350,0.071964,0.072390,-0.036869,-0.115464, -0.033315,0.218166,0.003469,0.039092,0.

{-0.113242,029370,0.151963,-0.137299,0.140645, -0.186259,-0.063780,-0.049865,0.077783,-0.098684, 0.105277,-0.131765,-0.040499,0.187960,-0.060280, 0.168357,-0.180927,-0.073977,0.016167,0.119988, 0.249310,0.160828,0.016432,-0.104951,-0.103452, -0.085361,0.045284,0.003648,-0.098853,0.014016, -0.158963,0.053626,0.102125,0.110043,0.032758, -0.066453,0.112142,-0.020935,0.014141,-0.

{-0. 142626,0.116170,0.156714,-0.046193,-0.092763, 0.059522,0.095298,-0.191132,0.171992,0.089482, 0.031693,-0.028470,-0.182267,-0.114526,-0.115156, -0.087294,0.101460,0.134756,0.211311,-0.072667, -0.184874,0.016518,0.073661,0.117918,-0.099371, -0.169612,0.094926,0.043618,-0.113961,0.139652, -0.032290,-0.042327,0.049550,-0.030139,-0.105134, 0.165565,-0.024617,-0.008021,-0.081065,0.

{0.096715,0.073130,-0.192145,-0.024840,-0.033337, -0.146108,0.030637,0.013074,0.053903,0.179474, -0.092141,-0.136250,-0.021751,-0.075464,0.041988, 0.123680,0.164398,-0.098024,0.143563,0.257533, 0.011460,-0.139854,-0.170764,0.002622,0.077216, -0.098878,0.013664,0.192634,-0.168319,-0.019956,

0.086204,-0.133177,-0.056676,-0.069633,0.039126, 0.024861,0.200507,-0.017833,-0.072507,-0.

{0. 188312,0.211973,-0.026577,-0.030511,-0.005324, -0.089297,-0.108139,-0.100579,-0.092361,-0.086512, -0.176998,0.033879,-0.072401,-0.108418,0.254736, -0.068285,0.077788,0.021740,-0.154785,0.031473, 0.161897,0.099157,0.003835,0.202560,-0.068410, -0.028448,0.166791,0.157988,-0.081325,-0.096342, 0.113814,-0.053872,-0.037803,0.003019,-0.105415, -0.105963,0.110935,-0.121537,-0.051934,0.

{-0. 005902,-0.025566,0.090201,-0.202733,-0.087222, 0.025591,0.088656,-0.075759,0.102605,-0.043815, 0.098726,-0.172410,-0.058015,0.136373,0.073529, -0.267444,-0.089580,-0.132521,-0.121546,0.030034, 0.125941,-0.115521,0.218909,0.161758,0.013384, 0.090387,-0.053082,-0.045271,0.031092,0.002709, -0.093612,0.150086,-0.043744,0.207734,0.059490, 0.013707,-0.009697,-0.101506,0.130092,-0.

{-0.031557,-0.216984,-0.117630,0.043260,0.010493, -0.077562,-0.011722,-0.012750,-0.006706,-0.116933, -0.037242,0.043246,0.189936,-0.001128,0.348653, -0.114783,0.103494,0.065052,0.017331,0.

-0.124355,0.116175,0.021859,0.140445,-0.080528, -0.021540,-0.059484,-0.039156,-0.003790,-0.013488, 0.024023,0.085937,0.029984,0.005821, 0.113871,-0.155281,-0.188480,-0.138627,0.

{-0. 055477,-0.078725,-0.227185,-0.069835,-0.083334, -0.103103,0.126817,0.097232,-0.148670,-0.003821, -0.014695,-0.006567,0.220706,0.003373,-0.233583, -0.059080,0.096967,0.105144,0.074281,0.062384, -0.238312,-0.011260,-0.087787,0.053234,0.114154, -0.087050,-0.067738,0.054583,0.087169,0.026215, 0.022347,-0.002260,0.024900,-0.085700,0.274932, -0.029898,0.187180,0.083484,-0.032945,0.

{0.060811,-0.013551,0.132393,0.173236,-0.134129, -0.025827,0.146442,-0.144697,-0.165687,-0.041179, -0.069049,0.065456,0.066934,-0.111799,-0.155041, 0.017693,0.018106,0.011958,-0.101361,0.135540, -0.026952,-0.072444,-0.099615,0.048850,0.074227, -0.006388,0.274960,-0.180664,-0.035351,0.147379,

-0.077568,0.066921,-0.091179,0.128088,-0.035639, -0.050608,-0.081541,0.011615,0.254577,-0.

{0. 092684,-0.066080,-0.104846,0.063964, -0.118125,-0.082160,0.039378,0.211586,-0.185354, -0.185207,-0.020687,0.064207,0.086469,0.054981, -0.041209,0.119450,0.052270,-0.011401,-0.010358, 0.021328,0.047320,0.163357,-0.063909,-0.043402, -0.037520,-0.080772,-0.077397,-0.043713,0.170929, 0.173935,-0.110798,0.0.154860, -0.004086,-0.048883,0.062513,-0.033936,0.

{-0. 102219,-0.085821,0.120788,-0.004709,0.153764, -0. 015832,0.044615,-0.050922,0.151970,-0.269232, -0.103572,0.024964,0.075853,-0.028581,0.045409, -0.060437,0.030973,-0.070224,0.212762,-0.005720, 0.014138,0.182639,-0.017510,0.022836, -0.192755,-0.200316,-0.034771,0.217484,-0.066266, 0.050939,0.024386,-0.037975,0.057006,-0.169418, 0.126019,0.006018,0.021719,-0.195182,0.

{-0.036546,0.066393,-0.168702,0.006627,-0.003036, 0.074054,0.088384,-0.033983, -0.021283,-0.202710,0.144675,-0.032790,-0.047744, -0.008852,0.142740,0.106081,0.060695,-0.062153, -0.168554,0.085919,-0.085650,-0.138377,0.021096, -0.215684,0.191959,0.063860,0.009517,0.035008, 0.177654,0.126762,0.055212,-0.008992,0.022952, 0.056175,-0.012106,0.205292,0.021328,-0.

{0. 169865,0.014836,-0.046132,-0.082306,-0.043342, -0.145627,-0.056395,-0.148761,-0.028014,0.116402, -0.105617,-0.134907,0.026502,0.230587,-0.190304, -0.022587,-0.063537,0.080261,0.000346,-0.228381, 0.112714,0.047662,0.114726,0.127581,-0.164887, -0.011701,-0.071580,-0.011703,-0.050086,0.012629, 0.172233,0.024553,0.097856,-0.045110,0.028485, 0.053387,0.206829,0.082417,0.106178,-0. <BR> <BR> <BR> <BR> <P>/*/<BR> <BR> <BR> <BR> <BR> <BR> /*-----------END-------------*/ /*--------------------------- END -----------------*/

/*========================================================== =======*/ /*========================================================== */ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* LIBRARY : Isfvq. tab */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*... TABLES */<BR> <BR> <BR> <BR> <BR> /___________________________________________________________ _________________*/ /*========================================================== =======*/ /*========================================================== */ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as transformation */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =======*/ /* FILE : FLOAT64 B 08k */ /*========================================================== =======*/ FLOAT64 B_08k [LP_08k] [LQMA_08k] [MAXLNp] = { {

{ 0.0.0.0.0.89184674,0.86520149, 0.83213462,0.82649626,0.81292217,0.

{ 0.48850325,0.51792467,0.54458026,0.57964919,0.65907100,0.624 23454, 0.57897302,0.57510412,0.53272744,0.

{ 0.0.28492453,0.30887250,0.34767876,0.41578426,0.39193895, 0.36463786,0.34570964,0.

0.10931949,0.11859086,0.13932375,0.16531784,0.0.19308363, 0.17434501,0.16239619,0.14627386,0. <BR> <BR> <BR> <BR> <BR> <P> @<BR> <BR> <BR> }, v<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*__________________________________________________________ _________*/ /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*FILE : FLOAT64B40k */ /* FILE : FLOAT64 B 40k */ { { { 0.45782564,0.59002827,0.73704688,0.73388197,0.75903791,0.740 76479,0.65966007 0. 58070788,0.52280647,0.

0.19087084,0.26721569,0.38110463,0.39655069,0.43984539,0.421 78869,0.34869783 0. 28691864,0.23847475,0.

0.13428787,0.16384420,0.23402430,0.25625744,0.29236925,0.279 22926,0.22702581 0. 18550745,0.15394289,0.

{ 0.10410849,0.10475287,0.13371967,0.16283702,0.18493450,0.177 83386,0.14728004 0. 11948265,0.10261001,0.

}, { 0.14936742,0.25397094,0.42536339,0.40318214,0.39778242,0.347 31435,0.22773174 0. 17583478,0.0.

{ 0.09932127,0.15389237,0.24021347,0.24507006,0.26478926,0.230 18456,0.15178193 0. 11368182,0.07674584,0.

{ 0.07376684,0.10618676,0.16013783,0.17315564,0.19320946,0.165 07346,0.10600940 0. 07680543,0.05146135,0.

0.06434994,0.08328096,0.10640056,0.12536714,0.13771986,0.115 89609,0.07617342 0. 05429825,0. <BR> <BR> <BR> <P>},<BR> <BR> } ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =======*/ /* FILE : FLOAT64 B 85k */

l == l FLOAT64 B_85k [LP_85k] [LQMA_85k] [MAXLNp] = { { 0.12600104,0.20991762,0.34262841,0.34478999,0.36982213,0.258 66520 0. 19844608,0.15549710,0.

0.09497737,0.14557657,0.23054897,0.24608043,0.27811978,0.256 69288,0.18951165 @ 0. 14322552,0.10976944,0. <BR> <BR> <BR> <BR> <BR> <BR> <P>},<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } ; /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ <BR> <BR> <BR> <BR> <BR> <BR> /* FILE : FLOAT64 CBes 08k */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> FLOAT64 CBes_08k[MAXLTT_08k][LSMAX_08k][MAXLNp] = { {{ 0.00269624, 0.00462087, -0.00621642, 0.00078393, 0.00203606, -0.00385235, - 0.00063855,-0.00073735,0.00002790,-0.

{-0. 00012394,-0.00089956,-0.00388915,-0.00432538,-0.00236658,-0.

0.00111489,-0.00046467,-0.00063866,-0.

{-0.00091016,0.00047345,0.00289452,0.00103649,-0.00014311 ,-0.

0.00192196,-0.00149023,0.00030132,-0.

{-0.00259585,-0.00289246,-0.00766695,-0.00713197,00507416 ,0.

0.00035725,-0.00001324,0.00003991,0.

{-0. 00261708,-0.00708436,-0.00241436,0.00289209,0.00368781,0.002 75999, 0.00069364,0.00112643,0.00040431,0.

{0. 00260231,0.00259305,0.01015206,0.01053691,0.00816243,0.00244 675, 0.00002146,0.00051176,-0.00072191,0.

{0. 00086895,0.00419154,0.00104835,-0.00633587,0.00568223,0.

0.00133821,0.00097780,0.00104668, {-0. 00387241,-0.00378492,0.00043591,-0.00710766,-0.00551754,-0.0 0367991, 0.00182042,-0.00122951,-0.00064698,-0.

{0. 00459307,0.01194545,0.00266756,0.00170909,-0.00010835,-0.001 94941, 0.00260933,-0.00076864,-0.00036982,-0.

{-0. 00180246,0.00572317,0.00494218,-0.00363662,-0.00552244, 0.00125745,-0.00142807,-0.00116519,-0.

{-0. 00700839,-0.01278847,-0.00523787,-0.00443510,-0.00440996,-0. 00465344, 0.00353442,-0.00161417,-0.00096975,-0.

{0. 00070303,0.00616162,-0.00457122,-0.01058358,-0.00684058,-0.0 0639819, 0.00173663,-0.00185740,-0.00100444,-0.

{-0. 00451619,-0.00642493,0.00633218,0.00433383,-0.00216043,-0.00 197399, 0.00291948,-0.00146477,0.00004796,-0.

{-0. 00139753,-0.00327792,-0.00410406,0.00047675,-0.00586987,-0.0 0831267, 0.00310294,-0.00191523,-0.

{0. 00163188,0.00087564,0.00403069,0.00512087,-0.00835469,-0.005 91542, 0.00381267,-0.00157757,-0.00049671,-0.

{-0. 00415972,-0.00603362,-0.00972475,-0.01204002,-0.00696619,-0. 00547653, 0.00232354,-0.00129666,-0.00119452,-0.

{ {-0. 00027304,-0.00013603,-0.00068813,0.00046191,-0.00018108,-0.0 0143655, 0.00143265,-0.00096053,-0.00029350,-0.

{0. 00327783,-0.00262084,-0.00072357,-0.00152624,-0.00289651,0.0 0242678, 0.00709684,-0.00418617,-0.00134299,-0.

{0. 00178766,0.00272996,-0.00424907,-0.00511227,-0.00350740,-0.0 0574813, 0.00298479,-0.00178375,-0.00080082,-0.

{-0. 00257793,0.00036133,0.00264883,-0.00468006,-0.00843945,-0.01 043396, 0.00919476,-0.00608852,-0.00215225,-0.

{-0. 00275632,-0.00064226,-0.00106406,-0.00928170,0.00164921,0.00 177093, 0.00330921,-0.00201606,-0.

{0. 00098576,0.00333945,0.00294397,-0.00296495,0.

0.00304436,-0.00168756,-0.00096723,-0.

{-0. 00081979,-0.00166735,0.00165792,-0.00361096,-0.00656657,0.00 213311, 0.00599592,0.00224467,0.00019724,0.

{-0. 00262302,-0.00197884,0.00408661,0.00254664,0.00058009,0.

0.00381683,-0.00056288,-0.

{-0. 00525909,0.00144658,0.00107922,-0.00301434,-0.00120794,-0.00 757923, 0.0.00014788,0.00002495,-0.

{-0. 00140917,-0.00409651,0.00156973,-0.00483243,0.

0.00348049,0.00042759,-0.00052304,-0.

{-0. 00026987,-0.00162823,0.00194360,0.00486534,-0.00358061,-0.00 978809, 0.00031236,0.00027704,-0.00069589,-0.

{-0. 00250411,0.00120978,-0.00274384,0.00233910,0.00139088,-0.007 36257, 0.00754632,-0.00465566,-0.00148867,-0.

{0. 00000985,0.00354670,0.00241602,0.00381914,-0.00498555,0.0003 4259, 0.00007178,-0.00160886,-0.00018617,-0.

{-0.00030544,0.00020933,0.00356684,-0.00290166,-0.0062905 5,-0.00501993, 0.00710975,-0.00422976,-0.00177327,-0.

{-0. 00226254,-0.00391714,-0.00326461,-0.00151939,-0.00365321,-0. 00340561, 0.00355831,-0.00279590,-0.00107019,-0.

{-0.00319889,0.00356115,-0.00255526,-0.00567546,-0.000406 61, 0.00596883,-0.00525175,-0.00086633,-0.

}, { {0. 00007492,0.00274526,0.00053401,0.00097771,0.00018040,-0.0030 3219, 0.00170872,-0.00089653,-0.00020116,-0.

{-0.00201631,-0.00125767,-0.00196945,-0.00464759,-0.00288 294,-0.00428708, 0.00183602,-0.00071289,-0.00093030,-0.

{-0.00223623,-0.00171246,-0.00046686,0.00170002,0.0024419 8,0.00108873, 0.00191275,0.00055247,0.00040544,0.

{-0.00149753,-0.00154993,0.00079974,0.00221293,-0.0055347 6,-0.00346923, 0.00211231,-0.00154997,-0.00037169,-0.

{0. 00289225,-0.00045208,0.00151539,-0.00150161,-0.00144310,-0.0 0308428, 0.00211248,00132638,0.00017002,0.

{-0. 00114496,0.00024257,0.00315614,-0.00436637,-0.00261428,0.002 96444, 0.00371535,-0.00308495,-0.00033931,-0.

{0. 00047727,0.00066667,-0.00498548,-0.00147002,-0.00211159,0.00 158957, 0.00093119,-0.00238958,-0.00021992,-0.

{-0. 00071416,-0.00142483,-0.00099961,-0.00030932,0.00108240,-0.0 0304381, 0.01041545,-0.00518788,-0.00149510,-0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000, 0.00000000,0.0.00000000,0.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. 00000000, 0. 00000000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo} , o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. 00000000, 0. 00000000,0.00000000,0.00000000), o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, }, }; /*========================================================== =======*/ /*=======================================================*/ /* Conexant System Inc. */ /* 4311 Jamboree Road */ /* Newport Beach, CA */ /___________________________________________________________ ________*/ /* Copyright (C) 2000 Conexant System */ /___________________________________________________________ ________*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /* FILE : FLOAT64 CBes 40k */ /*========================================================== =======*/ FLOAT64 CBes40k [MAXLTT40k] [LMSMAX40k] [MAXLNp] = { { {0. 00842379,0.00868718,0.01533677,0.00423439,-0.00886805,-0.

0.03152681,-0.01975061,-0.01152093,-0.

{0. 02528175,0.04259634,0.03789221,0.01659535,-0.00266498,-0.

0.01653101,-0.01528401,-0.01047642,-0.

{0. 00995479,0.00363859,0.00806370,0.00822096,0.00620995,-0.

0.01144342,-0.01579542,-0.00221153,-0.

{0. 01825004,0.02545979,0.04466266,0.02836983,0.00027194, 0.00400197,-0.00838218,-0.

{0. 00296122,-0.00108515,-0.01175420,-0.01975204,-0.02622812,-0. 03646736, 0.04191239,-0.02314044,-0.01950957,-0.

{0. 01074297,0.00681698,0.00056120,-0.00407483,-0.01399303,-0.02 157338, 0.01318401,-0.01868371,-0.02269936,-0.

{0. 00161361,-0.00204469,-0.00577466,-0.00520582,-0.01194833,-0. 01701884, 0.02718566,-0.03396933,0.00356014,0.

{0. 00128185,0.00071461,-0.00353124,-0.00402716,-0.01095437, 0.01997320,-0.01228136,-0.01038306,-0.

{0. 01263317,0.00885365,0.00553783,0.0.00051954,-0.00463222, 0.00479201,-0.00059580,-0.00296811,-0.

{0. 02932750,0.05512251,0.05469747,0.03776658,0.02375761,0.01262 417, 0.00718223,0.00132870,0.00011158,-0.

{0. 00642743,0.00434195,0.02734756,0.02479522,0.01571155,0.01283 758, 0.01229307,0.01044734,0.00897595,0.

{0. 01460256,0.0.06822591,0.05302119,0.04169594,0.03078633, 0.02255555,0.01244313,0.00953978,0.

{-0. 00287700,-0.00594367,-0.00427960,-0.00935634,-0.01810575,-0. 01295170, 0.00769887,-0.00571883,-0.00874120,-0.

{0. 01008734,0.01526783,0.00777807,0.00070427,0.00135748,-0.0053 6141, 0.01106339,-0.01607998,-0.

{-0.00328972,-0.00552321,-0.00318850,-0.00178185,-0.00147 855,-0.00051298, 0.00279881,0.00132960,-0.00017352,-0.

{0. 00121992,-0.00434412,0.01514515,0.01817932,0.01049800,0.0052 0725, 0.00023122,-0.00368011,-0.00530645,-0.

{0. 00199953,-0.00256907,-0.01114171,-0.02208218,-0.03765710,-0. 02107483, 0.00931923,-0.01498688,0.0.

{0. 02318353,0.02670253,0.01494551,-0.00435182,-0.01874850,-0.02 816325, 0.02151003,-0.01875342,-0.01056712,-0.

{0. 00593350,-0.00144199,-0.00319629,0.00534692,-0.00410015,-0.0 0689996, 0.00585349,-0.01388552,0.00983518,0.

{0. 02103832,0.01958430,0.01633620,0.00746899,-0.00235633,-0.009 29591, 0.00554876,-0.00612474,-0.00324632,-0.

{0. 00234866,-0.00352786,-0.02131325,-0.03497021,-0.05395155,-0. 05653978, 0.02600962,-0.01502758,-0.00980138,0.

{0. 01568001,0.01102804,-0.00170998,-0.02008550,-0.03923722,-0.0 4625200, 0.02200445,-0.00778321,-0.

{-0. 00585802,-0.01166306,-0.02076399,-0.01569569,-0.02319850,-0. 02849718, 0.03356291,-0.04020848,-0.00730455,0.

{0. 00185346,0.00153838,-0.01371849,-0.01459743,-0.

0.03180223,-0.01313531,-0.01769927,-0.

{0. 00821169,0.00139332,-0.00460277,-0.01685032,-0.02524833,-0.0 0457010, 0.00196353,-0.00415526,0.00912706,0.

{0. 03471515,0.03244906,0.0.00942270,0.00084999,-0.00060117, 0.00424733,00201139,0.00120962,-0.

{0. 00874697,0.00243208,-0.00304610,0.00436503,0.00711522,0.0040 3357, 0.00297985,-0.00013373,0.00316739,-0.

{0. 03284353,0.04366651,0.03130752,0.02318913,0.01642637,0.01414 287, 0.01412819,0.01325717,0.00966138,0.

{-0.00897348,-0.01645486,-0.02303920,-0.02958479,-0.04569 751,-0.01492066, 0.01361113,-0.01301319,-0.00757028,0.

{-0.00187898,0.00446579,-0.00080704,-0.00978002,-0.022109 03,-0.02856633, 0.00962606,-0.01269407,-0.00658807,-0.

{-0. 00446633,-0.01073344,-0.02048699,-0.03419970,-0.02140272,-0. 00647786, 0.00772629,-0.00141074,0.00209371,0.

{0. 00902524,0.00471972,-0.00531728,-0.00875254,0.00500107, 0.00748311,-0.00872906,-0.01258366,-0.

{0. 00084134,-0.00457492,0.00907268,-0.00166421,-0.00738630,-0.0 1300070, 0.01171425,-0.00534867,-0.00189046,-0.

{0. 00495534,0.02747202,0.02105600,0.01350886,0.00672681,0.00692 694, 0.00961278,0.00731403,0.00734680,0.

{-0. 01085449,0.00040259,0.01902320,0.01121839,0.01057293,0.00799 889, 0.00903296,0.00546843,0.00715537,-0.

{0. 00891381,0.01614815,0.05052174,0.03900262,0.02759091,0.02061 948, 0.01293547,0.00629289,0.00473463,-0.

{-0. 01427083,-0.02305916,-0.02815308,-0.02282330,-0.02653827,-0. 01853194, 0.00407586,-0.00043150,0.

{0. 00451472,-0.00037789,-0.00521137,-0.00857891,-0.01433970,-0. 02416975, 0.02263041,0.00545231,0.00509081,-0.

{-0.00732576,-0.01382500,-0.02440248,-0.00823324,-0.01648 982, 0.00672027,-0.01575532,0.00458639,0.

{-0.00584221,0.00239261,0.00002187,-0.00722194,-0.0048683 6,-0.00676743, 0.00609408,-0.00910835,-0.00233031,-0.

{0. 00156682,0.00529745,0.01074526,0.01358844,0.01228688,0.01451 921, 0.00886985,0.00921486,0.00922770,0.

{0. 02888988,0.04401362,0.04449791,0.03793522,0.03615802,0.03507 046, 0.02857499,0.02323810,0.01532404,0.

{-0.00673575,0.00708902,0.04383843,0.03175772,0.02881380, 0.02740709, 0.02920017,0.02384121,0.01895719,0.

{0. 02514915,0.05928013,0.07204149,0.06324505,0.05974481,0.05096 021, 0.04377068,0.03425910,0.02087256,0.

{-0. 00748868,-0.01403437,-0.01834467,-0.02220715,-0.01698717,0.0 0975040, 0.01151622,0.00725551,0.00642775,0.

{0. 00209732,0.00931211,0.00439910,0.00138879,0.01378028,0.00911 980, 0.00353992,0.00010052,0.00002712,-0.

{-0. 00165095,-0.00688923,-0.01339332,-0.01799657,0.00760584,0.02 621803, 0.02225676,0.01309325,0.01073847,0.

{0. 01340580,0.00737926,0.00937836,0.00955465,0.02491769,0.02088 644, 0.01809767,0.01206103,0.00688650,-0.

{-0.00280285,-0.01027851,-0.02114079,-0.03232847,-0.05019 914,-0.01541405, 0.01040407,0.00488665,0.00735409,0.

{0. 01769232,0.01286728,0.00509533,-0.00385545,-0.01360630,-0.01 065628, 0.00099360,-0.00752588,0.00392812,0.

{-0. 00287736,-0.00927581,-0.01141761,0.00494131,-0.00006858,0.00 383888, 0.00928349,0.00680291,0.01299393,0.

{0. 01338085,0.00684954,0.02016501,0.01396750,0.00394469,0.00215 369, 0.00532778,0.00390260,0.00729791,0.

{-0.00782735,-0.01769183,-0.03956412,-0.04925343,-0.06255 674,-0.04770456, 0.01246839,-0.00352283,-0.00008778,0.

{-0. 00043147,-0.00420665,-0.01525085,-0.01865562,-0.02901928,-0. 04225189, 0.01238412,00262297,-0.

{-0. 01897721,-0.03002013,-0.04157439,-0.01953528,-0.

0.00557029,0.00296829,0.00837520,0.

{-0.00430169,-0.00701750,-0.01399148,-0.01425799,-0.01951 155,-0.02099896, 0.00855452,0.00210266,0.

{0. 00089308,-0.00573222,-0.00687366,-0.01404191,-0.02040077,0.0 1115878, 0.00754778,0.00379226,0.00494852,-0.

{0. 02273135,0.02268721,0.02202985,0.01772318,0.01595899,0.01831 229, 0.02009693,0.01988832,0.01756866,0.

{-0. 00802140,-0.01147725,0.01735733,0.01614599,0.01890368,0.0252 7107, 0.02535296,0.02521981,01936066,0.

{0. 01101261,0.02459861,0.03007775,0.03132783,0.02500170,0.03112 715, 0.02820242,0.02555671,0.01990715,0.

{-0.01044815,-0.02010963,-0.03231533,-0.05076033,-0.04215 723,-0.01116070, 0.00748550,0.00002613,0.00462318,0.

{0. 00336939,-0.00304703,-0.00880680,-0.01591634,-0.02904755,-0. 02472976, 0.01099256,0.00917770,0.00472864,0.

{-0.01183996,-0.02066113,-0.03460361,-0.04184939,-0.01041 113,-0.00188617, 0.00098410,0.00161789,0.00375380,0.

{-0. 00039830,-0.00466744,-0.01262580,-0.02111370,0.00587910,0.01 104953, 0.00437385,-0.00111574,-0.00144865,-0.

{-0. 00912855,-0.00967373,0.00714008,0.00163746,-0.00275357,-0.00 691492, 0.00575918,-0.00602136,-0.00407011,-0.

{-0. 00255543,0.00614921,0.03687539,0.01820347,0.00124175,-0.0073 0685, 0.00935798,-0.01262178,-0.00737867,-0.

{-0. 01333849,-0. 01591748,0.00305090,0.01086912,0.01047755,0.00849883, 0.00303463,0.00222270,0.00134141,-0.

{-0. 00936362,-0.01047446,0.03651876,0.03415287,0.02215632,0.0136 4159, 0.00618621,0.00076102,0.00062994,-0.

{-0. 00648855,-0.01113029,-0.02130286,-0.02415974,-0.00906372,-0. 02048675, 0.01897523,-0.00729972,-0.01465304,-0.

{-0. 00073009,-0.00478232,-0.00809012,-0.01274285, 0.01476475,-0.02101635,-0.02841145,-0.

{-0. 01541940,-0.02257801,-0.01269042,-0.00663735,-0.01383393,-0. 01014917, 0.00815281,-0.00101933,0.

{-0.00430707,-0.01008551,-0.00538098,0.01127611,0.0018086 2,-0.00383903, 0.01162061,-0.01239840,-0.02236644,-0.

{0. 00250399,-0.00145059,0.00744185,0.00239925,0.00187795,0.0036 8643, 0.00341092,0.00234075,0.00295276,0.

{0. 02220381,0.02667705,0.03016336,0.02484058,0.02302165,0.01687 465, 0.01248381,0.00801419,0.00575512,-0.

{-0. 01289551,-0.01948192,00749604,0.03972999,0.02799627,0.030958 27, 0.02682699,0.01926759,0.01536589,0.

{-0.00694105,-0.00274076,0.06283919,0.05831478,0.04446961 ,0.03475004, 0.02466616,0.01660218,0.01015739,0.

{-0. 00663293,-0.02072134,-0.0.00350779,-0.

0.00781240,-0.00568940,-0.00619713,-0.

{0. 00052805,-0.00203616,-0.00862252,-0.00794312,0.01109699,0.00 296591, 0.00783946,-0.00642006,-0.01293148,-0.

{-0. 01385446,-0.02235013,-0.02005617,0.00658714,0.00311085,0.003 96594, 0.00201973,0.00017492,0.00070455,0.

{0. 00312050,-0.00502734,-0.00391517,0.02334708,0.01492120,0.006 09770, 0.00166321,-0.00414391,0.00144125,-0.

{-0. 00548185,-0.00927002,-0.01104572,-0.01737564,-0.02531887, 0.02824219,-0.00834746,-0.00524587,-0.

{0. 00458493,0.01671853,0.00619380,-0.00362342,-0.01016732,-0.01 291563, 0.00905806,-0.00497735,0.00129131,-0.

{-0. 01024597,-0.01324182,-0.00754560,-0.00682415,-0.00605662,-0. 00314351, 0.00866384,-0.00828965,-0.00057488,0.

{0. 00035898,0.00655540,0.00886062,0.0.00050215,-0.

0.00747207,-0.00688271,-0.00352236,-0.

{-0. 00793173,-0.01967196,-0.04026658,-0.03192191,-0.04031043,-0. 04440686, 0.03706285,-0.01990808,-0.00593113,-0.

{-0. 00635586,-0.01153473,-0.02387486,-0.02909210,-0.04337326,-0. 05288439, 0.01514696,-0.00500377,-0.00569617,0.

{-0. 01430856,-0.02562646,-0.04221961,-0.01853589,-0.01402970,-0. 02227550, 0.02219039,-0.02338731,-0.00807786,0.

{-0. 00998135,-0.01806646,-0.02136027,-0.00730465,-0.01160051,-0. 01000576, 0.01280801,-0.01978523,-0.02645340,0.

{-0. 00361873,-0.00711001,-0.01113611,-0.01442181,0.00048802,-0.0 0555145, 0.00999573,-0.01397199,0.

{0. 01608025,0.02072329,0.00865589,0.00419188,0.00587315,0.00650 795, 0.00746960,0.00493725,0.00530017,0.

{-0.00258830,-0.00860751,-0.01643995,-0.00330272,0.016697 32,0.

0.00455523,-0.00064296,-0.00070869,-0.

{0. 00045132,0.01927470,0.02936541,0.02556292,0.02449298,0.01514 524, 0. 00763378,-0.00025992,-0.00107520,-0.

{-0. 00807614,-0.01468184,-0.03526087,-0.05143390,-0.01592930,-0. 01986599, 0.02407442,-0.01347152,-0.00877064,-0.

{0. 00179084,-0.00207469,-0.02147562,-0.03247891,-0.00458303,-0. 00969956, 0.01977553,-0.00722409,-0.01118867,-0.

{-0. 01156613,-0.01882328,-0.02689507,-0.02577053,-0.00530313,-0. 00582166, 0.00599250,-0.00327482,0.

{-0. 00629756,-0.01144468,-0.01480162,-0.01132932,0.00363022,0.

0.00203589,-0.00919722,-0.01756165,-0.

{-0. 00505869,-0.01212584,-0.01604989,0.01406907,0.00703596,-0.00 003723, 0.00630506,-0.01217800,0.00493628,-0.

{0. 01614992,0.01499725,0.01847138,0.01780286,0.01376991,0.00696 326, 0.00218387,0.

{-0.00922172,-0.01839712,-0.01718859,0.02629952,0.0316921 1,0.02054630, 0.01191487,0.00581676,0.00289883,-0.

{0. 00130289,-0.00293433,0.01502302,0.03529064,0.04162203,0.0298 4230, 0.01820698,0.01010425,0.00515796,-0.

{-0. 00803390,-0.01768812,-0.04490980,-0.03476464,0.00128782,-0.0 0700112, 0.00889952,-0.00925927,-0.01047435,-0.

{-0. 00224388,-0.00885128,-0.01431027,0.00056043,-0.00175653,-0.0 0957837, 0.00213878,-0.00217443,-0.00787601,-0.

{-0. 00942789,-0.02489036,-0.04548997,0.00419906,-0.00204955,-0.0 0847809, 0.00757134,-0.01278104,0.00092336,-0.

{-0. 00862279,-0.01784181,-0.03137311,-0.01016528,0.02029932,0.01 087722, 0.00126383,-0.00187619,-0.00820948,-0.

{-0. 00214451,-0.01012148,-0.00815792,0.03032796,0.02118089,0.014 65145, 0.01434881,0.00924109,0.01234463,0.

{0. 01901068,0.02546003,0.03184928,0.02975200,0.03929600,0.03399 356, 0.02994347,0.02317742,0.01472360,0.

{-0. 00706920,-0.01106330,0.02697666,0.04237599,0.04876120,0.0544 6952, 0.04454959,0.03625874,0.02458257,0.

{0. 00584135,0.02277180,0.05493147,0.04792701,0.05513066,0.05228 310, 0.04242706,0.03760509,0.02533449,0.

{-0. 00832225,-0.01877720,-0.04596338,-0.05353089,0.00746299,0.02 192792, 0.01409321,0.00663039,0.00261977,-0.

{0. 00048273,-0.00945376,0.00004885,0.02869582,0.02042802, 0.00703972,0.00314249,-0.00177051,-0.

{-0.01064635,-0.02694699,-0.04942587,-0.00398838,0.024604 42,0.01967373, 0.01925711,0.01424337,0.01004813,0.

{-0. 00332860,-0.01091961,-0.01848431,-0.00486287,0.04553311,0.03 898003, 0.0.02015112,0.01086293,0.

{-0. 00652335,-0.01144519,-0.01534182,-0.01807526,-0.02371538,-0. 00915732, 0.00588846,-0.00487463,-0.00623341,0.

{0. 00716741,0.00382678,-0.00052349,-0.00409624,-0.01208226,-0.0 1751940, 0.00470209,0.00223712,-0.00350926,-0.

{-0. 01538645,-0.02243737,-0.00924649,0.00355542,0.00165311,0.009 18893, 0.00653865,0.00877182,0.00712893,0.

{-0. 00267666,-0.00919867,0.00496288,0.01178975,0.00884084,0.0128 9639, 0.01257300,0.00820578,0.00408443,0.

{-0. 01264225,-0.02720729,-0.05722194,-0.03947146,-0.03242657,-0.

0.00982578,-0.00860058,-0.00088398,0.

{-0. 00386645,-0.01399853,-0.03824488,-0.02298534,-0.

0.00544705,-0.01098026,-0.01050510,-0.

{-0. 01967032,-0.03639457,-0.04382661,0.00038419,0.00103522,0.007 88552, 0.00487504,0.00554907,0.00846038,0.

{-0. 01839912,-0.02937407,-0.03617522,-0.01499036,-0.00692504,0.0 0184427, 0.00044529,0.00611089,0.00796965,0.

{-0.00683449,-0.01304168,-0.02052076,-0.01609455,-0.00102 776,-0.00319254, 0.01275266,0.00963052,0.00370009,-0.

{0. 01103437,0.00541947,00506780,-0.00383360,-0.00847884,0.00753 648, 0.01370641,0.01064539,0.01309200,0.

{-0.00977018,-0.01846998,-0.02291703,0.00347842,0.0194454 4,0.01631708, 0.02954462,0.02392258,0.01608993,0.

{0. 00848938,0.00893435,0.01777669,0.01872626,0.02955171,0.03076 567, 0.03584935,0.0.01758367,0.

{-0.01398691,-0.02483689,-0.05063277,-0.06137782,-0.01182 542,-0.00872281, 0.00491626,-0.00299305,-0.00062419,0.

{-0. 00631871,-0.01176534,-0.02465955,-0.03502781,0.00645603,0.01 117879, 0.00357097,0.00024658,-0.00036118,-0.

{-0. 01238566,-0.02782555,-0.06269483,-0.04600188,0.00970197,0.00 648747, 0.00596559,0.00457740,0.00247241,-0.

{-0. 00773967,-0.01358329,-0.02234491,-0.02257646,0.02203643,0.02 084404, 0.01128873,0.00604494,0.00035335,-0.

{ {0. 00589332,0.00462334,-0.0.00674597,0.00164302, 0.00890749,-0.00091839,0.00487032,0.

{-0. 00346857,-0.00100200,-0.00418711,-0.01512477,-0.00104209,-0. 00491133, 0.00209555,0.00045850,0.00023339,0.

{-0. 00028271,0.00224414,0.00099960,-0.01264817,0.00158111,0.0002 2627, 0.01842169,-0.01055957,0.00042331,-0.

{-0. 00390851,-0.00352008,-0.00207375,0.00120978,-0.00464186,-0.0 0376280, 0.00221930,-0.01267883,-0.00542772,0.

{-0. 00382147,-0.00416908,-0.00485174,-0.00203840,0.00230541,0.01 428577, 0.00348975,-0.00203438,0.00540564,0.

{-0. 00658368,-0.00562053,-0.00032279,-0.00877305,-0.00793305,0.0 0320924, 0.00170063,0.00284923,0.00552278,0.

{-0. 00306744,-0. 00298506,0.00275083,-0.00903488,-0.00722304,0.00779413, 0.00659414,-0.01601075,0.00131982,-0.

{-0. 00248310,-0.00449444,0.00566261,-0.00065823,-0.00872763,-0.0 0130268, 0.01288316,-0.00693877,-0.01220849,-0.

{-0. 00072128,0.00231367,0.00035512,-0.01551778,0.00432592,0.0056 5027, 0.00593031,0.00810666,0.00899915,0.

{-0. 00066179,-0. 00173624,-0.00431518,-0.00780679,-0.00602446,-0.00298258, 0.00230417,0.01526494,0.0.

{0. 01420960,0.01196404,-0.00294391,-0.00888598,0.00196835,0.003 79997, 0.00358727,-0.00099442,0.00276169,0.

{0. 00321848,0.00710562,0.00119961,-0.00705532,-0.00591387,-0.00 790931, 0.00594289,-0.00112852,-0.00141542,0.

{0. 00158007,0.00075190,-0.00438742,-0.00815969,-0.01423721,0.00 789778, 0.00626154,-0.00721660,0.00986720,0.

{0. 00053880,0.00193110,-0.00320550,-0.01120683,-0.01402005,-0.0 0860931, 0.00088470,0.00359764,0.00639980,0.

{0. 00514671,0.00724043,0.00484854,-0.00241769,-0.00502971,0.005 67643, 0.00615547,-0.01736942,00360319,0.

{-0.00123535,0.00317582,0.00109983,-0.00277902,-0.0078507 3,-0.00623414, 0.00634773,-0.00697720,-0.00355725,-0.

{-0. 00232563,0.00140314,-0.00001979,-0.00260601,0.00649245,0.001 24911, 0. 00845958,-0.01423763,0.00877591,0.

{-0. 00033112,-0.00053678,-0.00671801,0.00048873,-0.00504141,-0.0 0520921, 0.01312229,-0.01582773,0.01416822,0.

{-0.00111536,-0.00099037,0.00077595,0.00925548,0.00657777 ,-0.00082887, 0.02043111,-0.02532625,-0.00004947,0.

{0. 00223668,0.00440574,-0.00389912,-0.00163039,-0.00531277,-0.0 1246551, 0.00572137,-0.01703647,0.00128153,-0.

{-0.00489011,-0.00537238,0.00466282,0.00913929,0.00263062 ,0.00055262, 0.00633866,-0.00173384,0.00295317,0.

{-0.00518055,-0.00184590,-0.00615225,-0.00513941,-0.00640 695,-0.00674303, 0.00939142,-0.00503372,-0.00261001,0.

{0. 00342481,0.00123740,0.00395662,0.01448936,-0.00232972,-0.001 30577, 0.00847327,-0.01335209,0.00276921,-0.

{-0.00054923,-0.00210083,0.01190224,0.00837311,-0.0053284 9,-0.01568541, 0.02727868,-0.01972403,-0.00978498,-0.

{0. 00127495,-0.00040612,-0.00190491,-0.00183223,0.00169595,0.00 266085, 0.00532158,00218445,0.00658819,0.

{0. 00234860,0.00330952,-0.00328322,-0.00849035,-0.00205267,-0.0 0707072, 0.00859310,0.01122104,0.01656984,0.

{0. 00280211,0.00477070,0.00686869,0.00053437,-0.00232578,-0.007 83250, 0.02164326,0.00027012,0.01494755,0.

{-0. 00069263,-0.00203166,0.00079744,-0.00185686,-0.00644126,-0.0 1254378, 0.02563748,0.00489706,0.00806657,0.

{0. 00050861,-0.00178828,0.00750363,0.00202558,-0.00285327,0.008 07892, 0.01136765,0.00086126,0.01255455,0.

{-0.00388121,0.00019894,0.01275788,-0.01009612,-0.0148209 3,-0.

0.00274766,0.00461392,0.00591598,0.

{0. 00389949,0.00561890,0.00164381,0.00179842,-0.01061784,-0.004 88127, 0.00294474,-0.00246773,0.00633013,0.

{-0. 00182684,0.00331154,0.01501940,-0.00102040,-0.01454819,-0.01 631174, 0.00713666,-0.00529551,0.00133896,-0.

{0. 00707108,0.00404909,-0.00897539,-0.00171521,-0.00538120,0.00 675914, 0.00805150,0.00315939,0.00552084,0.

{0. 00097440,0.00046715,-0.01037887,-0.00704198,-0.00189990,-0.0 1032341, 0.00730091,0.00133774,0.00755266,0.

{-0. 00429144,-0.00107703,-0.00272150,0.00592237,0.00373714,-0.00 153810, 0.00265470,-0.00380070,0.00191190,-0.

{-0. 00249022,-0.00255174,-0.00161664,0.00646709,-0.00455495,-0.0 1892915, 0.00189057,-0.00146743,0.00201011,0.

{0. 00307047,0.00152128,0.00274522,-0.00813843,-0.00637170,0.021 61188, 0.00769219,0.00422507,0.01083575,0.

{-0. 00026886,0.00146906,0.00690360,-0.00233633,-0.00743382,0.001 97966, 0.00461441,-0.00077399,0.00622981,0.

{-0. 00095175,-0.00300642,0.00349728,0.00973936,0.00130663,0.0167 2464, 0.00214381,-0.00479473,0.00021323,-0.

{-0. 00796774,-0.00777454,0.01472064,0.00419640,0.00009850,-0.002 27039, 0.00413390,-0.00745379,-0.00530568,-0.

{-0. 00234006,0.00776935,0.00056224,-0.00061124,-0.00076573,0.001 80958, 0.00268168,0.00534481,0.00376392,0.

{0. 00198816,0.00290657,0.00129810,-0.00500597,-0.01289560,-0.

0.0.01412627,0.00494994,0.

{0. 00723649,0.00496646,0.00543579,-0.00103025,0.00171306,0.0033 1929, 0.00035451,0.01023642,0.00581490,0.

{0. 00084689,0.00051713,0.00802087,0.00446553,-0.00621724,-0.008 73814, 0.00885721,0.00624454,-0.00380893,-0.

{-0. 00243724,-0.00216389,-0.00117648,-0.00252831,-0.01632920,004 78344, 0.01074398,0.00398316,0.00820569,0.

{0. 00486904,0.00644839,0.01191909,0.00233043,-0.01100158,-0.009 47657, 0.00863266,0.01294053,0.01078684,0.

{0. 00463246,0.00231681,0.01278480,0.00716155,0.00188431,0.00390 487, 0.00117313,-0.00118873,0.00141110,-0.

{-0. 00759524,-0.00214592,0.01757851,0.00191647,-0.00642818,-0.00 735460, 0.01055379,0.00696078,-0.00141687,-0.

{0. 00157257,-0.00417419,-0.01018863,0.01614394,0.00408876,0.002 77369, 0.00445860,-0.00524322,0.00999605,0.

{0. 00487436,0.00148844,-0.00299441,0.00966635,-0.00545120,-0.01 094305, 0.00934612,0.00000377,0.01068280,0.

{0. 00610992,0.00526033,-0.00074024,0.00850982,0.00886539,0.0038 1742, 0.00354831,-0.00656414,0.00863265,0.

{0. 00136375,0.00410255,0.00605260,0.00491661,0.00043020,-0.0113 9207, 0.00163925,-0.00745387,00095721,0.

{0. 00166585,0.00142636,-0.00379524,0.00486954,0.00892121,0.0095 7308, 0.00322862,0.00561332,0.00188950,0.

{-0. 00357255,-0.00403382,-0.00152553,0.00568588,-0.00278822,0.00 284068, 0.00261788,0.00745671,0.00662131,0.

{-0. 00156450,-0.00201631,0.00324050,0.02500402,0.00272701,0.0002 7856, 0.00547226,0.00365120,0.

{0. 00029645,-0.0.00888215,0.00687383,-0.01547752,0.00437531, 0.00941400,0.00762043,0.

{-0.00251414,-0.00204373,-0.00289258,-0.00308742,0.003111 07,0.01010143, 0.01046861,0.01386760,0.01371189,0.

{0. 00085058,00284917,0.00433633,0.00378226,-0.00066686,-0.01165 624, 0.00075283,0.01762876,0.00938403,0.

{0. 00116966,0.00140161,0.00644003,0.00630100,0.00481016,0.00067 718, 0.00302025,-0.00006228,0.01579197,0.

{-0. 00129828,-0.00112730,0.00413839,0.01474563,0.00591950,-0.007 69547, 0.01692050,0.00026673,0.00314501,0.

{0. 00050192,-0.00019614,0.00523667,0.00906082,-0.00532943,0.010 06419, 0.00564608,0.01186492,0.00969477,0.

{-0.00472998,-0.00313090,0.00439118,0.00022579,-0.0091171 9, 0.00020407,0.01041237,0.01523070,0.

{0. 00119451,0.00284162,0.00615884,0.01153521,0.00517547,0.00277 399, 0.00832575,0.00779691,0.00324772,0.

{-0.00519556,-0.00295172,0.02525489,0.01798212,-0.0043873 8,-0.01222669, 0.00900323,-0.00185156,0.00339578,0.

{-0.00270637,-0.00222864,-0.00539474,-0.01321067,0.007897 22,0.00313879, 0.00453286,0.00561428,-0.00475956,-0.

{-0. 00118036,-0.00042033,-0.00719468,-0.01000462,-0.00682112,0.0 0535234, 0.00235443,-0.00474756,-0.00545839,0.

{-0.00225500,-0.00171062,-0.00466855,-0.00747594,0.013894 86,0.00992659, 0.00695008,-0.01364416,-0.

{-0.00085803,0.00410182,-0.00196015,-0.00639579,0.0007862 8,-0.00226078, 0.00861787,-0.01373490,-0.02391058,-0.

{-0. 00063885,-0.00001952,-0.00743163,-0.01553771,0.01422720,0.01 936474, 0.00728046,-0.00008372,-0.00367349,-0.

{-0.00143970,-0.00178368,-0.00958149,-0.01110954,0.017822 50, 0.00774218,-0.00147129,-0.01449725,-0.

{-0.00070646,0.00159104,0.00274791,-0.00326417,0.01380166 ,0.01596148, 0.00444873,-0.00546512,-0.01887057,-0.

{-0.00144073,-0.00261082,0.00273428,-0.00317007,-0.005588 09,0.01255326, 0.00109155,-0.01208593,-0.02965142,-0.

{0. 00283848,0.00393704,-0.00296926,-0.00944444,0.0.00666967, 0.00841999,0.00754188,-0.00201340,-0.

{0. 00480224,0.00081276,-0.00093591,0.00293862,-0.00865280, 0.00171235,0.00781937,-0.00444062,-0.

{0. 00445001,0.00326413,-0.01123814,-0.0.0.

0.00356026,-0.00424684,-0.01156887,-0.

{-0. 00001678,0.00143093,-0.00345284,-0.00553204,0.00216156,-0.01 013138, 0.01031674,0.00521731,-0.00806113,-0.

{-0. 00184428,0.00471354,0.00859489,-0.01317721,0.00266957,0.0077 3321, 0.00466730,-0.00016286,-0.00560587,-0.

{-0. 00150527,0.00246554,-0.00357066,-0.00724693,-0.00780699,-0.0 1201075, 0.00866401,0.00266341,-0.01053797,-0.

{0. 00630638,0.0.00061292,0.00335619,0.00813022,0.01010773, 0.00259815,-0.00391783,-0.

{0. 00342893,0.00256425,-0.00293257,0.00447207,-0.00452771,-0.01 078035, 0.00152854,-0.00582106,-0.02093782,-0.

{0. 00174264,0.00486940,0.00101490,-0.00369979,0.00914580,-0.000 46007, 0.00393674,-0.00514304,-0.00502874,-0.

{0. 00367157,0.00164282,-0.00259170,-0.00102131,-0.00130364,-0.0 0405688, 0.00361148,0.00155262,-0.00264098,0.

{0. 00379067,0.00092008,-0.01490638,0.00682106,-0.00394004, 0.00989744,-0.01493545,-0.00413015,-0.

{0. 00324614,-0.00281525,-0.00637901,0.00571717,-0.00898235,0.00 195685, 0.00582317,-0.01132263,-0.00403691,-0.

{-0.00529028,-0.00491416,0.00404015,-0.00201376,0.0094112 6,0.00059865, 0.01008402,-0.00255501,-0.00695912,-0.

{-0.00119706,-0.00423473,-0.00828492,-0.00284703,-0.00058 170,-0.00458320, 0.00889183,-0.00170038,-0.01224148,-0.

{0. 00188817,0.00283448,0.00026518,0.01441261,0.01227742,0.00509 984, 0.00687448,-0.01384025,-0.01981324,-0.

{-0. 00053697,0.00136264,0.01095638,0.00811139,0.00453491,-0.0008 4917, 0.01580995,-0.02585460,-0.03501521,-0.

{-0. 00161777,-0. 00076829,-0.00361048,-0.00596857,0.01843197,0.00988164, 0.00150586,0.00012576,0.00777538,0.

{-0.00210784,-0.00409224,-0.00920995,0.00092189,0.0054220 1,-0.00211517, 0.00765625,0.00629464,0.00842455,0.

{0. 00003792,0.00222472,0.00228015,0.00100784,0.01260415,0.00201 989, 0.01000386,0.00598743,0.00253893,-0.

{0. 00507067,0.00480165,-0.00272484,0.00565289,0.00121260,-0.005 70415, 0.01959834,-0.00317788,-0.00411844,-0.

{-0. 00376294,0.00059416,0.01423623,0.00080375,0.00643702,0.00686 370, 0.00313787,-0.00987418,-0.00299491,-0.

{-0. 00806457,0.00222565,0.00504739,-0.00636976,-0.00098179,-0.00 726277, 0.00505596,-0.00341247,-0.

{-0. 00067223,0.00090078,0.00075010,-0.00162500,0.00183818,0.0089 7492, 0.00282313,-0.00134597,-0.00390676,-0.

{0. 00171542,0.00674575,0.00696047,0.00121510,-0.00079761,-0.002 80685, 0.00419458,-0.00418100,-0.00817770,-0.

{-0. 00480908,-0.00299589,-0.00693984,-0.00437097,-0.00048672,0.0 0064401, 0.00503113,0.00470563,0.00008420,0.

{-0. 00010864,-0.00080145,-0.00089350,-0.00030148,-0.01489977, 0.00793012,0.00084201,-0.00747283,0.

{-0. 00175219,-0.00341623,-0.00793373,0.00795065,0.01151782,0.004 77091, 0.00103290,-0.00150988,-0.01301039,-0.

{-0. 00213945,-0.00034159,-0.00073789,0.00375862,0.00220275,-0.00 676203, 0.00223236,-0.00809945,-0.02018789,0.

{-0. 00192672,-0.00173695,-0.00081662,-0.00184874,-0.00358986,0.0 1475006, 0.01613872,0.00823781,-0.00473629,-0.

{0. 00345772,0.00341053,0.00500926,-0.00330046,-0.01186972,0.011 81906, 0.00440546,0.00265077,-0.00258333,-0.

{-0. 00042330,0.00083297,0.00375033,0.00502954,0.00372912,0.00148 808, 0.01280970,0.00292874,-0.01416698,-0.

{0. 00113566,0.00249418,0.00389607,-0.00536590,-0.01420978,-0.00 016841, 0.00287547,-0.00624030,-0.01628379,-0.

{-0. 00135987,0.0.00264995,-0.00236121,0.00861954,0.00648555, 0.01697403,0.01659641,0.00547484,-0.

{-0. 00262019,-0.00285140,-0.00443122,-0.00008469,-0.00708718,-0. 01345062, 0.02067079,0.01735198,0.00351791,-0.

{-0. 00385576,-0.00350660,-0.00083694,0.00705176,0.00994210,0.003 68093, 0.00642495,0.01024715,0.00118806,-0.

{0. 00622286,0.00543629,-0.00045749,0.00418943,-0.00317214,-0.01 015493, 0.01309732,0.00753043,-0.00646111,-0.

{0. 00083145, 0.00461627,-0.01645929,-0.01458668,0.01870089, 0.02118257,0.00993928,0.00277086,-0.

{0. 00482793,0.00551503,0.00208811,-0.00565857,-0.01268429,-0.00 426449, 0.02459712,0.01985106,0.00847906,0.

{0. 00293454,0.00421160,0.00457712,0.00374468,0.00332494,0.01346 970, 0.01175397,0.00792934,0.00201689,-0.

{0. 00120334,0.00415760,0.00695187,0.00696322,-0.00317111,0.0016 1058, 0.00970844,0.00009515,-0.00806091,-0.

{-0. 00187667,-0.00216523,-0.00190075,0.00979870,0.00245961,-0.00 083074, 0.01583148,0.00805848,0.00650797,0.

{-0. 00197460,-0.00480332,-0.00926156,0.00782345,-0.00159864,-0.0 0761256, 0.01016645,0.00047921,-0.01013106,-0.

{-0. 00114979,.-0. 00094748,00052070,0.00669376,0.01050549,0.00668137, 0.00315455,-0.00712109,-0.00558144,0.

{0. 00320088,0.00416886,0.00593271,0.00483418,0.00568066,0.00139 672, 0.00959812,-0.01323612,-0.00508168,-0.

{-0. 00440848,-0.00146257,00310220,0.0.0.

0.00520584,0.00481628,-0.00233592,0.

{-0. 00286947,-0.00476632,0.00102804,0.00037028,-0.00369873, 0.00335549,0.00450933,-0.00478313,-0.

{0. 00562573,0.00177228,-0.00388755,0.01529287,0.00637977,-0.003 11580, 0.00524145,-0.00226732,-0.01257961,0.

{0. 00824527,0.00640849,0.00417142,0.00499035,-0.00196902,-0.001 36031, 0.00185235,-0.00845783,-0.01908885,-0.

{0. 00315259,0.00242346,-0.00524211,-0.00194243,0.01131435,-0.00 315874, 0.01082409,0.01283626,0.00487072,0.

{-0. 00668040,-0.00354932,-0.00117341,-0.00226992,-0.00022671,-0. 00666072, 0.00314488,0.00734916,0.00425614,0.

{-0. 00389583,0.00205666,0.01156000,0.00378337,00388467,0.0019101 6, 0.00226343,0.00715162,0.00447477,0.

{0. 00260564,0.00776913,0.00295654,0.00507983,0.00280605,-0.0026 2448, 0.00087415,00308014,-0.00047010,-0.

{-0.00400435,-0.00461726,0.00632126,0.00578397,0.01191517 , 0.00167871,0.01065949,0.00598003,0.

{-0. 00172116,0.00293152,0.00458923,-0.00446042,-0.00402144,-0.00 537020, 0.01255438,0.01025417,0.00081987,-0.

{0. 00098726,0.00151129,0.00213603,0.01091075,0.01596006,0.01027 042, 0.00492642,0.00288748,-0.00109633,-0.

{-0. 00137552,-0.00354111,0.00880722,0.01614140,-0.00039181,0.000 28126, 0.00048723,-0.00412099,-0.01187375,-0.

{ {-0. 00071405,0.00244371,0.00235739,-0.00329369,0.00472867,-0.003 61321, 0.00584670,0.00863128,0.

{0. 00242589,-0.00430711,-0.00122645,-0.00464764,-0.00017887,-0. 00471663, 0.00181162,0.00249980,-0.00276848,-0.

{-0. 00126161,0.00092104,0.00405563,0.00014858,-0.00389621,-0.004 36458, 0.00588222,0.00666140,0.00160434,-0.

{0. 00144272,-0.00099722,-0.00329538,0.00173437,-0.00306283,0.00 373708, 0.00877845,0.00397062,-0.00065690,-0.

{-0. 00005275,-0.00144138,-0.00384176,-0.00446236,0.00088025,0.00 069624, 0.00766217,-0.00227704,0.00487439,-0.

{-0. 00139297,0.00141438,-0.00012646,-0.01026693,-0.00010281,-0.0 0277474, 0.00025676,-0.00333147,-0.00272379,-0.

{-0. 00001482,0.00462141,0.00170302,0.00056160,0.00010522,-0.0005 5656, 0.00580159,-0.00135691,0.00699179,-0.

{-0. 00209273,0.00036039,-0.00388741,-0.00210837,0.00414685,-0.00 550009, 0.00800933,-0.00162490,-0.00075248,-0.

{0. 00221342,-0.00070693,0.00305034,-0.00100824,0.00209771,0.004 33956, 0.01006429,0.00335628,-0.00422019,-0.

{0. 00110913,0.00340343,-0.00021330,-0.00231460,-0.00372496,-0.0 0103889, 0.00204804,0.00150248,-0.00867284,-0.

{0. 00129154,0.00225690,0.00307610,-0.00457771,-0.00260350,0.007 04766, 0.00038185,0.00136466,-0.00074573,-0.

{-0. 00197707,0.00190446,0.00129311,-0.00202580,0.00168859,0.0020 2957, 0.00764207,0.00343175,-0.00841492,-0.

{-0. 00106230,-0.00290282,0.00301179,-0.0.0.00276419, 0.00704790,0.00021120,-0.

{-0. 00335184,-0.00011723,-0.00134520,0.00234701,0.00275337,-0.00 243280, 0.00553081,-0.00189510,-0.00558213,-0.

{-0. 00138223,-0.00078722,-0.00120769,-0.00597490,0.00077555, 0.00204629,-0.00278627,-0.00509984,-0.

{-0. 00085738,0.00296249,-0.00100328,0.00620823,-0.00194594,-0.00 477741, 0.00408894,-0.00431777,-0.00362229,-0.

{0. 00316502,-0.00496468,0.00196254,0.00170085,-0.00353618,0.001 61267, 0.00450792,0.00475622,0.00559953,0.

{0. 00053033,-0. 00215320,-0.00123736,0.00400112,-0.00279937,-0.00382983, 0.00922124,0.00920321,-0.00189296,-0.

{0. 00052374,0.00024094,0.00074222,0.00121188,-0.01308354,0.0036 5845, 0.00019892,0.00285161,0.00119182,-0.

{0. 00304271,0.00045754,-0.00242181,0.00326300,0.00404964,0.0016 2161, 0.00036536,0.00577343,-0.

{-0. 00226510,-0.00217357,-0.00177951,0.00056309,-0.00247590,-0.0 0393503, 0.00087352,-0.00385851,0.00499243,0.

{-0.00333292,0.00237891,0.00005875,-0.00045224,-0.0057700 7,-0.00489336, 0.00492713,-0.00252844,0.00232674,-0.

{-0. 00180577,0.00152251,-0.00168650,-0.00373161,-0.00494445,0.00 070000, 0.00429748,00264468,0.00510881,0.

{0. 00057352,0.00182813,-0.00478781,-0.00132287,-0.00291248,-0.0 0582607, 0.00036611,0.00615309,-0.00063952,-0.

{-0.00182077,-0.00052387,0.00205275,0.00439155,0.00206254 ,0.00666979, 0.00737222,-0.00041091,0.00380985,-0.

{0. 00014505,-0.00015497,0.00061676,0.01102116,0.00142684,0.0001 1530, 0.00312628,-0.00115247,-0.00199428,0.

{-0. 00117950,-0.00018668,-0.00688237,0.00558761,-0.00323614,0.00 541723, 0.00055777,0.00037185,0.00298021,-0.

{-0. 00268489,-0.00092316,0.00159680,0.00503780,0.00394093,0.0024 2255, 0.0.00128319,0.00007167,-0.

{-0. 00135406, 0.00225185,0.00350878,0.00389900,0.00171999, 0.00146560,-0.01126312,0.00449526,0.

{0. 00057295,0.00202047,0.00151283,0.00312576,-0.00383849,-0.001 82327, 0.01048760,0.00046503,0.00309555,0.

{-0. 00609476,0.00199366,0.00169769,0.00046054,-0.00149788,0.0024 7156, 0.00418583,-0.00524517,0.00147818,-0.

{-0. 01003447,0.01292732,0.00144356,0.00014990,-0.00020365,-0.000 69182, 0.00181901,0.00113486,0.00113268,-0.

{0. 00006361,-0.00181203,0.00862741,0.00068174,0.00059483,-0.003 96821, 0.00204192,-0.00122617,-0.00279883,-0.

{0. 00181692,0.00040708,0.00331578,0.00298869,0.00229580,-0.0047 0435, 0.00041688,0.00701320,-0.00684961,0.

{-0. 00266523,-0.00105798,-0.00115075,-0.00481424,0.00159800,0.00 371013, 0.00172283,0.00560712,0.00009891,-0.

{-0. 00096200,-0.00239708,-0.00072227,0.00067105,0.00463245,-0.00 181151, 0.00337878,0.0.00288416,0.

{0. 00569136,00077628,0.00039776,0.00048030,-0.00188477,-0.00314 697, 0.00222859,-0.00447499,-0.00134527,-0.

{-0. 00153154, 0.00040495,0.00152195,0.00070061,0.00138840,-0.01182738, 0.00063394,-0.00060032,-0.00145040,0.

{0. 00161879,0.00168494,0.00016532,-0.00457719,0.00575290,0.0039 2115, 0.00266311,0.00249840,0.00499373,0.

{-0.00070075,00073156,0.00065334,0.00149705,0.01170892,-0 .00197723, 0.00141944,-0.00046048,0.00095963,0.

{-0. 00156776,0.00045531,0.00268804,0.00243883,-0.00464246,0.0056 6962, 0.00172435,-0.00532991,-0.00755432,0.

{0. 00030268,-0.00185108,-0.00129334,0.00272568,0.00062491,-0.00 097022, 0.00302455,-0.00348647,-0.01446303,0.

{-0. 00159285,-0.00020812,0.00015774,-0.00097503,0.00055084,0.012 84415, 0.00377701,-0.00068963,0.00427403,-0.

{-0. 00056554,-0.00072153,0.00399038,-0.00497191,-0.00216464,0.00 230184, 0.00514089,0.00188768,-0.00145550,0.

{0. 00014005,0.00159032,0.00329557,-0.00328601,-0.00164245,-0.00 200642, 0.00427870,-0.00869724,-0.00082951,0.

{0. 00148181,0.00041916,-0.00309927,0.00000661,0.00416487, 0.00532559,-0.00516995,-0.00491788,0.

{0. 00181614,0.00144269,-0.00413538,-0.00380312,-0.00057933,0.00 520384, 0.00350609,-0.00557332,-0.00211640,-0.

{0. 00066935,0.00251700,0.00184908,0.00313305,0.00486335,0.00320 866, 0.00053516,-0.00308264,-0.00540642,-0.

{-0. 00056760,-0.00509891,0.00312949,0.00258167,-0.00347055,0.001 68554, 0.00454403,0.00083750,-0.

{-0.00172296,-0.00043749,0.00021821,0.00597557,-0.0057585 4,-0.00305225, 0.00185040,0.00412548,-0.00124724,0.

{-0.00155956,-0.00139261,0.00127855,-0.00271569,-0.005030 71,0.00013262, 0.00702389,0.00286641,-0.0.

{-0. 00018965,0.00035757,-0.00072086,-0.00143142,-0.00076345,0.00 185087, 0. 00587735,0.01505721,0.0.

{0. 00153159,-0.00074015,0.00455896,0.00502158,-0.00181818,0.001 42143, 0.00367497,-0.00577837,0.00397397,0.

{0. 00219679,0.00016825,0.00112885,-0.00123956,-0.00506878,-0.00 586318, 0.00599759,-0.00257719,-0.00168635,0.

{-0.00259072,0.00143377,0.00410598,0.00032354,0.00259146, 0.00057327, 0.00177219,0.00040267,0.00496435,0.

{0. 00120161,0.00134208,-0.00114094,0.00600306,0.00122526,-0.005 77037, 0.00099565,0.00334876,0.00698501,0.

{-0. 00056736,-0.00167842,-0.00069670,0.00355302,0.

0.00242661,-0.00140627,0.00151165,0.

{0. 00083364,0.00285861,-0.00243291,0.00164170,0.00263424,-0.000 90010, 0.00697612,0.00302630,-0.00104099,0.

{-0. 00017316,0.00009661,-0.00299242,-0.00102654,0.00586767,0.006 04661, 0.00028475,0.00204755,-0.0.

{-0. 00014705,0.00171547,0.00258157,0.00347264,-0.00015150,0.0062 7925, 0.00319688,0.00698722,0.00121685,0.

{0. 00179634,0.00126112,-0.00073379,0.00063915,-0.00368064,0.007 18675, 0.00185159,-0.0.00912638,0.

{0. 00036801,0.00043860,-0.00172184,-0.00545561,-0.00089735,-0.0 0376398, 0.00148660,0.00088411,0.00278433,0.

{-0.00233412,0.00492067,-0.00200138,-0.00302371,0.0015427 9,0.00258392, 0.00437544,-0.00059180,0.

{0. 01100540,0.01627034,0.00098453,-0.00264300,-0.00342966,-0.00 000160, 0.00029849,0.00180940,0.00122892,0.

{0. 00000000,0.00000000,0.00000000, 0.00000000,0.00000000,0.00000000,0.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. 00000000, 0. 00000000, 0. 00000000, 0. 00000000), { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000,0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, o. 00000000, 0. 00000000, 0. 00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo} , { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, o. 00000000, 0. 00000000, 0. 00000000), { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,. o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, o. ooooo0000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo0000, o. ooooo000, 0. 00000000, o. 00000000, o. ooooo000, o. ooooooo0}, {0. 00000000, o. ooooo000, o. ooooo000, o. ooooo000,0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, 0. 00000000, o. 00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. 00000000, o. ooooo000, o. ooooo000, o. ooooooo0}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo0000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> <BR> <BR> <BR> <BR> } s<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> } ; /*========================================================== =======*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*--------------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*--------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =======*/ /* FULE: FLOAT64 CBes_85k */ /*========================================================== =======*/ FLOAT64 CBes_85k[MAXLTT_85k][LMSMAX_85k][MAXLNP} = { {( 0.03011250, 0.05271740, 0.06473784, 0.06435282, 0.06452657, 0.06279520, 0.05773527,0.04953492,0.03258218,0.

{0. 01602284,0.01223286,0.02716675,0.01515761,-0.00130077,-0.005 32771, 0.0.00036138,0.00272831,-0.

{0. 02401271,0.03914647,0.03915858,0.01749331,-0.00316505,-0.

0.02332304,-0.01928769,-0.01089091,-0.

{-0.01300759,-0.00840161,0.00682484,-0.00081947,-0.006515 57,-0. 00812344, - 0.00999762,-0.00801675,-0.00511146,-0.

{-0. 01818762,-0.03192724,-0.06456176,-0.04615027,-0.00055719,-0.

0.00290679,-0.00506395,-0.00036802,-0.

{0. 04702580,0.05568841,0.04484019,0.02967458,0.01458701,0.00945 917, 0.00722793,0.00571889,0.00149213,-0.

{-0. 01485766,-0. 01597556,0.00778368,0.01287732,0.01335396, 0.01049375,0.00863086,0.00659185,0.

{0. 01027236,0.02730616,0.04024012,0.02727445,0.00988789,0.00395 820, 0.00281685,-0.00016378,0.00442352,-0.

{0. 01018086,0.02317232,0.01823444,0.01381079,0.01110116,0.00731 025, 0.00224764,0.00064606,0.00224514,-0.

{0. 03440958,0.04813170,0.04772426,0.03918479,0.03828848,0.04482 698, 0.04793362,0.0.03528126,0.

{0. 02012151,0.02798955,0.01690498,-0.00162132,-0.01795221,-0.02 033811, 0.00304788,0.00318819,0.00300105,-0.

{-0.00771849,-0.01042661,0.02415417,0.02101670,0.00511120 ,-0.00259045, 0.01164459,-0.01753263,-0.01833297,-0.

{0. 03093007,0.02841266,0.01851041,0.00770237, 0.00354944,-0.00713726,-0.01158101,-0.

{0. 01250769,0.01073677,0.04218614,0.03936715,0.02331104,0.01263 867, 0.00130949,-0.00833368,-0.00515605,-0.

{0. 02999284,0.03533733,0.02511555,0.01201614,0.00337246,0.00922 871, 0.01583742,0.01541255,0.01296229,0.

{-0. 01170270,-0.01799777,-0.03459895,-0.04037440,-0.00093168,-0. 00201978, 0.01253730,-0.00295387,-0.00802624,-0.

{-0.00726885,-0.01627472,-0.01522945,0.0.01089532, 0.00154582,-0.00739393,0.00585284,-0.

{-0. 00436114,-0.01237267,-0.02091931,-0.00244249,0.01246437,0.00 270874, 0.00687659,-0.00651871,-0.01814616,-0.

{0. 03517674,0.06355752,0.06857296,0.05938929,0.04741369,0.03893 724, 0.02726384,0.01966913,0.01129379,0.

{-0. 01860181,-0.02677876,-0.04407154,-0.04095438,-0.01009746,-0. 01626406, 0.01253701,-0.00731142,-0.00220656,0.

{0. 01698267,0.01310731,00257197,-0.01257890,-0.03301049,-0.0374 8283, 0.01335818,-0.01974036,-0.01923884,-0.

{-0. 01302456,-0.02004788,-0.03292591,-0.02055095,0.02059680,0.01 219580, 0.00013659,-0.00557743,-0.00905106,-0.

{-0. 00101468,0.01573975,0.01522490,0.00440810,-0.01547614, 0.01712205,-0.01281291,-0.00291117,-0.

{-0. 00645665,-0.00803376,0.03718368,0.03703527,0.02560332,0.0206 0903, 0.01271667,0.00626016,0.00721148,-0.

{0. 00969971,0.00507633,-0.00469157,-0.00353471,0.01129945,0.001 62597, 0.00787840,-0.00714222,-0.01077091,-0.

{-0. 00921545,-0.01537870,-0.01341638,-0.01877411,-0.00679339,0.0 1005825, 0.00052251,-0.00884878,-0.01748464,-0.

{-0. 02241539,-0.03247605,-0.03701199,-0.01090514,-0.00887298,0.0 0529690, 0.00127800,0.00405804,0.00659569,0.

{0. 00600397,0.01074139,0.02092690,0.01970426,0.01176908,0.01359 934, 0.01409811,0.01382651,0.01320097,0.

{0. 01141765,0.00585173,0.00099689,-0.01003275,0.00167233,0.0180 9863, 0.01718491,0.01680690,0.01478071,0.

{0. 00532323,0.02795015,0.06817748,0.06100996,0.05743580,0.

0.04499788,0.03264736,0.02017310,0.

{-0. 02035650,-0.03006271,-0.04684134,-0.03358747,-0.02235513,-0. 01916831, 0.00595318,-0.00071390,-0.00137424,0.

{-0.00390696,-0.00736702,-0.01984008,-0.02822155,0.003271 65,0.00343909, 0.00602792,-0.00782717,-0.00570698,-0.

{-0. 00083505,-0.00797647,-0.01183219,-0.00060675,-0.00978943,-0. 01842960, 0.00060424,0.00138312,-0.00990396,-0.

{-0. 00153786,0.0.01742534,0.01203318,0.00432435,0.00026490, 0.00152903,0.00261276,0.00144338,-0.

{0. 02514795,0.02694397,0.03251137,0.02791743,0.02189767,0.01664 660, 0.01392899,0.01020858,0.0.

{0. 01100263,0.01767290,0.01081835,-0.00842438,-0.02354175,-0.03 362519, 0.03553471,-0.00317026,0.00153320,-0.

{0. 01299545,0.02093436,0.03195115,0.03015983,0.02262512,0.02771 440, 0.02669818,0.02707517,0.02510345,0.

{0. 01109239,0.00726528,0.01170571,0.01399126,0.02465632,0.01511 573, 0.00541503,0.00142378,-0.00097093,-0.

{-0.01941829,-0.02760284,-0.03358766,-0.01196969,-0.01694 781,-0.01634516, 0.01319709,-0.00584112,-0.00097540,0.

{-0. 02107221,-0.02948952,-0.04896206,-0.05545068,-0.01814541,-0. 01060619, 0.00334635,0.00268116,0.00045516,0.

{-0. 01400252,-0.02253890,-0.04613798,-0.05388472,0.00707619,0.01 867959, 0.0.00198822,-0.00470518,-0.

{-0.00148627,-0.00099175,0.00560137,-0.00668187,0.0003011 7,-0.00039004, 0.00639128,-0.01024137,-0.00170219,-0.

{-0.00549896,-0.01470279,-0.01695822,0.02198312,0.0366961 7,0.02463584, 0.01276040,0.00736205,0.00005241,-0.

{-0. 00132779,-0. 00278557,0.02514555,0.02374663,0.02009989,0.02808080, 0.03082887,0.03087115,0.02409034,0.

{-0.01058509,-0.01658262,-0.02338305,-0.00972392,0.005532 97,-0.00333131, 0.00588576,0.00111411,-0.00029098,-0.

{0. 00160918,-0.00536342,-0.01461500,-0.00612135,0.02269393,0.01 788420, 0.00592269,0.00065486,-0.00379472,-0.

{-0. 00735894,-0.01347182,-0.02349130,-0.02205992,0.02751215,0.02 381083, 0.00992716,0.00358035,-0.00636554,-0.

{-0. 00259622,-0.00664229,-0.01866048,-0.03590918,-0.05839927,-0. 06065164, 0.01983147,0.00600777,0.00351924,0.

{0. 03019245,0.04180980,0.04242800,0.03707932,0.02969960,0.02907 674, 0.02621267,0.02268569,0.01544914,0.

{0. 00410478,-0.00295468,0.02816624,01664470,0.00777464, 0.00692805,-0.00028335,0.00294711,0.

{-0. 01128064,-0.01882569,-0.01409550,0.01270598,0.00521923,0.017 08157, 0.01549205,0.01315745,0.01284490,0.

{0. 01235582,0.00495826,0.00768318,0.01105327,-0.00329601,-0.003 57798, 0.00325452,0.00012424,0.00501045,0.

{0. 01030086,0.00438282,-0.00311851,-0.02076026,-0.04378026,-0.0 4024490, 0.00518616,0.01327369,0.00583413,0.

{0. 01585195,0.02158346,0.01265352,-0.00225988,-0.01537653,-0.02 523274, 0.02858671,-0.01981777,-0.02753662,-0.

{-0. 00405472,-0.00972641,0.00833755,0.00837587,0.00118455,0.0098 2980, 0.00623398,0.00759464,0.00871849,0.

{-0. 01145855,-0. 01827606,-0.01906050,-0.01321846,-0.01659787,-0.00515321, 0.01575232,-0.02756877,-0.03799206,-0.

{0. 00720446,-0.00064353,-0.00701769,-0.02430002,-0.03349658,0.0 0705156, 0.00874910,0.00186248,0.00901299,0.

{-0. 01518806,-0.02321451,-0.02690132,0.00534415,-0.00308821,-0.0 0432329, 0.00601155,-0.01009555,-0.01496766,-0.

{-0. 01550506,-0.02653400,-0.03852672,0.01008836,0.01733050,0.012 04091, 0.01458971,0.00882104,0.00848728,0.00131771}, {-0.01295495,-0.02006295,-0.03745275,-0.03024400,-0.01406475 ,-0.02456492, 0.00740866,-0.00919721,-0.00415596,0.

{-0. 01664452,-0.02405961,-0.03649393,-0.03646140,-0.01100296,-0. 00245895, 0.00755079,-0.01214057,-0.01077375,0.

{-0. 00108388,-0.00662234,-0.02067877,-0.03852748,-0.05961239,-0. 02435135, 0.00623433,-0.00902003,0.00759261,0.

{-0. 01724702,-0. 02611390,-0.03652935,-0.03780674,-0.03761547,-0.01849779, 0.01307332,-0.00332941,0.00083897,0.

{0. 01208979,0.00809377,0.01689381,0.01941724,0.00720310,-0.0047 6103, 0.01467246,-0.01450666,-0.00270332,-0.

{0. 00980247,0.01559737,0.00594148,0.00019967,-0.00062672,-0.010 00914, 0.01451608,-0.01143174,-0.01193905,-0.

{-0. 00311454,-0.01203376,-0.00927907,0.02078032,0.00360031,-0.00 034344, 0.00832342,-0.00936971,0.00192210,-0.

{-0.01379369,-0.02012157,-0.02470930,-0.02980865,-0.03913 091,-0.00703542, 0.00668963,-0.00621541,-0.00767146,0.

{-0. 01307473,-0.02603028,-0.05475627,-0.03679790,0.02162444,0.01 966973, 0.01865785,0.01710904,0.01237958,0.

{0. 00064712,-0.00558789,-0.01323406,-0.01583633,-0.03346232,-0. 03305713, 0.01043219,0.00799608,0.00367465,-0.

{-0. 01743761,-0.02261109,-0.03091739,-0.02751019,-0.02026401,-0. 01742175, 0.02580788,-0.02763544,-0.01051019,0.

{0. 00216431,-0.00560940,-0.01900158,-0.04152299,-0.05988942,-0. 02922351, 0.01788276,0.01381030,0.01100524,0.

{-0.01828726,-0.02442716,-0.01062820,0.00049875,-0.005101 24,0.00221065, 0.00191559,0.00275880,0.00074190,0.

{-0.00879868,-0.01598313,-0.03004215,-0.04948885,-0.04196 567,-0.01983909, 0.01370329,-0.00427476,0.00082035,0.

{-0.00230832,-0.01010282,-0.01668657,-0.03198117,-0.03699 492,0.01269478, 0.01377988,0.00820876,0.00580972,-0.

{0. 01551234,0.03419445,0.06055726,0.04707260,0.03313935,0.02368 624, 0.01430269,0.00668846,0.00691489,0.

{0. 01406692,0.01449025,0.02394177,0.02399262,0.03079103,0.02573 220, 0.02140991,0.01309781,0.00779774,-0.

{-0.00828736,-0.01743047,0.00335240,0.04816538,0.03638020 ,0.03234748, 0.02652692,0.01796155,0.01503502,0.

{0. 00094473,-0.00491647,0.00128189,0.01052383,0.03986395,0.0356 0681, 0.02404924,0.01677403,0.00763441,-0.

{-0.01506920,-0.02351502,-0.04035310,-0.04043075,-0.00847 623,0.00878313, 0.00972518,0.00819359,0.00632904,0.

{0. 01785404,0.02207023,0.03441687,0.03255487,0.04601287,0.04152 598, 0.04282719,0.03719784,0.02088540,0.

{0. 01931626,0.01456799,0.00936344,0.00110318,-0.01440516,-0.014 37875, 0.01424618,-0.02355264,0.00183293,-0.

{0. 00521639,-0.00179269,-0.00175685,0.01034082,-0.00307994,-0.0 0944490, 0.01447315,-0.02104899,0.00289221,-0.

{-0. 00685119,0.00469486,0.00447692,-0.00819117,-0.02000782,-0.02 240418, 0.01177251,-0.01311489,0.00040491,-0.

{0. 02359967,0.03214284,0.05067474,0.05064540,0.03918985,0.04448 732, 0.03853463,0.03322630,0.02812674,0.

{-0.00315399,0.00029074,-0.00602774,-0.00750983,-0.014278 04, 0.02487497,-0.01355392,-0.01422887,-0.

{0. 01021442,0.00593011,-0.00854369,-0.03200625,-0.05616386,-0.0 5552187, 0.02617807,-0.02123191,-0.01014762,0.00017089},

{-0. 00357899,-0.01168453,-0.02003192,0.00360176,-0.00698634,-0.0 1205097, 0.00501530,-0.00571256,0.00716748,0.

{-0. 00204187,0.00754425,-0.00122054,-0.01452030,-0.02381772,-0.0 2974159, 0.02443919,-0.02145534,-0.02556043,-0.

{-0. 01225962,-0.02021357,-0.03276307,0.00077601,0.00339980,-0.00 682563, 0.01438413,-0.02362521,0.00510472,-0.

{-0. 01243222,-0.02180635,-0.03374801,-0.0.03324926,0.03598020, 0.02254258,0.01346735,0.00006868,-0.

{0. 01148091,0.00692796,0.00040312,-0.00436061,-0.01726674,-0.02 679639, 0.00256074,0.00092198,-0.00728032,-0.

{-0. 00178888,-0.00688681,-0.01213265,-0.02513887,-0.03796508,-0. 00819531, 0.01296614,-0.01487822,-0.01910969,-0.

{-0.00725535,-0.01262777,-0.01183104,-0.00983393,-0.01670 010,-0.00293400, 0.00771642,-0.00212860,0.00386644,0.

{0. 00164142,-0.00392946,-0.01381401,-0.00515787,0.00254924,-0.0 0942431, 0.01478234,-0.02189020,-0.03120124,-0.

{-0. 00637770,-0.01406334,-0.02198870,-0.00809124,0.04237495,0.04 494788, 0.03299125,0.02381818,0.01366707,0.

{-0. 00854519,-0.01460363,-0.02844237,-0.02588072,-0.04063413,-0. 03740634, 0.00128514,0.00170535,0.00151977,0.

{-0.01347334,-0.02291845,-0.04127466,-0.06185673,-0.03481 773,-0.01543559, 0.00855813,0.00127078,0.00279083,0.

{-0. 00883732,-0.01775697,-0.03452937,-0.03890479,-0.05133868,-0. 05444499, 0.02467414,-0.00827826,-0.00632791,0.

{0. 01947562,0.01480394,0.00585211,-0.01157039,-0.02573721,-0.00 361897, 0.00770904,0.00117448,0.01013551,0.

{-0.00797957,-0.01335512,-0.02556722,-0.02463242,-0.00471 432,-0.01441015, 0.01478523,-0.00963687,-0.01951507,-0.

{-0. 01014364,-0.01336506,-0.00756888,-0.02085792,-0.03437920,-0. 03380901, 0.01522635,-0.01085877,-0.00407099,-0.

{-0. 01191418,-0.01893562,-0.02285608,-0.02175026,-0.01437801,0.0 0862057, 0.01242598,0.01037422,0.00881772,0.

{-0. 00410227,-0.00810982,-0.02082509,-0.02673533,-0.02102781,-0. 03371932, 0.03125568,-0.00162297,-0.00621962,-0.

{-0. 00236826,-0.00528324,-0.01688967,-0.02665562,-0.04625641,-0. 04899277, 0.01293267,-0.00471950,-0.00579889,0.

{-0.00829334,-0.01601839,-0.02981488,-0.04926722,-0.02466 496,0.00312334, 0.01756506,0.01017462,0.00301230,-0.

{-0. 00314835,-0.00971408,-0.00126585,0.00084833,-0.01221557, 0.02038756,-0.01962756,-0.02820450,-0.

{-0. 00652397,-0.01336956,-0.03077461,-0.04977855,-0.06644036,-0. 02418368, 0.0.00168036,0.00799340,0.

{-0. 00459352,-0.00907604,-0.02068476,-0.01752188,-0.03509759,-0. 02897723, 0.02242144,-0.02913997,0.00318966,-0.

{0. 01107762,0.00546846,-0.00001276,-0.00142842,-0.01076665,-0.0 2078226, 0.02919168,-0.02466836,-0.03191429,-0.

{0. 00783465,-0.00136463,-0.00608877,-0.02410140,-0.00715177, 0.00640987,-0.01457449,0.00913402,0.

{-0. 01546191,-0.01056069,-0.01249849,-0.01381879, 0.01374939,-0.00900376,-0.00739429,-0.

{0. 00078318,0.00203456,-0.00457136,-0.01985878,-0.03592355,-0.0 4690434, 0.02895935,0.00293128,-0.00121505,-0.

{-0. 01212653,-0.01986692,-0.02324829,0.00367052,-0.01032869,-0.0 1729308, 0.03407878,-0.02295738,-0.00829270,-0.

{-0. 00904510,-0.01094450,-0.01829106,-0.03299925,-0.04246203,-0. 02987120, 0.03013587,-0.02375396,-0.01112768,0.

{0. 00371073,0.01192758,0.04487591,0.04961298,0.04469640,0.03739 255, 0.02788493,0.01888919,0.01006733,0.

{-0. 00414876,-0.00806971,-0.01853441,-0.00784140,-0.01284125,-0. 02142337, 0.01870911,-0.02863545,-0.00013891,-0.

{0. 00370482,-0.00028583,-0.01043066,-0.01367416,-0.02846861,-0. 03863164, 0.01679499,-0.01875735,-0.02837507,-0.

{-0.01149320,-0.02138073,-0.01879618,0.02580091,0.0315810 1,0.03076868, 0.04075558,0.03485110,0.02587197,0.

{-0. 01344467,-0.02008154,-0.02874508,-0.01984988,-0.03087705,-0. 03726973, 0.01355235,-0.0.

{0. 00017944,-0.00749797,-0.00950584,-0.01971890,-0.03880470,-0. 05068581, 0.05707708,-0.00602932,-0.00093686,0.

{-0. 00657895,-0.01276092,-0.00663745,-0.01018639,-0.02569065,-0. 03611357, 0.04709358,-0.01963325,-0.02213332,-0.

{-0.00891231,-0.00896874,0.04729117,0.04958298,0.04900047 ,0.05114494, 0.04291088,0.03529066,0.02325801,0.

{-0. 00625101,-0.01361953,-0.02559423,-0.03223054,0.00838412,0.03 074426, 0.02326855,0.01143200,0.00726839,-0.

{0. 00962416,0.00578797,-0.00469408,-0.02098031,-0.03970154,-0.0 2410071, 0.01945893,-0.02555644,0.00279541,-0.

{0. 00016594,-0.00399601,-0.00731727,-0.00585359,-0.01695927,-0. 02650291, 0.04236752,-0.00927053,0.

{-0.01137819,-0.01841432,-0.02863844,-0.02549466,-0.00272 539,0.03105273, 0.04129874,0.02703469,0.01674746,0.

{-0. 01240696,-0.02050348,-0.03230916,-0.01847850,0.02493462,0.01 658082, 0.01950329,0.01626036,0.01239434,0.

{0. 00400441,0.00044364,-0.00439758,-0.01272883,-0.02737488,-0.0 3568903, 0.05039078,-0.01931315,0.00614772,-0.

{ {0. 00006111,-0.00011239,-0.00171992,0.01263544,0.01320593, 0.01204569,0.01293225,0.00666364,0.

{0. 00779445,0.00696512,-0.00184068,0.00596820,0.01118068,0.0071 0638, 0.00466814,0.00030543,-0.00416637,-0.

{-0. 00775987,-0.00470163,0.02876918,0.01544713,0.00472025,0.0023 3966, 0.00091549,-0.00172232,-0.00574072,-0.

{-0. 00192205,-0.00209183,0.00072963,-0.00370971,-0.01469616,-0.0 1831928, 0.01060567,0.00841196,-0.00113362,-0.

{0. 00727874,0.00550317,0.00265535,0.00347190,-0.00348257,-0.007 00786, 0.01453249,0.01124473,0.00636632,0.

{-0. 00370169,-0.00578109,-0.01054631,0.00237922,0.00610875,0.003 82378, 0.01112889,0.01061231,0.00444948,0.

{-0. 01082310,-0.00343578,0.00088772,-0.00179936,0.00486192,0.002 72746, 0.00364738,0.00156064,-0.00077856,-0.

{0. 00827082,0.00679115,-0.00515113,-0.01458570,0.00622652,0.006 87030, 0.00124702,0.00308527,0.00723321,0.

{0. 00033643,0.00105011,0.00317059,0.00722382,0.00500150,0.00323 058, 0.01981710,0.01102549,-0.00303191,-0.

{0. 00236747,0.00370410,-0.00666410,-0.01274279,-0.01239504,-0.0 1568273, 0.01086512,-0.00400080,-0.00089377,0.

{0. 00276404,0.00157884,0.00686494,0.01048618,0.00795789,0.01655 090, 0.00799517,0.00421079,0.00749205,0.

{-0. 00212620,-0.00277584,0.00272206,0.01528548,0.01589311,0.0097 0912, 0.00469392,0.00593647,0.00104566,-0.

{0. 00005560,-0.00071041,-0.00280654,-0.00394772,-0.

0.02467535,0.02212432,0.01059736,0.

{0. 00464703,0.00474611,0.00196303,-0.00845117,-0.00736551,0.013 93551, 0.01622437,0.00953056,0.00301761,-0.

{0. 00047992,-0.00137581,0.00480373,0.02034039,0.00168192,-0.002 73659, 0.00600385,0.00154407,-0.00004413,0.

{-0. 00111287,0.00035244,-0.00680570,-0.01735569,-0.00251611,-0.0 0534775, 0.00351667,0.00680632,-0.00068295,-0.

{0. 00748514,0.00560680,-0.00091863,0.00920877,0.00118810,-0.006 32105, 0.00962053,-0.00702395,0.00190340,-0.

{-0. 00250611,-0.00404516,-0.00747983,0.01095903,0.00795864,0.002 82929, 0.00388997,-0.00170172,-0.01516082,-0.

{-0. 00382775,-0.00496896,-0.00872420,-0.00897827,-0.01372950,0.0 0223387, 0.00948376,0.00437347,0.00551626,0.

{-0. 00068027,-0.00054087,-0.00137117,-0.01218331,-0.01646237,-0. 00125409, 0.00512591,-0.00259414,0.00019934,-0.

{0. 01072110,0.01216315,0.00858058,0.00496877,0.00387715,0.00465 455, 0.00295036,0.00223345,0.00185529,0.

{0. 00296041,0.00674527,0.00374328,-0.00204315,-0.00721346,-0.00 780599, 0.00719436,0.00024193,-0.01220476,-0.

{-0. 00216296,-0.00253576,-0.01080409,-0.01403971,0.01317200,0.01 261837, 0.00193829,0.00045172,0.00132059,-0.

{0. 00922137,0.01014334,0.00260340,-0.00465584,-0.00515572,-0.00 850082, 0.00859783,-0.00459811,-0.00840030,-0.

{-0. 00801438,-0.00425278,0.01495038,-0.00190038,-0.00985608,-0.0 1157529, 0.00885614,-0.00304473,0.00181800,0.

{-0. 00490201,-0.00762224,0.00040365,0.00582002,-0.00073916,0.011 54589, 0.00012161,-0.00446718,0.00332097,0.

{0. 00137264,0.00074422,0.02283779,0.01073287,-0.00116295,-0.010 58273, 0.00316988,0.00677347,0.0.

{0. 00319146,-0.00045188,-0.01012620,-0.00021037,-0.00441827,-0. 01132391, 0.00311417,-0.00315884,-0.01255682,-0.

{0. 00171563,-0.00111647,-0.00583420,0.01095067,0.00858833,0.006 92717, 0.00873388,0.00136371,0.01266588,0.

{0. 00042425,-0.00141434,-0.00204316,-0.00825233,-0.00419762,0.0 1843774, 0.00776467,0.00399437,0.01425773,0.

{0. 00198198,00052505,0.00305308,0.00190291,-0.01278992,-0.00529 606, 0.00142837,-0.00523604,0.00823206,0.

{0. 00407774,0.00128382,-0.01316027,-0.00600687,0.00007500,-0.00 346172, 0.00039881,0.00485414,0.00543620,0.

{0. 00088827,0.00372026,0.00085106,-0.00512459,0.00587403,0.0007 9244, 0.00147824,0.00452383,-0.00429125,-0.

{-0.00288860,-0.00282246,-0.00094926,-0.00396700,-0.00478 751,0.01771119, 0.01499634,0.00307891,-0.00983328,-0.

{-0. 00321458,0.00689814,0.00937494,-0.00267765,0.00449666,0.0013 1638, 0.00049454,-0.00173761,0.00155754,0.

{0. 00243335,0.00346759,-0.01570546,0.00138322,0.00309032, 0.00448764,-0.01035466,-0.01368467,-0.

{-0. 00445209,-0.00451981,0.00775260,0.00538409,0.00259379,0.0113 0075, 0.01159070,0.01239608,0.01218984,0.

{-0. 00161021,0.00070235,-0.00059480,0.00445431,0.00396118,-0.007 32553, 0.00000194,00135627,-0.00251368,-0.

{-0. 00651984,-0.00550594,-0.00499920,-0.00484211,-0.00506232,-0. 00662786, 0.00706928,-0.00334101,-0.01055323,-0.

{0. 00457578,0.00388137,0.00548547,0.00933548,0.01001904,0.00163 964, 0.00450871,0.01572982,0.01107527,0.

{-0.00445362,-0.00337934,-0.00944068,0.00200823,0.0037757 9, 0.00386050,0.00763733,0.01127368,0.

{0. 00228387,0.00262173,-0.00174080,-0.00116707,0.01802132,0.010 01005, 0.00421486,-0.01083893,0.00535106,0.

{-0.00219198,-0.00696038,-0.00326018,-0.00700208,-0.01000 534, 0.00590006,-0.00019387,0.01364628,0.

{-0. 00525566,-0.00589099,-0.00218846,-0.00069747,-0.00377804, 0.00281350,-0.00928819,-0.00206454,0.

{-0. 00648441,-0.00834980,0.00047410,0.00544467,-0.00151490,-0.00 721561, 0.00421142,0.01267029,0.00553720,0.

{-0. 00319906,-0.00153334,-0.00319572,0.00124053,0.00867730,0.004 69551, 0.00579935,-0.01876245,-0.02031045,-0.

{0. 00153075,0.00203053,0.01557594,0.00248293,-0.00568021,0.0099 2088, 0.00651748,0.00288808,-0.00400202,-0.

{0. 00486833,0.00291524,0.00857085,0.00288218,-0.00243590,0.0075 8656, 0.00270442,0.00120835,0.01880961,0.

{-0.00011043,0.00233758,0.00924841,-0.00813434,-0.0106949 2,-0.00390450, 0.00359210,0.01126875,0.00746396,0.

{-0. 00494091,-0.00523131,0.01230702,0.01752272,0.00766125,-0.003 18486, 0.01345777,-0.00804930,0.00290803,0.

{0. 00032569,0.00009018,0.01225586,0.00569636,-0.00705480,-0.013 84848, 0.01169237,-0.01071170,-0.01027119,-0.

{0. 00280051,0.0.00490902,0.00336591,0.00371334,-0.

0.01473072,-0.01935226,-0.02067918,-0.

{0. 00612606,0.00452334,0.00281361,-0.00371625,-0.00823255,0.003 77597, 0.00722384,-0.01549285,0.00240305,-0.

{-0.00188299,-0.00288016,-0.00945697,-0.00819146,0.003766 93,-0.00310810, 0.01815127,-0.01087037,-0.00275809,-0.

{0. 00302839, 0.00234366,0.00453269,0.01641155,0.01357589,0.00569236, 0.00491735,-0.00780978,-0.00900474,-0.

{-0. 00080239,-0.00316640,-0.00369995,0.00115340,-0.00644417,-0.0 1160044, 0.02211991,0.00383138,0.00405909,0.

{0. 00174899,00438349,0.00367090,-0.00111571,0.01566313,0.015798 12, 0.00417576,-0.00456289,-0.01404146,-0.

{0. 00718619,0.00681000,0.01045663,0.01057205,0.00363275,0.00126 916, 0.00035579,-0.00555201,-0.01126034,-0.

{0. 00405121,0.00357693,0.00265770,-0.00375096,-0.00505171,-0.01 364679, 0.01345036,0.01153075,0.01532976,0.

{-0. 00043160,-0.00087914,0.00860999,0.00148947,0.00531393,0.0035 2189, 0.01237297,-0.00004966,-0.00106361,-0.

{-0. 00056662,-0.00212456,-0.00117172,0.00762109,0.00219673,-0.00 025564, 0.01128915,-0.01699960,0.01354709,0.

{-0. 00408654,-0.00096384,-0.00423818,-0.00744231,-0.00876295,-0. 01304774, 0.01141891,-0.01555846,-0.01246216,0.

{-0. 00039385,0.00025901,0.00353937,0.00203476,-0.00176971,0.0020 9237, 0.00340730,-0.01026764,-0.02600074,-0.

{0. 00243314,0.00343546,0.00371032,-0.00350422,-0.00970857, 0.02319258,-0.02738033,0.00899502,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0. <BR> <BR> <BR> <P>{0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, o. oooooooo}, <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, o. oooooooo} { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000},<BR> <BR> <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, o-oooooooo} s { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, o. 00000000}, <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0.00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0.00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo0000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, o. 00000000, 0. 00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, o. 00000000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo0000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> o. ooooo0000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { {0. 00007302,-0.00074506,0.00167535,-0.00200298,-0.01561921,0.00 467142, 0.00250590,-0.00179108,0.00045385,-0.

{0. 00093298,-0.00177509,0.01404716,0.00543233,0.00031596,0.0029 1425, 0.00009707,0.00167511,0.00182873,0.

{-0.00174480,0.00007287,-0.00089953,-0.01199317,-0.000503 11,-0.00556124, 0.00281232,-0.00114969,-0.

{-0. 00262070,0.00748139,-0.00280502,-0.00136286,-0.00078590,0.00 175876, 0.00098000,0.00457380,0.00355523,0.

{0. 00074436,-0.00115665,0.00189529,0.01157575,0.00224026,-0.002 12844, 0.00306117,0.00230632,-0.00278911,0.

{0. 00390810,0.00046965,-0.00695795,0.00670060,0.00287957,0.0021 0736, 0.00370070,0.00504010,0.00404556,0.

{0. 00189179,0.00096211,0.00210929,0.00010549,-0.00104655,011680 18, 0.00070392,0.00279664,0.00885825,0.

{-0. 00079471,-0.00199071,0.00625236,0.00278785,-0.00271890,0.000 75786, 0.00309626,-0.00618918,0.00809770,0.

{0. 00013985,-0.00365764,0.00326014,-0.00874184,0.00148973, 0.00651280,-0.00398857,0.00748833,0.

{0. 00696733,0.01084724,0.00240300,-0.00150848,-0.00300501,-0.00 039626, 0.00258365,-0.00025108,-0.0.

{-0. 00023407,-0.00239894,0.00102984,0.00612422,-0.00136156,0.008 67489, 0.00206586,0.00942366,0.00106978,-0.

{0. 00234993,-0.00051945,-0.00417579,-0.00371189,0.00557327, 0.00565083,0.01242620,-0.00050916,-0.

{-0. 00188685,-0.00077652,0.00330529,-0.00125596,-0.00501212,-0.0 0913486, 0.00240911,0.00818219,0.00350082,0.

{-0. 00076638,0.00183468,0.00532269,-0.00322180,0.00552090,0.0025 6412, 0.00336437,0.00908956,0.

{0. 00111320,-0.00037587,-0.00024503,0.00402914,0.00237231,-0.00 271156, 0.01232017,0.01351714,0.01213235,0.

{0. 00210448,0.00546874,-0.00340875,0.00102174,0.00582430,-0.002 56006, 0.00040125,0.00165970,-0.

{0. 00126084,0.00040107,-0.00141030,-0.00645370,-0.00571476,0.00 271883, 0.00332637,0.00396915,0.00628144,0.

{0. 00117079,0.00014311,-0.00465681,-0.00591142,-0.00478553, 0.00138077,-0.00704582,-0.01184659,0.

{0. 00138973, 0.00123652,0.00507302,0.00288668,-0.00338459, 0.01331825,0.00027167,0.00470983,0.

{0. 00076815,0.00155115,0.00291000,0.00703008,0.00621193,0.00485 275, 0.00301572,-0.00341427,0.00549137,0.

{0. 00033265,-0.00047441,-0.00019610,-0.00024157,0.01414834,0.00 262556, 0.00205734,0.00161241,0.00131464,0.

{-0. 00378284,-0.00044598,-0.00380424,-0.00331107,0.00360503,-0.0 0291761, 0.00829789,0.00941720,0.00051424,-0.

{0. 00195321,0.00184592,-0.00126926,0.00055559,-0.00055360,-0.00 721628, 0.00243223,-0.00459577,0.01175538,0.

{-0. 00023710,0.00162962,-0.00275466,-0.00136286,0.00636333,0.009 27344, 0.00845523,0.00355330,-0.00205688,-0.

{0. 00427265,0.00381217,-0.00033214,0.00105652,-0.00486730,0.000 89909, 0. 00048308,-0.00797174,0.00324721,-0.

{0. 00026448,-0.00067842,0.00107705,0.00333172,0.00195835,0.0018 9156, 0.00951886,0.00930392,0.00693669,0.

{0. 00407814,0.00285434,0.00269327,0.00424816,0.00462708,0.00521 001, 0.00096518,0.00184609,-0.00404653,-0.

{0. 00051601,0.00244371,0.00807730,-0.00659189,0.00075139,0.0012 0002, 0.00067461,-0.00520723,0.00006501,-0.

{0. 00154864,0.00175935,0.00137842,0.00332717,-0.00770257,-0.002 81735, 0.00898536,0.00426355,0.00356744,-0.

{-0. 00110883,-0.00025148,0.00118848,-0.00870558,0.00650556,0.005 86968, 0.00271981,-0.00453412,0.00242571,0.

{0. 00070532,-0.00025072,0.00366505,-0.00167716,-0.00296136,0.01 020369, 0.00688567,0.00095235,-0.01077141,0.

{0. 00269407,0.00092414,-0.00878398,0.00160851,-0.00639129,-0.00 094266, 0.00082998,-0.00270264,-0.00442263,-0.

{-0. 00278214,0.00287601,-0.00500381,-0.00138864,-0.00284296,-0.0 0735792, 0.00637880,-0.00326541,0.00157648,-0.

{0. 00363546,0.00214577,0.00414674,0.00266734,-0.00079453,-0.004 06520, 0.0.00206326,-0.00523273,0.

{-0.00000026,-0.00386427,0.00640634,0.00261276,0.00277903 ,-0.00013026, 0.01273183,0.00959437,-0.00109646,-0.

{0. 00349409,0.00059023,-0.00230930,0.00261091,-0.00124556,-0.00 746849, 0.01029008,0.00287435,-0.00605374,-0.

{0. 00353078,0.00009537,0.00405514,-0.00273642,-0.00681506,0.000 89121, 0.00769497,0.00918448,0.00100596,-0.

{-0.00048915,0.00219592,0.00196135,0.00371528,0.00049757, -0.00921692, 0.0.00796835,-0.00439759,-0.

{0. 00099541,-0.00179639,-0.00422007,0.00144744,-0.00122703,0.00 894285, 0.00517048,-0.00422113,0.00026459,0.

{0. 00284500,0.00255142,-0.00501236,-0.00399376,0.00453097,-0.00 045817, 0.00396111,-0.00344911,-0.01026568,0.

{-0. 00325499,0.00057240,-0.00117489,-0.00668998,-0.00387262,0.00 826259, 0.00012935,-0.00535898,-0.00161315,-0.

{-0. 00204424,-0.00205964,-0.00267784,-0.00085138,0.00334009,-0.0 0839914, 0.00136307,-0.00173559,-0.00516495,0.

{-0.00410270,0.00939750,0.00385454,0.00290060,0.00194424, 0.00206843, 0.00582770,-0.00159821,-0.00199349,-0.

{0. 00129409,-0.00184888,-0.00259575,-0.00257605,0.00297719,0.00 723570, 0.00858313,-0.00202067,-0.00340528,-0.

{-0.00235071,-0.00109572,-0.00477851,-0.00437243,0.004619 58,0.00073576, 0.00018923,0.00108088,0.00900257,0.

{-0. 00078569,0.00304111,0.00186742,-0.00410820,0.00456433,-0.000 60262, 0.00330057,-0.00122075,-0.01093924,-0.

{0. 00095778,0.00049767,0.00293670,0.00335490,0.00341477,0.00244 888, 0.00308668,-0.01163045,-0.01418884,0.

{0. 00026347,-0.00164608,-0.00094501,0.00772980,0.00046633,-0.00 128056, 0.00689654,-0.00084991,-0.01277967,-0.00052741},

{-0. 00065633,0.00272296,0.00456446,0.00488337,-0.00292273,-0.004 87562, 0.00517779,-0.00174580,-0.

{0. 00260815,-0.00641491,-0.00095775,-0.00283377,-0.00246661, 0.00611697,-0.00409055,0.00354730,0.

{-0. 00099595,0.00094685,-0.00331898,-0.00146973,0.00179052,-0.00 139797, 0.00709227,-0.01524743,0.00441790,0.

{-0. 00408121,0.00089766,0.00094466,0.00325065,0.00672033,-0.0001 9249, 0.00589924,0.00322853,-0.00242561,0.

{-0. 00257228,-0.00179791,-0.00268333,-0.00031574,-0.00369395, 0.00741923,-0.00260730,-0.00501607,0.

{-0. 00113380,-0.00073103,-0.00428704,0.00683978,0.00594497,0.003 72150, 0.00602975,-0.

{0. 00341457,0.00178256,-0.00503937,-0.00927698,0.00228853,0.002 47928, 0.00337487,0.00382129,0.00237729,-0.

{-0. 00621084,0.00386607,0.00249559,0.00131394,0.00261413,0.00158 248, 0.00461110,-0.00825484,0.00388321,0.

{-0. 00071191,-0.00404093,-0.00406227,-0.00362297,-0.00396032,-0. 00054434, 0.00823714,0.00458085,-0.00313846,-0.

{-0. 00317347,-0.00411505,0.00082595,0.00270407,0.00844264, 0.00193732,0.00016764,0.00304433,0.

{-0. 00530220,0.00236141,0.00160612,-0.00435760,-0.00325925,-0.00 106870, 0.01171124,0.00597055,0.

{-0. 00380354,-0.00248355,-0.00205986,0.00649275,-0.00148701,-0.0 0123465, 0.00469793,0.00036483,0.00663194,0.

{-0. 00319243,-0.00320118,0.00582574,-0.00058566,-0.00096663,-0.0 0345346, 0.00008310,-0.00664409,-0.00607386,-0.

{-0. 01462694,0.01047577,0.00080652,-0.00036210,0.00012141,-0.002 13070, 0.00368270,0.00243329,0.00218546,-0.

{0. 00057512,-0.00450090,-0.01124568,-0.00049298,0.00071818,-0.0 0244420, 0.00243412,0.00051171,-0.00145560,-0.

{-0.01118169,0.00200960,0.01001314,0.00019961,0.00375019, 0.00144620, 0.00091153,-0.00359078,-0.

{0. 00000000, 0.00000000,0.00000000,0.00000000,0.00000000,0.00000000, 0.00000000,0.00000000,0.00000000,0. <BR> <BR> <BR> <P>{0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000,<BR> <BR> <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. oooooooo} {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000 0. 00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. 00000000, 0.00000000,0.00000000,0.00000000), { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. 00000000, o. oooooooo, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo} , { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,0.00000000,0.00000000, 0. 00000000, 0. 00000000, 0. 00000000,0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> <BR> {0. 00000000, o. 00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}. <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo0000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo},.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, o. 00000000, 0. 00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000},<BR> <BR> <BR> <BR> <BR> {0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0.

{ 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000},

} X { {0. 00086208,-0.00248842,0.00084186,-0.00446845,0.00190942,-0.00 295110, 0.00414520,0.00622425,0.00301297,-0.

{-0. 00066277,-0.00156242,-0.00188648,-0.00068226,0.00362849,0.00 524252, 0.00329070,0.00544285,0.00084142,-0.

{0. 00028247,-0.00016973,0.00049755,-0.00255812,-0.00450452,0.00 681138, 0.00044480,0.00599771,0.00111314,0.

{0. 00041410,0.00081556,-0.00343059,-0.00500038,-0.00225441, 0.00018195,0.00143104,0.00177757,-0.

{-0. 00079673,0.00159853,-0.00034292,0.00129426,-0.00007302,0.005 46219, 0.00665160,-0.00060734,0.00546493,0.

{0. 00068656,0.00111316,-0.00008834,0.00168500,-0.00013310,-0.01 042266, 0.00157247,0.00014180,0.00170112,0.

{-0.00166456,-0.00053325,0.00240356,-0.00180217,0.0030001 5,-0.00312061, 0.00658243,-0.00067789,0.00694877,0.

{0. 00118114,-0.00008417,-0.00656243,0.00095065,0.00071917,-0.00 153054, 0.00386470,-0.00257462,0.00007614,0.

{0. 00094708,-0.00160821,0.00629218,0.00066733,0.00448857,-0.002 83788, 0.00022201,0.00142664,0.00163499,-0.

{-0. 00443331,0.00103346,-0.00057657,-0.00053597,-0.00097487,0.00 332860, 0.00072481,-0.00027174,0.00542735,-0.

{-0. 00153246,0.00126305,0.00037245,0.00417289,-0.00493101,-0.002 90573, 0.00475200,-0.00247545,0.00169144,-0.

{0. 00632485,0.00086394,-0.00243321,-0.00106806,0.00089774,0.001 07041, 0.00100679,-0.00003992,-0.00117692,-0.

{-0. 00623386,0.01390054,0.00108531,-0.00192767,-0.00132562,0.001 04818, 0.00054211,-0.00030534,-0.00020025,-0.

{-0. 00113192,-0.00059348,0.00129056,-0.00149712,-0.00082094, 0.00071770,0.00970785,0.00744038,0.

{0. 00123799,0.00207061,-0.00115538,-0.00289553,0.00056005,-0.00 391641, 0.00717160,0.00382398,-0.

{0. 00077307,0.00142555,0.00109648,-0.00464006,0.00533187,-0.005 10332, 0.00023855,-0.00328482,-0.00074710,-0.

{0. 00238819,-0.00135793,-0.00201387,0.00387475,-0.00317698,-0.0 0222894, 0.00021505,00525476,0.00104911,-0.

{0. 00065771,-0.00098232,0.00319080,-0.00011477,-0.00132514,-0.0 0374788, 0.00162312,0.00722737,-0.00459214, {-0. 00080202,0.00335683,0.00240561,-0.00084930,-0.00253268,-0.00 320793, 0.00148629,0.00474258,0.00404238,-0.

{-0. 00084023,-0.00062754,0.00305737,-0.00390684,0.00155093, 0.00464761,0.00169321,-0.00112743,-0.

{-0. 00176868,0.00027891,-0.00201939,-0.00235603,-0.00009332,-0.0 0457865, 0.00467367,0.00322558,0.00020224,0.

{0. 00086051,-0.00472371,0.00225357,0.00169834,-0.00099507,0.001 66508, 0.00349894,-0.00397513,0.00081766,0.

{-0. 00135226,-0.00102119,0.00024682,0.00058089,0.00708151,0.0033 8386, 0.00097824,-0.00454912,0.00067067,0.

{-0.00166578,-0.00031528,0.00204148,0.00423986,0.00002128 ,0.00552738, 0.00293300,0.00102631,-0.00392290,0.

{0. 00247632,0.00008008,0.00181157,0.00039791,-0.00424684,-0.001 78287, 0.00106831,-0.00164437,0.00466169,0.

{0. 00125419,0.00000370,-0.00230147,0.00086239,-0.00376812,0.009 98392, 0.00183310,-0.00260948,0.00012972,-0.

{-0. 00129835,-0.00040074,0.00347131,-0.00240826,-0.00210135,0.00 023977, 0.00514458,0.00096217,0.00482401,0.

{-0. 00020902,0.00260007,0.00052125,-0.00445330,-0.00314753,0.003 50929, 0.00163139,-0.00557720,0.00211181,0.

{0. 00095971,0.00192905,0.00138940,-0.00149907,0.00434330,0.0029 9268, 0.00050098,0.00685241,0.00339234,0.

{0. 00111410,0.00147469,-0.00261147,0.00385966,-0.00161462,0.000 69539, 0.00429436,0.00372510,-0.00357642,0.

{0. 00006076,0.00042616,-0.00290309,-0.00079895,0.00620516,-0.00 348487, 0.00376823,0.00253090,0.00253809,0.

{-0. 00012903,0.00379365,0.00290667,0.00212028,0.00266207, 0.00094542,0.00127099,0.00286725,-0.

{-0.00009478,-0.00029151,-0.00049341,0.00888911,0.0021437 5,0.00061872, 0.00143956,0.00142848,0.00333705,0.

{0. 00222409,-0.00002446,-0.00149917,0.00325262,0.00276110,-0.00 310332, 0.00352549,-0.00657974,-0.00242479,0.

{-0.00134549,0.00274138,-0.00217626,0.00018026,0.00211455 ,0.00533394, 0.00307828,-0.00164653,-0.00277337,0.

{0. 00064191,-0.00189750,-0.00206915,-0.00192326,-0.00156328,-0. 00116744, 0.00750298,0.00038875,-0.00034884,0.

{-0.00064076,0.00027328,-0.00032465,-0.00764104,0.0027359 1,0.00193690, 0.0.00269155,-0.00268331,0.

{-0.00203748,0.00145185,-0.00306498,0.00044752,-0.0037380 6,0.00209342, 0.00038828,0.00603700,-0.00437354,-0.

{0. 00024120,-0.00048565,-0.00123779,0.00499967,-0.00281858,0.00 397071, 0.00330131,-0.00607967,0.00298967,0.

{0. 00196641,0.00056098,-0.00177490,-0.00194885,0.00203612,-0.00 067509, 0.00565878,0.00424678,-0.00609632,0.

{0. 00014292,-0.00202034,-0.00166715,-0.00079566,-0.00315657,-0. 00596721, 0.00141144,-0.00552633,0.

{0. 00093111,-0.00165178,-0.00032798,0.00295016,0.00195668,0.001 47907, 0.00431917,0.00469877,-0.00039486,0.

{0. 00122796,0.00203197,0.00095639,-0.00378623,0.00180324, 0.00269705,-0.00036101,-0.00557186,-0.

{0. 00180834,0.00084937,0.00222321,0.0.

0.00671113,0.00031736,0.00160739,-0.

{-0. 00174145,0.00091289,-0.00316276,-0.00256852,0.00151101,0.001 04166, 0.00534198,-0.00497542,-0.00067080,-0.

{-0.00097879,0.00144201,0.00080518,00356054,0.00239883,-0 .00256869, 0.00483024,0.00850655,-0.00034326,-0.

{-0. 00212114,-0.00127095,-0.00140703,0.00327541,0.00122228,-0.00 489747, 0.00317885,0.00162179,-0.00275859,-0.

{0. 00025401,0.00014398,0.00298840,0.00243957,0.00166451,0.00629 781, 0.00537736,0.00110198,0.00363840,-0.

{-0. 00202005,0.00235003,0.00217112,0.00022358,0.00312872,-0.0021 8539, 0.00335181,0.00012472,-0.00442290,0.

{-0. 00202496,0.00038179,0.00070388,-0.00313552,0.00304247,0.0019 6510, 0.0.00062708,-0.00069537,-0.

{-0.00024116,-0.00111487,0.00232351,0.00340867,0.00186041 ,-0.

0.00575372,-0.00318147,-0.00328493,0.

{0. 00147860,0.00312901,0.00014157,0.00339818,0.00150767,-0.0020 5441, 0.00322139,-0.00185155,0.00341243,0.

{0. 00018523,0.00192453,-0.00110424,0.00024090,-0.00346463,-0.00 066422, 0.00953683,0.00067760,0.00292052,-0.

{0. 00056105,0.00009368,0.00118450,-0.00227920,0.00227109,-0.002 05330, 0.00230305,-0.00634465,0.00179672,0.

{0. 00215523,-0.00042082,-0.00175150,-0.00358539,0.00279677,0.00 336525, 0.00016516,-0.00443252,0.00674258,0.

{-0. 00142919,0.00124386,0.00293935,0.00149501,-0.00001751,-0.000 30417, 0.00203712,-0.00892448,00199036,-0.

{0. 00185580,-0.00063800,0.00416852,-0.00335500,0.00154925,0.003 45948, 0.00107564,-0.00527175,-0.00310700,-0.

{-0.00096271,-0.00176145,-0.00088351,-0.00397697,-0.00203 621,0.00308198, 0.00394513,-0.00270040,-0.00509416,0.

{0. 00073146,-0.00078403,0.00206517,-0.00050691,0.00247155,0.005 21481, 0.00314152,0.00658762,0.

{-0. 00177727,-0.00088440,0.00112403,0.00121361,-0.00446313,-0.00 190805, 0.00097416,-0.00196491,-0.00458979,0.

{-0. 00063716,-0.00074135,-0.00320684,0.00060174,0.00146160,-0.00 175724, 0.00095403,-0.00052926,-0.01098564,0.

{0. 00147074,-0.00242869,-0.00034958,0.00151139,-0.00105102,0.00 117536, 0.00341839,-0.00116328,-0.00521109,-0.

{-0. 00089161,0.00169236,0.00070051,-0.00300855,-0.00261332,-0.00 489216, 0.00078356,-0.00301007,-0.00620281,-0.

{0. 00009583,0.00150178,-0.00007453,0.00239520,0.00522328,0.0014 7270, 0.00167806,-0.00123525,-0.00775452,-0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.0.0.

{0. 00000000,0.00000000,0.00000000,0.00000000,00000000,0.0000000 0, 0.0.0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000, {0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000, {0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000, {0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.0.0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000 000, 0.00000000,0.00000000,0.00000000,0.

{0. 00000000,0.00000000,0.00000000,0.00000000,00000000,0.0000000 0, 0.00000000,0.00000000,0.00000000,0.

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000), <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, 0. 00000000, 0. 00000000, 0. 00000000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, 0. 00000000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0},<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0, {0. 00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. 00000000, 0. 00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, <BR> <BR> <BR> 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000,<BR> <BR> <BR> <BR> <BR> o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000), { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, @ 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, @ 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, @ { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000} @ { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, { 0, 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000}, { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, @ 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000} @ { 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000, @ 0. 00000000, 0. 00000000, 0. 00000000, 0. 00000000},

{ 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. oooooooo} , o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooo0000, 0.00000000, 0.00000000, 0.00000000, 0.00000000}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, o. ooooo000, o. ooooo000, o. ooooo000, o. ooooooo0}, }, } /*----------------------------------------------------*/ /*========================================================== =======*/ /*---------------------------END------------------------*/ <BR> <BR> <BR> /*========================================================== =======*/

=*/<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> =*/ /* Conexant System */ /* 4311 Jamboree */ /* Newport Beach, CA */ /*-----------------------------------------------*/ /* Copyright (C) 2000 Conexant System */ /*------------------------------------------------------*/ /* ALL RIGHTS */ /* No part of this software may be reproduced in any form or by */ /* means or used to make any derivative work (such as */ /* or adaptation) without the authorisation of Conexant System */ /*========================================================== =======*/ <BR> <BR> <BR> <BR> /* LIBRARY: tracks. */<BR> <BR> <BR> <BR> <BR> */ /*---------------------------------------------------------- -------*/ */ /*-------------------------------- TABLES ------------------------- <BR> <BR> <BR> <BR> <BR> <BR> <BR> */<BR> <BR> <BR> <BR> <BR> <BR> */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> static INT16 srchpuls [12] = {0, 1,2,3,4,6,5,7,7,1, ; /*---------------------------------------------------------- -------*/ /*============================ 13 bits FCB ==========================*/ <BR> <BR> <BR> <BR> /*---------------------------------------------.. */<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*--------------------------------------..--------*/ /* 2 pulses CB: 2pulses x Sbits/pulse + 2 signs = 12 */ /*---------------------------------------------------------- -------*/ static INT16 track_2_5_0[2] [32]={ {0, 1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,22,24,26, 28,30,32,34,36,38,40,42,44,46,48,50, {1, 3,5,7,9,11,12,13,14,15,16,17,18,19,20,21,22,23,25,

27,29,31,33,35,37,39,41,43,49, ; /*---------------------------------------------------------- -------*/ /* 3 pulses CB: 3 pulses x 2 bits/pulse + 3 signs = 9 */ /*---------------------------------------------------------- -------*/ static INT16 track_3_2_0 [3] [4] =1 (0, 3,6, {1, 4,7, {2, 5,8, }; <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /* 1 pulse CB: 1 pulse x 3 bits/pulse + 1 signs = 4 (3) */ <BR> <BR> <BR> /*----------.---------.----------------.------*/ static INT16 track_1_3_0[1] [8] = { (0, 5,11,17,23,29,35, }; <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /*================================ 15 bits FCB ======================*/ /*---------------------------------------------------------- -------*/ /*---------------------------------------------------------- -------*/ /* 2 pulses CB: 2pulses x 6. + 1 sign = 14 */ /*---------------------------------------------------------- -------*/ static INT16 track 27 1 [2] [80] = ( {0, 1,2,5,6,7,8,9,10,11,12,13,14,15, 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,34,35,36,37,38,39,40,41,42,43,45,46,47, 48,49,50,51,52,54,55,56,57,59,60,61,62,63, 64,65,66,67,68,69,70,71,72,73,74,76,77,78, {0, 1,2,3,5,6,7,9,10,11,12,13,14,15, 16,17,18,19,20,21,22,23,24,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, 64,65,66,67,68,70,71,72,73,74,75,76,77,78, ;

/*---------------------------------------------------------- -------*/ /* 1 pulse CB: 1 pulse x 4 bits/pulse + 1 signs = 5 (4) */ /*---------------------------------------------------------- -------*/ static INT16 track_1_4_0[1] [16] = ( (0, 4,8,12,16,20,24,28,33,38,43,48,53,58,63, ; /*---------------------------------------------------------- -------*/ /*============================ 30 bits FCB ==========================*/ <BR> <BR> <BR> <BR> /*------------------.-------..-----------------------*/ /*---------------------------------------------------------- -------*/ /* 8 pulses CB: 6p x 3b + 2p x 4b + 4b signs = 30 */ <BR> <BR> <BR> /*---------..-------------------------------------*/ static INT16 track 8 40 [8] [16] = { (0, 5,10,15,20,25,30,35,2,7,12,17,22,27,32, (1, 6,11,16,21,26,31,36, 0], {3, 8,13,18,23,28,33,38, {4, 9,14,19,24,29,34,39, [0, 5,10,15,20,25,30,35,2,7,12,17,22,27,32, (1, 6,11,16,21,26,31,36, (3, 8,13,18,23,28,33,38, [4, 9,14,19,24,29,34,39, <BR> <BR> <BR> <BR> ) ;<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> // /*=========================== bits ==========================*/ /*---------------------------------------------------------- -------*/ /*------------------------------------------------*/ /* 5 pulses CB: 3p x 4b + 2p x 3b + 3b signs = 21 */ <BR> <BR> <BR> /*.--------------------------------..----------------*/ static short track540 [5] [16] = {

(0, 5,10,15,20,25,30,35,2,7,12,17,22,27,32, (1,6,11,16,21,26,31,36,3,8,13,18,23,28,33, {4, 9,14,19,24,29,39, (1, 6,11,16,21,26,31,36,3,8,13,18,23,28,33, {4, 9,14,19,24,29,34,39, 1 : /*---------------------------------------------------------- -------*/ /* 5 pulses CB: 5p x 3b + Sb signs = 20 */ /*---------------------------------------------------------- -------*/ static short track532 [5] [8] = ( (0, 1,2,3,4,6,8, {5, 9,13,16,19,22,25, (7, 11,15,18,21,24,28, [12, 14,17,20,23,26,30, {29, 31,33,35,36,37,38, 39] ); /*---------------------------------------------------------- -------*/ /* 5 pulses CB: 5p x 3b + 5b signs = 20 */ /*---------------------------------------------------------- -------*/ static short track 5 3 1 [5] [8] = ( {0, 1,2,5,6, 7 ), (8, 9,10,11,12,13,14, (16, 17,18,19,20,21,22, (24, 25,26,27,28,29,30, (32, 33,34,35,36,37,38, ) ; /*---------------------------------------------------------- ------- */ <BR> <BR> <BR> <BR> <BR> <BR> <BR> /*------------------------------------END------------------- --------------- */ */