1. Field of the Invention
The present invention relates to a method of speech coding and decoding and a design of speech coder and decoder, more particularly to a method of speech coding and decoding and a design of speech coder and decoder that reduces the bit rate of the original speech from 64 Kbps to 1.6 Kbps.
2. Description of the Related Art
Basically, the main purpose of the digital speech coding is to digitize the speech, and appropriately compress and encode the digitized speech to lower the bit rate required for transmitting digital speech signals, reduce the bandwidth for signal transmission, and enhance the performance of the transmission circuit. Besides lowering the bit rate of the speech transmission, we also need to assure the compressed speech data received at the receiving end can be synthesized into the sound with reasonable speech quality. At present, various speech coding techniques invariably strive to lower the bit rate and improve the speech quality of the synthesized sound.
In the development of low bit rate encoder, the U.S. National Defense Department announced a new standard of 2.4 Kbps for the mixed excitation linear predictive (MELP) vocoder after the FS1016 CELP 4.8 Kbps and caused the trend of studying the decoder of 2.4 Kbps or lower. The inventor of the present invention studied the present 2.4 Kbps standard such as the LPC10 and the mixed excitation linear predictive vocoder, and then developed a 1.6 kbps speech compression method. The implementation of speech technology by hardware is the key to the commercialization of the speech product that makes the speech technology as part of our life. The present invention completes the design of the hardware structure of the 1.6 kbps vocoder by the ASIC architecture with an execution speed faster than the digital signal processor, and fits the system requiring fast computation speed such as the multiple-line coder, and its cost is also lower than the digital signal processor.
The primary objective of the present invention is to provide a speech encoding method to lower the bit rate of the original speech from 64 Kbps to 1.6 Kbps in order to decrease the bit rate for transmitting the digital speech signal, reduce the bandwidth for transmitting the signal, and increase the performance of the transmission circuit.
The secondary objective of the present invention is to provide a speech coding method to assure that the compressed speech data can have reasonable speech quality.
Another objective of the present invention is to complete the hardware structure of the speech coder and decoder by the application specific integrated circuit (ASIC) design with an execution speed faster than the digital signal processor that suits the system requiring fast computation speed such as the multiple line coding, and its cost is also lower than the digital signal processor.
To accomplish the foregoing objectives, the present invention discloses a speech coding method to sample the speech signal by 8 KHz and divide the speech signal into several frames as the unit of the coding parameter transmission, wherein a frame sends out a total of 48 bits, the size of each frame is 240 points, and the bit rate is 1.6 Kbps. The coding parameters include a Line Spectrum Pair (LSP), a gain parameter, sound/soundless determination parameter, pitch cycle parameter, an 1-bit synchronized bit; wherein the method of finding the LSP is to pre-process the speech of the frame by Hamming Window, and find its autocorrelation coefficient for the linear predictive analysis to find the linear predictive coefficients with the scale from one to ten, and then convert them into the linear spectrum pair (LSP) parameters; the gain parameter uses the linear predictive analysis to find the autocorrelation coefficient and the linear predictive coefficient; the sound/soundless determination coefficient uses the zero crossing rate, energy, and the first level of linear predictive as the overall determination; the method of finding the pitch cycle parameter comprises the following steps:
In addition, each frame is divided into 4 sub-frames at the decoding end, and the ten-scale linear predictive coefficient of each synthesized sub-frame is the interpolation between the linear spectrum pair parameter after quantizing the current frame and the quantized value of the linear spectrum pair parameter of the previous frame. The solution can be obtained by reversing the process. Furthermore, if the excitation source has sound, then the mixed excitation is adopted and composed of the impulse train generated by the pitch cycle and the random noises; if the excitation source has no sound, then only the random noise is used for the representation; moreover, after the excitation source with sound or without sound is generated, the excitation source must pass through a smooth filter to improve the smoothness of the excitation source; finally, the ten-scale linear predictive coefficient is multiplied by the past 10 synthesized speech signals and added to the foregoing speech excitation source signal and gain to obtain the synthesized speech corresponsive to the current speech excitation source signal.
Furthermore, the present invention discloses a speech coder/decoder to work with the foregoing method, which is designed with the application specific integrated circuit (ASIC) architecture, wherein the coding end comprises: a Hamming window processing unit for pre-processing the speech of each frame by the Hamming Window; an autocorrelation operating unit for finding the autocorrelation coefficient of the previously processed speech; a linear predictive coefficient capturing unit for performing the linear predictive analysis on the foregoing autocorrelation coefficient to find the ten-scale linear predictive coefficient and quanitize the coding; a gain capturing unit, using the foregoing autocorrelation coefficient and the linear predictive coefficient to find the gain parameter; a pitch cycle capturing unit, using the foregoing frame to find the pitch cycle, and a sound/soundless determining unit, using the zero crossing rate, energy, and the scale-one coefficient pf the foregoing linear predictive coefficient to determine whether such speech signal is with sound or without sound.
The decoding end comprises an impulse train generator for receiving the foregoing pitch cycle to generate an impulse train; a first random noise generator for generating a random noise, and when the sound/soundless determining unit determines the signal as one with sound, then the random noise and the impulse train are sent to an adder to generate an excitation source; a second random noise generator for generating a random noise, and when the sound/soundless determining unit determines the signal as one without sound, then the random noise is used to represent the excitation source directly; a linear spectrum pair parameter interpolation (LSP Interpolation) unit for receiving the foregoing linear spectrum pair parameter, and interpolating the weighted index between the linear spectrum pair parameter after quantizing the current frame and the quantized value of the linear spectrum pair parameter of the previous frame; a linear spectrum pair parameter to the linear predictive coefficient filter (LSP to LPC) for using the linear spectrum parameter after the foregoing interpolation to find the ten-scale linear predictive coefficient for each synthesized frame; a synthetic filter for multiplying the foregoing ten-scale linear predictive coefficient with the 10 speech signals and adding it to the foregoing speech excitation source and the gain to obtain the synthesized speech corresponsive to the current speech excitation source.
To make it easier for our examiner to understand the objective of the invention, its structure, innovative features, and performance, we use preferred embodiments together with the attached drawings for the detailed description of the invention.
Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiments with reference to the accompanying drawings, in which:
To fully disclose the present invention, the following preferred embodiments accompanied with the drawings are used for the detailed description of the present invention. The present invention is designed by application specific integrated circuit (ASIC) architecture, sampling the speech signal with 8 KHz, and dividing the sampled speech signal into several frames as the transmission unit of coding parameter, and the size of each frame is 30 ms (240 sample points); wherein the illustrative diagram of the coding end as shown in
The coding method of the present invention is to pre-process the speech of each frame by the Hamming Window, and use it to find the autocorrelation coefficient for the linear predictive analysis and the ten-scale linear predictive coefficient, and then convert said coefficient into Line Spectrum Pair (LSP), which is different from the LPC-10 Reflection Coefficients. Its physical significance is when the speech is fully opened or fully closed, the spectrograph forms a pair of linear lines close to the position where the resonant frequencies occur; the LSP occur in the interlacing manner, and its value falls between 0 and π, therefore the linear spectrum pair coefficient has good stability. In addition, the LSP has the features of quantization and interpolation to lower the bit rate, and thus we can convert the ten-scale linear predictive coefficient into the linear spectrum pair coefficient, and quantize the LSP parameter for coding.
Besides the linear spectrum pair parameter, this method also needs to transmit the speech parameters such as the gain, sound/soundless determination, and pitch cycle as described below:
(1) Gain
The gain can use the linear predictive analysis to find the autocorrelation coefficient and the linear predictive coefficient, and its formula is given below:
Where, G is the gain, R(k) is the autocorrelation coefficient, α(k) is the linear predictive coefficient, and n is the number of linear predictive scale.
(2) Determination of Speech With Sound or Without Sound
Each frame needs to be determined as with sound or without sound, and such determination is to select different excitation source. If the frame is with sound, then select the excitation source with sound; if the frame is without sound, then select the excitation source without sound. Therefore the determination of speech with sound or without sound is very important, otherwise if such determination is wrong, then the excitation source will be determined wrong accordingly and the speech quality will also drop. There are many methods for determining the speech with sound or without sound, and the present invention uses three common methods, and they are described as follows:
If the zero crossing rate is high, then it means that the speech in such section is without sound; if the zero crossing rate is low, then it means that the speech in such section is with sound, because the speech without sound is the energy of friction sound that gathers at the 3 KHz or above, and thus the zero crossing rate tends to be high.
If the energy is large, then it means that the speech is with sound; if the energy is small, then it means that the speech is without sound, and the energy has been found when calculating the autocorrelation R(0).
If any two of the aforementioned 3 methods determines the sound is with sound, then the frame is a speech with sound, or else a speech without sound.
(3) Pitch
The algorithm for finding pitch cycle is described as follow:
The structural diagram at the decoding end is shown in
In the decoding method of the present invention, the linear predictive coefficient parameter of the synthesized sub-frame is interpolated between the linear spectrum pair parameter of the current quantized frame and the linear spectrum pair parameter of the previous quantized frame. The solution can be found by reversing the process. Refer to the following table for the weighted index of the interpolation.
If the excitation source is with sound, then the mixed excitation is adopted and composed of the impulse train generated by the pitch cycle plus the random noise. The purpose of the mixed excitation is to appropriately add some random noises to the excitation source in order to simulate more possible speech characteristics to produce various speeches with sound, avoid the feeling of traditional linear predictive analysis mechanical sound and annoying noise, improve the natural feeling of the synthesized speech, and enhance the speech quality of the sound, which the traditional LPA lacks the most. If the speech is without sound, then only the random noise is used for the representation.
Furthermore, this method adds the following two strategies for enhancing the synthesized speech quality:
(1) Excitation Source Smooth Filter
The excitation source smooth filter enables the decoding end to have a better speech excitation source.
The issue of continuity between frames must be taken into consideration, and the processing method is to record the size of the remaining points of the previous frame, and generate the impulse train of the excitation from the current frame by the remaining point plus the pitch cycle of the current frame. For example, if the pitch cycle of the current frame is 50, the remaining point will be 40. If the pitch cycle of the current frame is 75, then the starting point of the current frame to generate the impulse train is changed to 35 to enhance the continuity between the frames as shown in
Since the coding method of the present invention does not employ the reflection coefficient but use the linear spectrum pair parameter instead, therefore it can save the number of bits. The bit allocation takes 34 bits to transmit the ten-scale linear spectrum parameter per frame, 1 bit for the determination of the speech with sound or without sound, 7 bits for the pitch cycle, 5 bits for the gain, 1 bit for the synchronized bit, and thus each frame transmits a total of 48 bits per frame. The size of each frame is 240 points, and the bit rate is 1.6 Kbps.
The following focuses on the autocorrelation operation, linear predictive coefficient capturing, linear spectrum pair parameter capturing, gain capturing, and pitch cycle capturing adopted by the coding method. Their operations are analyzed first, and then the design of their hardware structure is proposed according to the formula for the computation.
[Design of Hardware Structure of Autocorrelation Computation]
The number of computations for the autocorrelation computation is the largest among all methods of calculating the speech parameter. Taking the ten-scale autocorrelation computation for example, it requires 11 computations to calculate from R0 to R10. Taking R0 for example, it requires 240 multiplications and 239 additions; R1 requires 239 multiplication and 238 additions, and so forth, R11 requires 230 multiplications and 229 additions. If control ROM is used to control the multiplication and addition and save the results in the registers, the number of control words is 5159, which is too large and too inefficient.
Since the autocorrelation algorithm has a fixed cycle, therefore the present invention proposes a solution by finite status machine, the finite status machine is directly used to send control signal to the data path. An autocorrelation computation of a frame with 240 points is taken for example:
Regardless of the scale, the condition for its termination is when x(m+k)=x(239) in the Equation (1.1). We use two sets of address counters c1 and c2 in the circuit to represent the values of x(m) and x(m+k) respectively, and the calculation of the range of c1 and c2 for each scale is distributed as shown in
Divide the autocorrelation into 6 states, which are described as follows:
S1: Load R1
S2: Load R2
S3: Load R4 (execute R1×R2)
S4: Load R3
S5: Execute R3+R4
S6: If (c2=239), End of calculation R(0 . . . 10) and store the value,
Else c2=c2+1,c1=c1+1
There are two sets of address counters c1 and c2 in the control unit to generate the x(m) and x(m+k) addresses. If the state of the finite status machine is 6, the control unit will determine if c2 is 239 to end the multiplication and addition of a certain scale for the autocorrelation. The autocorrelation computation is a data path composed of multiplication and addition, therefore after a multiplier completes a multiplication, the adder immediately accumulates the product, and the accumulation register will store the computed autocorrelation value and regulate the autocorrelation value below 16384 through the barrel shifter.
[Design of Hardware Structure of Linear Predictive Coefficient Capturing]
Immediately after the autocorrelation coefficient is found, we will use Durbin algorithm to find the linear predictive coefficient as follows:
E
(0)
=R(0)
αi(i)=Ki
αj(i)=αj(i−1)−Kiαi−j(i−1)1≦j≦i−1
E(i)=(1−Ki2)E(i−1))
αj=αj(p) 1≦j≦p
Where,
There are three loops in the Durbin algorithm of the present invention, which are derived into instruction by instruction, and the microinstruction set is used to control the data path for the computation of capturing the linear predictive coefficient. For example, i=5, the expanded algorithm is shown in
For example, the whole process of using 5.0 to divide 3.0 as the algorithm of the computation is shown in
[Design of Hardware Structure of Linear Spectrum Pair Parameter Capturing]
The method of converting the linear predictive coefficient into the linear spectrum pair parameter is described first. The physical significance of the linear spectrum pair parameter stands for the spectrum pair parameter polynomials P(z) and Q(z) provided the sound track is fully opened or fully closed. These two polynomials are linearly correlated, which can be well used for the linear interpolation during decoding in order to lower the bit rate of the coding. Thus, it is widely used in various speech coders.
P(z)=An(z)+z−(n+1)An(z−1) (2.1)
Q(z)=An(z)−z−(n+1)An(z−1) (2.2)
Equations (2.1) and (2.2) are further derived into:
P(x)=16x5+8p1x4+(4p2−20)x3−(8p1−2p3)x2+(p4−3p2+5)x+(p1−p3+p5) (2.3)
Q(x)=16x5+8q1x4+(4q2−20)x3−(8q1−2q3)x2+(q4−3q2+5)x+(q1−q3+q5) (2.4)
Where
x=cosω
p1=a1+a10−1
p2=a2+a9−p1
p3=a3+a8−p2
p4=a4+a7−p3
p5=a5+a6−p4
q1=a1−a10+1
q2=a2−a9+q1
q3=a3−a8+q2
q4=a4−a7+q3
q5=a5−a6+q4 (2.5)
a10, a9, a8, . . . ,a1 are the ten-scale linear predictive parameters; the roots of P(x) and Q(x) are the linear spectrum pair parameters.
Equations (2.3) and (2.4) can be divided by 16 without affecting the roots.
P′(x)=x5+g1x4+g2x3+g3x2+g4x+g5 (2.6)
Q′(x)=x5+h1x4+h2x3+h3x2+h4x+h5 (2.7)
To improve the accuracy and reduce the number of computations, Equations (2.6) and (2.7) can be changed into the nested form:
P′(x)=((((x+g1)x+g2)x+g3)x+g4)x+g5 (2.8)
Q′(x)=((((x+h1)x+h2)x+h3)x+h4)x+h5 (2.9)
In Equation (2.6), it takes 15 multiplications and 5 additions, and Equation (2.8) only takes 4 multiplication and 5 additions, which reduces the number of multiplication and greatly improves its accuracy. The g1˜g5 and h1˜h5 in Equations (2.8) and (2.9) can be converted from the following equations.
g5=0.03125*P5−0.0625*P3+0.0625*P1
g4=0.0625*P4−0.1875*P2+0.3125
g3=0.125*P3−0.5*P1
g2=0.25*P2−1.25
g1=0.5*P1
h5=0.03125*Q5−0.0625*Q3+0.0625*Q1
h4=0.0625*Q4−0.1875*Q2+0.3125
h3=0.125*Q3−0.5*Q1
h2=0.25*Q2−1.25
h1=0.5*Q1
The index value of the linear spectrum pair parameter of each level is stored in the Look Up Table (LUT). Before solving the equations, we must compute the coefficients g1˜g5 and h1˜h5 of the polynomials and save these values into the RAM first. Solving the LSP is actually finding the roots. We use the Newton's root to solve the roots, that is when P(a)P(b)<0, a root of P(x) exist between a and b. Therefore, in the structure, we need to compare the circuit to determine the positive and negative sign of the P(a)P(b), since P(a) and P(b) are two complementary numbers, therefore comparing the circuit with an exclusive OR gate can solve the problem.
The start and end of the whole computation is controlled by the linear spectrum pair parameter of the finite status machine (LSP_FSM). The purpose of the LSP_FSM relies on sending a signal to notice the LSP_FSM that the currently desired root is found when the comparison of the circuit has found that root, and execute the operation of saving the index, and then continue to find the LSP index for the next scale until all 10 scales of the linear spectrum pair are found. Therefore, the LSP_FSM is used to control the computation of a sequence of linear spectrum pair indexes. In addition, the controller will follow the instruction given by the LSP_FSM to control the look up table (LUT) and send the values to the register (REG) or the content of register file is stored into the register, and control the operation of other computation units.
[Design of Hardware Structure of Gain Capturing]
Refer to Equation (3.1) for the operation of gain. Since there is a square root sign in Equation (3.1), therefore it is modified to Equation (3.2) to avoid additional circuit design of the square root sign, so that the computation only needs the mathematical operations of addition, subtraction, and multiplication. The structure of the circuit architecture is shown in
[Design of Hardware Structure of Pitch Cycle Capturing]
To simplify the hardware design, we simplify the pitch cycle capturing method as follows:
The 48 bits generated after coding of the present invention are saved into the register composed by a group of 48 bits, and the sequence of storing the data follows the parameter capturing sequence to arrange the index values of the ten-scale linear spectrum pair parameters in the 0th to 33rd registers, the gain index values in the 34th to 38th registers, the sound/soundless bit in the 39th bit, the pitch cycles in the 40th to 46th registers, and the 48th bit is reserved for expansion.
In summation of the above description, the present invention herein enhances the performance of the speech coding/decoding method and speech coder/decoder than the conventional method and structure and further complies with the patent application requirements and is submitted to the Patent and Trademark Office for review and granting of the commensurate patent rights.
While the present invention has been described in connection with what is considered the most practical and preferred embodiments, it is understood that this invention is not limited to the disclosed embodiments but is intended to cover various arrangements included within the spirit and scope of the broadest interpretations and equivalent arrangements.
Number | Date | Country | Kind |
---|---|---|---|
90132449 A | Dec 2001 | TW | national |
Number | Name | Date | Kind |
---|---|---|---|
5426718 | Funaki et al. | Jun 1995 | A |
5528723 | Gerson et al. | Jun 1996 | A |
5673361 | Ireton | Sep 1997 | A |
5774837 | Yeldener et al. | Jun 1998 | A |
5826226 | Ozawa | Oct 1998 | A |
5832180 | Nomura | Nov 1998 | A |
5864796 | Inoue et al. | Jan 1999 | A |
6012023 | Iijima et al. | Jan 2000 | A |
6047253 | Nishiguchi et al. | Apr 2000 | A |
6260010 | Gao et al. | Jul 2001 | B1 |
6311154 | Gersho et al. | Oct 2001 | B1 |
RE38269 | Liu | Oct 2003 | E |
6963833 | Singhal et al. | Nov 2005 | B1 |
Number | Date | Country | |
---|---|---|---|
20030139923 A1 | Jul 2003 | US |