Signals and Systems - Electrical Engineering

(avery) #1

444 CHAPTER 7: Sampling Theory


7.4.3 Sampling, Quantizing, and Coding with MATLAB


The conversion of an analog signal into a digital signal consists of three steps: sampling, quantization,
and coding. These are the three operations an ADC does. To illustrate them consider a sinusoid
x(t)=4 cos( 2 πt). Its sampling period, according to the Nyquist sampling rate condition, is

Ts≤π/max=0.5 sec/sample

as the maximum frequency ofx(t)ismax= 2 π. We letTs=0.01 (sec/sample) to obtain a sam-
pled signalxs(nTs)=4 cos( 2 πnTs)=4 cos( 2 πn/ 100 ), a discrete sinusoid of period 100. The following
script is used to get the sampledx[n] and the quantizedxq[n] signals and the quantization errorε[n]
(see Figure 7.13).

0 0.5 1

− 4

− 2

0

2

4

t (sec)

x(

t)

0 50 100

− 4

− 2

0

2

4

n

x[

n]

Sampled signal

(a) (b)

(c) (d)

0 50 100

− 4

− 2

0

2

4

Quantized signal

n

0 50 100

0

1

2

3

4

e[

n]

n

xq

[n
]

FIGURE 7.13
(a) Sinusoid, (b) sampled sinusoid usingTs=0.01, (c) quantized sinusoid using four levels, and (d) quantization
error.
Free download pdf