Time Signals: Chapter 4 Sampling of Conti-Nuous
Time Signals: Chapter 4 Sampling of Conti-Nuous
Time Signals: Chapter 4 Sampling of Conti-Nuous
xc (t)
x[n]
C/D
xc (t )
T=1, x[n ] xc ( nT )
T=2, x[n ] xc ( nT )
Chapter 4
DSP
Continuous-time signal: xc (t )
Discrete-time signal: x[n] xc (nT ), n , T: sampling period
How to model this C/D process?
In theory, we break the C/D operation into two steps:
(1) Ideal sampling using analog delta function (impulse)
(2) Conversion from impulse train to discrete-time sequence
Step (1) can be modeled by mathematical equation.
Step (2) is a concept, no mathematical model.
In reality, the electronic analog-to-digital (A/D) circuits can approxmate the ideal C/D operation. This circuitry is one piece; it cannot be
split into two steps.
Ideal sampling
xc (t )
xs (t )
Sampling
s (t )
xc (t )
xs (t )
Conversion from
impulse train
to discrete-time
sequence
x[n]
t nT , T: sampling period
Chapter 4
DSP
x s t xc t s t xc t t nT
n
xc t t nT xc nT t nT
k s
, where s 2 / T
1
1
X s j
X c j S j X c j k s
2
T
k
1
1
X c j k s T X c j k s
T k
k
The sampled signal spectrum is the sum of shifted copies of the original.
Remark: In analog domain,
x(t ) y (t ) X ( f ) * Y ( f )
1
X ( j ) * Y ( j )
2
DSP
jT
1
) X c j k s
T k
1
2k
Thus, X (e ) X c j
T k T
T
j
Remark: In time domain, xs (t ) and x[n] are two very different signals
but they have the same spectra in frequency domain.
Two Cases:
(1) no aliasing: s 2 N , and
(2) aliasing: s 2 N , where N is the highest nonzero frequency component of X c ( j) .
After sampling, the replicas of X c ( j) overlap (in frequency
domain). That is, the higher frequency components of X c ( j)
overlap with the lower frequency components of
X c j ( s ) .
(Fig. 4.3 on O&S, p.186)
xs(t)
xc(t)
t
T
FT
FT
Xs(j)
Xc(j)
N
Chapter 4
S
4
DSP
2
2 N . (Nyquist, Shannon)
T
Convert from
Sequence to
Impulse train
xs (t )
Reconstruction
filter
xr (t )
Chapter 4
DSP
xr (t ) xs (t ) hr (t ) x[n] ( nT )hr (t )d
x[n]
( nT )hr (t )d
x[n]hr (t nT )
hr (t )
sin(t T )
(t T )
hr(t)
Chapter 4
2T
DSP
Is xr (t ) xc (t ) ?
Proof in (1) frequency domain (clear!),
in (2) time domain?
(A) Check t nT
n0
1,
hr (t )
0, n 1,2,
xr (t ) x[n] xc (t )
sin (t nT ) / T
(t nT ) / T
x[n]
C/D
Discrete-time
system
H ( e j )
y[n]
D/C
yr (t )
H eff ( j)
(1)
Chapter 4
x[n] y[n] : Y (e j ) H (e j ) X (e j )
DSP
2k
j
T
T
(2)
xc (t ) x[n] : X (e ) X c
T k
(3)
y[n] yr (t ) : Yr ( j) H r ( j)Y (e jT )
xc (t ) yr (t ) :
Yr ( j) H r ( j) H (e jT ) X (e jT )
H r ( j ) H ( e
jT
1
2k
) X c j j
T k
T
DSP
However, there are methods in designing the sampling and the reconstruction processes to make the approximation better.
Impulse invariance
A filter design method design a discrete-time filter that approximates an analog filter. We simply sample the analog filter impulse
response h[n] Thc (nT ) . (Details will be discussed in the filter design chapter.)
xc (t )
D/C
Continu.-time
system
yc (t )
y[n]
C/D
H c ( j )
H ( e j )
X c ( j) TX (e jT ),
Yc ( j) H c ( j) X c ( j),
Y (e j )
Chapter 4
1
Yc ( j ),
T
T
DSP
Y(e j ) Hc ( j ) Xc ( j ) Hc ( j ) X (e j )
T
T
T
T
H (e j ) H c ( j
H ( e jT ) H c ( j)
or, equivalently,
H (e j ) e j
xc(t)
x[n]
n
yc(t) = xc(t-T)
y[n]
n
y[n ] y c ( nT ) x c ( nT T )
x[k ]
sin[ (t T kT ) / T ]
|t nT
(t T kT ) / T
x[k ]
sin[ ( n k )]
(n k )
Chapter 4
10
DSP
T x[n] xc (nT )
T ' x'[n] xc (nT ' )
~
x [ n]
Lowpass filter
Cutoff= M
xd [ n] ~
x [nM ]
T=MT
1
X c ( j)
T1
FT
t
2
T1
T1
Downsampling
1
X c ( j)
T2
FT
t
T2 = MT1
Chapter 4
2
T2
11
DSP
T k T
T
j
1
2r
X d (e )
X c j
0 1 2 ( M 1) M
r
2
1
i ( M 2) ( M 1) 0 1 2 ( M 1) 1
1
1
0 0 0
0
1
k
( M 1)
2
r i kM
r ,,2,1,0,1,2,,
k ,,2,1,0,1,2,,
i 0,1,2, , M 1
X d (e )
Xc
T ' r
j
2r
j
'
'
T
T
1
2r
X
j
c
MT r MT MT
1 M 1
Xc
MT k i 0
X d (e
1
)
M
2kM 2i
j
MT
MT
MT
2k
1
2i
T X c j MT j T
i 0 k
M 1
j 2i
X e M M
i 0
Chapter 4
M 1
12
DSP
Chapter 4
13
DSP
Chapter 4
14
T
xi [ n] = x c n
L
x[ n ], n = 0, L,2 L,
x e [n] = L
otherwise
0,
=
x[k ] [n kL]
k =
<Frequency-domain>
X e (e ) = x[k ] [n kL] e jn
n = k =
j
= x[k ] [n kL]e jn = X (e jL )
n=
k =
Note that
[n kL]e jn
n =
= e jLk
old _ = T ,
new _ = T ' = T L , old _ = new _ L
Remark: At this point, we only insert zeros into the original signal.
In time domain, this signal doesnt look like the original.
The shape of the spectrum is not changed.
hi [n] =
xi [ n] =
sin(n L)
, an interpolator!
(n L)
k =
x[k ]
sin[ (n kL) / L]
(n kL) / L
Linear interpolation
1 | n | / L,
| n | L
hlin [n] =
otherwise
0,
Fig. 4.25
1 sin(L 2)
H lin (e j ) =
L sin( 2)
xlin [n] =
k =
ion
T interpolat
M
T
L
T decimation M
T
L
L
Figure 4.29
Figure 4.30
In summary:
-- Sampling
Time-domain
Prefiltering
Frequency -domain
Limit bandwidth s > 2 N
-- Reconstruction
Time-domain
Frequency -domain
-- Down-sampling
Time-domain
Frequency -domain
Prefiltering
Limit bandwidth
-- Up-sampling
Time-domain
Insert zeros
Interpolation
Frequency -domain
Shrink (by a factor of L)
Remove extra copies in a 2
period
Fig. 4.48
A/D Conversion
Digital: discrete in time and discrete in amplitude
Ideal sample-and-hold: (Fig. 4.46) Sample the (input) analog
signal and hold its value for T seconds.
x0 (t ) =
x[n]h0 (t nT )
n =
1, 0 < t < T
h0 (t ) =
0, otherwise
Fig. 4.51
2X m X m
= B
B +1
2
2
Figure 4.54
( e ) = E (e e )
2
1
2
= / 2 e
de =
12
/2
2 2 B X m2
=
12
2
e
Xm
12 2 2 B x2
x2
SNR = 10 log10 2 = 10 log10
B
=
10
.
8
+
6
.
02
20
log
10
x
X m2
e
Remarks: (1) One bit buys a 6dB SNR improvement.
(2) If the input is Gaussian, a small percentage of the input samples
would have an amplitude greater than 4 x . If we choose
X m = 4 x , SNR 6 B 1.25dB
For example, a 96dB SNR requires a 16-bit quantizer.
D/A Conversion
The ideal lowpass filter is replaced by practical filters.
Examples of practical filters: zero-order hold and first-order hold.
Mathematical model: (Fig. 4.62)
x DA (t ) =
x[n]h0 (t nT )
n =
x DA (t ) =
n =
n =
x[n]h0 (t nT ) + e[n]h0 (t nT )
= x0 (t ) + e0 (t )
~
Purpose: Find a compensation filter hr (t ) to compensate for the
distortion caused by the non-ideal h0 (t ) so that its output x r (t )
is close to the analog original x a (t ) .
x[n]
x DA (t )
D/A
Converter
Compensated
reconstruction
~
filter H r ( j)
x r (t )
T
In frequency domain:
= x[n]e jnT H 0( j) = X (e jT ) H 0( j)
n =
2k
j
,
T
k =
1
2k
X 0 ( j ) = X a j
H 0 ( j )
T k =
T
1
(
)
=
X
j
Because
T
1, 0 < t < T
h0 (t ) =
0, otherwise
2sin(T / 2) jT / 2
e
Or , H 0 ( j) =
T / 2
e jT / 2 , | |< / T
~
H r ( j) = sin(T / 2)
0,
| |> / T
Remark: A practical filter cannot achieve this approximation.
Overall system:
X a ( j )
H aa ( j)
H (e jT )
Anti-aliasing
reconst.
Processing
H 0 ( j )
~
H r ( j )
Ya ( j)
Zero-order-hold Compensated
~
Ya ( j) = H r ( j) H 0 ( j) H ( e jT ) H aa ( j) X a ( j)
(2) First-order hold
Better frequency response than zero-order-hold. Predict the next
x(t) using the current sample x(nT) and the slope between x(nT-T)
and x(nT).
(P&M)
x (t ) = x(nT ) +
x(nT ) x(nT T )
(t nT ), nT t < (n + 1)T
T
1 + t
0t T
T,
T t < 2T
h0 (t ) = 1 t
T,
0,
otherwise
2 sin(T / 2) j ( )
e
T
2
H 0 ( j) = T (1 + T )
2
and () =
2 1/ 2
T
+ tan 1 (T )
2