Digital Integrator and Filters (Slides)
Digital Integrator and Filters (Slides)
First-
First-Order IIR Digital Integrators First-
First-Order IIR Digital Integrators
Backward Rectangular Integrator is based on
backward rectangular method of integration Trapezoidal Integrator is based on the
• Its time-domain input-output relation is trapezoidal method of integration
y[n] = y[n − 1] + T ⋅ x[n] • Its time-domain input-output relation is
• Its transfer function is given by y[n] = y[n − 1] + T ⋅ ( x[n] + x[n − 1])
2
• Its transfer function is given by
H BR ( z ) = T ⎛⎜ 1−1 ⎞⎟
⎝ 1− z ⎠ ⎛ −1 ⎞
• Note: HTR ( z ) = T ⎜⎜ 1 + z −1 ⎟⎟
H FR (e jω ) = H BR (e jω ) 2 ⎝1 − z ⎠
3 4
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
First-
First-Order IIR Digital Integrators Second-
Second-Order IIR Digital
• The magnitude response of the ideal integrator Integrators
is between those of the rectangular integrator Simpson integrator is based on the Simpson
and the trapezoidal integrator method of integration and provides an
1.5
improved numerical result
1 • Its time-domain input-output relation is
Magnitude
1
Digital Differentiators Digital Differentiators
• Employed to perform the differentiation • A practical discrete-time differentiator is
operation on the discrete-time version of a used to perform the differentiation operation
continuous-time signal in the low frequency range and is thus
• Frequency response of an ideal discrete- designed to have a linear magnitude
time differentiator is given by response from dc to a frequency smaller
than p
H (e jω ) = jω for 0 ≤ ω ≤ π
which has a linear magnitude response from
dc to ω = π
7 8
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
|H ID (e j ω )|
which is same as that of a first-order FIR 1
|H CD(e j ω )|
highpass filter described earlier 0.5
0
0 0.2 0.4 0.6 0.8 1
9 10 ω/ π
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
Higher-
Higher-Order FIR Digital
Simple FIR Digital Differentiators
Differentiator
Central-Difference Differentiator avoids the
noise amplification problem of the first- • The time-domain input-output relation of a
difference differentiator higher-order FIR digital differentiator is
• Its time-domain input-output relation is given by
y[n] = 1 ( x[ n] − x[n − 2]) y[n] = − 1 x[n] + x[n − 2] − x[n − 4] + 1 x[ n − 6]
2 16 16
• Its transfer function is given by • Its transfer function is given by
H CD ( z ) = 1 (1 − z − 2 ) H ID ( z ) = − 1 + z −2 − z −4 + 1 z −6
2
• It has a linear magnitude response in a very 16 16
small low-frequency range
11 12
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
2
Higher-
Higher-Order FIR Digital
DC Blockers
Differentiator
• Its magnitude response, scaled by a factor • In some applications it is necessary to
0.6 is shown below remove the dc bias present in a signal
• The frequency range of operation of this before other signal processing algorithms
differentiator is from dc to ω = 0.34π can be applied
2 |HDIFF (ejω )|
Ideal differentiator • The ideal dc blocker has an infinite
1.5
|H FD(e j ω )|
attenuation at dc (ω = 0) and passes all input
Magnitude
|H ID (e j ω )|
1
|H CD(e j ω )|
signals with non-zero frequencies
0.5
0
0 0.2 0.4 0.6 0.8 1
13 ω/ π 14
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
DC Blockers DC Blockers
Simple FIR DC Blocker
• As a result, a dc blocker is essentially a • The simple first-order FIR differentiator
H FD ( z ) = 1 − z −1
highpass filter with a transfer function
having at least one zero at z = 1 and unity
magnitude response for ω ≠ 0 has a zero at z = 1 and thus blocks the dc
component of a signal quite well
• We describe next several simple FIR and • However, very low-frequency spectral
IIR filters that can be used as dc blockers components close to ω = 0 are also
attenuated as can be seen from its
magnitude response plot in Slide No. 13
15 16
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
DC Blockers DC Blockers
Simple IIR DC Blocker • The IIR filter G(z) is often called a leaky
• To boost the dropping magnitude of the integrator
simple FIR dc blocker H FD (z ) near dc, one • The magnitude response of the nonlinear-
solution is to cascade it with an all-pole phase cascaded differentiator/integrator
first-order IIR filter with a transfer function 1 − z −1
H ( z ) = G ( z ) H FD ( z ) =
1G( z) = 1 − αz −1
1 − αz −1 is shown in the next page for various values
where α is real and 0 < α < 1 of α
17 18
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
3
DC Blockers DC Blockers
1
α = 0.9
0.8
α = 0.7 Higher-Order FIR DC Blocker
Magnitude
0.6 α = 0.5
0.4
• A linear-phase dc blocker can be
0.2 implemented by a delay-complementary
0
0 0.2 0.4 0.6 0.8 1 Type 1 moving average filter
ω/π
• Note: The transfer function F(z) is the same • A recursive form of the transfer function of
as that of the first-order IIR highpass filter an M-point (M odd) moving average filter is
H HP (z ) except for the scale factor (1 + α) / 2 given by ⎛ −M ⎞
H MA ( z ) = 1 ⎜⎜ 1 − z −1 ⎟⎟
M ⎝ 1− z ⎠
19 20
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
DC Blockers DC Blockers
• The transfer function of the linear-phase dc • If M is a power-of-2 integer, then the
blocker is thus given by scaling factor M1 can be implemented using
F ( z ) = z −( M −1) / 2 − H MA ( z ) binary shift-and-add operations, avoiding
• Its schematic representation is shown below the multiplication operation
• However, in this case the delay unit z −( M −1) / 2
z −( M −1) / 2 +
−1
develops a fractional delay making it
H MA (z ) difficult to synchronize the two sequences
at the output of the adder
21 22
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
DC Blockers DC Blockers
• The modified structure requires a delay unit
• One way to avoid this problem is to form
the delay-complementary of the cascade of z −( M −1) and provides an integer-valued
delay
two moving average filters as indicated • Gain response of this dc blocker for M = 32
below is shown below
0.5
3
0 0.2 0.4 0.6 0.8 1
ω/ π
23 24
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
4
Comb Filters Comb Filters
• In its most general form, a comb filter has a
• The simple filters discussed so far are frequency response that is a periodic
characterized either by a single passband function of ω with a period 2π/L, where L is
and/or a single stopband a positive integer
• There are applications where filters with • If H(z) is a filter with a single passband
multiple passbands and stopbands are and/or a single stopband, a comb filter can
required be easily generated from it by replacing
• The comb filter is an example of such each delay in its realization with L delays
filters resulting in a structure with a transfer
25 26
function given by G( z ) = H ( z L )
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
0.6
filter −M
0 ≤ k ≤ L − 1 , in the
0.4
H ( z ) = 1− z −1
0.2 M (1− z )
frequency range
has been used as a prototype
0 ≤ ω < 2π
0
0 0.5 1 1.5 2
ω/π
29 30
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
5
FIR Comb Filters IIR Comb Filters
• This filter has a peak magnitude at ω = 0, • The transfer functions of the simplest forms
and M − 1 notches at ω = 2πl / M ,1 ≤ l ≤ M − 1 of the prototype IIR filter are given by
• The corresponding comb filter has a transfer −1 + −1
function H 0 ( z ) = K 1 − z −1 , H1 ( z ) = K 1 z −1
− LM 1 − αz 1 − αz
G( z ) = 1− z − L
M (1− z ) where α < 1 for stability
whose magnitude has L peaks at ω = 2πk/ L,
• Note: H 0 ( z ) is a highpass filter with a zero
0 ≤ k ≤ L − 1 and L( M − 1) notches at
at z = 1 and H1( z ) is a lowpass filter with a
ω = 2π k / LM , 1 ≤ k ≤ L( M − 1)
zero at z = −1
31 32
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra
Gain, dB
_ 20 _ 20
−L + −L
G0 ( z ) = K 1 − z − L , G1( z ) = K 1 z − L
_ 40 _ 40
_ 50 _ 50
_1 _ 0.5 0 0.5 1 _1 _ 0.5 0 0.5 1
1 − αz 1 − αz
ω/ π ω/ π
G0 ( z ) = H 0 ( z 8 ) G1 ( z ) = H1 ( z 8 )
33 34
Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra