Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
3 4
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
5 6
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
1
Basic Structures Basic Structures
• A fractional change in the sampling rate by
• Here, the lowpass filter H (z ), called the a rational factor L/M can be achieved by
decimation filter, bandlimits the input signal cascading a factor-of-L interpolator with a
x[n] to ω < π / M prior to down-sampling, factor-of-M decimator
to ensure no aliasing
• The interpolator must precede the decimator
• It can be shown that the transpose of a as shown below to ensure that the baseband
factor-of-M decimator is a factor-of-M of w[n] is greater than or equal to that of
interpolator x[n] or y[n]
x[ n ] L H u (z) w[ n ] Hd (z) M y[n ]
7 8
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
2
Input-Output Relation of the Input-Output Relation of the
Interpolator Interpolator
• For the interpolator structure shown below, • Combining the last two equations and
let h[n] denote the impulse response of the making a change of a variable, we arrive at
decimation filter H(z) the desired time-domain input-output
xu [n] relation of the interpolator as
x[ n ] L H (z ) y[n ]
∞
• Then ∞ y[n] = ∑ h[n − Lm] x[ m]
y[n] = ∑ h[ n − l] xu [l] m = −∞
l = −∞
and • In the z-domain, the input-output relation of
xu [ Lm] = x[m], m = 0, ± 1, ± 2,K the interpolator is thus given by
13 14
Y ( z) = H ( z) X ( z L )
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
x[n]
17 18
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
3
Interpolation Filter Interpolation Filter
Specifications Specifications
• Since the sampling is being performed at the • Figure below show the Fourier transform of
Nyquist rate, there is no overlap between the y[n]
shifted spectras of X ( jω / To )
• If we instead sample xa (t ) at a much higher
rate T = To / L yielding y[n], its Fourier
transform Y (e jω ) is related to X a ( jΩ)
through
1 ∞ ⎛ jω − j 2π k ⎞ = L ∞ X ⎛⎜ jω − j 2π k ⎞⎟
Y ( e jω ) = ∑ Xa⎜ ⎟ ∑ a
T k = −∞ ⎝ T ⎠ To k = −∞ ⎝ To / L ⎠
19 20
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
21 22
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
4
Decimation Filter
Filter Design Methods
Specifications
• In a similar manner, we can develop the • The design of the filter H(z) is a standard
specifications for the lowpass decimation IIR or FIR lowpass filter design problem
filter that are given by • Any one of the techniques outlined in
Chapter 7 can be applied for the design of
⎧1, ω ≤ ωc / M
H ( e jω ) = ⎨ these lowpass filters
⎩0, π / M ≤ ω ≤ π
25 26
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
5
Computational Requirements Computational Requirements
• Now assume H(z) to be an IIR filter of order • Its direct form implementation is given by
K with a transfer function w[n] = −d1w[n − 1] − d 2 w[n − 2] − L
V ( z) P( z ) − d K w[n − K ] + x[n]
= H ( z) =
X ( z) D( z ) v[n] = p0 w[n] + p1w[n − 1] + L + pK w[n − K ]
where K • Since v[n] is being down-sampled, it is
P( z ) = ∑ pn z −n sufficient to compute v[n] only for values of
n =0
K n that are integer multiples of M
D( z ) = 1 + ∑ dn z −n
31 n =1 Copyright © 2010, S. K. Mitra
32
Copyright © 2010, S. K. Mitra
Computational Requirements
Computational Requirements
• However, the intermediate signal w[n] must
be computed for all values of n • Example - We compare the computational
• For example, in the computation of complexity of various implementations of a
v[M ] = p0 w[M ] + p1w[ M − 1] + L + pK w[ M − K ] factor-of-M decimator
K+1 successive values of w[n] are still • Let the sampling frequency be FT
required • Then the number of multiplications per
• As a result, the savings in the computation second, to be denoted as RM , are as follows
in this case is going to be less than a factor for various computational schemes
of M
33 34
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
6
Sampling Rate Alteration
Computational Requirements Using MATLAB
• For the case of interpolator design, very
• The function decimate can be employed
similar arguments hold
to reduce the sampling rate of an input
• If H(z) is an FIR interpolation filter, then signal vector x by an integer factor M to
the computational savings is by a factor of L generate the output signal vector y
(since v[n] has L − 1 zeros between its
• The decimation of a sequence by a factor of
consecutive nonzero samples)
M can be obtained using Program 10_5
• On the other hand, computational savings is which employs the function decimate
significantly less with IIR filters
37 38
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
Amplitude
-2 -2
0 20 40 60 80 100 0 10 20 30 40 50
Time index n Time index n
39 40
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
Amplitude
41
interp 42
Time index n Time index n
7
Sampling Rate Alteration
Sampling Rate Alteration
Using MATLAB
Using MATLAB
• The function resample can be employed
to increase the sampling rate of an input • Example - The input and output plots of a
vector x by a ratio of two positive integers, factor-of-5/3 interpolator designed using
L/M, generating an output vector y Program 13_7 are given below
• The M-file employs a lowpass FIR filter Input sequence Output sequence
2 2
designed using fir1 with a Kaiser
1 1
window
Amplitude
Amplitude
0 0
• The fractional interpolation of a sequence
-1 -1
can be obtained using Program 13_7 which
employs the function resample -2
0 10 20 30
-2
0 10 20 30 40 50
Time index n Time index n
43 44
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
45 46
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
8
Multistage Design of Multistage Design of
Decimator and Interpolator
Decimator and Interpolator
• Assume H(z) to be designed as an
• Specifications for the decimation filter H(z) equiripple linear-phase FIR filter
are assumed to be as follows:
• Now Kaiser’s formula for estimating the
Fp = 180 Hz , Fs = 200 Hz , order of H(z) to meet the specifications is
δ p = 0.002 , δ s = 0.001 given by
− 20 log10 δ pδ s −13
N=
14.6 Δf
where Δf = ( Fs − Fp ) / FT is the normalized
transition bandwidth
49 50
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
9
Multistage Design of Multistage Design of
Decimator and Interpolator Decimator and Interpolator
• This can be compensated for by designing • Thus, specifications for the two filters G(z)
F(z) and G(z) to have a passband ripple of and F(z) are as follows:
δ p = 0.001 each G(z): δ p = 0.001, δs = 0.001, Δf = 300
12,000
• On the other hand, the cascade of F(z) and 420
G( z15) has a stopband at least as good as F ( z ): δ p = 0.001, δs = 0.001, Δf =
12,000
F(z) or G( z15), individually
• The filter orders obtained using the M-file
• So we can choose δ s = 0.001 for both filters kaiord are: Order of G(z) =129
Order of F(z) = 92
55 56
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
10
Multistage Design of
Decimator and Interpolator
• The total complexity of the IFIR-based
implementation of the factor-of-30
decimator is therefore
52,000 + 74,400 = 126,400 mult/sec
which is about 5.72 times smaller than that
of a direct implementation of the
decimation filter H(z)
61
Copyright © 2010, S. K. Mitra
11