The present invention relates to speech processing in general, and more particularly to a speech encoding method and system based on code excited linear prediction (CELP).
Code-excited linear prediction (CELP) is a speech coding technique commonly used for producing high quality synthesized speech at low bit rates, i.e., 4.8 to 9.6 kilobits-per-second (kbps). This class of speech coding, also known as vector-excited linear prediction, utilizes a codebook of excitation vectors to excite the LPC filter 610 in a feedback loop to determine the best coefficients for modeling a sample of speech. A difficulty of the CELP speech coding technique lies in the extremely high computationally intense activity of performing an exhaustive search of all the excitation code vectors in the codebook. The codebook search consumes roughly 60% of the total processing time of a speech codec (compression encoder-decoder).
The ability to reduce the computation complexity without sacrificing voice quality is important in the digital communications environment. Thus, a need exists for improved CELP processing.
A method and system for speech synthesis includes an adaptive codebook search (ACS) process based on a set of matrix operations suited for data processing engines which support one or more SIMD (single instruction multiple data) instructions. A set of matrix operations were determined which recast the conventional standard algorithm for ACS processing so that a SIMD implementation achieves not only improved computational efficiency, but also reduces the number of memory accesses to realize improvements in CPU (central processing unit) performance.
The optimum excitation signal is determined in the codebook search process 102 by selecting the code vector which produces the weighted error signal representing the minimum energy for the current frame; i.e., the search through a codebook of candidate excitation vectors is performed on a frame-by-frame basis. Typically, the selection criterion is the sum of the squared differences between the original and the synthesized speech samples resulting from the excitation information for each speech frame, called the mean squared error (MSE).
Referring to the general architectural diagram of a speech synthesis system 140 of
As shown in
The speech coder can utilize various storage technologies. A typical storage (memory) component 154 of the system can include conventional RAM (random access memory) and hard disk storage. The program code that is executed can reside wholly in a RAM component, or portions may be stored in RAM and/or a cache memory and other portions on a hard drive as is commonly done in modem operating system (OS) environments. The program code can be stored in firmware. The codebook might be stored in some form of non-volatile memory. Other implementations can include ASIC-microcontroller combinations, and so on.
A signal converter 156 is typically included to convert the analog speech-in signal to a suitable digital format, and conversely an analog speech-out signal can be produced by converting the digital data. The SIMD-based processor 152 can include one or more control signals 166 which are communicated to operate the signal converter. Data channel 162 and 164 can be provided to provide data paths among the various components.
The speech synthesis system 140 can be any system that utilizes speech synthesis or otherwise benefits from speech synthesis. Examples include mobile devices supporting voice communication such as video conference systems, audio recorders, dictaphones, voice mail boxes, order processing systems, security, and intercom systems. These devices typically require real time processing capability, have limits on power consumption, and have limited processing resources. Further, most current day fixed point application processors have SIMD extensions. The present invention uses the SIMD architecture to reduce the computational load on the data processing component 152. Hence devices can operate in a lower power mode. Mail boxes and dictaphones having limited processing resources use uncompressed voice transactions. These devices can be replaced by the voice codecs using compression technology, thereby increasing the efficiency of storage. Existing mobile phones and conference systems make use of CELP based voice codecs. The present invention frees up the processor to perform additional functions, or simply to save power. Most existing analog voice applications such as intercom/security systems will be eventually replaced by digital systems with content compression for better resource usage, and thus would be well suited for use with the present invention.
The calculation which takes place in the codebook search process 102 involves computing the convolution of each excitation frame stored in the codebook with the perceptual weighted impulse response. Calculations are performed by using vector and matrix operations of the excitation frame and the perceptual weighting impulse response. The calculation includes performing a particular set of matrix computations in accordance with the invention to compute a correlation vector representing the correlation between the target vector signal 108 and an impulse response.
As mentioned above, adaptive codebook search involves searching for a codebook entry that minimizes the mean square error between the input speech signal and the synthesized speech. It can be shown (per the G.723.1 ITU specification) that the computation of MSE can be reduced to an equation whose “maximum” represents the best codebook entry to be selected:
where i is an index into codebook,
vi is the excitation vector at index i,
φ=HTH,
d=HTR,
R is the target vector signal, and
H is the impulse response of the synthesis filter 112 (
The quantity d represents the correlation between the target vector signal r and the impulse response H. The quantity d is defined by:
where FrmSz is the frame size, e.g., 59 frames, and
0≦j≦FrmSz.
The quantity φ represents the covariance matrix of the impulse response:
For each excitation vector vi, a metric MaxVali is computed. Each excitation vector therefore has an associated MaxVali. A minimum value of the metric is determined and the vector associated with that metric is deemed to be the entry that minimizes the mean square error.
The equation for d for a speech codec (coder/decoder) per the ITU (International Telecommunication Union) reference ‘C’ implementation is expressed as:
where RzBf is the residual excitation buffer (i.e. the target vector signal),
ImpRes is the impulse response buffer, and
pitch is a constant.
A typical scalar implementation of this expression is shown by the following C-language code fragment:
The ‘saturate( )’ function or some equivalent is commonly used to prevent overflow.
A line-by-line statistical profiling of a conventional adaptive codebook search algorithm indicates that the foregoing implementation for computing the correlation quantity d consumes about one third of the total processing time in a speech codec.
It was discovered that a decomposition of the expression:
can be produced that reduces the computational load for computing the correlation quantity. More specifically, it was discovered that a certain combination of matrix operations can be obtained which is readily implemented using a SIMD instruction set. Moreover, the instructions can be coded in a way that reduces the number of accesses between main memory and internal registers in a processing unit.
Referring now to
In accordance with the invention, the first four elements of F[ ] (F0–F3) can be expressed by the matrix operation shown in
Another constituent component of elements F4–F7 is intermediate vector F″[ ] which is determined by the operation shown in
As can be seen in
The matrix operations shown in
Every four elements in F[ ] (e.g., F4–F7, F8–F11, F12–F15, etc.) can be determined by computing every four elements of its constituent intermediate vectors, F′ and F″.
indicates that the index l begins at zero and increments by four. The index m begins at (n+3) and decrements by four. The summation stops when (m−6)≦0.
In accordance with various implementations of the embodiments of the present invention these operations are implemented in a computer processing architecture that supports a SIMD instruction set. A commonly provided instruction is the “multiply and accumulate” (MAC) instruction, which performs the operation of multiplying two operands and summing the product to a third operand. A generic MAC instruction might be:
MAC %1 %2 %3 , %3←%3+(%1×%2)
where %1, %2, and %3 are the register operands.
In a SIMD architecture, the MAC instruction performs the operation simultaneously on multiple sets of data. Typically, the registers used by a SIMD machine can store multiple data. For example, a 64-bit register (e.g., %1) can contain four 16-bit data (e.g., %10, %11, %12, and %13) to provide what will be referred to as “4-way parallel” SIMD architecture. Thus, execution of the foregoing MAC instruction would perform the following operations in a 4-way SIMD machine:
%30←%30+(%10×%20)
%31←%31+(%11×%21)
%32←%32+(%12×%22)
%33←%33+(%13×%23)
Typically, a SIMD instruction set comprises a full complement of instructions for all math and logical operations, and for memory load and store operations. Specific instruction formats will vary from one manufacturer of processing unit to another. However, the same ideas of parallel operations are common among them.
The processing in
In a step 404, the quad words contained in the register Rend are copied to an intermediate register 152e to produce the following intermediate quad words: (0, 0, 0, r0), (0, 0, r0, r1), (0, r0, r1, r2), and (r0, r1, r2, r3). Each intermediate quad word is combined in a MAC (multiply and accumulate) operation with another intermediate register 152f which contains the first four words (I1, I2, I3, I4) from the impulse response vector I[ ]. Thus, in a MAC operation (step 406a), the output for y0 is computed:
y0=0×I3+0×I23+0×I1+r0×I0.
Similarly in subsequent MAC operations (steps 406b–406d), the following are computed:
y1=0×I3+0×I23+r0×I1+r1×I0,
y2=0×I3+r0×I23+r1×I1+r2×I0,
y3=r0×I3+r1×I23+r2×I1+r3×I0.
The outputs of the MAC operations are stored in registers used by the SIMD engine 152 (
In a step 408, the contents of the registers containing the outputs y0–y3 are written to the output vector Ynxt[ ] in a memory area 154b in the memory component 154, pointed to by a pointer ptrYnxt which initially points to the beginning of the vector.
Next, various pointers are updated in a step 410 in preparation for the subsequent operations. The pointer ptrRend is incremented by four. A pointer ptrInxt is copied to ptrIcur. A pointer ptrRnxt is set to the beginning of R[ ]. The ptrYnxt is incremented by four.
Note that by setting the pointers ptrRend to the beginning of the vector R[ ] and ptrYnxt to the beginning of vector Ynxt[ ], the very first iteration through the foregoing steps produces the boundary condition computation shown in
The processing in
Next, in a step 414, the data (n3, n2, n1, n0) in the Inxt register 152b and the data (p3, p2, p1, p0) in another register Iprv 152c are manipulated to produce combinations of quad words stored in an intermediate register 152d, in preparation for a set of MAC operations (step 416). Thus, in a step 416a, a MAC operation between the Rnxt register 152a and the intermediate register 152d containing the packed quad-word (n0, p3, p2, p1) produces the output y0 defined as:
y0=r0×n0+r1×p3+r2×p2+r3×p3
Similar operations are performed in steps 416b–416d, to produce outputs y1–y3 respectively. The outputs y0–y3 are also registers used by the SIMD engine 152 (
Registers are updated in a step 420 in preparation to continue the inner sum operation. Thus, the contents of the Inxt register are copied to the Iprv register because in the next iteration the current contents of Inxt become the “previous” contents. Various pointers to the vectors in the memory 154 are updated. A pointer ptrRnxt is incremented by 4, as is the pointer ptrYnxt. A pointer ptrInxt is decremented by four.
A test is performed in a step 401 to determine if the lower limit of the impulse vector I[ ] is exceeded. Step 401 checks the pointer ptrInxt is decremented beyond this lower limit. The lower limit is defined in the generalized inner sum operation 304b (
Referring to
Similarly, the matrix operation shown in
The following assembly code fragment is provided merely to illustrate an example of an implementation of the processing shown in
It can be seen that the generalized form shown in
Conversely, if a SIMD architecture provides for 2-way parallelism, it can be appreciated that the matrix operations are nonetheless suited for 2-way parallel operations, albeit requiring two operations to perform. For example, operations using a 4×4 matrix (i.e.,
would require four MAC operations to compute on 4-way SIMD engine, the same product would require eight MAC operations to compute on a 2-way SIMD machine.
It is further noted that word size can determine the amount of parallelism attainable. Consider a 4-way SIMD, using 64-bit registers. A 16-bit data size results in a single MAC instruction per vector multiplication of a row in the matrix. However, an 8-bit data size would allow for two such multiplication operations to occur per MAC instruction. Conversely, a 32-bit data size would require two MAC instructions per matrix row.
It can be appreciated from the foregoing that varying degrees of parallelism and hence attainable performance gains can be achieved by a proper selection of SIMD parallelism and word size. The selection involves tradeoffs of available technology, system cost, performance goals such as speed, quality of synthesized speech, and the like. While such considerations may be particularly relevant to the specific implementation of the present invention, they are not germane to the invention itself.
The foregoing description of the present invention was presented using human speech as the source of analog signal being processed. It noted this is merely for convenience of explanation. It can be appreciated that any form of analog signal of bandwidth within the sampling capability of the system can be subject to the processing disclosed herein, and that the term “speech” can therefore be expanded to refer any such analog signals.
It can be further appreciated that the specific arrangement which has been described is merely illustrative of one implementation of an embodiment according to the principles of the invention. Numerous modifications may be made by those skilled in the art without departing from the true spirit and scope of the invention as set forth in the following claims.
| Number | Name | Date | Kind |
|---|---|---|---|
| 5031037 | Israelsen | Jul 1991 | A |
| 5327520 | Chen | Jul 1994 | A |
| 5530661 | Garbe et al. | Jun 1996 | A |
| 5717825 | Lamblin | Feb 1998 | A |
| 5892960 | Seide | Apr 1999 | A |
| 6161086 | Mukherjee et al. | Dec 2000 | A |
| 6314393 | Zheng et al. | Nov 2001 | B1 |
| 6766289 | Kandhadai et al. | Jul 2004 | B1 |
| Number | Date | Country |
|---|---|---|
| WO 9733236 | Sep 1997 | WO |
| Number | Date | Country | |
|---|---|---|---|
| 20040010406 A1 | Jan 2004 | US |