0% found this document useful (0 votes)
30 views102 pages

Ch4 Sampling of Continuous-Time Signals-2023

Uploaded by

Majd Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views102 pages

Ch4 Sampling of Continuous-Time Signals-2023

Uploaded by

Majd Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 102

Chap 4

Sampling of Continuous-Time Signals


Introduction
 4.1 Periodic Sampling
 4.2 Frequency-Domain Representation of Sampling
 4.3 Reconstruction of a Bandlimited Signal from its Samples
 4.4 Discrete-Time Processing of Continuous-Time Signals
 4.5 Continuous-Time Processing of Discrete-Time Signals
 4.6 Changing the Sampling Rate Using Discrete-Time Processing
 4.7 Multirate Signal Processing
 4.8 Digital Processing of Analog Signals
 4.9 Oversampling and Noise Shaping in A/D and D/A Conversion

2023/9/23 DSP 2
Periodic Sampling
 Sequence of samples x[n] is obtained from a continuous-time signal xc(t) :
 x[n] = xc(nT), - infinity < n < infinity
 T : sampling period
 fs = 1/T : sampling frequency, samples/second

C/D
Continuous-to-discrete-time
Xc(t) converter X[n] = Xc(nT)

T
 In a practical setting, the operation of sampling is often implemented by an analog-to-digital
(A/D) converter which can be approximated to the ideal C/D converter.
 The sampling operation is generally not invertible.
 The inherent ambiguity in sampling is of primary concern in signal processing.

2023/9/23 DSP 3
Sampling with a Periodic Impulse Train
s(t) C/D Converter
Conversion from
X
impulse train x[n] = xC(nT)
xC(t) xS(t) to discrete-time
sequence
xC(t) xC(t)
xS(t) 2 Sampling Rates xS(t)

-4T 0 2T -4T 0 2T

x[n] 2 Output Sequences x[n]

-4 0 2 -4 0 2

2023/9/23 DSP 4
Frequency-domain representation of sampling
 The conversion of xc(t) to xs(t) through modulating signal s(t) which is a
periodic impulse train

s (t )    (t  nT )
n  

xs (t )  xc (t ) s (t )  xc (t )   (t  nT )
n  

by shifting property of the impulse



xs (t )   x (nT )(t  nT )
n 
c

 The Fourier transform of a periodic impulse train is a periodic impulse train.


2 
{s (t )}  S ( j) 
T
  (  k
k  
s )

where  s  2 / T : sampling frequency in radians/sec

2023/9/23 DSP 5
Frequency-domain representation of sampling
 Time domain sampling xs (t )  xc (t ) s=>
(t ) Frequency domain Convolution
1 1 2 
X s ( j ) 
2
X c ( j )  S ( j ) 
2
X c ( j ) 
T
  (  k )
k  
s

1 
  X c ( j  kj s )
T k  

 xc(t) can be recovered from xs(t) with an ideal lowpass filter with frequency response Hr(j ).
 Xr(j ) = Hr(j )Xs(j ) where  s > 2  N

 If Hr(j ) is an ideal lowpass filter with gain T and cutoff frequency such that
  N<  c < ( s -  N) then Xr(j ) = Xc(j )

 ALIASING is the distortion in reconstruction process due to  s


 2N

2023/9/23 DSP 6
Nyquist Sampling Theorem

2023/9/23 DSP 7
Harry Nyquist Claude Elwood Shannon
(February 7, 1889 – April 4, (April 30, 1916 – February 24, 2001)
1976) was an important was an American mathematician,
contributor to communication electronic engineer, and
theory. cryptographer known as "the father
of information theory".
Effect in the frequency domain of sampling
in the time domain
XC(j)
1
Spectrum of the original

-N N
S(j)
Spectrum of the sampling function
2/T

-S 0 S
XS(j) S = 2N Aliasing Effect
S > 2N S < 2N

-S -N N S Spectrum of the sampled signal

2023/9/23 DSP 9
2023/9/23 DSP 10
Example 4.1
 If we sample the continuous-time signal
xc (t )  cos(4000 t )
with a sampling period T=1/6000
 In this case, s  2 / T  12000
 The conditions of the Nyquist sampling theorem are satisfied.
 The Fourier transform of xc(t) is

X c ( j)   (  4000 )   (  4000 )

2023/9/23 DSP 11
Figure 4.6 (a) Continuous-time and (b) discrete-time Fourier
transforms for sampled cosine signal with frequency
Ω0 = 4000π and sampling period T = 1/6000.
Relation between Continuous and Discrete-
Time Domains

2023/9/23 DSP 13
Relation between Continuous and Discrete-Time
Domains

2023/9/23 DSP 14
Relation between Continuous and
Discrete-Time Domains

2023/9/23 DSP 15
Aliasing

2023/9/23 DSP 16
Frequency-domain representation of sampling 3

 The discrete Fourier transform of the sequence x[n] is



j
X (e )   x [
n 
n ]e  jn

where x[n] = xc(nT). But


 
X s ( j)  {xs (t )}  {  xc (nT ) (t  nT )}  x
n  
c ( nT )e  jTn
n  

so

1
j
Xs ( j)  X (e )| T  X (e jT
)
T
 X ( j  jk )
k 
c s

or

1   2 k
X (e )   Xc ( j  j
j
)
T k  T T

2023/9/23 DSP 17
2023/9/23 DSP 18
Reconstruction of a Bandlimited Signal from its samples
 Samples of a continuous-time bandlimited signal taken frequently enough are
sufficient to represent the signal exactly in the sense that the signal can be
recovered from the samples and from the knowledge of the sampling period.
 If Hr(j W) has gain T and cutoff frequency pi/T then

sin ( t / T )
hr (t ) 
and t / T
 
sin[ (t  nT ) / T ]
xr (t )   x[n]hr (t  nT ) 
n 

n 
x[ n ]
(t  nT ) / T
This means that the ideal lowpass filter interpolates between the impulses of xs(t)
to construct a continuous-time signal xr(t).

Xr ( j)   x[n]H ( j)e
n 
r
 jTn
 Hr ( j) X (e jT )

2023/9/23 DSP 19
Block diagram, frequency response, and impulse response of an
ideal bandlimited signal reconstruction system

Ideal reconstruction system

Convert the x (t) Ideal


S
sequence to reconstruction
x[n] impulse train filter Hr(j) x r (t)

Sampling period T

H r(j) h r(t)
1
T

t
-/T /T  -3T -T 0 T 3T

2023/9/23 DSP 20
2023/9/23 DSP 21
Ideal bandlimited interpolation

2023/9/23 DSP 22
Discrete-time processing of continuous-time
signal

2023/9/23 DSP 23
Discrete-Time Processing of Continuous-Time Signals 2
 C/D converter produces a discrete-time signal
x[ n]  xc ( nT )
1 
 2 k
j
X (e ) 
T

k 
Xc ( j
T
 j
T
)

 Linear Time-Invariant Discrete-Time Systems

y[n]  h(n)  x[n]


Y(ej) = H(ej) X(ej)
 D/C converter creates a continuous-time output signal

sin[  (t  nT ) / T ]
yr (t )  y[n]  hr [t ]   y[n]
n    (t  nT ) / T
Yr ( j)  H r ( j)Y (e jT )

2023/9/23 DSP 24
2023/9/23 DSP 25
Example of Ideal Continuous-Time Lowpass Filtering Using a
Discrete-Time Lowpass Filter

a) Fourier transform of a bandlimited


input signal
b) Fourier transform of the sampled input
c) Discrete-time Fourier transform of
sequence of samples and frequency
response of the discrete-time system
d) Fourier transform of output of the
discrete-time system
e) Fourier transform of output of the
discrete-time system and frequency
response of ideal reconstruction filter
f) Fourier transform of output

2023/9/23 DSP 26
Discrete-Time Processing of
Continuous-Time Signals
Example 4.4 Discrete-Time Implementation of an Ideal
Continuous-Time Bandlimited Differentiator
d
 eq. 4.43 yc (t )   xc (t ) 
dt

 eq. 4.44  H c ( j )  j 
Discrete-Time Processing of
Continuous-Time Signals

 j,   /T
 eq.4.45 H eff ( j)  

0,   /T
j
 eq. 4.46  j
H (e )  ,  
T
0, n0

 eq. 4.47  h  n   cos  n
 , n0
 nT
Figure 4.13 (a) Frequency response of a continuous-time ideal bandlimited
differentiator Hc (jΩ) = jΩ, |Ω| < π/T.
(b) Frequency response of a discrete-time filter to implement a continuous-time
bandlimited differentiator.
Discrete-Time Processing of Continuous-Time Signals:
Impulse Invariance
 The LTI behavior of the system depends on 2 factors:
discrete-time system must be linear and time-invariant
input signal must be bandlimited and the sampling rate must be high enough
so that any aliased components are removed by the discrete-time system

 Discrete-time system is said to be an impulse-invariant version of the


continuous-time system when
h[n] = Thc(nT)
and H(ej) = Hc(j/T), || < and = 

2023/9/23 DSP 30
Impulse Invariance
Figure 4.14 (a) Continuous-time LTI system. (b) Equivalent system for
bandlimited inputs.

31
Impulse Invariance

 eq. 4.48  H (e j
)  Hc ( j / T ),   

 eq. 4.49 Hc ( j)  0,   /T

 eq. 4.50 h n  Thc (nT )

32
Impulse Invariance
From sampling depicted in Eq. (4.16)

 eq. 4.51 h n  hc (nT )


1     2 k  
 eq. 4.52  H (e )   H c  j  
j

T k    T T 
1  
 eq. 4.53 j
H (e )  H c  j  ,   
T  T
Modifying Eqs (4.51) and (4.53) to account for the scale factor
of T, we have

 eq. 4.54 h n  Thc (nT )


 
 eq. 4.55 j
H (e )  H c  j  ,   
 T
33
Impulse Invariance
Example 4.5 A Discrete-time Lowpass Filter obtained by Impulse
Invariance
1,   c
H c ( j )  
0,   c

sin(c t )
hc (t ) 
t

sin(c nT ) sin( c n)
h  n   Thc (nT )  T 
 nT n

j
1,    c
H (e )  
0,  c    
34
Continuous-Time Processing of Discrete-Time Signals

2023/9/23 DSP 35
2023/9/23 DSP 36
Continuous-Time Processing of Discrete-Time Signals
 For ideal D/C : Xc(jW) and Yc(jW) are zero for |  |  / T
 We can express D/C as follows.

sin[ (t  nT ) / T ]
x c ( t )   x[ n ]
n   (t  nT ) / T

sin[ (t  nT ) / T ]
yc (t )  
n  
y[ n]
(t  nT ) / T
where x[n] = xc(nT) and y[n] = yc(nT) , and frequency-domain :
Xc ( j)  TX ( e jT ),...........    / T
Yc ( j)  Hc ( j) Xc ( j),....    / T
1
Y ( e j )  Yc ( j / T ),..........   
T
Overall system behaves as a discrete-time system whose
H(e j )  Hc ( j / T ),......   
and if frequency response of continuous-time system is
Hc ( j)  H(e jT ),........    / T

2023/9/23 DSP 37
Continuous-Time Processing
of Discrete-Time Signals
Example 4.7 Noninteger Delay

 eq. 4.61 H ( e j
)  e  j
,  

 eq. 4.62  y n  x n   

 eq. 4.63 H c ( j)  H (e jT )  e  jT 

 eq. 4.64  yc (t )  xc (t  T )
Continuous-Time Processing of
Discrete-Time Signals

 eq. 4.65 y  n   yc (nT )  xc (nT  T  )


 sin  (t  T   kT ) / T 
  x k 
k   (t  T   kT ) / T t  nT

sin  (n  k   )
  x k 
k   (n  k  )
Figure 4.16 (a) Continuous-time processing of the discrete-time sequence (b)
can produce a new sequence with a “half-sample” delay.
Example 4.8

2023/9/23 DSP 41
Example 4.8

1 sin  ( M  1) / 2  j M / 2
 eq. 4.66  j
H (e )  e ,  
( M  1) sin( / 2)

If M is an even integer, then the linear-phase term


corresponds to an integer delay

 eq. 4.67 y n   n  M / 2


Figure 4.18 Illustration of moving-average filtering. (a) Input signal x[n] =
cos(0.25πn). (b) Corresponding output of six-point moving-average filter.
Changing The Sampling Rate Using Discrete-Time
Processing
 Sampling Rate Reduction by an Integer Factor
 Increasing the Sampling Rate by an Integer Factor
 Changing the Sampling Rate by a Noninteger Factor

 Sampling Rate Reduction  Increase period


 Decrease frequency

2023/9/23 DSP 44
Sampling Rate Reduction by an Integer Factor
 Sampling Rate Reduction by an Integer Factor
xd[n] = x[nM] = xc(nMT)
system called Sampling Rate Compressor or Compressor
operation called Downsampling
 xd[n] is an exact representation of xc(t) if p/(MT) > WN
 sampling rate can be reduced by a factor of M without aliasing if the original sampling rate
was at least M times the Nyquist rate or if the bandwidth of the sequence is first reduced
by a factor of M by discrete-time filtering
 Fourier transform of discrete-time sampled sequence xd[n] is
1   2 r
j
Xd ( e )  
MT r 
Xc ( j
MT
j
MT
)

where r = i+kM, -infinity < k < infinity and 0 < and = i < and = M-1
1 M 1
j
X d (e )   X (e j ( / M 2i / M ) ) (4.77)
M i 0
 Lowpass filter+Compressor = Decimator
2023/9/23 DSP 45
2023/9/23 DSP 46
2023/9/23 DSP 47
General system for sampling rate reduction
by integer factor M

x[n] Lowpass filter x~[n] xd~[n] = x~[nM]


Gain = 1 M
Cutoff = /M

Sampling Sampling Sampling


period T period T period T’ = MT

2023/9/23 DSP 48
Sampling rate reduction by 2

2023/9/23 DSP 49
Downsampling with aliasing (a to c) and with prefiltering to
avoid aliasing (d to f)

2023/9/23 DSP 50
Increasing the Sampling Rate by an Integer Factor

 Increasing the Sampling Rate by an Integer Factor


xi[n] = x[n/L] = xc(nT/L), n = 0, ±L, ± 2L, ...

 system called Sampling Rate Expander or Expander


 operation called Upsampling or Interpolation

xe [ n ]   x[k ][n  kL]
k 
and
 

  jn 
X e (e )     x[k ] [n  kL] e
j
  x[k ]e  jLk  X (e jL ) (4.85)
n   k   k 

 Xi(ejw) can be obtained from Xe(ejw) by correcting the amplitude scale from 1/T to L/T
and by removing all the frequency-scaled images of Xc(jW) except at integer multiples
of 2pi

sin[ ( n  kL) / L]
xi [n]   x[k ]
k  (n  kL) / L
2023/9/23 DSP 51
General system for sampling rate increase by
integer factor L

x[n] xe[n] Lowpass filter xi[n]


L Gain = L
Cutoff = /L
Sampling Sampling Sampling
period T period T’ = T/L period T’ = T/L

2023/9/23 DSP 52
Increasing sampling rate (Interpolation) by 2

2023/9/23 DSP 53
Linear Interpolation
 In practice, ideal lowpass cannot be implemented exactly.
 In some case, very simple interpolation procedures are adequate.
 Linear interpolation can be accomplished by the system below if the filter has
impulse response

x[n] xe[n] xi[n]


Lowpass filter
L Gain = L
Sampling Sampling Cutoff = /L Sampling
period T period period T’ = T/L
T’ = T/L

hlin[n] = 1 - |n|/L, |n| ≦ L;


0, otherwise.

2023/9/23 DSP 54
Linear Interpolation by Filtering
 Impulse response for linear
interpolation:
hlin[n] = 1-|n|/L, n < and = L
0 , otherwise

 Illustration of linear interpolation by


filtering.

 Frequency response of linear


interpolator compared with ideal
lowpass interpolation filter.

2023/9/23 DSP 55
2023/9/23 DSP 56
Changing the Sampling Rate by a Noninteger Factor
 If the filter has impulse response hlin[n] = 1-|n|/L, |n| ≦ L
= 0, otherwise
the interpolated output will be
 
xlin[n]   x [k ]h
k 
e lin [n  k ]   x[k ]h
k 
lin [n  kL]

 Changing the Sampling Rate by a Noninteger Factor


 If x[n] was obtained by sampling at the Nyquist rate, the
sequence xd [n] will represent a lowpass-filtered version
of the original underlying bandlimited signal if we are to avoid aliasing.
 If M < L, then pi/L is the dominant cutoff frequency and there will be no
need to further limit the bandwidth of the signal below the original Nyquist
frequency

2023/9/23 DSP 57
Interpolator Decimator

x[n] xe[n] Lowpass filter xi[n] Lowpass filter xo[n] xd[n]


L Gain = L Gain = 1 M
Cutoff = /L Cutoff = /M

T T/L T/L T/L TM/L

Lowpass filter
x[n] xe[n] Gain = L xo[n] xd[n]
L Cutoff = M
min(/L, /M)

T T/L T/L TM/L


2023/9/23 DSP 58
2023/9/23 DSP 59
2023/9/23 DSP 60
2023/9/23 DSP 61
Multirate Signal Processing
 Changing sampling rate  requires large amount of computation
 Concepts of multirate signal processing
 Classical technique: to change the sampling rate of a digital signal is to convert it back into analog
and then re-digitize it at the new rate.
 Disadvantage of this classical technique: quantization and aliasing errors will degrade the signal.
 Better technique: to process digital signal in a digital form until conversion to analog is necessary.
 Multirate processing is basically an efficient technique for changing the
sampling frequency of a signal digitally.
 The processes of decimation and interpolation are the fundamental operations
in multirate signal processing, and they allow the sampling frequency to be
decreased or increased without significant, undesirable effects of errors.

2023/9/23 DSP 62
Multirate Signal Processing Techniques

Normally, there are many techniques because of their


widespread applicability.
Two basic techniques are as follow:
Interchange of filtering and downsampling/upsampling
Polyphase decomposition
Polyphase decomposition of a sequences is obtained by representing it as
a superposition of M subsequences, each consisting of every Mth value of
successively delayed versions of the sequence.

2023/9/23 DSP 63
Interchange of Filtering and Downsampling/Upsampling

 In the figures
Two equivalent systems
X b ( e j )  H (e j M ) X ( e j ) (4.98)
From Eq. (4.77), we have H(zM) M
x[n] xb[n] y[n]
M 1
1
Y (e j )  
M i 0
X b (e j ( / M 2 i / M ) ) (4.99)

Substituting Eq. (4.98) into Eq. (4.99) gives M H(z)


M 1 x[n] xa[n] y[n]
1
Y (e j ) 
M
 H
i 0
( e j (   2 i )
) X (e j (  / M  2 i / M )
). (4.100)

Since H ( e j ( 2 i ) )  H ( e j ), Eq. (4.100) reduces to


M 1
1
j
Y (e )  H (e )
M
j
 X (e
i 0
j (  / M  2 i / M )
)  H (e j ) X a (e j ) (4.101)

2023/9/23 DSP 64
Interchange of Filtering and Downsampling/Upsampling
Similarly, we have from Eq. (4.85)
Y ( e j )  X a ( e j L )  X ( e j L ) H ( e j L ) (4.102)
Since from Eq. (4.85)
X b ( e j )  X ( e j L ),
it follows that Eq. (4.102) is,
Y ( e j )  H ( e j L ) X b ( e j ),
which corresponds to Fig. 4.32(b)

H(z) L L H(zL)
x[n] xa[n] y[n] x[n] xb[n] y[n]
Two equivalent systems

2023/9/23 DSP 65
Polyphase Decompositions
 The polyphase decomposition of a sequence is obtained by
representing it as a superposition of M subsequences.
 Consider an impulse response h[n] that we decompose into M
subsequences hk[n]
h[n  k ], n  integer multiple of M,
hk [n]  
 0, otherwise
 We can reconstruct the original impulse response h[n]
M 1
h[n]   hk [n  k ]
k 0

 In Fig. 4.32 and 4.33,


ek [n]  h[nM  k ]  hk [nM ]

2023/9/23 DSP 66
2023/9/23 DSP 67
Polyphase Decompositions
 The polyphase representation corresponds to
expressing H(z) as
M 1 
H [ z]   Ek ( z ) z ;
k 0
M k
Ek ( z ) 
M
 k
h [
n 
nM ]z  nM

2023/9/23 DSP 68
Polyphase Implementation of Decimation Filters

 To obtain a more efficient implementation of filters whose


output is then downsampled, we can exploit polyphase
decomposition of the filter.
 Suppose we express h[n] in polyphase form with polyphase
components
ek [n]  h[nM  k ]  hk [nM ]

 From Eq. (4.105), M 1


H [ z ]   Ek ( z M ) z  k
k 0

H(z) M
x[n] y[n] w[n]=y[nM]
2023/9/23 DSP 69
Figure 4.39 Implementation of decimation filter using polyphase
decomposition.
Figure 4.40 Implementation of decimation filter after applying the
downsampling identity to the polyphase decomposition.
Polyphase Implementation of Decimation Filters

Suppose that the input x[n] is clocked at a rate of 1 sample


per unit time and that H(z) is an N-point FIR filter.
Straightforward implementation
N multiplications and N-1 additions per unit time
Polyphase: each of the filters Ek(z) is of length N/M and their
inputs are clocked at a rate of 1 per M units of time
Each filter requires (1/M)(N/M) multiplications per unit time and (N/M-
1)+(M-1) additions per unit time.

2023/9/23 DSP 72
Digital Processing of Analog Signals

Prefiltering to avoid aliasing


Analog-to digital (A/D) conversion
Analysis of quantization errors
Digital-to-analog (D/A) conversion

2023/9/23 DSP 73
Prefiltering to Avoid Aliasing
Ideal C/D converter (approximation) analog-to-digital (A/D) converter
Ideal D/C converter (approximation) digital-to-analog (D/A) converter

xC(t) Anti- xa(t) x[n] Discrete- y[n] yr(t)


aliasing C/D Time D/C
filter System
Haa(j)
T T

Discrete-time filtering of continuous-time signals

xc(t) xa(t) xo(t) x^[n] y^[n] yDA(t) yr^(t)


Anti- Sample Compensated
Discrete-time reconstruction
aliasing and A/D D/A
system filter
filter hold
Haa(j) Hr~(j)
T T T

Digital processing of analog signals


2023/9/23 DSP 74
Prefiltering to Avoid Aliasing

1, |  | c   / T ,
H aa ( j)  
 0, |  | c
 H (e ), |  | c ,
jT
H eff ( j)  
 0, |  | c
jT
H eff ( j)  H aa ( j) H (e )

2023/9/23 DSP 75
Using oversampled A/D conversion to simplify a continuous-time
antialiasing filter

Sampling rate reduction by M

Sharp
xC(t) Simple xa(t) x^[n] xd[n]
antialiasing
antialiasing C/D M
filter
filter
cutoff = /M

T = (1/M)(/N)

2023/9/23 DSP 76
Using oversampled A/D conversion to simplify a continuous-time
antialiasing filter

Idealized filter  for preventing aliasing


Such sharp-cutoff analog filters can be realized using active
networks and integrated circuits.
Sharp-cutoff filters are difficult and expensive to implement,
and if the system is to operate with a variable sampling rate,
adjustable filters would be required.

2023/9/23 DSP 77
Use of oversampling followed by decimation in C/D
conversion

2023/9/23 DSP 78
Analog-to-Digital (A/D) Conversion

 An ideal C/D converter converts a continuous-time signal into a discrete-time


signal, where each sample is known with infinite precision.
 An approximation to ideal C/D converter for digital signal processing, the system
below converts a continuous-time (analog) signal into a digital signal, i.e., a
sequence of finite-precision or quantized samples.

Physical configuration for analog-to-digital conversion.

xa(t) Sample xO(t) xB^[n]


A/D
and
Converter
Hold

T T

2023/9/23 DSP 79
Ideal Sample-and-Hold System


s( t )   ( t  nT )
n  

x Zero-order
xa(t) xS(t) hold hO(t) xO(t)

Sample-and-Hold System
xa(t) xO(t)

-3T -2T -T 0 T 2T 3T 4T 5T

2023/9/23 DSP 80
Sample and Hold
 Normally, "sample and hold" is a ADC term, in which an analog signal is
"sampled" by charging a capacitor to voltage of the signal, and then "held", by
disconnecting the charge circuitry and giving the convertor stage some time to
digitize the (now constant) held sample.

2023/9/23 DSP 81
Sample and Hold
 In terms of DACs. You can output a sampled waveform by writing each (digital)
sample to the DAC at a fixed interval. If the DAC has a fast settling time relative
to the frequency that you write to it, this method will produce a "staircase" form of
output.

 In the case where the DAC settling time is fast, sometimes it can be filtered
digitally by computing (interpolating) one or more points between each sample
pair and outputting them at a rate faster than the "sample and hold" case. The
waveform will then appear to be comprised of a series of ramps rather than steps.
So it will appear "smoother" (more continuous).

2023/9/23 DSP 82

x0 (t )   x[n]h (t  nT )
n 
0

x[n]  xa (nT )
 1, 0  t  T
h0 (t )  
0, otherwise

x0 (t )  h0 (t )   x (nT ) (t  nT )
n 
a

2023/9/23 DSP 83
Physical system and its conceptual representation

Physical configuration for analog-to-digital conversion.

xa(t) Sample xO(t) xB^[n]


A/D
and
Converter
Hold

T T

Conceptual representation of the physical system

xa(t) x[n] x^[n] xB^[n]


C/D Quantizer Coder

2023/9/23 DSP 84
Typical Quantizer for A/D Conversion

2023/9/23 DSP 85
Typical Quantizer for A/D Conversion

 If we have a (B+1)-bit binary two’s-complement fraction


of the form a0 a1a2 ...aB
Then its value is a0 20  a1 21  a2 22  ...  aB 2 B
 Xm is the full-scale level of the A/D converter.
 The step size of the quantizer is
2Xm Xm
  B 1  B
2 2
 The numeric relationship between the code words and
the quantized samples is
xˆ[n[ X m xˆB [n]
1  xˆB [n]  1 (for two's complement)
2023/9/23 DSP 86
The Three Numbering Systems, Demonstrated for 3-Bit Binary
Fractions (i.e., b = 3)
Interpretation
Binary number Sign and magnitude 2's complement 1's complement

0Δ111 7/8 7/8 7/8


0Δ110 6/8 6/8 6/8
0Δ101 5/8 5/8 5/8
0Δ100 4/8 4/8 4/8
0σ011 3/8 3/8 3/8
0Δ010 2/8 2/8 2/8
0Δ001 1/8 1/8 1/8
0Δ000 0 0 0
1Δ000 -0 -1 -7/8
1Δ001 −1/8 −7/8 −6/8
1Δ010 −2/8 −6/8 −5/8
1Δ011 −3/8 −5/8 −4/8
1Δ100 −4/8 −4/8 −3/8
1Δ101 −5/8 −3/8 −2/8
1Δ110 −6/8 −2/8 −1/8
1Δ111 −7/8 −1/8 −1

2023/9/23 DSP 87
Sampling, Quantization, Coding, and D/A Conversion with a
3-bit Quantizer

2023/9/23 DSP 88
Analysis of Quantization Errors
 The difference between the quantized sample x^[n] and true sample value x[n] is
the quantization error:
e[n] = x^[n] – x[n].
 If linear round-off (B+1)-bit quantizer is used, then
-D/2 < e[n] < = D/2
which holds whenever
(-Xm – D/2) < x[n] < = (Xm – D/2)
where D is step size of the quantizer:
D = Xm/2B
 If x[n] is outside the range mentioned above, then the qunatization error is larger
in magnitude than D/2 and such samples are said to be clipped.

2023/9/23 DSP 89
Additive Noise Model for Quantizer

x[n] Quantizer x^[n] = Q{x[n]}


Q{.}

x[n] x^[n] = x[n] + e[n]


+

e[n]

2023/9/23 DSP 90
Analysis of Quantization Error 2

 The statistical representation of quantization errors is based


on the following assumptions:
 The error sequences e[n] is a sample sequence of a stationary
random process.
 The error sequence is uncorrelated with the sequence x[n].
 The random variables of the error process are uncorrelated; i.e., the
error is a white-noise process.
 The probability distribution of the error process is a uniform over the
range of quantization error.

/2
1  2 22 B X m
   e de 
2 2


e
 / 2
12 12

2023/9/23 DSP 91
Example of Quantization Noise for a Sinusoidal Signal

2023/9/23 DSP 92
Conclusion of Quantization Error
 In low number-bit case, the error signal is highly correlated with the unquantized
signal.
 The quantization error for high number-bit quantization is assumed to vary
randomly and is uncorrelated with the unquantized signal.

SNR= 10log10(sx2/se2)
= 10log10(12*22Bsx2/Xm2) for rounding quantizer
= 6.02B + 10.8 –20log10(Xm/sx)

 The SNR ratio increases approximately 6 dB for each bit added to the word
length of the quantized samples.

2023/9/23 DSP 93
2023/9/23 DSP 94
 For analog signals such as speech or music, the distribution of
amplitudes tends to be concentrated about zero and falls off rapidly
with increasing amplitude.
 The probability that the magnitude of a sample will exceed 3 or 4 times the RMS value is very
low.
 For example, obtaining a signal-to-noise ratio of about 90~96 dB for use in high quality music
recording and playback requires 16-bit quantization.
 But it should be remembered that such performance is obtained only if the input signal is
carefully matched to the full-scale range of the A/D converter.
 The trade-off between peak signal amplitude and absolute size of the
quantization noise is fundamental to any quantization process.

2023/9/23 DSP 95
D/A Conversion

x^[n] xDA(t)
D/A
Converter

xB^[n] x^[n] Convert xDA(t)


Scale by Zero-order
to
Xm hold
impulses

2023/9/23 DSP 96
D/A Conversion

2023/9/23 DSP 97
D/A Conversion

2023/9/23 DSP 98
D/A Conversion

2023/9/23 DSP 99
Frequency response of zero-order hold compared with
ideal interpolating filter and ideal compensated
reconstruction filter for use with a zero-order-hold output

T Ideal interpolating
Filter Hr(j)
Zero-order
Hold |HO(j)|

-2/T -/T 0 /T 2/T 

|Hr~(j)|

-/T 0 /T 

2023/9/23 DSP 100


D/A Conversion

Ya ( j)  H r ( j) H 0 ( j) H (e j ) H aa ( j) X c ( j)


H eff ( j)  H r ( j) H 0 ( j) H (e j ) H aa ( j)

2023/9/23 DSP 101


Project of Chapter 4
Download an audio signal file with a sampling rate of 16 KHz
from the course Web site and process the signal as follows.
Change the sampling rate to 12 KHz for the audio signal.
 Please upload your program and the results to the ftp site within two
weeks after the date of project assignment.
The audio signal files can be downloaded from the website.
The ftp site can be found at the course website.

2023/9/23 DSP 102

You might also like