You are on page 1of 92

Sampling Theorem

主講者:虞台文
Content
 Periodic Sampling
 Sampling of Band-Limited Signals
 Aliasing --- Nyquist rate
 CFT vs. DFT
 Reconstruction of Band-limited Signals
 Discrete-Time Processing of Continuous-Time Signals
 Continuous-Time Processing of Discrete-Time Signals
 Changing Sampling Rate
 Realistic Model for Digital Processing
Sampling Theorem

Periodic Sampling
Continuous to Discrete-Time Signal Converter

xc(t) x(n)= xc(nT)


C/D

T
Sampling rate
C/D System
s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence
Sampling with Periodic Impulse train

xc(t) xc(t)

3T 2T T 0 T 2T 3T 4T
t 8T 4T 2T 0 2T 4T 8T 10T
t

x(n) x(n)

3 2 1 0 1 2 3 4
n 6 4 2 0 2 4 6 8
n
We want to restore xc(t) from x(n).
Sampling with Periodic Impulse train
What condition has to be placed
on the sampling rate?
xc(t) xc(t)

3T 2T T 0 T 2T 3T 4T
t 8T 4T 2T 0 2T 4T 8T 10T
t

x(n) x(n)

3 2 1 0 1 2 3 4
n 6 4 2 0 2 4 6 8
n
C/D System
s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence

xs (t )  xc (t )s(t )
n 
 xc (t )  (t  nT )
n 
s (t )   (t  nT )
n  
n  
n 
  x (nT )(t  nT )
n  
c
C/D System
1
s(t)
X s ( j)  X c ( jConversion
) * S ( j)from
2 x (t) x(n)= xc(nT)
s impulse train to
xc(t) 
2  2
  (  k sequence
discrete-time
S ( j )  s ), s 
T k  T
xs (t )  xc (t )s(t )
n 
 xc (t )  (t  nT )
n 
s (t )   (t  nT )
n  
n  
n 
  x (nT )(t  nT )
n  
c
C/D System
1 s :
X s ( j)  X c ( j) * S ( j)
2 Sampling Frequency
2  2
S ( j )  
T k  
(  k s ),  s 
T

1  2  
X s ( j) 
2
X c ( j) *  
 T k 
(  k s ) 

C/D System
1 
X s ( j)   X c ( j  kj s )
T k  
1 
  X c ( j  kj s )
T k  

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

1  2  
X s ( j) 
2
X c ( j) *  
 T k 
(  k s ) 

Sampling Theorem

Sampling of
Band-Limited Signals
Band-Limited Signals
Xc(j)
Band-Limited 1

N N 

Band-Unlimited Yc(j)


1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Sampling of Band-Limited Signals
Xc(j)
Band-Limited 1

N N 
Sampling with
Higher Frequency
2/T
S(j)

3s 2s s s 2s 3s
Sampling with
Lower Frequency 2/T S(j)

6s 4s 2s 2s 4s 6s
Sampling Theorem

Aliasing ---
Nyquist Rate
1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Recoverability
Xc(j)
Band-Limited 1

N N 
Sampling with
Higher Frequency
s > 2N
2/T
S(j)

3s 2s s s 2s 3s

s < 2N
Sampling with
Lower Frequency 2/T S(j)

6s 4s 2s 2s 4s 6s
1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Case 1: s > 2N
Xc(j)
1

N N 
2/T
S(j)

3s 2s s s 2s 3s
Xs(j)
1/T

3s 2s s s 2s 3s
1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Case 1: s > 2N
Passing Xs(j) through a
Xc(j)
1 Xs(j) is a periodic
low-pass filter with cutoff
frequency N < c< s N , function with
N N 
the original signal can be period s.
recovered. 2/T
S(j)

3s 2s s s 2s 3s
Xs(j)
1/T

3s 2s s s 2s 3s
1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Case 2: s < 2N
Xc(j)
1

N N 
2/T S(j)

6s 4s 2s 2s 4s 6s

1/T Xs(j)

6s 4s 2s 2s 4s 6s
1  2
X s ( j)   X c ( j  kj s ),  s 
T k   T
Case 2: s < 2N
Xc(j)
1 Xs(j) is a periodic
No way to recover
function with
the original signal. N N 
period s.
2/T S(j)

6s 4s 2s 2s 4s 6s

1/T Xs(j)

6s 4s 2s 2s 4s 6s
Nequist Rate
Xc(j)
Band-Limited 1

N N 

Nequist frequency (N)


The highest frequency of a band-limited signal

Nequist rate = 2N


Nequist Sampling Theorem
Xc(j)
Band-Limited 1

N N 

s > 2N Recoverable

s < 2N Aliasing


Sampling Theorem

CFT vs. DFT


1 
X s ( j)   X c ( j  kj s )
T k  
C/D System
s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence

xs (t )  xc (t )s(t )
n 
 xc (t )  (t  nT )
n 
s (t )   (t  nT )
n  
n  
n 
  x (nT )(t  nT )
n  
c
1 
X s ( j)   X c ( j  kj s )
T k  
Continuous-Time Fourier Transform

s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence

 xs (t )  xc (t )s(t )
X s ( j) n  X ( nT ) e  jTn n 
 xc (t )  (t  nT )


c
s (t )  n 
(t  nT ) n  
n   n 
  x (nT )(t  nT )
n  
c
1 
X s ( j)   X c ( j  kj s )
T k  
CFT vs. DFT
s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence

 
X s ( j )   c
X (
n  
nT ) e  jTn
X (e j )   x (
n  
n ) e  jn

x(n)
1 
X s ( j)   X c ( j  kj s )
T k  
CFT vs. DFT
s(t)
Conversion from
xs(t) impulse train to x(n)= xc(nT)
xc(t) 
discrete-time
sequence

 
X s ( j )   c
X (
n  
nT ) e  jTn
X (e j )   x (
n  
n ) e  jn

x(n)
j j
X s ( j)  X (e ) X (e )  X s ( j) T 
T
CFT vs. DFT
1 
X s ( j)   X c ( j  kj s )
T k  
j
X (e )  X s ( j) T 

1 
 2k
X (e )   X c ( j  j
j
)
T k   T T
1 
 2k
X (e )   X c ( j  j
j
)
T k   T T
CFT vs. DFT
1 Xc(j)

Xs(j) 2
1/T s 
T

s s
1/T X(ej)


4 2 2 4
1 
 2k
X (e )   X c ( j  j
j
)
T k   T T
CFT vs. DFT
1 Xc(j)
Amplitude scaling

&
Repeating

Xs(j) 2
1/T s 
T
Frequency scaling

s2
s s
1/T X(ej)


4 2 2 4
Sampling Theorem

Reconstruction of
Band-limited Signals
Key Concepts
xc(t) Xc(j)
CFT

ICFT 
3T 2T T
t
0 T 2T 3T 4T
/T /T

Sampling Retrieve
C/D One period
x(n) FT X(ej)

IFT 
n
3 2 1 0 1 2 3 4
 
Interpolation
X c  j
1
X (e jT )   /T    /T
T

 T  / T j(t Tn ) 
  xc (nT )   e
/T
1
  d
2   / T
jt
xc (t )  X j  e d
c
n    2   / T


1 /T

2   / T
TX e jT
e jt
d 
  xc (nT )
sin[ (t  nT ) / T ]
n   (t  nT ) / T
T /T  
 jTn  jt
    xc (nT )e e d
2   / T
 n 

 T  / T  jTn jt 
  xc (nT )   e e d
n    2   / T

Interpolation

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


xc (t )   x(n)
n  
n (t )
Ideal D/C Reconstruction System

Ideal
x(n) Covert from xs(t) Reconstruction xr(t)
sequence to Filter
impulse train Hr(j)

T T
Obtained from sampling xc(t)
using an ideal C/D system.
Ideal D/C Reconstruction System

Ideal
x(n) Covert from xs(t) Reconstruction xr(t)
sequence to Filter
impulse train Hr(j)

T T
Hr(j)

 T
xs (t )   x(n)(t  nT )
n  
/T /T


sin(  / T )(t  nT )
xr (t )   x(n)
n   ( / T )(t  nT )
Ideal D/C Reconstruction System

Ideal
x(n) Covert from xs(t) Reconstruction xr(t)
sequence to Filter
impulse train Hr(j)

T T

jT
X s ( j)  X (e jT
) X r ( j)  H r ( j) X (e )

sin(  / T )(t  nT )
xr (t )   x(n)
n   ( / T )(t  nT )
Ideal D/C Reconstruction System

xc(t) x(n) xr(t)


C/D D/C

T T

In what condition xr(t) = xc(t)?


Sampling Theorem

Discrete-Time Processing of
Continuous-Time Signals
The Model
xc(t) x(n) Discrete-Time
y(n) yr(t)
C/D System D/C

T T

Continuous-Time
xc(t) System yr(t)
The Model
xc(t) x(n) Discrete-Time
y(n) yr(t)
C/D H (e ) j D/C
System

T T

Continuous-Time
xc(t) H (j)
System
eff yr(t)
LTI Discrete-Time Systems
X c ( j ) X (e j ) Y ( e j ) Yr ( j)
xc(t) x(n) Discrete-Time
y(n) yr(t)
C/D j
H (e ) HrD/C
(j)
System

T T
1   2k
X (e )   X c ( j  j
j
)
T k   T T
Yr ( j)  H r ( j)Y (e jT )  H r ( j) H (e jT ) X (e jT )
1 
2k
 H r ( j ) H ( e )  X c ( j   j
jT
)
T k   T
LTI Discrete-Time Systems
X c ( j ) X (e j ) Y ( e j ) Yr ( j)
xc(t) x(n) Discrete-Time
y(n) yr(t)
C/D j
H (e ) HrD/C
(j)
System

T T

H (e jT ) X c ( j) |  |  / T
Yr ( j)  
0 |  |  / T

1 
2k
Yr ( j)  H r ( j) H (e )  X c ( j  j
jT
)
T k   T
H (e jT ) |  |  / T
H eff ( j)  
0 |  |  / T
LTI Discrete-Time Systems

Continuous-Time
xc(t) H (j)
System
eff yr(t)
X c ( j ) Yr ( j)  H eff ( j) X r ( j)

H (e jT ) X c ( j) |  |  / T
Yr ( j)  
0 |  |  / T
H (e jT ) |  |  / T
H eff ( j)  
0 |  |  / T
Example:Ideal Lowpass Filter
X c ( j ) Yr ( j)
H(ej)
xc(t) x(n) Discrete-Time
1
y(n) yr(t)
C/D System D/C

c c
T T

1 |  | c / T
H eff ( j)  
0 |  | c / T
H (e jT ) |  |  / T
H eff ( j)  
0 |  |  / T
Example:Ideal Lowpass Filter
Heff(j)
Continuous-Time
xc(t) 1
System yr(t)

c c

j 1 |  | cT
H (e )  
0 cT |  | 2
Example:
Ideal Bandlimited Differentiator

d
xc(t) Continuous-Time
System
yc (t )  x c (t )
dt

 j |  |  / T
H ( j )  j H eff ( j)  
0 |  |  / T
Example:
Ideal Bandlimited Differentiator
|Heff(j)|

d
xc(t) 
Continuous-Time
System
yc (t )  x c (t )


dt
T T

 j |  |  / T
H ( j )  j H eff ( j)  
0 |  |  / T
Example:
Ideal Bandlimited Differentiator
|Heff(j)|

d
xc(t) 
Continuous-Time
System
yc (t )  x c (t )

 dt
T T

j
H (e )  j / T , |  | 
j
H (e )  H c ( j / T ), |  | 

Impulse Invariance
Continuous-Time
xc(t) LTI system yc(t)
hc(t), Hc(j)

Discrete-Time
xc(t) x(n) LTI System y(n) yc(t)
C/D h(n) D/C
H(ej)
T T

What is the relation between hc(t) and h(n)?


j
H (e )  H c ( j / T ), |  | 

Impulse Invariance
x(n)  X (e ) j
xc (t )  X c ( j)

x(n)  xc (nT )
1 
  2k 
X (e )   X c  j  j
j

T k   T T 
j 1  
X (e )  X c  j  , |  | 
T  T
j
H (e )  H c ( j / T ), |  | 

Impulse Invariance
j
h ( n)  H (e ) hc (t )  H c ( j)
h(n)  hc (nT )
j 1  
H (e )  H c  j  , |  | 
T  T
h(n)  Thc (nT )
j  
H (e )  H c  j  , |  | 
 T
h(n)  Thc (nT )
Impulse Invariance
Continuous-Time
xc(t) LTI system yc(t)
hc(t), Hc(j)

Discrete-Time
xc(t) x(n) LTI System y(n) yc(t)
C/D h(n) D/C
H(ej)
T T

What is the relation between hc(t) and h(n)?


Sampling Theorem

Continuous-Time Processing of
Discrete-Time Signals
The Model
x(n) xc(t) Continous-Time yc(t) y(n)
D/C System
C/D

T T

Discrete-Time
x(n) System y(n)
The Model
x(n) xc(t) Continous-Time yc(t) y(n)
D/C Hc(j)
System
C/D

T T

Discrete-Time
x(n) H (e )
System
j y(n)

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

The Model
X (e )j
X c ( j ) Yc ( j) Y (e )j

x(n) xc(t) Continous-Time yc(t) y(n)


D/C Hc(j)
System
C/D

T T

X c ( j)  TX (e jT ), |  |  / T
Yc ( j)  H c ( j) X c ( j), |  |  / T
j 1
Y (e )  Y ( j / T ), |  | 
T
The Model
j 1
Y ( e )  H c ( j / T ) X c ( j / T )
T
1 j j
 H c ( j / T )  TX (e )  H c ( j / T ) X (e )
T

X c ( j)  TX (e jT ), |  |  / T
Yc ( j)  H c ( j) X c ( j), |  |  / T
j 1
Y (e )  Yc ( j / T ), |  | 
T
j
H (e )  H c ( j / T )
The Model
j 1
Y ( e )  H c ( j / T ) X c ( j / T )
T
1 j j
 H c ( j / T )  TX (e )  H c ( j / T ) X (e )
T

Discrete-Time
x(n) H (e )
System
j y(n)
j
H (e )  H c ( j / T )
The Model
x(n) xc(t) Continous-Time yc(t) y(n)
D/C Hc(j)
System
C/D

T T

Discrete-Time
x(n) H (e )
System
j y(n)
Sampling Theorem

Changing Sampling Rate Using


Discrete-Time Processing
The Goal
x(n)  xc (nT ) x' (n)  xc (nT ' )
Down/Up
Sampling
Sampling Rate Reduction By an Integer Factor

x(n)  xc (nT ) x' (n)  xc (nT ' )


Down
Sampling

T '  MT xd (n)  x(nM )  xc (nMT )


Sampling Rate Reduction By an Integer Factor

1    2k 
X (e )   X c  j  j
j

T k   T T 

1 
  2r  1 
  2r 
X d (e )   X c  j  j
j
  Xc j j 
T ' r    T ' T '  MT r    MT MT 

T '  MT xd (n)  x(nM )  xc (nMT )


Sampling Rate Reduction By an Integer Factor

1    2k 
X (e )   X c  j  j
j

T k   T T 

1 
  2r 
j
X d (e ) 
MT

r  
Xc j
 MT
j
MT 
 Let r = kM + i

1 M 1
1    2k 2i 

M
  T  X c  j MT  j T  j MT 
i 0  k    
1 M 1
1     2i 2k 
j
X d (e ) 
M
  T  X c  j MT  j T 
i 0  k    
M 1
1
j
X d (e ) 
M
 X
i 0
( e j (  2 i ) / M
)

Sampling Rate Reduction By an Integer Factor


Xc(j)

N N
jT
1/T Xs(j), X (e )

2/T N N 2/T
j
1/T X (e )

2 N N=NT 2

1 M 1
1     2i 2k 
j
X d (e ) 
M
  T  X c  j MT  j T 
i 0  k    
M 1
1
N <  : no aliasing X d (e ) 
M
j
 X
i 0
( e j (  2 i ) / M
)

Sampling Rate Reduction By an Integer Factor


Xc(j)

N N
jT
1/T Xs(j), X (e )

2/T N N 2/T
j
1/T X (e )

2 N N=NT 2
j
M=2
1/MT Xd (e )

2 2
Xd (ejT)
1/T’ 
4/T’ 2/T’ 2/T’ 4/T’
Antialiasing
1/T X (ej)

2 N N 2

Xd (ej) M=3
1/MT

2 2
However, xd(n) x(nT’)

Antialiasing
1/T X (ej)

2 N N 2
Hd (ej)
1 M=3

2 /3 /3 2
X d (e j )  H d (e j ) X (e j )


2 /3 /3 2
~
X d (e j )

2 2 
Decimator

Lowpass filter ~
xd (n)  ~
M
x (nM )
Gain = 1
x(n) ~
Cutoff = /M x (n)
Increasing Sampling Rate By an Integer Factor

x(n)  xc (nT ) x' (n)  xc (nT ' )


Up
Sampling T ' T / L

T
T' T / 4
Increasing Sampling Rate By an Integer Factor
j j
X (e ) X ' (e )
x(n)  xc (nT ) x' (n)  xc (nT ' )
Up
Sampling T ' T / L
X (ej)
1/T

 
X’(ej)
L/T

 

xe (n)   x(k )(n  kL)
k  

Interpolator
Lowpass filter

x(n) L xe (n)
Gain = L
Cutoff = /L xi (n)

 x(n / L) 0, L,2 L,


xe (n)  
 0 otherwise

X e (e j )  X (e jL ) xe (n)   x(k )(n  kL)
k  

Interpolator

 
  jn
X e (e )     x(k )(n  kL) e
j

n    k   

   jn 
  x(k )  (n  kL)e 
k    n  

  x (
k  
k ) e  jLk

X e (e j )  X (e jL ) xe (n)   x(k )(n  kL)
k  

Interpolator
X (ej)
1/T

 
Xe(ej) L=3
1/T

 
j
L Hi(e )


 /3 /3 

Xi(ej)
L/T

 
Changing the Sampling Rate By a Noninteger Factor

x(n)  xc (nT ) x' (n)  xc (nT ' )

Resampling TM
T '
L
Changing the Sampling Rate By a Noninteger Factor

Sampling Periods:

T T/L TM / L
Lowpass filter Lowpass filter

x(n)
L xe (n)
Gain = L
Cutoff = /L
Gain = 1
xi (n) Cutoff = /M ~
xi (n) M ~
xd (n)

x(n) xe (n) Lowpass filter ~ ~


xd (n)
L M
xi (n)
Gain = L
Cutoff = min(/L, /M)
Sampling Theorem

Realistic Model for


Digital Processing
Ideal Discrete-Time Signal Processing Model

xc(t) x(n) Discrete-Time y(n) yc(t)


C/D LTI System
D/C

T T

Real world Ideal continuous-to- Ideal discrete-to-


signal usually is discrete converter is continuous
not bandlimited not realizable converter is not
realizable
More Realistic Model

xc(t) x(n) Discrete-Time y(n) yc(t)


C/D LTI System
D/C

T T

xc (t ) xa (t ) xo (t ) xˆ (n) yˆ (n) yDA (t ) yˆ r (t )


Anti- Sample Compensated
A/D Discrete-time D/A
aliasing and reconstruction
converter system converter
filter Hold filter
H aa ( j) ~
T T T H r ( j )
Analog-to-Digital Conversion
xa (t ) Sample xo (t ) xˆB (n)
A/D
and
converter
Hold

T T

xa (t )

T xo (t )
Sample and Hold
1 0  t  T
h0 (t )  
0 otherwise
 ho(t)
 (t  nT )
n  
t
t
T

xa (t )

T xo (t )
Sample and Hold
1 0  t  T
h0 (t )  
0 otherwise xo(t)

 x(n)(t  nT )
n  
ho(t)

 t
 xa (nT )(t  nT )
t
 T
n  
xa (t )

T xo (t )
Sample and Hold
1 0  t  T
h0 (t )  
0 otherwise xo(t)

 x(n)(t  nT )
n  
ho(t)

 t
 xa (nT )(t  nT )
t
 T
n  


xo (t )  ho (t ) *  xa (nT )(t  nT )
n  
Goal: To hold constant sample value for A/D converter.

Sample and Hold



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

Zero-Order
Hold
xc (t ) xs (t ) ho(t) xo (t )


xo (t )  ho (t ) *  xa (nT )(t  nT )
n  
xˆ (n)  Q[ x(n)]
A/D Converter

xa (t ) x(n) xˆ (n) xˆB (n)


C/D Quantizer Coder

T
2X m X m
  B 1  B
2 2
Typical Quantizer
xˆ  Q ( x) 2’s complement Offset binary
code code
3 011 111
2 010 110

 001 101
- 2
x
000 100
9 7 5 3 
- 2 - 2 - 2 - 2 2
3
2
5
2
7
2
9
2
 111 011

 2 110 010

3 101 001

 4 100 000
2Xm (B+1)-bit Binary code
xˆ (n)  X m xˆ B (n)
Analysis of Quantization Errors

xa (t ) x(n) xˆ (n) xˆB (n)


C/D Quantizer Coder

x(n) Quantizer xˆ (n)  Q[ x(n)]


Q[ ]

x(n) xˆ (n)  x(n)  e(n)

e(n)
Analysis of Quantization Errors

 The error sequence e(n) is a stationary random process.


 e(n) and x(n) are uncorrelated.
 The random variables of the error process are uncorrelated,
i.e., the error is a white-noise process.
 e(n) is uniform distributed.

x(n) xˆ (n)  x(n)  e(n)

( X m   / 2)  x(n)  ( X m   / 2) e(n)   / 2  e(n)   / 2


SNR (Signal-to-Noise Ratio)
 2x  2 ( X m / 2 B ) 2 2 2 B X m
SNR  10 log 10  2   
2
 
 e 
e
12 12 12

 12  22 B 2x   Xm 
SNR  10 log 10    6.02B  10.8  20 log 10  
 x 
2
 Xm 

x(n) xˆ (n)  x(n)  e(n)

( X m   / 2)  x(n)  ( X m   / 2) e(n)   / 2  e(n)   / 2


SNR (Signal-to-Noise Ratio)
 2x  2 ( X m / 2 B ) 2 2 2 B X m
SNR  10 log 10  2   
2
 
 e 
e
12 12 12

 12  22 B 2x   Xm 
SNR  10 log 10    6.02B  10.8  20 log 10  
 x 
2
 Xm 

每增加一個bit,SNR增加約6dB
Let x=Xm / 4  SNR  6B1.25 dB
SNR (Signal-to-Noise Ratio)
 2x  2 ( X m / 2 B ) 2 2 2 B X m
SNR  10 log 10  2   
2
 
 e 
e
12 12 12

 12  22 B 2x   Xm 
SNR  10 log 10    6.02B  10.8  20 log 10  
 x 
2
 Xm 

 x大較有利,但不得過大(為何?)
 x過小不利 x每降低一倍SNR少6dB
 X~N(0, x2)  P(|X|<4x )0.00064

You might also like