Lab4 Quantization
Lab4 Quantization
Faculty of Engineering
Beirut Arab University
Experiment 4
GENERAL RULES
If you open a VI and you are not asked to do any changes to it, then close it without saving
changes by clicking on “Defer decision”.
Save plots as [Student family name]_Question number.jpg. For questions with more than
one plot, append extra info to the name to differentiate between the plots.
A. UNIFORM QUANTIZATION
GetUniformParameters.VI
Gets the quantization values for a uniform quantizer.
QuantizeGeneric.VI
It quantizes a signal based on the passed from the previous
GetUniformParameters function.
SNRq.VI
Computes the quantization SNR in dB.
PlotQFunction.VI
Creates a plot of the quantization staircase function.
1
Q.2 What is the relation between the number of bits per sample and the number
of quantization levels?
On the Front Panel of “UniformExample.VI”, set the following parameters and run the VI.
Q.3 What is the resulting value of the SNR in dB? Compare with the theoretical
value.
Q.4 Calculate the difference between the resulting value of the SNR with the
value obtained in Q.17. Comment.
B. Optimal Quantization
In this part, you will compare optimal quantization to uniform quantization. The difference is in
specifying the quantization steps and their thresholds which are referred to as Parameters in the
experiment.
GetOptimalParameters.VI
Gets the quantization values for an optimal quantizer.
On the Front Panel of “UniformVSOptimal.VI”, set the following parameters:
Q.5 Why are the first and last quantization intervals smaller for the optimal
quantizer compared to the uniform quantizer?
2
Q.6 Note the difference between the two SNR values. Comment.
Change the Signal Type to Sinc Function and the Frequency to 5 kHz. Run the VI and note the
difference.
Q.8 Why is the gap between the optimal and uniform quantizers bigger with
Sinc Function compared to Sine Wave? Save a figure of the quantized
signal.
Change the Signal Type to Linear and examine the waveforms and the steps graphs.