Sei sulla pagina 1di 11

Multirate Structures for Multirate Structures for

Sampling Rate Conversion Sampling Rate Conversion


• From the sampling theorem it is known that • Likewise, the zero-valued samples
the sampling rate of a critically sampled introduced by an up-sampler must be
discrete-time signal with a spectrum
interpolated to more appropriate values for
occupying the full Nyquist range cannot be
reduced any further since such a reduction an effective sampling rate increase
will introduce aliasing • We shall show shortly that this interpolation
• Hence, the bandwidth of a critically can be achieved simply by digital lowpass
sampled signal must be reduced by lowpass filtering
filtering before its sampling rate is reduced
by a down-sampler
1 2
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Multirate Structures for


Basic Structures
Sampling Rate Conversion
• Since a fractional-rate sampling rate • Since up-sampling by an integer factor L
converter with a rational conversion factor causes periodic repetition of the basic
can be realized by cascading an interpolator spectrum, the basic interpolator structure for
with a decimator, filters are also needed in integer-valued sampling rate increase
the design of such multirate systems consists of an up-sampler followed by a
low-pass filter H (z ) with a cutoff at π / L
as indicated below:
xu [n]
x[n ] L H (z ) y[n ]

3 4
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Basic Structures Basic Structures


• The lowpass filter H (z ), called the • Hence, the basic decimator structure for
interpolation filter, removes the unwanted integer-valued sampling rate decrease
images in the spectra of the up-sampled consists of a lowpss filter H (z ) with a cutoff
signal xu [n] at π/M, followed by the down-sampler as
• On the other hand, down-sampling by an shown below
integer factor M may result in aliasing y[n ]
x[n ] H (z) M

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

Input-Output Relation of the


Basic Structures
Decimator
• As both the interpolation filter H u (z ) and • For the decimator structure shown below,
the decimation filter H d (z ) operate at the let h[n] denote the impulse response of the
same sampling rate, they can be replaced decimation filter H(z)
with a single filter designed to avoid v[ n ] y[n ]
x[ n ] H (z) M
aliasing that may be caused by down- • Then ∞
sampling and eliminate images resulting v[n] = ∑ h[n − l]x[l]
from up-sampling l = −∞
and
x[ n ] L H ( z) M y[ n ] y[n] = v[ Mn]
9 10
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Input-Output Relation of the Input-Output Relation of the


Decimator Decimator
• Combining the last two equations we arrive • Now the input-output relation of the dowm-
at the desired input-output relation of the sampler is given by
decimator given by 1 M −1 1 / M −k
∞ Y ( z) = ∑ V ( z WM )
y[n] = ∑ h[ Mn − l] x[l] M k =0
l = −∞ • Combining the last two equations we arrive
• In the z-domain, the input-output relation of at the input-output relation of the decimator
the decimation filter is given by as
1 M −1 1 / M −k 1 / M −k
V ( z) = H ( z) X ( z) Y ( z) = ∑ H ( z WM )X ( z WM )
M k =0
11 12
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

Input-Output Relation of the Interpolation Filter


Fractional-Rate Converter Specifications
• Here, in the time-domain the input-output • Assume x[n] has been obtained by sampling a
relation is given by continuous-time signal xa (t ) at the Nyquist
∞ rate
y[n] = ∑ h[ Mn − Lm]x[ m]
m = −∞ • If X a ( jΩ) and X (e jω ) denote the Fourier
transforms of xa (t ) and x[n], respectively,
• In the z-domain it is given by
then it can be shown
1 M −1 1/ M −k L / M − kL 1 ∞ ⎛ jω − j 2 π k ⎞
Y ( z) = ∑ H ( z WM )X ( z WM ) X ( e jω ) =
M k =0 ∑ Xa⎜ ⎟
To k =−∞ ⎝ To ⎠
15 16
• where To is the sampling period
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Interpolation Filter Interpolation Filter


Specifications Specifications
• Figures below show xa (t ) and x[n] obtained • Figures below show the Fourier transforms of
by sampling xa (t ) at the Nyquist rate xa (t ) and x[n]
xa (t ) X a ( jΩ )

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

Interpolation Filter Interpolation Filter


Specifications Specifications
• On the other hand, if we pass x[n] through a • It therefore follows that if xu [n] is passed
factor-of-L up-sampler generating xu [n] , the through an ideal lowpass filter H(z) with a
relation between the Fourier transforms of cutoff at π/L and a gain of L, the output of
x[n] and xu [n] are given by the filter will be precisely y[n]
X u ( e jω ) = X ( e jω L ) LH ( e jω )

1 X u (e )

21 22
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Interpolation Filter Interpolation Filter


Specifications Specifications
• In practice, a transition band is provided to • If ωc is the highest frequency that needs to
ensure the realizability and stability of the be preserved in x[n], then
lowpass interpolation filter H(z) ω p = ωc / L
• Hence, the desired lowpass filter should • Summarizing the specifications of the
have a stopband edge at ωs = π / L and a lowpass interpolation filter are thus given
passband edge ω p close to ωs to reduce the by
distortion of the spectrum of x[n] ⎧ L, ω ≤ ωc / L
H ( e jω ) = ⎨
⎩ 0, π / L ≤ ω ≤ π
23 24
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

Filters for Fractional Sampling Computational Requirements


Rate Alteration
• The lowpass decimation or interpolation
• For the fractional sampling rate structure filter can be designed either as an FIR or an
shown below, the lowpass filter H(z) has a IIR digital filter
stopband edge frequency given by • In the case of single-rate digital signal
π π
ω s = min⎛⎜ , ⎞⎟
processing, IIR digital filters are, in general,
⎝L M ⎠ computationally more efficient than
equivalent FIR digital filters, and are
L H (z ) M therefore preferred where computational
cost needs to be minimized
27 28
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Computational Requirements Computational Requirements


• This issue is not quite the same in the case
of multirate digital signal processing • Now, the down-sampler keeps only every
• To illustrate this point further, consider the M-th sample of v[n] at its output
factor-of-M decimator shown below • Hence, it is sufficient to compute v[n] only
x[ n ] H (z)
v[n ]
M y[ n ] for values of n that are multiples of M and
skip the computations of in-between
• If the decimation filter H(z) is an FIR filter
samples
of length N implemented in a direct form,
then • This leads to a factor of M savings in the
N −1
v[n] = ∑ h[m] x[n − m] computational complexity
29 m =0 Copyright © 2010, S. K. Mitra
30
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

Computational Requirements Computational Requirements


• FIR H(z) of length N :
• In the FIR case, savings in computations is
RM , FIR = N × FT by a factor of M
• FIR H(z) of length N followed by a down- • In the IIR case, savings in computations is
sampler: by a factor of M(2K+1)/[(M+1)K+1], which
RM , FIR − DEC = N × FT / M is not significant for large K
• IIR H(z) of order K: • For M = 10 and K = 9, the savings is only
RM , IIR = (2 K + 1) × FT by a factor of 1.9
• IIR H(z) of order K followed by a down- • There are certain cases where the IIR filter
sampler : can be computationally more efficient
35 RM , IIR − DEC = K × FT + ( K + 1) ×Copyright
FT / ©M 2010, S. K. Mitra
36
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

Sampling Rate Alteration Sampling Rate Alteration


Using MATLAB Using MATLAB
• Example - The input and output plots of a • The function interp can be employed to
factor-of-2 decimator designed using the increase the sampling rate of an input signal
Program 13_5 are shown below x by an integer factor L generating the
2
Input sequence
2
Output sequence output vector y
1 1 • The lowpass filter designed by the M-file is
Amplitude

Amplitude

0 0 a symmetric FIR filter


-1 -1

-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

Sampling Rate Alteration Sampling Rate Alteration


Using MATLAB Using MATLAB
• The filter allows the original input samples • Example - The input and output plots of a
to appear as is in the output and finds the factor-of-2 interpolator designed using
missing samples by minimizing the mean- Program 13_6 are shown below
square errors between these samples and 2
Input sequence
2
Output sequence

their ideal values 1 1


Amplitude

Amplitude

• The interpolation of a sequence x by a 0 0

factor of L can be obtained using the -1 -1

Program 13_6 which employs the function -2


0 10 20 30 40 50
-2
0 20 40 60 80 100

41
interp 42
Time index n Time index n

Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

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

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• The interpolator and the decimator can also • Likewise if the decimator factor M can be
be designed in more than one stages expressed as a product of two integers, M1
• For example if the interpolation factor L can and M2 , then the factor-of-M interpolator
be expressed as a product of two integers, L1 can be realized in two stages as shown
and L2 , then the factor-of-L interpolator can below
be realized in two stages as shown below
x[ n ] H1( z ) M1 H2 ( z ) M2 y[n ]
x[ n ] L1 H1( z ) L2 H2 ( z ) y[n ]

45 46
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• Of course, the design can involve more than • Example - Consider the design of a
two stages, depending on the number of decimator for reducing the sampling rate of
factors used to express L and M, respectively a signal from 12 kHz to 400 Hz
• In general, the computational efficiency is • The desired down-sampling factor is
improved significantly by designing the therefore M = 30 as shown below
sampling rate alteration system as a cascade
H(z) 30
of several stages
12 kHz 12 kHz 400 Hz
• We consider the use of FIR filters here
47 48
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

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• The M-file kaiord determines the filter order • We next implement H(z) using the IFIR
using Kaiser’s formula approach as a cascade in the form of
• Using kaiord we obtain N = 1808 G( z15 ) F ( z ) G ( z15 ) F (z ) 30
12 kHz 12 kHz 12 kHz 400 Hz
• Therefore, the number of multiplications per
second in the single-stage implementation • The specifications of the
of the factor-of-30 decimator is parent filter G(z) should
12,000 thus be as shown on the
R M ,H = 1809 × = 723,600
30 right
51 52
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• This corresponds to stretching the • Note: The desired response of F(z) has a
specifications of H(z) by 15 wider transition band as it takes into
• Figure below shows the magnitude response account the spectral gaps between the
of G( z15) and the desired response of F(z) passbands of G( z15)
• Because of the cascade connection, the
overall ripple of the cascade in dB is given
by the sum of the passband ripples of F(z)
and G( z15) in dB
53 54
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

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• The length of H(z) for a direct implementation • The computational complexity of the
is 1809 decimator implemented using the cascade
• The length of cascade implementation structure can be dramatically reduced by
G( z15 ) F ( z ) is 92 + 15 × 129 + 1 = 2028 making use of the cascade equivalence #1
• The length of the cascade structure is • To this end, we first redraw the structure
higher G ( z15 ) F (z) 30
in the form shown below
F (z ) G ( z15 ) 30
57 58
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra

Multistage Design of Multistage Design of


Decimator and Interpolator Decimator and Interpolator
• The last structure is equivalent to the one • From the last realization we observe that the
shown below implementation of G(z) followed by a
F (z) G ( z15 ) 15 2 factor-of-2 down-sampler requires
• The above can be redrawn as indicated R M ,G = 130 × 8002
= 52,000 mult/sec
below by making use of the cascade • Likewise, the implementation of F(z)
equivalence #1 followed by a factor-of-15 down-sampler
F (z) 15 G( z) 2 requires
12 kHz 12 kHz 800 Hz 800 Hz 400 Hz R M , F = 93 × 12,000 = 74,400 mult/sec
15
Factor-of-15 decimator Factor-of-2 decimator
59 60
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

Potrebbero piacerti anche