You are on page 1of 1

Digital Communication: UE17EC352

VI Sem ECE, PESU: Jan-May 2020

Experiment-1: Quantization
22-01-2020

NOTE: Do not use the quantiz function of MATLAB.

Steps:

1. Write a function for quantizing a given signal and finding the SNR.
The function takes the signal vector x and the peak value A as inputs.
Perform the following steps for number of bits N from 1 to 8:
2A
(a) Find ∆ = 2N
.
∆ ∆
(b) Find the set of representation values: {−A + 2
:∆:A− 2
}.
(c) Obtain the quantized signal xq by approximating the x values with
the nearest representation value. (You can do this efficiently by
using the round instruction).
(d) Find the SNR. You can use 20*log10(norm(x)/(norm(x-xq)))

2. Let X be a uniform r.v over the range [−10, 10]. Generate 10000 re-
alizations and quantize them. Plot SNR vs. N . (Note that rand in
MATLAB returns uniform r.v values over [0, 1]. You need to scale and
shift appropriately to obtain the required range).

3. Repeat the above step for gaussian r.v with mean 0 and variance 1.
Select A = 4. Plot the SNR vs. N and compare with the uniform case.

You might also like