Problem Filter Design 1
Problem Filter Design 1
PART A
DSP filters can also be “Finite Impulse Response”(FIR). FIR filters do not use
feedback, so for a FIR filter with N coefficients, the output always becomes zero after
putting in N samples of an impulse response.
FIR filters are one of two primary types of digital filters used in Digital Signal Processing
(DSP) applications (the other type being IIR).
(I) The duration of impulse response should be large to realize sharp cut off filters.
(II) The non-integral delay can be lead to problems in some signal processing
applications.
7. What is the necessary and sufficient condition for the linear phase
characteristic of a FIR filters?
The necessary and sufficient condition is that the phase function should be a linear
function of w, which in turn requires constant phase delay or constant phase and group
delay.
8. What are the conditions to be satisfied for constant phase delay in linear phase
FIR filters?
N 1
The conditions for constant phase delay zero phase delay, = (i.e., phase delay is
2
constant) impulse
response h(n) =h(N-1-n) (i.e., phase delay constant) impulse response, h(n)=h(N-
1-n)(i.e., Impulse response is symmetric)
9. What are the possible types of impulse response for linear phase FIR filters?
There are four types of impulse response for linear phase FIR filters.
10. List the well known design techniques for linear phase FIR filters.
i. The width of the main lobe should be small and it should contain as much of the total
energy as possible.
ii. The side lobes should decrease in energy rapidly as w tends to increases.
12. What is the drawback in FIR filters design using windows and frequency
sampling method? How it is overcome?
The FIR filter design by window and frequency sampling method does not have
precise control over the critical frequencies such as wp and ws. This drawback can be
overcome by designing FIR filter using chybyshov approximation technique. In this
technique an error function is used to approximate the ideal frequency response, in
order to satisfy the desired specifications.
13. Write the characteristic features of rectangular window?
14. List the features of FIR filter designed using rectangular window.
(I) The width of the transition region is related to the width of the mainlobe of window
spectrum.
(II) Gibb's oscillations are noticed in the passband and stop band.
(III)The attenuation in the stopband is constant and cannot be varied.
15. Why Gibb's oscillations are developed in rectangular window and how it can
be eliminated or reduced?
The Gibb's oscillations in rectangular window are due to the sharp transitions
window are due to the sharp transitions from 1 to 0 at the edge of window sequence.
(I) The width of the transition band depends on the type of window.
(II) The width of the transition band can be made narrow by increasing the value of N
where N is the length of the window sequence.
(III) The attenuation in the stopband is fixed for a given window, except in case of
kaiser window where it is variable.
18. Why trianglar window is not a good choice for designing FIR filters?
In FIR filters designed using triangular window the transition from passband to
stopband is not sharp and the attenuation in stop band is less when compared to filters
designed with rectangular window for the above two reasons the rectangular window is
not a good choice.
19. List the features of hanning window spectrum?
Answer:
Hamming window
Kaiser Window:
The impulse response is "finite" because there is no feedback in the filter; if you
put in an impulse (that is, a single "1" sample followed by many "0" samples), zeroes will
eventually come out after the "1" sample has made its way in the delay line past all the
coefficients.
DSP filters can also be "Infinite Impulse Response" (IIR). IIR filters use feedback, so
27. What are the advantages of IIR filters (compared to FIR filters)?
IIR filters can achieve a given filtering characteristic using less memory and
calculations than a similar FIR filter.
28. What are the disadvantages of IIR filters (compared to FIR filters)?
3. They don't offer the computational advantages of FIR filters for Multirate (decimation
and interpolation) applications.
29. What are the disadvantages of FIR Filters (compared to IIR filters)?
Compared to IIR filters, FIR filters sometimes have the disadvantage that they
require more memory and/or calculation to achieve a given filter response
characteristic. Also, certain responses are not practical to implement with FIR filters.
Most FIRs are linear-phase filters; when a linear-phase filter is desired, a FIR is usually
used.
"Linear Phase" refers to the condition where the phase response of the filter is a
linear (straight-line) function of frequency (excluding phase wraps at +/- 180 degrees).
This results in the delay through the filter being the same at all frequencies. Therefore,
the filter does not cause "phase distortion" or "delay distortion". The lack of phase/delay
distortion can be a critical advantage of FIR filters over IIR and analog filters in certain
systems, for example, in digital data modems.
FIR filters are usually designed to be linear-phase (but they don't have to be.) A
FIR filter is linear-phase if (and only if) its coefficients are symmetrical around the center
coefficient, that is, the first coefficient is the same as the last; the second is the same as
the next-to-last, etc. (A linear-phase FIR filter having an odd number of coefficients will
have a single coefficient in the center which has no mate.)
The formula is simple: given a FIR filter which has N taps, the delay is: (N - 1) / (2
* Fs), where Fs is the sampling frequency. So, for example, a 21 tap linear-phase FIR
filter operating at a 1 kHz rate has delay: (21 - 1) / (2 * 1 kHz) = 10 milliseconds.
The simplest example of an all-pass filter is a pure delay system with system
function
H ( z) z k
Therefore, the magnitude is
H ( ) H ( z e j ) e j.k cos(.k ) j sin(.k ) 1
In the design of FIR filter using window method, the power of the original
sequence {x(n)} that was concentrated at a single frequency has been spread by the
window into the entire frequency range. We say that the power has leaked out into the
entire frequency range. This phenomenon, which is the characteristic of windowing the
signal, is called leakage.
37.What are the major factors that influence the choice of a specific realization?
N 1
T
2
FIR filter has a linear phase response property, whereas IIR system having no
this property. Therefore, by exploiting the property of symmetry, the number of
multiplication can be reduced by two fold, thereby can reduce the computational cycle
or hardware requirement.
44. What is the Z transform of a FIR filter?
For an N-tap FIR filter with coefficients h(k), whose output is described by:
Consider a DC (zero Hz) input signal consisting of samples which each have
value 1.0. After the FIR's delay line had filled with the 1.0 samples, the output would be
the sum of the coefficients. Therefore, the gain of a FIR filter at DC is simply the sum of
the coefficients.
This intuitive result can be checked against the formula above. If we set to
zero, the cosine term is always 1, and the sine term is always zero, so the frequency
response becomes:
d w
g
d w
where (w) is the phase response
49. What is the condition for linear phase characteristics of an FIR filter [All, April
2004]
A filter has linear phase characteristics it the impulse response satisfies the symmetry
condition
h(n) = h(M-1-n)
22. Design a low pass FIR filter using frequency sampling technique having cut
off frequency of /2 rad/sample. The filter should have linear phase and length of
17.
Solution:
we desired freq. response is Hd(w) for the linear phase FIR low pass filter.
M 1
jw
H d (w) e 2
for w wc
Here we will write +ve range other wire of frequencies in above equation.
M 1
jw
H d (w) e 2
for w wc
the length of filter is 17 and cut of freq is we =/2 rad /sam filtering these values in
above equation.
Hd(w)=e-jw for 0 wc ≤
2
To sample Hd(w)
2 k
W ; k 0,1, 2 N 1
N
2 k
W ; k 0,1, 2....16
1f
2 k
H (k ) H 4 ( w) | w
17
2 k 8
j 2 k
e 17
for 0
17 2
2 k
for
2 17
16 k
j
e 17
for 0 K 17
4
0 K 17 i.e.0 K 4.25
4
OK 4
5 K 8
2 k
j .8
H (k ) e 17
; for 0 K 4
; for 5 K 8
1 8
h(n) 1 2 Re H (k )e j 2 kn /17
17 K 1
substituting H(k).
1 4
h(n) 1 2 Re e j 2 kn / N
17 K 1
1 4
j 2 k 8 n /17
17
1 2
K 1
Re e
1 4
j 2 kn / N
h( n) 1 2 cos 17
17 K 1
n 0,1, 2,......6
Unit sample response of the FIR filter using freq. sampling technique.
23. Derive an expression for system function if the unit sample response h(n) is
obtained using freq sampling technique.
Solution:
N 1
H ( z ) h( n) z n
n 0
N 1
W 1
j 2 k n n
H ( x ) 1 H ( k )e N
z
n 0
N K 0
N 1
W 1
N
H (k )
j 2 k n
H ( z) 1 H (k )e N
z n
n 0 K 0
Let us use the result
w2 N 2 1
an a a
N1
n=N1 1 a
N 1
N 1 n
N
j 2 k n
H ( z) 1 H ( k ) e N
z n
n 0 K 0
1 N 1
1 e j 2 k z m
H ( z)
N
H (k ) 1 e j 2 k / n z 1
K 0
Heree j 2 k
1 N 1
1 z N
H ( z)
N
H (k ) 1 e
K 0
j 2 k / n 1
z
1 z N N 1
H (K )
H ( z)
N
K 0 1 e j 2 k / n z 1
Solution:
1
2
hd ( w) H d ( w)e jwn , dw
wc 2 wc1
1 j n w
e
j ( n ) w j ( n ) w
= e dw e dw dw
2 wc1 wc 2
2 1
1 j n w
e dw e e
j ( n ) w j ( n ) w
= dw dw
2 1 wc 2
1
Sin(n ) Sin2(n ) Sin(n ) n Z
(n c)
1
1 : n
N-1 7 1
Here = 3.
2 2
hd(0)=hd(6)=0.04462
hd(1)=hd(5)=0.26517-
hd(2)=hd(4)=-0.02159
W(n) = 1 : 0 n N-1
hd(0)=hd(6)=0.04462
hd(1)=hd(5)=0.26517-
hd(2)=hd(4)=-0.02159
hd(3)= 0.68169
W(n)=1/2(1-cos n/3) 0 n 6
W(0)=W(6)=0
W(3)=1/2(1=cos )=1
h(0)=h(6)=0
h(1)=h(5)=1/4 x 0.26517=0.0662
h(2)=h(4)=3/4 x -0.02157=0.01619
h(3)= 1 x 0.31831=0.31831=0.31831
7
H ( z ) h( n) Z n
n0
Solution:
hd (n) 1 e
jwn
dw
2
3
4
2 3
=1 e j 3we jwn dw
4
3
4
=1 e j n 3 w dw
2 3
4
Sin 3
4
n 3
hd(n)= , n 3and
n 3
hd (n) 3
4
hd(0) = 0.0750,hd(1)=-0.1592,=hd(5)
hd(2)=0.2251=hd(4),hd(6)=0.0750
the hamming window function
W(0)=0.08=w(6)
W(1)=0.31=w(5)
W(2)=0.77=w(4)
W(3)=1.
H(n)=hd(n)w(n):n=0,1,2,3,4,5.6.
Therefore
H(0) = 0.006=h(6)
H(1)=-0.0494=h(5)
H(2)=0.1733=h(4)
H(3)=0.75
H(ejw)=
n 0
h(n)e jwn
H d (e jw ) e j 2 w ; - w
4 4
0 ; w
4
Determine the filter co-efficient hd(n) if the window function Referred as
w(n) 1 ; 0 n N-1
otherwise
otherwise ;0
Solution:
Data given
H d (e jw ) e j 2 w - w
4 4
w
4
There fore
hd (n) 1
2
H d (e jw ) e jwn dw
4 4
=1 dw 1 e j 2 we jwn dw
j 2w jwn
e e
2 2
4
4
jw n 2
e e jw n 2 dw
2
=1 dw 1
2
4
1 e j n 2 e j n 2 e j n 2 4 e j n 2 4
n 2 2j 2j
1
Sin (n 2) Sin (n 2) 4 n 2
n 2
H(2)=3/4,h(0)=1/2=h(4)&
4
H (e jw ) h(n)e jwn
n 0
2 1
H (e jw ) e j 2 w 0.75 cos w cos 2w
27. A low pass – filter is to be designed both the following desired freq response
H d (e jw ) e j 2 w ; w
4 4
0 ; w
4
Solution:
Given
e j 2 w - w
H d (e jw ) 4
w
4
0
4
therefore
hd (n) 1
2
H d (e jw ) e jwn dw
4
=1
2
e j 2 we jwn dw
4
4
=1 e jw n 2 dw
2
4
1 e j n 2 4 e j n 2 4
n 2 2j
Sin (n 2)n 2
1
n 2 4
for n=2 the filter co-efficient can be obtained by applying L hospital and rule.
hd(2)=1/4
Hd(0)=1/2 = hd(4)
Hd(1)=1/2 =hd(3)
Therefore
H(0)=1/2=h(4),h(1)=1/2=h(3)and h(2)=1/4.
4
H (e jw ) h(n)e jwn
n0
28. Design a band pass filter to pass freq range 1 to 2 rad/sec. using hanning
window, with N=5.
Solution:
=1 Hd (w)e
jwn
dw
2
wc1 wc2
e
jwr jwe
=1 e e jwn
dw 1 e jwn dw
2 2
wc2 wc1
wc1 wc1
e jw( n ) 1 e
jw ( n )
1
2 j (n ) 2 j (n )
wc2 wc2
1
sin wc2 (n ) sin wc1 (n ) n
(n )
2 n
w(n) 0.5 0.5cos ; for n=0.1-N-1.
N 1
Let us assume wc1 1rad/sec and rw wc2 = 2 rad/sec.
Given N=5.
N 1 5 1
2
2 2
h(n)=hd(n)w(n)
n 0 : h(1)
Sin(2 (1 2)) Sin(1 (1 2))
(1 2)
0.5 0.5cos 4
2
0.0108 h(3)
2 1
n 2 : h(2) 0.3183
n 4 : H (4) H (o).
N 1
( N 1) 2 N 1
H ( w) h 2h n cos wn.
2 n 1 2
=h(2)+2h(1)cosw+2h(0)cos2w
=0.3183+2x0.0108cosw+0
H(w)=0.3183+0.0216cosw.
29. Design a Band slop filter to reject frequencies in the range 1 to 2 rad/sec
using rectangular window with w=7.
Solution:
otherwise
hd(n)= 1 Hd (w)e
jwn
dw
2
wc2 wc1
e jwr e jwn dw 1 e
jwe
=1 e jwn dw
2 2
wc1
1
e
jw
e jwn dw
2
wc2 wc2
1 1 1
2n
e jw( n ) dw
2
wc1
e jw( n ) dw
2
wc1
e jw( n ) dw
1
hd (n) sin wc1 (n ) sin (n ) sin wc2 (n ) n
(n )
when n=
wc wc1
hd(n)=1- 2 : for n=
consider the rectangular window sequence
h(n)=1-
wc2 wc1 : for n=
h(1)=h(s)=0.2652
h(2)=h(4)=-0.0216
h(3) 1
2 1 0.6817
for N=7.(add)
N 1
( N 1) 2 N 1
H ( w) h 2h n cos wn.
2 n 1 2
=h(3)+2h(2)cosw+2h(1)cos2w+2w(0)cos3w
=0.6817+2x(-0.0216)cosw+2x0.2652cos2w+2x0.0446cos3w
H(w) =0.6817-0.0432cosw+0.5304cos2w+0.0892cos3w