Unit-4 - Design of Digital Filter
Unit-4 - Design of Digital Filter
Digital Filter
• A digital filter is a mathematical algorithm implemented in
hardware/software that operates on a digital input to produce a digital
output.
• Digital filters are preferred in a number of applications like data
compression, speech processing, image processing, etc., because of the
following advantages.
1. Digital filters can have characteristics which are not possible with analog
filters such as linear phase response.
2. The performance of digital filters does not vary with environmental
changes, for example, thermal variations.
3. The frequency response of a digital filter can be adjusted if it is
implemented using a programmable processor.
4. Several input signals can be filtered by one digital filter without the need
to replicate the hardware.
5. Digital filters can be used at very low frequencies.
• The following are the main disadvantages of digital filters compared
with analog filters:
(i) Speed limitation
(ii) Finite word length effects
(iii) Long design and development times
• Digital filters are classified either as
1. finite duration impulse response (FIR) filters
2. infinite duration impulse response (IIR) filters,
depending on the form of the impulse response of the system.
Finite number of
FIR
non-zero terms
• The Fourier coefficients of the series hd(n) are identical to the impulse response of a
digital filter.
• There are two difficulties with the for designing a digital filter:
1. The impulse response is of infinite duration and
2. The filter is non-causal and unrealizable.
• No finite amount of delay can make the impulse response realizable. Hence the filter
resulting from a Fourier series representation of H(ejω) is an unrealizable IIR filter.
• The infinite duration impulse response can be converted to a finite duration impulse
response by truncating the infinite series at n= ±M.
• But, this results in undesirable oscillations in the passband and stopband of the digital
filter.
• These undesirable oscillations can be reduced by using a set of time-limited weighting
functions, w(n), referred to as window functions, to modify the Fourier coefficients.
• The desired frequency response H(ejω) and its Fourier coefficients {h(n)} are shown
above
• The finite duration weighting function w(n) and its Fourier transform W(ejω) are shown below:
• The Fourier transform of the weighting function consists of a main lobe, which contains most of
the energy of the window function and side lobes which decay rapidly.
•
The sequence ℎ(n) = h(n).ω(n) is obtained to get an FIR approximation of H(ejω). The sequence
ℎ(n)
is exactly zero outside the interval –M ≤ 𝑛 ≤ M. Sequence ℎ(n) and its Fourier transform
jω) are shown below:
ℎ(e
• jω) is nothing but the circular convolution of H(ejω) and W(e jω).
𝐻(e
• The realisable causal sequence g(n), which is obtained by shifting ℎ(n) , is shown in
the last row and this can be used as the desired filter impulse response.
• The desirable characteristics of window functions are:
1. The Fourier transform of the window function W(e jω) should have a small width of
main lobe containing as much of the total energy as possible.
2. The Fourier transform of the window function W(ejω) should have side lobes that
decrease in energy rapidly as ω tends to π.
Rectangular Window Function
• The weighting function for the rectangular window is :
• The width of the main lobe is approximately 8π/M and the peak of the first side lobe is
at 243 dB. The side lobe roll off is 20 dB/decade.
• For a causal Hamming window, the second and third terms are negative:
Hanning Window Function
• The window function of a causal Hanning window is:
• The width of the main lobe is approximately 8π/M and the peak of the first side lobe is
at -32 dB.
Blackman Window Function
• The window function of a causal Blackman window is
• The width of the main lobe is approximately 12π/M and the peak of the first side-lobe is
at –58 dB.
Solution
Solution
Ans
:
Design of IIR Filter
• The system function describing an analog filter may be written as
• where {ak} and {bk} are the filter coefficients. The impulse response
of these filter coefficients is related to Ha(s) by the Laplace
transform
• The analog filter having the rational system function Ha(s) also be
described by the LCCDE
• The design techniques for IIR filters are presented with the restriction that the
filters be realisable and stable.
• An analog filter with system function H(s) is stable if all its poles lie in the left-
half of the s-plane.
• As a result, if the conversion techniques are to be effective, the technique
should possess the following properties:
(i) The jΩ axis in the s-plane should map onto the unit circle in the z-plane.
This gives a direct relationship between the two frequency variables in the two
domains.
(ii) The left-half plane of the s-plane should map into the inside of the unit
circle in the z-plane to convert a stable analog filter into a stable digital filter.
Impulse Invariance Method
• The impulse response of the discrete system
(digital filter) be the discrete version of the
impulse response of the analog system (filter).
• The desired impulse response of the digital filter
is obtained by uniformly sampling the impulse
response of the equivalent analog filter. That is,
h(n) = ha (nT)
where T is the sampling interval.
• Steps:
1. Get H(s) of an analog filter that satisfies the
prescribed magnitude response.
2. Apply the inverse Laplace transform to get the
impulse response h(t).
3. Obtain a discrete version of h(t) by replacing t by
nT i.e. h(nT).
4. Apply the Z-transform to h(nT) to get H(z) and
multiply by T.
1.
2.
3.
4.
• The analog pole at s = pi is mapped into a digital pole at z = epiT.
• Therefore, the analog poles and the digital poles are related by the
relation
z = esT
• The general characteristic of the mapping z = esT can be obtained by
substituting s = σ + jΩ and expressing the complex variable z in the
polar form as z = rejω.
re jω = eσT e jΩT
Therefore, r = eσT
ω = ΩT
• σ < 0 implies that 0 < r < 1 and σ > 0 implies that r > 1. When σ = 0,
we have r = 1. Therefore, the left-half of s-plane is mapped inside
the unit circle and the right-half of s-plane is mapped into points that
fall outside the unit circle in z plane.
• The mapping ω = ΩT implies that the interval -π/T ≤ Ω ≤ π/T maps
into the corresponding values of -π ≤ ω ≤ π .
• Some of the properties of the impulse invariant transformation are
given below.
as,
Recall that,
Bilinear Transformation
• The IIR filter design using the impulse invariant method is
appropriate for the design of low-pass filters and band pass filters
whose resonant frequencies are low.
• This technique is not suitable for high-pass or band-reject filters.
• This limitation is overcome in the mapping technique called the
bilinear transformation.
• This transformation is a one-to-one mapping from the s-domain to
the z-domain.
• The bilinear transformation is obtained by using the trapezoidal
formula for numerical integration
• Let the system function of the analog filter be
..(1)
…(2)
where
If r < 1, then σ < 0, and if r > 1, then σ > 0. Thus, the left-half of the s-
plane maps onto the points inside the unit circle in the z-plane and the
transformation results in a stable digital system. For r = 1, σ is zero. In
this case,
…(3)
…(4)
Warping
because the factor 2/T cancels out at numerator and denominator while
calculating the order N of filter and H(z).
Using Equ. (3)
…(1)
…(2)
….(4)
…(5)
….(6)
The unnormalised poles, s'n, can also be obtained from the normalised poles
Example : Obtain the system functions of normalised Butterworth filters
for order N = 1 and 2
Chebyshev Filters
• The Chebyshev low-pass filter has a magnitude response
Assuming equality,
by &
2. Define
3. Find the expression
4. Find d
6. Calculate ε
7. Define β
8. Calculate:
9. Define
10. Calculate:
11. Define
:
Finite Word Length Effect
• Digital Signal Processing the computations like FFT algorithm, ADC and filter
designs are associated with numbers and coefficients.
• These numbers and coefficients are stored in a finite length registers but due to
mathematical manipulations performed with fixed point arithmetic number of
errors are present by storing the numbers and coefficients are required to
quantize the different type of number representations are used for this purpose.
• The implementation of digital filters involves the use of finite precision
arithmetic. This leads to quantization of the filter coefficients and the results of
the arithmetic operations.
• These type of effect due to finite precision representation of numbers in digital
system are called finite word length effects.
• Finite word length of the signals to be processed the finite word length of the
filter coefficients does not affect the linearity of the filter behavior.
• This effect only amounts to restrictions on the linear filter characteristics,
resulting in discrete grids of pole-zero patterns.
• These effects, which divide into those due to "signal quantization" and those
due to "overflow".
Errors arise due to quantization of numbers:
• Input quantization error.
• Product quantization error.
• Co-efficient quantization error.
Truncation:
• Truncation is the process of reducing the size of binary number by
discarding all bits less significant than least significant bit that is
retained.
• Example: Truncate the binary number from 8 bits to 4 bits.
0.01011000 0.0101
(8 bits) (4-bits)
1.10100111 1.1010
(8 bits) (4-bits)
• where H(f) is the frequency response of the model and PEE(f) is the
input power spectrum.
Signal Modeling
• The idea of signal modeling is to represent the signal via (some) model
parameters.
• In the model given below, the random signal x[n] is observed. Given the
observed signal x[n], the goal here is to find a model that best describes the
spectral properties of x[n] under the following assumptions:
x[n] is WSS (Wide Sense Stationary) . A random process X(t) is said to be
wide-sense stationary (WSS) if its mean and autocorrelation functions are time
invariant, i.e.,
E(X(t)) = μ, independent of t
RX(t1, t2) is a function only of the time difference t2 − t1
E[X(t)2] < ∞ (technical condition)
The input signal to the LTI system is white noise ( noise containing many
frequencies with equal intensities) following Gaussian distribution – zero mean
and variance σ2.
The LTI system is BIBO (Bounded Input Bounded Output) stable.
• In the model shown above, the input to the LTI system is a white noise
following Gaussian distribution – zero mean and variance σ2.
• The power spectral density (PSD) of the noise w[n] is
• The noise process drives the LTI system with frequency response H(ejɷ)
producing the signal of interest x[n].
• The PSD of the output is
• 3 cases are possible given the nature of the transfer function of the LTI
system
Auto Regressive (AR) models : H(ejɷ) is an all-poles system
Moving Average (MA) models : H(ejɷ) is an all-zeros system
Auto Regressive Moving Average (ARMA) models : H(ejɷ) is a
pole-zero system
AR, MA, and ARMA equations
• General ARMA equations:
• Particular cases:
….MA
….AR
• The actual power density spectrum is the expected value of Pxx(F) in the limit as T0 →
∞,
• The estimate Pxx(F) can also be expressed as
• where x(f) is the Fourier transform of the finite duration sequence x(n) , 0 ≤ n ≤ N − 1.
• This form of the power density spectrum estimate is called the periodogram.
Nonparametric Methods for Power Spectrum
Estimation
• The nonparametric methods make no assumption about how the data were generated.
• The Bartlett Method: Averaging Periodograms:
• It reduces the variance in the periodogram. The N -point sequence is subdivided into K
non overlapping segments, where each segment has length M. This results in the K
data segments
Where, is the frequency characteristic of the Bartlett window
Therefore, the variance of the Bartlett power spectrum estimate has been reduced by the factor K
The Blackman and Tukey Method: Smoothing the
Periodogram:
In this method the sample autocorrelation sequence is windowed first and then
Fourier transformed to yield the estimate of the power spectrum.
The Blackman-Tukey estimate is
where the window function w(m) has length 2M − 1 and is zero for |m| ≥ M.
The frequency domain equivalent expression:
m
The variance of the Blackman-Tukey power spectrum estimate is
Parametric Methods for Power Spectrum
Estimation:
• Parametric methods avoid the problem of spectral leakage and provide
better frequency resolution than do the nonparametric methods.
• Parametric methods also eliminate the need for window functions.
• The Yuke-Walker Method for the AR Model Parameters:
• This method is used to estimate the autocorrelation from the data and
use the estimates to solve for the AR model parameters.
• The autocorrelation estimate is given by
At the sampling instants of y(m), w’(n) = w(n) and in other cases, it is zero.