Académique Documents
Professionnel Documents
Culture Documents
Processing
Basic Sampling Rate Alteration Devices
Up-sampler - Used to increase the sampling
rate by an integer factor
Down-sampler - Used to decrease the
sampling rate by an integer factor
Copyright 2001, S.
Up-Sampler
Time-Domain Characterization
An up-sampler with an up-sampling factor
L, where L is a positive integer, develops an
output sequence xu [n] with a sampling rate
that is L times larger than that of the input
sequence x[n]
Block-diagram representation
x[n]
2
xu [n ]
Copyright 2001, S.
Up-Sampler
Up-sampling operation is implemented by
inserting L 1 equidistant zero-valued
samples between two consecutive samples
of x[n]
Input-output relation
x[n / L],
xu [n]
0,
n 0, L, 2 L,
otherwise
Copyright 2001, S.
Up-Sampler
Figure below shows the up-sampling by a
factor of 3 of a sinusoidal sequence with a
frequency of 0.12 Hz obtained using
Program 10_1
InputSequence
1
0.5
Amplitude
Amplitude
0.5
0
0.5
1
Outputsequenceupsampledby3
0
0.5
10
20
30
Timeindexn
40
50
1
0
10
20
30
Timeindexn
40
50
Copyright 2001, S.
Up-Sampler
In practice, the zero-valued samples
inserted by the up-sampler are replaced with
appropriate nonzero values using some type
of filtering process
Process is called interpolation and will be
discussed later
Copyright 2001, S.
Down-Sampler
Time-Domain Characterization
An down-sampler with a down-sampling
factor M, where M is a positive integer,
develops an output sequence y[n] with a
sampling rate that is (1/M)-th of that of the
input sequence x[n]
Block-diagram representation
x[n]
6
y[n]
Copyright 2001, S.
Down-Sampler
Down-sampling operation is implemented
by keeping every M-th sample of x[n] and
removing M 1 in-between samples to
generate y[n]
Input-output relation
y[n] = x[nM]
Copyright 2001, S.
Down-Sampler
Figure below shows the down-sampling by
a factor of 3 of a sinusoidal sequence of
frequency 0.042 Hz obtained using Program
10_2
InputSequence
1
0.5
Amplitude
Amplitude
0.5
0
0.5
1
Outputsequencedownsampledby3
0
0.5
10
20
30
Timeindexn
40
50
10
20
30
Timeindexn
40
50
Copyright 2001, S.
Copyright 2001, S.
Down-Sampler
Figure below shows explicitly the timedimensions for the down-sampler
x[ n ] xa ( nT )
Input sampling frequency
1
FT
T
10
y[ n ] xa ( nMT )
Output sampling frequency
FT
1
'
FT
M T'
Copyright 2001, S.
Up-Sampler
Figure below shows explicitly the timedimensions for the up-sampler
x[ n ] xa ( nT )
y[n]
xa ( nT / L ), n 0, L, 2 L ,
0
otherwise
1
FT
T
11
Copyright 2001, S.
13
Up-Sampler
Frequency-Domain Characterization
Consider first a factor-of-2 up-sampler
whose input-output relation in the timedomain is given by
x[n / 2], n 0, 2, 4,
x u [n ]
0,
otherwise
14
Copyright 2001, S.
Up-Sampler
In terms of the z-transform, the input-output
relation is then given by
X u ( z)
n
x
[
n
]
z
n
x
[
n
/
2
]
z
n
n even
x[m] z 2 m X ( z 2 )
15
Copyright 2001, S.
Up-Sampler
In a similar manner, we can show that for a
factor-of-L up-sampler
L
X u ( z) X ( z )
On the unit circle, for z e j , the inputoutput relation is given by
X u (e
16
) X (e
j L
Copyright 2001, S.
Up-Sampler
Figure below shows the relation between
j
j
X (e ) and X u (e ) for L = 2 in the case of
a typical sequence x[n]
17
Copyright 2001, S.
Up-Sampler
As can be seen, a factor-of-2 sampling rate
j
expansion leads to a compression of X (e )
by a factor of 2 and a 2-fold repetition in the
baseband [0, 2]
This process is called imaging as we get an
additional image of the input spectrum
18
Copyright 2001, S.
Up-Sampler
Similarly in the case of a factor-of-L
sampling rate expansion, there will be L 1
additional images of the input spectrum in
the baseband
Lowpass filtering of xu [n] removes the L 1
images and in effect fills in the zerovalued samples in xu [n] with interpolated
sample values
19
Copyright 2001, S.
Up-Sampler
Program 10_3 can be used to illustrate the
frequency-domain properties of the upsampler shown below for L = 4
Inputspectrum
0.8
Magnitude
Magnitude
0.8
0.6
0.4
0.2
0
20
Outputspectrum
0.6
0.4
0.2
0.2
0.4
0.6
0.8
0
0
0.2
0.4
0.6
0.8
Copyright 2001, S.
Down-Sampler
Frequency-Domain Characterization
Applying the z-transform to the input-output
relation of a factor-of-M down-sampler
we get
y[n] x[Mn]
Y ( z)
x[Mn] z
Copyright 2001, S.
Down-Sampler
To get around this problem, define a new
sequence xint [n] :
x[n], n 0, M , 2 M ,
xint [n]
otherwise
0,
Then
Y ( z)
22
x[Mn] z
xint [k ] z
xint [Mn] z
k / M
1/ M
X int ( z
Copyright 2001, S.
Down-Sampler
Now, xint [n] can be formally related to x[n]
through
xint [n] c[n] x[n]
where
23
1, n 0, M , 2 M ,
c[n]
otherwise
0,
A convenient representation of c[n] is given
by
1 M 1 kn
c[n]
WM
M k 0
where WM e j 2 / M
Copyright 2001, S.
Down-Sampler
Taking the z-transform of xint [n] c[n] x[n]
and making use of
1
c[n]
M
M 1
k 0
WMkn
we arrive at
X int ( z )
24
c[n]x[n] z
M 1
kn
WM
x[n] z n
n k 0
M 1
1
kn n
k
x
[
n
]
W
z
X
z
W
M
M
M
k 0 n
k 0
Copyright 2001, S.
n
1 M 1
Down-Sampler
Consider a factor-of-2 down-sampler with
an input x[n] whose spectrum is as shown
below
25
Y (e ) { X (e j / 2 ) X (e j / 2 )}
2
Copyright 2001, S.
Down-Sampler
Now X (e j / 2 ) X (e j ( 2 ) / 2 ) implying
j / 2 )
X
(
e
that the second term
in the
previous equation is simply obtained by
shifting the first term X (e j / 2 ) to the right
by an amount 2 as shown below
26
Copyright 2001, S.
Down-Sampler
The plots of the two terms have an overlap,
and hence, in general, the original shape
of X (e j ) is lost when x[n] is downsampled as indicated below
27
Copyright 2001, S.
Down-Sampler
This overlap causes the aliasing that takes
place due to under-sampling
There is no overlap, i.e., no aliasing, only if
X ( e j ) 0
for / 2
Note: Y (e j ) is indeed periodic with a
period 2, even though the stretched version
of X (e j ) is periodic with a period 4
28
Copyright 2001, S.
Down-Sampler
For the general case, the relation between the
DTFTs of the output and the input of a factorof-M down-sampler is given by
M 1
1
j ( 2 k ) / M )
Y ( e j )
X
(
e
M k 0
Y (e j ) is a sum of M uniformly
shifted and stretched versions of X (e jand
)
29
Copyright 2001, S.
Down-Sampler
Aliasing is absent if and only if
X (e j ) 0 for / M
as shown below for M = 2
X (e j ) 0 for / 2
30
Copyright 2001, S.
Down-Sampler
Program 10_4 can be used to illustrate the
frequency-domain properties of the upsampler shown below for M = 2
Inputspectrum
0.4
Magnitude
Magnitude
0.8
0.6
0.4
0.2
0
0
31
Outputspectrum
0.5
0.3
0.2
0.1
0.2
0.4
0.6
0.8
0
0
0.2
0.4
0.6
0.8
Copyright 2001, S.
Down-Sampler
The input and output spectra of a down-sampler with
M = 3 obtained using Program 10-4 are shown below
Inputspectrum
0.4
Magnitude
0.8
Magnitude
Outputspectrum
0.5
0.6
0.4
0.3
0.2
0.1
0.2
Effect
of aliasing can be clearly
seen
0
32
0.2
0.4
0.6
0.8
0
0
0.2
0.4
0.6
0.8
Copyright 2001, S.
Cascade Equivalences
A complex multirate system is formed by an
interconnection of the up-sampler, the
down-sampler, and the components of an
LTI digital filter
In many applications these devices appear
in a cascade form
An interchange of the positions of the
branches in a cascade often can lead to a
computationally efficient realization
33
Copyright 2001, S.
Cascade Equivalences
To implement a fractional change in the
sampling rate we need to employ a cascade
of an up-sampler and a down-sampler
Consider the two cascade connections
shown below
34
x[n ]
y1 [ n ]
x[n ]
y2 [ n]
Copyright 2001, S.
Cascade Equivalences
A cascade of a factor-of-M down-sampler
and a factor-of-L up-sampler is
interchangeable with no change in the
input-output relation:
y1[n] y2 [n]
if and only if M and L are relatively prime,
prime
i.e., M and L do not have any common
factor that is an integer k > 1
35
Copyright 2001, S.
Cascade Equivalences
Two other cascade equivalences are shown
below
Cascade equivalence #1
x[n ]
y1 [ n ]
H (z )
x[n ]
H (z M )
y1 [ n ]
H (z )
y2 [ n]
Cascade equivalence #2
x[n ]
y2 [ n]
H (z L )
36
x[n ]
Copyright 2001, S.
Copyright 2001, S.
38
Filter Specifications
Since up-sampling causes periodic
repetition of the basic spectrum, the
unwanted images in the spectra of the upsampled signal xu [n] must be removed by
using a lowpass filter H(z), called the
interpolation filter,
filter as indicated below
x[n ]
39
xu [n]
H (z)
y[n ]
Filter Specifications
On the other hand, prior to down-sampling,
the signal v[n] should be bandlimited to
/M
by means of a
lowpass filter, called the decimation filter,
filter
as indicated below to avoid aliasing caused
by down-sampling
x[n ]
H (z)
y[n ]
Copyright 2001, S.
Interpolation Filter
Specifications
41
j j 2 k
1
j
X (e )
Xa
To k
To
Copyright 2001, S.
Interpolation Filter
Specifications
Since the sampling is being performed at the
Nyquist rate,
rate there is no overlap between the
shifted spectras of X ( j / To )
If we instead sample xa (t ) at a much higher
rate T L To yielding y[n], its Fourier
j
transform Y (e ) is related to X a ( j)
through
Y (e
42
j j 2 k
1
j j 2 k
L
)
Xa
Xa
T k
T
To / L
To k
Copyright 2001, S.
Interpolation Filter
Specifications
43
Interpolation Filter
Specifications
In practice, a transition band is provided to
ensure the realizability and stability of the
lowpass interpolation filter H(z)
Hence, the desired lowpass filter should
have a stopband edge at s / L and a
passband edge p close to s to reduce the
distortion of the spectrum of x[n]
44
Copyright 2001, S.
Interpolation Filter
Specifications
If c is the highest frequency that needs to
be preserved in x[n], then
p c / L
Summarizing the specifications of the
lowpass interpolation filter are thus given
by
c / L
L,
j
H (e )
0, / L
45
Copyright 2001, S.
Decimation Filter
Specifications
In a similar manner, we can develop the
specifications for the lowpass decimation
filter that are given by
H (e
46
c / M
1,
)
0, / M
Copyright 2001, S.
47
Copyright 2001, S.
Copyright 2001, S.
49
H u (z)
H d (z)
H u (z)
M
H (z)
M
Copyright 2001, S.
Computational Requirements
The lowpass decimation or interpolation
filter can be designed either as an FIR or an
IIR digital filter
In the case of single-rate digital signal
processing, IIR digital filters are, in general,
computationally more efficient than
equivalent FIR digital filters, and are
therefore preferred where computational
cost needs to be minimized
51
Copyright 2001, S.
Computational Requirements
This issue is not quite the same in the case
of multirate digital signal processing
To illustrate this point further, consider the
factor-of-M decimator shown below
x[n ]
52
H (z)
v[n ]
y[n ]
Copyright 2001, S.
Computational Requirements
Now, the down-sampler keeps only every Mth sample of v[n] at its output
Hence, it is sufficient to compute v[n] only
for values of n that are multiples of M and
skip the computations of in-between
samples
This leads to a factor of M savings in the
computational complexity
53
Copyright 2001, S.
Computational Requirements
Now assume H(z) to be an IIR filter of
order K with a transfer function
V ( z)
P( z )
H ( z)
X ( z)
D( z )
where
P( z )
pn z
n 0
D( z ) 1
54
dn z
n 1
n
Copyright 2001, S.
Computational Requirements
Its direct form implementation is given by
w[n] d1w[n 1] d 2 w[n 2]
d K w[n K ] x[n]
v[n] p0 w[n] p1w[n 1] pK w[n K ]
Since v[n] is being down-sampled, it is
sufficient to compute v[n] only for values of
n that are integer multiples of M
55
Copyright 2001, S.
Computational Requirements
However, the intermediate signal w[n] must
be computed for all values of n
For example, in the computation of
v[M ] p0 w[M ] p1w[M 1] pK w[M K ]
K+1 successive values of w[n] are still
required
As a result, the savings in the computation
in this case is going to be less than a factor
of M
56
Copyright 2001, S.
Computational Requirements
For the case of interpolator design, very
similar arguments hold
If H(z) is an FIR interpolation filter, then the
computational savings is by a factor of L
(since v[n] has L 1 zeros between its
consecutive nonzero samples)
On the other hand, computational savings is
significantly less with IIR filters
57
Copyright 2001, S.
Copyright 2001, S.
59
1
Amplitude
Amplitude
1
0
1
2
0
Outputsequence
20
40
60
Timeindexn
80
100
0
1
2
0
10
20
30
Timeindexn
40
50
Copyright 2001, S.
60
Copyright 2001, S.
61
Copyright 2001, S.
62
1
Amplitude
Amplitude
1
0
1
2
0
Outputsequence
10
20
30
Timeindexn
40
50
0
1
2
0
20
40
60
Timeindexn
80
100
Copyright 2001, S.
63
Inputsequence
64
1
Amplitude
Amplitude
1
0
1
2
0
Outputsequence
10
20
Timeindexn
30
0
1
2
0
10
20
30
Timeindexn
40
50
Copyright 2001, S.