You are on page 1of 39

Department of Computer Eng.

Sharif University of Technology


Discrete-time signal processing

Chapter 4:
Sampling of Continuous-Time Signals

Content and Figures are from Discrete-Time Signal Processing, 2e by Oppenheim, Shafer and Buck, 1999-2000 Prentice Hall Inc.
4.1 Periodic Sampling
In this method x[n] obtained
from xc(t) according to the
relation :
x [n ] x c (nT ) n
T sampling period f s 1/T sampling frequency

The sampling operation is generally not invertible i.e.,


given the output x[n] it is not possible in general to
reconstruct xc(t). Although we remove this ambiguity by
restricting xc(t).

Chapter 4: Sampling of Continuous-Time Signals 1


Sampling with a Periodic Impulse
Train
Figure(a) is not a representation of
any physical circuits, but it is
convenient for gaining insight in both
the time and frequency domain.

s (t ) (t nT )
n

(a) Overall system

(b) xs(t) for two sampling rates

(c) Output for two sampling


rates

Chapter 4: Sampling of Continuous-Time Signals 2


4.2 Frequency Domain Representation
of Sampling

x s (t ) x c (t )s (t ) x c (t ) (t nT ) ( Modulation )
n

x s (t ) x
n
c (nT ) (t nT ) (Shifting property )

Let us now consider the Fourier transform of xs(t):


If s (t ) S ( j ) and x c (t ) X C ( j )
Fourier Fourier

2
S ( j)
T
( k )
k
s where s 2 / T is the sampling rate in radians/s.


1 1
X s ( j )
2
X c ( j ) * S ( j )
T
X j ( k )
k
c s

Chapter 4: Sampling of Continuous-Time Signals 3


Frequency Domain Representation
of Sampling
By applying the continuous-time Fourier transform to
equation
x s (t ) x
n
c (nT ) (t nT )
We obtain
X S ( j )
n
x c (nT )e j Tn

x [n ] x c (nT ) and X (e j
)
n
x [n ]e j n

consequently
1 2k
j
X s ( j ) X (e ) X (e j T
) X (e ) X c j
j

T
T k T T

Chapter 4: Sampling of Continuous-Time Signals 4


Exact Recovery of Continuous-Time
from Its Samples
(a) represents a band
limited Fourier
transform of xc(t)
Whose highest nonzero
frequency is N .

(b) represents a
periodic impulse train
with S frequency.

(c) shows the output of


impulse modulator in
the case
S N N S 2N

Chapter 4: Sampling of Continuous-Time Signals 5


Exact Recovery of Continuous-Time
from Its Samples
In this case X C ( j )
dont overlap
therefore xc(t) can be
recovered from xs(t)
with an ideal low pass
filter H r ( j ) with gain
T and cutoff frequency
N C S N
It means X r ( j ) X C ( j )

=
Chapter 4: Sampling of Continuous-Time Signals 6
Aliasing Distortion
(a) represents a band
limited Fourier
transform of xc(t)
Whose highest nonzero
frequency is N .

(b) represents a
periodic impulse train
with S frequency.

(c) shows the output of


impulse modulator in
the case
S N N S 2N

Chapter 4: Sampling of Continuous-Time Signals 7


Aliasing Distortion

In this case the copies of X C ( j ) overlap and is not longer


recoverable by lowpass filtering therefore the reconstructed signal
is related to original continuous-time signal through a distortion
referred to as aliasing distortion.

Chapter 4: Sampling of Continuous-Time Signals 8


Example: The effect of aliasing in the
sampling of cosine signal
Suppose x c (t ) cos(0t )

Chapter 4: Sampling of Continuous-Time Signals 9


Nyquist Sampling Theorem
Sampling theorem describes precisely how much information is
retained when a function is sampled, or whether a band-limited
function can be exactly reconstructed from its samples.
Sampling Theorem: Suppose that x c (t ) X C ( j ) is band-limited
to a frequency interval N , N , i.e., X ( j )
C

X C ( j ) 0 for N

N 0 N

Then xc(t) can be exactly reconstructed from equidistant samples


x [n ] x c (nT s ) x c (2 n / s ) s 2N
where Ts 2 / s is the sampling period, f s 1 / Ts is the sampling
frequency (samples/second), s 2 / Ts is for radians/second.
Chapter 4: Sampling of Continuous-Time Signals 10
Oversampled
Suppose that x c (t ) X C ( j ) is band-limited:
X C ()
A

0
N N
Then if T S is sufficiently small, X (e j
) appears as:
A X (e j )
Ts


N T S N T S
2
0
2

Condition: 2 N T S N T S or N T S or S 2N
Chapter 4: Sampling of Continuous-Time Signals 11
Critically Sampled
Critically sampled: N T S or S 2N
A
X (e j )
Ts


2 0 2
According to the Sampling Theorem, in general the signal cannot be
reconstructed from samples at the rate T S / N .
This is because of errors will occur if X c (N ) 0 , the folded
frequencies will add at .
Consider the case: x c (t ) A sin(N t ) Aj ( N ) ( N )
and note that for T S / N .
x (nT s ) A sin(c nT s ) A sin(n ) 0 (for all n )
Chapter 4: Sampling of Continuous-Time Signals 12
Undersampled (aliased)
If sampling theorem condition is not satisfied N T S or S 2N
A
X (e j )
Ts


2 0 2
The frequencies are folded - summed. This changes the shape of the
spectrum. There is no process whereby the added frequencies can be
discriminated - so the process is not reversible.
Thus, the original (continuous) signal cannot be reconstructed exactly.
Information is lost, and false (alias) information is created.
If a signal is not strictly band-limited, sampling can still be done at twice the
effective band-limited.

Chapter 4: Sampling of Continuous-Time Signals 13


4.3 Reconstruction of a Bandlimited
Signal from Its Samples
Figure(a) represents an ideal
reconstruction system.
Ideal reconstruction filter has
the gain of T and cutoff
frequency c
N C S N

we choice C S / 2 /T.
This choice is appropriate for
any relationship between S
and N .

Chapter 4: Sampling of Continuous-Time Signals 14


Reconstruction of a Bandlimited
Signal from Its Samples
Therefore

x S (t ) x [n ] (t nT )
n

x r (t ) x [n ]h (t nT )
n
r

sin( t /T )
hr (t )
t /T

sin( (t nT ) /T )
x r (t ) x [n ]
n (t nT ) /T

Chapter 4: Sampling of Continuous-Time Signals 15


Reconstruction of a Bandlimited
Signal from Its Samples

x r (t ) x [n ]h (t nT )
n
r

hr (0) 1 x r (mT ) x c (mT ) For all integer


values of m. independent from the
hr (nT ) 0 n 1, 2,... sampling period T.

Therefore the resulting signal is an exact reconstruction of xc(t)


at the sampling times. the fact that, if there is no aliasing, the
low pass filter interpolates the correct reconstruction between
the samples, and if there is aliasing, it cant interpolate them
correctly.

Chapter 4: Sampling of Continuous-Time Signals 16


Ideal D/C Converter

The properties of the ideal D/C converter are most easily seen in the
frequency domain.

x r (t )
n
x [n ]hr (t nT ) X r ( j )
n
x [n ]H r ( j )e j Tn

X r ( j ) H r ( j ) x [n ]e j Tn
n
X r ( j ) H r ( j )X (e j T )
Chapter 4: Sampling of Continuous-Time Signals 17
4.4 Discrete-Time Processing of
Continuous-Time Signals
A major application of discrete-time systems is in the processing of
continuous-time signals.

We know from the previous sections



sin( (t nT ) /T )
x [n ] x c (nT )
y r (t )
n
y [n ]
(t nT ) /T
1

2 k Y r ( j ) H r ( j )Y (e j T )
j
X (e )
T

k
XC(j(
T T
))
TY (e j T ), /T

0, otherwise

Chapter 4: Sampling of Continuous-Time Signals 18


4.4.1 LTI Discrete-Time systems
In the LTI systems we have
Y (e j ) H (e j )X (e j )
Y r ( j ) H r ( j )H (e j T )X (e j T )
1
2 k
Y r ( j ) H r ( j )H (e j T
)
T

k
X C ( j (
T
))

IF X C ( j ) 0 for /T then

H (e j T )X C ( j ), /T
Y r ( j )
0, /T

Chapter 4: Sampling of Continuous-Time Signals 19


4.4.1 LTI Discrete-Time systems

In general if the discrete-time system is LTI and if the


sampling frequency is above the Nyquist rate associated
with the band width of the input xc(t), then the overall
system will be equivalent to a LTI continuous-time
system with an effective frequency response given by:

H (e j T )X C ( j ), /T
Y r ( j ) H eff ( j )X C ( j )
0, /T
H (e j T ), /T
H eff ( j )
0, /T

Chapter 4: Sampling of Continuous-Time Signals 20


Example: Ideal Continuous-Time Lowpass
Filtering Using a Discrete-Time Lowpass Filter

j
1, C
H (e )
0, C

C
1,
H eff ( j ) T
0, C

T

Chapter 4: Sampling of Continuous-Time Signals 21


Example: Ideal Continuous-Time Lowpass
Filtering Using a Discrete-Time Lowpass Filter

Chapter 4: Sampling of Continuous-Time Signals 22


Example: Discrete-Time Implementation of
an Ideal Continuous-Time Bandlimited Differentiator

The ideal continuous-time differentiator system is


d
y c (t ) [x c (t )] H C ( j ) j
dt
For processing bandlimited signals, it is sufficient that
j , /T
H eff ( j )
0, /T
Therefore the corresponding discrete-time system has frequency
response H (e j ) j /T with period 2

H (e j ) j /T with period 2
0, n 0
n cos( n ) sin( n )
h [n ] cos( n )
n T2
nT , n 0

Chapter 4: Sampling of Continuous-Time Signals 23


Example: Discrete-Time Implementation of
an Ideal Continuous-Time Bandlimited Differentiator

If this system has the input


x c (t ) cos(0t ) 0 /T x [n ] cos(0Tn )

1
X (e j T
)
T
[ (
k
0 k s ) ( 0 k s )]

X (e j ) ( 0 ) ( 0 ) 0 0T
j j jj
Y (e ) H (e )X (e ) [ ( 0 ) ( 0 )]
T
j 0 j
Y (e j ) ( 0 ) 0 ( 0 )
T T
Y r ( j ) TY (e j T ) j 0 ( 0 ) j 0 ( 0 )
d
y r (t ) 0 sin(0t ) [x c (t )]
dt
Chapter 4: Sampling of Continuous-Time Signals 24
4.4.2 Impulse Invariance
If the desired continuous-time system has bandlimited frequency
response H C ( j ) then how to choose H (e j ) so that
H eff ( j ) H c ( j )
H (e j T ), /T
H eff ( j )
0, /T
H (e j ) H c ( j /T ),

T be choosen such that H c ( j ) 0 /T

h [n ] Thc (nT )
In this case the discrete-time system is said to be an impulse-
invariant version of the continuous time system.

Chapter 4: Sampling of Continuous-Time Signals 25


Example: A discrete-time lowpass filter
obtained by impulse invariance
We want to obtain an ideal lowpass discrete-time filter with cutoff
frequency c . we can do this by sampling a continuous-time
ideal lowpass filter with cutoff frequency c c /T /T

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

Chapter 4: Sampling of Continuous-Time Signals 26


4.6 Changing the sampling rate using
discrete-time processing
We have seen that a continuous-time signal can be
represented by a discrete-time signal.
x [n ] x c (nT )
It is often necessary to change the sampling rate of x[n]
and obtain a new discrete-time signal such that
x [n ] x c (nT )
One approach is to reconstruct x c (t ) and then resample
it with period T , but it is of interest to consider methods
that involve only discrete time operations.

Chapter 4: Sampling of Continuous-Time Signals 27


4.6.1 Sampling rate reduction by an
integer factor
Discrete-time sampler or compressor
x d [n ] x [nM ] x c (nMT )

If X C ( j ) 0 for N then x d [n ] is an exact


representation of x c (t ) iff /T / MT N

Downsampling: the operation of reducing the sampling


rate (including any filtering).

Chapter 4: Sampling of Continuous-Time Signals 28


Frequency domain relation between the
input and output of the compressor

1
2 k
x [n ] x c (nT ) X (e j
)
T

k
X C ( j (
T

T
))

1 2 r
x d [n ] x c (nMT ) X d (e )
j

MT r
X C ( j (
MT MT
))

r i kM k , 0 i M 1
1 M 1
1
2 k 2 i
X d (e j
)
M

i 0 T
k
XC(j(
MT

T
))
MT
1 M 1
j
X d (e )
M i 0

X (e j ( / M 2 i / M )
)

Chapter 4: Sampling of Continuous-Time Signals 29


Downsampling without Aliasing

Chapter 4: Sampling of Continuous-Time Signals 30


Downsampling with aliasing

Chapter 4: Sampling of Continuous-Time Signals 31


Downsampling with prefiltering to
avoid aliasing

Chapter 4: Sampling of Continuous-Time Signals 32


4.6.2 Increasing the sampling rate
by an integer factor

We will refer to the operation of increasing the sampling rate


upsampling x i [n ] x [n / L ] x c (nT / L ) n 0, L , 2L ,...
The system on the left is called a sampling rate expander. Its output
is
x [n / L ], n 0, L , 2L ,...
x e [n ]
0, otherwise

x e [n ] x [k ] [n kL ]
k
The system on the right is a lowpass discrete-time filter with cutoff
frequency / L and gain L.

Chapter 4: Sampling of Continuous-Time Signals 33


Increasing the sampling rate
by an integer factor

j n
X e (e ) x [k ] [n kL ] e
j
x [k ]e j Lk X (e j L )
n k k

This system is an interpolator


because of it fills in the missing
samples.

Chapter 4: Sampling of Continuous-Time Signals 34


Increasing the Sampling Rate
By an Integer Factor
x [n / L ], n 0, L , 2L ,...
x e [n ]
0, otherwise

x e [n ] x [k ] [n kL ]
k

sin( n / L )
h i [n ]
n /L

sin( (n kL ) / L )
x i [n ] x [k ]
k (n kL ) / L
therefore x i [n ] x [n / L ] x c (nT / L ) x c (nT ) n 0, L , 2L ,...
If the input sequence x [n ] x c (nT ) was obtained by sampling
without aliasing then x i [n ] x c (nT ) is correct for all n, And x i [n ]
is obtained by oversampling of x c (t ) .

Chapter 4: Sampling of Continuous-Time Signals 35


Linear Interpolation
In practice ideal lowpass filters can not be implemented exactly. In
some cases, simple interpolation procedure are adequate. Since
linear interpolation is often used.
1 n / L , n L
hlin [n ]
0, otherwise
2
1 sin( L / 2)
H lin (e j )
L sin( / 2)

x lin [n ] x
k
e [k ]hlin [n k ]

x [k ]h
k
lin [n kL ]

Chapter 4: Sampling of Continuous-Time Signals 36


4.6.3 Changing the Sampling Rate
by a Noninteger Factor
By combining decimation and interpolation it is possible to change
the sampling rate by a noninteger factor.

The interpolation and decimation filter can be combined together.

Chapter 4: Sampling of Continuous-Time Signals 37


Changing the Sampling Rate
by a Noninteger Factor

Chapter 4: Sampling of Continuous-Time Signals 38

You might also like