Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Vector Quantizers

Building Your Vector Quantizer Model

In the previous section, you created scalar quantizer encoders and decoders and used them to
quantize your residual signal and reflection coefficients. The bit rate of your scalar
quantization system was 64.4 kbits per second. This bit rate is higher than most modern
speech coders. To accommodate a greater number of users in each channel, you need to lower
this bit rate while maintaining the quality of your speech signal. You can use vector
quantizers, which exploit the correlations between each sample of a signal, to accomplish this
task.

In this topic, you modify your scalar quantization model so that you are using a split vector
quantizer to quantize your reflection coefficients:

1. Open a model similar to the one you created in Creating a Scalar Quantizer by typing
doc_vq_example1 at the MATLAB command prompt. The example model
doc_vq_example1 adds a new LSF Vector Quantization subsystem to the
doc_sq_example3 model. This subsystem is preconfigured to work as a vector
quantizer. You can use this subsystem to encode and decode your reflection
coefficients using the split vector quantization method.

2. Delete the SQ Encoder – Reflection Coefficients and SQ Decoder – Reflection


Coefficients blocks.

3. From the Simulink Sinks library,click-and-drag a Terminator block into your model.

4. From the Signal Processing Blockset Estimation > Linear Prediction library, click-
and-drag a LSF/LSP to LPC Conversion block and two LPC to/from RC blocks into
your model.

5. Connect the blocks as shown in the following figure. You do not need to connect
Terminator blocks to the P ports of the LPC to/from RC blocks. These ports disappear
once you set block parameters.
You have modified your model to include a subsystem capable of vector quantization. In the
next topic, you reset your model parameters to quantize your reflection coefficients using the
split vector quantization method.

 Back to Top

Configuring and Running Your Model

In the previous topic, you configured your scalar quantization model for vector quantization
by adding the LSF Vector Quantization subsystem. In this topic, you set your block
parameters and quantize your reflection coefficients using the split vector quantization
method.

1. If the model you created in Building Your Vector Quantizer Model is not open on
your desktop, you can open an equivalent model by typing doc_vq_example2 at the
MATLAB command prompt.

2. Double-click the LSF Vector Quantization subsystem, and then double-click the LSF
Split VQ subsystem.
The subsystem opens, and you see the three Vector Quantizer Encoder blocks used to
implement the split vector quantization method.

This subsystem divides each vector of 10 line spectral frequencies (LSFs), which
represent your reflection coefficients, into three LSF subvectors. Each of these
subvectors is sent to a separate vector quantizer. This method is called split vector
quantization.

3. Double-click the VQ of LSF: 1st subvector block.

The Block Parameters: VQ of LSF: 1st subvector dialog box opens.


The variable CB_lsf1to3_10bit is the codebook for the subvector that contains the
first three elements of the LSF vector. It is a 3-by-1024 matrix, where 3 is the number
of elements in each codeword and 1024 is the number of codewords in the codebook.
Because , it takes 10 bits to quantize this first subvector. Similarly, a 10-
bit vector quantizer is applied to the second and third subvectors, which contain
elements 4 to 6 and 7 to 10 of the LSF vector, respectively. Therefore, it takes 30 bits
to quantize all three subvectors.

Note   If you used the vector quantization method to quantize your reflection
coefficients, you would need 230 or 1.0737e9 codebook values to achieve the
same degree of accuracy as the split vector quantization method.

4. In your model file, double-click the Autocorrelation block and set the Maximum
non-negative lag (less than input length) parameter to 10. Click OK.

This parameter controls the number of linear polynomial coefficients (LPCs) that are
input to the split vector quantization method.
5. Double-click the LPC to/from RC block that is connected to the input of the LSF
Vector Quantization subsystem. Clear the Output normalized prediction error
power check box. Click OK.

6. Double-click the LSF/LSP to LPC Conversion block and set the Input parameter to
LSF in range (0 to pi). Click OK.

7. Double-click the LPC to/from RC block that is connected to the output of the
LSF/LSP to LPC Conversion block. Set the Type of conversion parameter to LPC to
RC, and clear the Output normalized prediction error power check box. Click OK.

8. At the MATLAB command prompt, type load lpcvocoder.

The codebook values for your vector quantizer are loaded into memory. You have
now configured the parameters of your vector quantizer model and are ready to
quantize your reflection coefficients.

9. Run your model.

10. Double-click the Original Signal and Processed Signal blocks to listen to both the
original and the processed signal.

There is no perceptible difference between the two. Quantizing your reflection


coefficients using a split vector quantization method produced good quality speech
without much distortion.

You have now used the split vector quantization method to quantize your reflection
coefficients. The vector quantizers in the LSF Vector Quantization subsystem use 30 bits to
quantize a frame containing 80 reflection coefficients. The bit rate of a quantization system is
calculated as (bits per frame)*(frame rate).

In this example, the bit rate is [(80 residual samples/frame)*(7 bits/sample) + (30
bits/frame)]*(100 frames/second), or 59 kbits per second. This is less than 64.4 kbits per
second, the bit rate of the scalar quantization system. However, the quality of the speech
signal did not degrade. If you want to further reduce the bit rate of your system, you can use
the vector quantization method to quantize the residual signal.

You might also like