Professional Documents
Culture Documents
3 FIR Filter Design by YBP 01-09-2013
3 FIR Filter Design by YBP 01-09-2013
3 FIR Filter Design by YBP 01-09-2013
FIR FILTER
DESIGN
Design by
Prof. Yogesh B. Patel
Assistant Professor
Output EC Dept., UVPCE
Digital Filters
Digital filter allow desired band of frequency and attenuate (stop) undesired band
of frequency of digital input signal to produce digital output signal.
The arithmetic computation required by the digital filter for filtering the signal is
performed on a DSP processor or general purpose processor. This is, in general,
called as Digital Signal Processing.
Advantages :
A digital filter is a computer program and hence it is reprogrammable as per
need.
Digital filters are easily designed, tested and implemented on computer or
workstation.
Digital filters are extremely stable with respect both to ambient conditions
and ageing (time).
Digital filters can handle very low frequency signals accurately.
Classification of Digital Filters
Time Domain based Classification
Infinite Impulse Response (IIR)
Finite Impulse pulse Response (FIR)
Transfer Function based Classification
Based on magnitude characteristics
LPF, HPF, BPF and BSF
All pass
Based on phase characteristics
Zero phase
Linear phase
Minimum phase & Maximum phase.
Time Domain based Classification:
∑ k
b z −k
M
H (z ) =
Y ( z)
H (z ) =
Y ( z)
= k =0 = ∑ bk z − k
N
X ( z ) k =0
1 + ∑ ak z − k
X ( z)
k =1
Here, ak and bk are the coefficients of the filter which have to be selected
suitably to make the filter to achieve the desired output.
Example:
Find the impulse response of a digital system with following input output relation.
Is it an IIR or FIR filter?
a) y(n) = ½ x(n)+ ½ x(n-l)
b) y(n) = x(n) + y (n -1);
Solution:
a) y(n) = ½ x(n)+ ½ x(n-l)
Taking Z - transform
Y(z) = ½ X(z) + ½ z-1 X(z)
Y(z)/X(z) = H(z) = ½ + ½ z-1
Comparing this with transform function of FIR filter
Here , b0= ½ And b1= ½
Therefore , h(n) = { b0 , b1 }
:. Unit sample response h(n) = { ½, ½ }
This is the unit sample response of the digital FIR filter because it contains only
two samples i.e. finite number of samples.
Moreover , it is observed that output depends only on present and past input and
not on past output. This is import characteristic of FIR filter. Also known as
Nonrecursive Filter.
b) y(n) = y(n-1) + x(n)
Taking Z - transform
Y(z) = z-1 Y(z) + X(z)
System function Y(z)/X(z) = H(z) = 1/(1 - z-1 )
The inverse Z-transform of system function H(z) is called unit sample response or
impulse response denoted by h(n.)
Hence taking inverse Z-transform of above equation,
h(n) = u(n)
We know that,
u(n) = 1 for n ≥ 0
0 for n < 0
u(n) = { 1,1,1,………….}
Unit step function has infinite duration. Therefore the filter we have considered
here is IIR filter.
Moreover, it is observed that output depends only on present and past input as well
as on past output. This is important characteristic of IIR filter. Also known as
Recursive Filter
Advantages of IIR Filters
IIR filters are useful for high speed designs because they typically
require a lower number of multipliers compared to FIR filters.
The attenuation characteristic of IIR filter is always superior than
what is required.
IIR Filter require less resources for implementation as compared
to FIR filters because of Feedback taps.
Therefore for non linear phase filter, the frequency components which
form the input signal will reach the output at different time instances
to form the output signal which is said to be phase distorted output
signal.
The effect of phase distortion on the quality of signal will be very large if
the signal band width is larger e.g. video signal is compared to low
bandwidth signal because small part of non-linear phase characteristics can
be considered as linear for low bandwidth.
The audio signal bandwidth (20 kHz) is very small, therefore , phase
distortion is not occurs in these signal. However, video signal band
width is very large (5MHz). Therefore phase distortion is large.
Thus IIR filter can be used for processing of audio signal but for video
signal linear phase FIR filter are preferred to video signal processing.
Phase distortion can’t be made zero in case of IIR filter design but can be
minimized. This complete problem can be eliminated by use of symmetric
or Antisymmetric FIR filter because symmetric and Antisymmetric FIR
filters are always linear in phase. Therefore, group velocity is constant. i.e.
no phase distortion.
If any impulse response with odd or even number of samples can be made
symmetric or Antisymmetric and any impulse response which is symmetric
or Antisymmetric is always linear in phase.
Hence, FIR filter are designed where linear phase is essential. Typical
example of application of linear phase FIR filter is filtering of video
signals.
Filter Type Choice between : FIR and IIR
FIR IIR
No feedback (only zeros). Feedback (poles & zeros).
Always stable. May be unstable.
Can be linear phase. Non linear phase.
High order (20-2000). Typ. <1/10th order of FIR
(4-20).
If you care about phase If you care about
response, use linear phase computational cost and
FIR. attenuation response, use
low complexity IIR.
Condition of Linear Phase Characteristics
To achieve the linear phase characteristic, impulse response of filter
is essentially needed to be either Symmetric or Antisymmetric.
When n=0
When n≠0
When n=0
When n≠0
When n=0
When n≠0
When n=0
When n≠0
Tight window function produces more ripples but less transition band.
Smooth window function produces less ripples but wide transition band.
Thus, selection of window function is a compromise between ripples tolerated and
transition band required in FIR filter design.
Ideal low-pass filter approximation
FIR Filter Design using Fourier transform method
Bright Side:
Design procedure is simple and it is same for LP ,HP,
BP,BS.
Dark Side:
Truncation in the time-domain results in ‘Gibbs effect’ in
the frequency domain, i.e. large ripple in pass-band and
stop-band, which cannot be reduced by increasing the filter
order N-1.
FIR Filter Design using ‘Windows’
n = −∞
− jωn
hd [n] =
2π −∫π
Hd e( )
jω
e jωn
dω
hd [n] 0 ≤ n ≤ M
h[n] =
0 else
• More generally
1 0 ≤ n ≤ M
h[n] = hd [n]w[n] where w[n] =
0 else
Windowing in Frequency Domain
• Windowed frequency response
π
1
( )
H e jω = ∫
2π − π
Hd ( ) (
e jω
W e )
j(ω − θ )
dθ
• The windowed version is smeared version of desired response
• Simplest window
possible
• As M increases, the main lobe becomes narrower, the area under the
side lobes remains the same irrespective of the changes in value of M.
Bartlett (Triangular) Window
n
Wtri[n] = 1 − , −M ≤ n ≤ M
M
• Side lobs
– -26 dB
• Hamming window
performs better
• Simple equation
• Side lobs
– -31 dB
• Hamming window
performs better
• Same complexity as
Hamming
• Complex equation
Main Minimum
Peak of first
Window lobe stopband
side lobe(dB)
width attenuation (dB)