Вы находитесь на странице: 1из 3

EECS 554

Homework 2

Due: 9/30

1 Quantization
1.1 A speech signal has a total duration of 10s. It is sampled at the rate of 8 KHz and
then quantized. The signal-to-(quantization) noise ratio is required to be 40 dB. Calculate
the minimum storage capacity needed to accommodate this digitized speech signal. For your
calculations you can model the speech signal as a sinusoidal signal.

1.2 Consider a nonuniform quantizer that is described as follows: The interval (−M, M )
is partitioned into intervals of length ∆1 , ∆2 , . . . , ∆N . This partition determines the decision
thresholds a0 = −M , a1 = −M + ∆1 , a2 = −M + ∆1 + ∆2 ,. . ., aN = M . The reconstruction
levels are the midpoints of each
∑Ninterval. The probability that the input signal amplitude lies
within each interval ∆i is pi ( i=1 pi = 1). Assume that within each interval the quantization
noise is uniformly distributed. Show ∑ that for the above quantizer the mean squared value of
1 N 2
the quantization error is given by 12 i=1 pi ∆i .

1.3 A 4-level quantizer is defined by

(a1 , a2 , a3 , a4 , a5 ) = (−∞, −2, 0, 2, ∞) (1)

and
(x̂1 , x̂2 , x̂3 , x̂4 ) = (−3, −1, 1, 3) (2)
(a) Write an explicit expression for the quantization noise x̃ = g(x) as a function of the
input amplitude x.
(b) Find an exact expression for the quantization noise power, and the output SQNR if
the input signal is modeled as a zero-mean, unit variance Gaussian random ∫variable.

Hint: You can express your results in terms of the Q-function, where Q(x) = x N (x; 0; 1)dx,
and N (·, m, σ 2 ) is the Gaussian pdf with mean m and variance σ 2 . Do not confuse
this Q(·) function with the end-to-end quantization function with the same
name.

1.4 Derive the Lloyd-Max conditions for a 2-dimensional vector quantizer

1.5 Consider a source with pdf


{
A , x ∈ [−1.1, −0.9] ∪ [0.9, 1.1] ∪ [2.5, 3.5]
fX (x) =
a , x ∈ [−3, 4] \ ([−1.1, −0.9] ∪ [0.9, 1.1] ∪ [2.5, 3.5]),
where we can assume that A >> a.
Give an example of a 1-bit (i.e., N = 2) scalar quantizer that satisfies the Lloyd-Max
conditions but is not optimal.

1
1.6 A differential pulse coded modulation (DPCM) scheme is a simple quantization scheme
with memory, whereby the differences x(kTs ) − x((k − 1)Ts ) of the signal x(t) are quantized.
The idea behind this “vector” quantizer is that consecutive samples are positively correlated,
and thus their differences are small. As a result, the dynamic range of the required scalar
quantizer for the differences is much smaller than when actual samples are quantized.

1. Show that this simple scheme cannot work in practice, due to the fact that noise accu-
mulates at the output of the receiver.

2. Show that this problem can be fixed by modifying the DPCM scheme so that it quantizes
the difference x(kTs ) − x̂((k − 1)Ts )

3. Draw a block diagram of the transmission and reception scheme for the modified DPCM
scheme.

1.7 A differential pulse coded modulation (DPCM) scheme is a simple quantization scheme
with memory, whereby the differences x(kTs ) − x((k − 1)Ts ) of the signal x(t) are quantized.
The idea behind this “vector” quantizer is that consecutive samples are positively correlated,
and thus their differences are small. As a result, the dynamic range of the required scalar
quantizer for the differences is much smaller than when actual samples are quantized.
The purpose of this problem is to develop an approximate SQNR expression for a DPCM
scheme. In particular, for a signal x(t) having bandwidth W and sampled at rate fs (sam-
ples/sec), we want an expression for SQNR as a function of the the oversampling factor
def
Q = fs /(2W ), and the number of bits per (difference) sample R for an appropriately designed
uniform quantizer. State your assumptions and approximations. Specialize the derived ex-
pression for x(t) = cos(2πW t). Plot SQNR (dB) as a function of R for different values of
Q.

1.8 The purpose of this problem is to experimentally evaluate the SQNR for a uniform
quantizer and a mu-law compander, thus confirming that the mu-law compander results in
better performance than a uniform quantizer.
You will first have to study the “Communications toolbox” help file of Matlab and in
particular the section on “source coding”, or just do help quantiz and help compand. We
will be using the functions quantiz(), and compand().
The first step is to build a prototype uniform quantizer which can be done as follows (start
with R=2 or 3 to see how it works, but then fix the value to 8.):
R=8;
N=2∧R;
xmax=4;
delta=2*xmax/N;
partition = delta*[-N/2+1:N/2-1]; %these are the quantiz. thresholds
codebook = [partition+0.5*delta];
codebook=[-codebook(end) codebook]; %these are the reconst. amplitudes
The next step is to generate M random Gaussian samples with zero mean and variance
2
σ . This can be done in Matlab using:
signal=randn(1,M)*sqrt(σ 2 );

2
Each of this samples is first companded, then quantized, then reproduced and then ex-
panded, to generate the signal “reproduced”. The mean squared error averaged over the M
samples is then evaluated (M has to be on the order 1,000 to 10,000 samples for accurate
results). This is accomplished by:
qerror=reproduced-signal;
sqnr=mean(signal.∧2)/mean(qerror.∧2);
sqnrdb=10*log10(sqnr);
The signal generation and quantization/reproduction step is repeated for different values
of the variance σ 2 , e.g., for 10 log10 (σ 2 ) = −60 dB to 0 dB, with resolution of 1 dB, which
is the same as saying for different signal powers.
The entire process is done twice: once with µ = 0.1 (which results essentially in a uniform
quantizer) and once with µ = 255. Plot the two SQNR (in dB) curves together versus σ 2 (in
dB). Comment on the behavior of these curves.

Вам также может понравиться