SlideShare a Scribd company logo
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 1
Chapt 04
Design of Digital Filters ( FIR)
B.E. Comps, Mumbai Uni
PrePrepared by
IRDC India
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 2
Chapt 04 Design of Digital Filters
•Design of FIR filters
•Design of IIR filters from analog filters
•Frequency transformation
•Design of digital filters based on least-squares method
•Digital filters from analog filters
•Properties of FIR filters
•Design of FIR filters using windows
•Comparison of IIR and FIR filters
•Linear phase filters
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 3
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 4
What is filter ?
Basic building block of DSP:
Input is given to filter and output of the system would be
signal obtained from input and filter's impulse response.
Filter
Input Output
[ 1 1]
Input Output
[ 1 -1]
Input Output
Integrator ( Low
pass filter)
Differentiator
(High pass filter)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 5
Contd..
Different impulse response different characteristics
Characteristic of the filter – Frequency domain characteristics
Frequency
Characteristic
Phase
Characteristic
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 6
Frequency Characteristic
H(w)
Wπ
Frequency characteristic plot between frequencies and magnitude
For given system if particular frequency is passed thorough the system,
its magnitude at output can be obtained from corresponding magnitude
from frequency characteristic
Note: most of the time input wont be single pure sinusoidal/frequency but
would be a set of frequencies
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 7
Phase Characteristic
ϕ(w)
Wπ
Phase characteristic plot between frequencies and phase shift
For given system if particular frequency is passed thorough the system,
its delay/phase shift at output can be obtained from corresponding phse
from phase characteristic
Note: most of the time input wont be single pure sinusoidal/frequency but
would be a set of frequencies
π−
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 8
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 9
Ideal Characteristics
Frequency Phase
Sharp cutoff
Linear
phase
Sharp cutoff is requirement for
almost all the applications
Non-linear phase characteristic
distorts the signal.
Linear phase characteristic has
constant group delay.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 10
Effect of Linear Phase Characteristic
Let us pass signal , made up of summing frequency 1 Hz, 2Hz & 3
Hz, through filters with different phase characteristics
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 11
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 12
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 13
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 14
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 15
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 16
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 17
Challenge …..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 18
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 19
Verify ….
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 20
M file used in MATLAB for this simulation
clear all;
close all;
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]));
title(' Inoput Signal Composition');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])]));
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]+pi/8));
title(' Filtered Signal with phase characteristic pi/8');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]+pi/8));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]+pi/8));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)]));
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 21
Contd..
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]+pi/4));
title(' Filtered Signal with phase characteristic pi/4');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]+pi/4));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]+pi/4));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)]));
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]+pi/2));
title(' Filtered Signal with phase characteristic pi/2');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]+pi/2));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]+pi/2));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)]));
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 22
Contd..
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]+pi/8));
title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]+pi/4));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]+pi/2));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)]));
figure,
subplot(4,1,1);
plot(sin(2*pi*1*[0:0.01:3]+pi/4));
title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)');
subplot(4,1,2);
plot(sin(2*pi*2*[0:0.01:3]+pi/2));
subplot(4,1,3);
plot(sin(2*pi*3*[0:0.01:3]+pi/1));
subplot(4,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)]));
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 23
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 24
Chapt 04
figure,
subplot(6,1,1);
plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])]));
title('I am Input Signal , which of followings looks like me ?');
subplot(6,1,2);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)]));
%title(' Filtered Signal with phase characteristic pi/8');
subplot(6,1,3);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)]));
%title(' Filtered Signal with phase characteristic pi/4');
subplot(6,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)]));
%title(' Filtered Signal with phase characteristic pi/2');
subplot(6,1,5);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)]));
%title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)');
subplot(6,1,6);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)]));
%title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)');
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 25
Chapt 04
figure,
subplot(6,1,1);
plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])]));
title(' Input Signal ');
subplot(6,1,2);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)]));
title(' Filtered Signal with phase characteristic pi/8');
subplot(6,1,3);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)]));
title(' Filtered Signal with phase characteristic pi/4');
subplot(6,1,4);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)]));
title(' Filtered Signal with phase characteristic pi/2');
subplot(6,1,5);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)]));
title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)');
subplot(6,1,6);
plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)]));
title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)');
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 26
Linear Phase Conclusion
If filter doesn't have linear phase characteristic( constant group
delay) then signal shape gets distorts.
e.g. First 3 filtered outputs
If filter has linear phase characteristic( constant group delay) then
signal shape would be preserved.
e.g. Last 2 filtered outputs
Linear phase can be obtained easily by FIR filter by having
symmetric/anti-symmetric property in its impulse response.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 27
FIR Filter
FIR filter has finite number of samples in its impulse response
Advantages:
• The question of stability and realizability never arise for FIR filters ( it is
always stable and realizable)
• It gives linear phase relationship with frequency , which can be
achieved by having symmetric or anti-symmetric impulse response of the
filter
Disadvantages :
• Long sequences for h(n) are generally required to adequately
approximate sharp cut-off filters
•Hence , higher computation complexity
•The delay of linear phase FIR filters need not always be an integer
number of samples . This non-integral delays can lead to problems in
some signal processing applications
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 28
Characteristic of FIR filter
Let { h(n)} be a causal finite durations sequence of length N( 0 to N-1).
Its z-transform
∑
−
=
−
=
1
0
)()(
N
n
n
znhzH --------(1)
Its Fourier transform,
∑
−
=
−
=
1
0
)()(
N
n
jwnjw
enheH
Which is periodic in frequency with period of 2π
)()( )2( mjj
eHeH πωω +
= ......3,2,1,0 ±±±=mfor
--------(2)
Consider h(n) be real and its magnitude and phase ,
)(
)()( ωθjjwjw
eeHeH ±=
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 29
Contd..
From eq (2) , since wnjwne jwn
sincos −=−
symmetric
Anti-
symmetric
Magnitude of Fourier transform is symmetric and the phase
is an anti-symmetric function
)()( jwjw
eHeH −
=
πω ≤≤0
)()( ωθωθ −−=
Consider , we have to have linear phase response
i.e. αωωθ −=)(
where α is constant ( phase delay in samples)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 30
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 31
Contd..
We would find , condition/restriction on impulse response such that it
will give linear phase response
Mathematically,
∑
−
=
−
=
1
0
)()(
N
n
jwnjw
enheH
αωjjw
eeH −
±= )( Requirement
∑
−
=
−
=
1
0
)()(
N
n
jwnjw
enheH
Given
∑∑
−
=
−
=
−=
1
0
1
0
)sin()()cos()(
N
n
N
n
wnnhjwnnh












−
=−
∑
∑
−
=
−
=−
1
0
1
01
)cos()(
)sin()(
tan N
n
N
n
wnnh
wnnh
αω
Since n=0, sin(wn)=0
Hence , limit starts
from 1
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 32
Contd..












=
∑
∑
−
=
−
=
1
0
1
0
)cos()(
)sin()(
)tan( N
n
N
n
wnnh
wnnh
αω












+
=∴
∑
∑
−
=
−
=
1
1
1
1
)cos()()0(
)sin()(
)tan( N
n
N
n
wnnhh
wnnh
αω
There are two possible solutions
1) α=0 , h(0) can be arbitrary
& h(n)=0 for n≠0
In this case filter will have order 0 and it would be
just amplifier and not a filter. This is not too
useful result
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 33
Contd..
2) α≠0












==∴
∑
∑
−
=
−
=
1
0
1
0
)cos()(
)sin()(
)cos(
)sin(
)tan( N
n
N
n
nnh
nnh
ω
ω
αω
αω
αω
∑∑
−
=
−
=
=∴
1
0
1
0
)cos()sin()()sin()cos()(
N
n
N
n
nnhnnh αωωαωω
0)}cos()sin()sin()){cos((
1
0
=−∴∑
−
=
αωωαωω nnnh
N
n
0)sin()(
1
0
=−∴∑
−
=
nnh
N
n
ωαω
0)(sin)(
1
0
=−∴∑
−
=
nnh
N
n
αω
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 34
Contd..
From this equation , unique solution is obtained for the set of
conditions
1) α= (N-1)/2
i.e. for any value of sequence , there is only one value of phase delay
α , which is the condition to obtain linear phase.
2) h(n)=±h(N-1-n) for 0 ≤ n ≤ N-1
i.e. impulse response sequence must have a special kind of symmetry
for the value of α
For linear phase filter , impulse response should be either symmetric or
anti-symmetric.
As impulse response can be of odd or even length, there are four
possible types of impulse response which will have linear phase
characteristic.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 35
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 36
Linear Phase Filters – Impulse Responses
1) Symmetric and Even N
2) Anti-symmetric and Even N
3) Symmetric and Odd N
4) Anti-symmetric and Odd N
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 37
Symmetric and Even & Odd N
0 1 2 3 4 5 6 7 8 9 10
N=11 ( Odd)
α= 5
Center of
symmetry
0 1 2 3 4 5 6 7 8 9
N=10 ( Even)
α= 4.5
Center of
symmetry
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 38
Anti-Symmetric and Even & Odd N
0 1 2 3 4 5 6 7 8 9 10
N=11 ( Odd)
α= 5
Center of
symmetry
0 1 2 3 4 5 6 7 8 9
N=10 ( Even)
α= 4.5
Center of
symmetry
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 39
Proofs of Linear phase characteristics for all four types
Refer Rabinar and Gold
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 40
Position of zeros in Linear phase filters
∑
−
=
−
=
1
0
)()(
N
n
n
znhzHWe have
)1()2()3(
4321
)0()1()2(
)4()3()2()1()0(
−−−−−−
−−−−
±±±−−−
−−−++++=
NNN
zhzhzh
zhzhzhzhh
→± Symmetry/ anti-symmetry in impulse response
2/)1(
)( −−
= N
zzH [ ]
[ ]
[ ]
}
)2(
)1(
)0({
2/)5(2/)5(
2/)3(2/)3(
2/)1(2/)1(
−−−−−+
±+
±+
±
−−−
−−−
−−−
NN
NN
NN
zzh
zzh
zzh
-----------(1)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 41
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 42
Contd..
If z is replaced by z-1 in eq 1 we get
2/)1(1
)( −−
= N
zzH [ ]
[ ]
[ ]
}
)2(
)1(
)0({
2/)5(2/)5(
2/)3(2/)3(
2/)1(2/)1(
−−−−−+
±+
±+
±
−−−
−−−
−−−
NN
NN
NN
zzh
zzh
zzh
-----------(2)
Comparing eq 1 & 2 we get
)()( )1(1
zHzzH N −−
±=
H(z) and H(z-1) are identical within a
delay of (N-1) samples and multiplier ±1
(r,-Ɵ)
(r,Ɵ)
(1/r,Ɵ)
(1/r,-Ɵ)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 43
Ideal Filter
Consider ideal low-pass filter characteristic
H(w)
Wc w



=
0
1
)(ωH
πωω
ωω
≤<
≤
c
c
By taking inverse fourier transform we get impulse response of the
above filter as




=
n
n
c
cc
c
nh
ω
ω
π
ω
π
ω
sin
)(
0
0
≠
=
n
n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 44
Why ideal filter is not physically realizable ?
Two observations of above h(n) that makes ideal filter not realizable
•Length of h(n) is infinite
•Impulse response is not causal. To make is causal , shifting
response could be one way, but shifting by infinity amount is not
possible .
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 45
Filter Specifications
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 46
Contd..
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 47
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 48
Design of FIR filter
FIR filters can be designed by using following methods
•Window method ( Fourier Series Method)
•Frequency sampling method
•Optimal filter design
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 49
Windowing Technique
• Desired frequency response with specifications Hd(w)
•Take inverse Fourier transform of Hd(w) to obtain filter impulse
response hd(n)
•Since , impulse response hd(n) is infinite in duration, window
w(n) is used to truncate it and gives impulse sample response of
the FIR filter.
i.e. hw(n)= hd(n). w(n)
Since window function w(n) will have finite samples (say M ),
we get



=
0
)().(
)(
nwnh
nh d
w
otherwise
Mn 2/,......2,1,0 ±±±=
• Give a shift of M/2 samples to hw(n) to make it causal
)2/()( Mnhnh w −=
Name of
Window
Time domain sequence h(n) , 0 ≤
n ≤ M-1
Approx
Transition width
of main lobe
Peak
Sidelobe
(dB)
Rectangular 1 4π/M -13
Barlett (
traingualr)
8π/M -27
Blakman 8π/M -32
Hamming 8π/M -43
Hanning 12π/M -58
Kaiser -- --
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 50
Different Windows
1
4
cos08.0
1
2
cos5.042.0
−
+
−
−
M
n
M
n ππ
1
2
1
2
1
−
−
−
−
M
M
n
1
2
cos46.054.0
−
−
M
nπ






−
−
1
2
cos1
2
1
M
nπ











 −













 −
−−




 −
2
1
2
1
2
1
22
M
I
M
n
M
I
o
o
α
α
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 51
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 52
Frequency response to impulse response
1) Ideal low pass filter



=
0
1
)(ωdH
otherwise
cωω ≤≤ ||0H(w)
-π -Wc Wc π w
∫−
=
π
π
ω
π ωω deHnh nj
dd )()( 2
1
c
c
c
c
jn
e
de
nj
nj
ω
ω
ω
π
ω
ω
ω
π ω
−−
== ∫ 2
1
2
1





 −
=
−
jn
ee njnj cc ωω
π2
1





 −
=
−
j
ee
n
njnj cc
2
11 ωω
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 53
Contd..
n
n
d
c
nh π
ωsin
)( = for 0≠n
for 0=n
∫−
=
c
c
denh nj
d
ω
ω
ω
π ω2
1
)(
∫∫ −−
==
c
c
c
c
ddeh j
d
ω
ω
π
ω
ω
ω
π ωω .1)0( 2
10.
2
1
π
ω
π
ω
π
ωω cc
d
cc
h === −−
2
2
)0( 2
)(






=
n
n
nh
c
c
d
π
ω
π
ω
sin
)(
0
0
≠
=
n
n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 54
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 55
Contd..




=
−−
0
)(
)( 2
1 ω
ω
Nj
d
e
H
otherwise
cωω ≤≤ ||0
If
then






−
−
=
−
−
)(
)(sin
)(
2
1
2
1
N
N
c
c
d
n
n
nh
π
ω
π
ω
otherwise
n N
2
1−
=
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 56
High Pass Filter
H(w)
-π -Wc Wc π w



=
0
1
)(ωdH
otherwise
c πωω ≤≤ ||
∫−
=
π
π
ω
ωω
π
deHnh nj
dd )(
2
1
)(








+= ∫∫
− π
ω
ω
ω
π
ω
ωω
π c
c
dede njnj
.1.1
2
1








+=
−
−
π
ω
ωω
π
ω
π c
c
jn
e
jn
e njnj
2
1
[ ]njnjnjnj cc
eeee
jn
ωππω
π
−+−= −−
2
1











 −
−




 −
−=
−−
j
ee
j
j
ee
j
jn
njnjnjnj cc
2
2
2
2
2
1 ππωω
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 57
Contd..
( )nn
n
nh cd πω
π
sinsin
1
)( +
−
=
n
n
nh c
d
π
ωsin
)(
−
= 0sin =nπQ for all integers n
for 0=n








+= ∫∫
− π
ω
ω
ω
π
ω
ωω
π c
c
dedeh jj
d
0.0.
.1.1
2
1
)0(








+= ∫∫
− π
ω
ω
π
ωω
π c
c
dd .1.1
2
1 ( )cc ωππω
π
−++−=
2
1
( )cωπ
π
22
2
1
−=
π
ωc
−=1






−
−
=
n
n
nh
c
c
d
π
ω
π
ω
sin
1
)(
0
0
≠
=
n
n
-π -Wc2 -Wc1 Wc1 Wc2 π w
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 58
Band-Pass Filter
H(w)



=
0
1
)(ωdH
otherwise
cc 21 || ωωω ≤≤
∫−
=
π
π
ω
ωω
π
deHnh nj
dd )(
2
1
)(








+= ∫∫
−
−
2
1
1
2
.1.1
2
1 c
c
c
c
dede njnj
ω
ω
ω
ω
ω
ω
ωω
π








+=
−
−
2
1
1
2
2
1
c
c
c
c
jn
e
jn
e njnj ω
ω
ωω
ω
ω
π
[ ]njnjnjnj cccc
eeee
jn
1221
2
1 ωωωω
π
−+−= −−











 −
−




 −
−=
−−
j
ee
j
j
ee
j
jn
njnjnjnj cccc
2
2
2
2
2
1 1122 ωωωω
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 59
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 60
Contd..
( )nn
n
nh ccd 12 sinsin
1
)( ωω
π
−= 0≠n
( )
π
ωω
ωω
π
12
12 )(2
2
1
)( cc
ccd nh
−
=−= 0=n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 61
Band-stop filter
( )nn
n
nh ccd 21 sinsin
1
)( ωω
π
−= 0≠n
1)( 21
+
−
=
π
ωω cc
d nh 0=n
Proceed in same way ….
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 62
Hilbert Transform
-π π w
H(w)
j
-j


−
=
j
j
Hd )(ω
0
0
≤≤−
≤≤
ωπ
πω
∫−
=
π
π
ω
ωω
π
deHnh nj
dd )(
2
1
)(






−= ∫∫−
π
ω
π
ω
ωω
π 0
0
..
2
1
dejdej njnj








−=
−
πω
π
ω
π 0
0
2 jn
e
jn
ej njnj
[ ]11
2
1
+−−= − njnj
ee
jn
ππ
π











 +
−=
−
2
22
2
1 njnj
ee
n
ππ
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 63
Contd..
( )n
n
nhd π
π
cos1
1
)( −=
0)( =nhd
0=n
( ))cos(1
1
22 nn
n
ππ
π
+−= ( ))(sin)(cos1
1
2
2
2
2
nn
n
ππ
π
+−=
( ))(sin)(sin
1
2
2
2
2
nn
n
ππ
π
+=
n
n
nhd
π
π
)(sin2
)( 2
2
= 0≠n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 64
FIR differentiator
πωπ ≤≤−jwHd =)(ω
∫∫ −−
==
π
π
ω
π
π
ω
ωω
π
ωω
π
dejdeHnh njnj
dd .
2
1
)(
2
1
)(
π
π
ωω
ω
π −






−= 22
.
2
1
nj
e
jn
e
j
njnj






−+−=
−
−
jn
e
e
jn
e
e
jn
j nj
nj
nj
nj
π
π
π
π
ππ
π
..
2
( )





−−




 +
= −
−
njnj
njnj
ee
jn
ee
n
ππ
ππ
π
π
1
2
2
2
1
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 65
Contd..











 −
−




 +
=
−−
j
ee
n
ee
n
nh
njnjnjnj
d
2
2
2
2
2
1
)(
ππππ
π
π




−= n
n
n
n
πππ
π
sin
2
cos2
2
1
[ ]0cos2
2
1
−= n
n
ππ
π
n
n
nhd
πcos
)( =
0)( =nhd
0=n
0≠n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 66
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 67
Problem
a) Design a low pass , linear phase , FIR filter of length 9 ( order 8) with
cut-off frequency of 5kHz and sampling frequency 20 kHz. Use Hann
window with
Find the delay involved.
a) Find magnitude and phase response of this filter and obtain the plots.
Derive necessary expressions
b) Find the cut-off frequency of a designed filter






−
−=
1
2
cos1
2
1
)(
M
n
nw
π
10 −≤≤ Mn
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 68
Solution
Ideal low pass filter with cutoff frequency ,fc= 5kHz and sampling frequency
fs=20kHz



=
0
1
)(ωdH
otherwise
cωω ≤≤ ||0H(w)
-π -Wc Wc π w
∫−
=
π
π
ω
π ωω deHnh nj
dd )()( 2
1
c
c
c
c
jn
e
de
nj
nj
ω
ω
ω
π
ω
ω
ω
π ω
−−
== ∫ 2
1
2
1





 −
=
−
jn
ee njnj cc ωω
π2
1





 −
=
−
j
ee
n
njnj cc
2
11 ωω
π
As fs=20 kHz is equivalent to 2π,
fc=5kHz corresponds to wc=2π*5/20=0.5
π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 69
Contd..
n
n
d
c
nh π
ωsin
)( = for 0≠n
for 0=n
∫−
=
c
c
denh nj
d
ω
ω
ω
π ω2
1
)(
∫∫ −−
==
c
c
c
c
ddeh j
d
ω
ω
π
ω
ω
ω
π ωω .1)0( 2
10.
2
1
π
ω
π
ω
π
ωω cc
d
cc
h === −−
2
2
)0( 2
)(






=
n
n
nh
c
c
d
π
ω
π
ω
sin
)(
0
0
≠
=
n
n
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 70
Contd..
Using above equation , obtain desired filter coefficients from h(-4) to
h(4) for filter with wc=0.5 π and length 9
hd(0)=0.5
hd(1)= 0.31830 =hd (-1)
hd(2)=0 =hd (-2)
hd(3)=0.10615 =hd (-3)
hd(4)=0 =hd (-4) hc(4)=0.5
hc(5)= 0.31830 =hc (3)
hc(6)=0 =hc (2)
hc(7)=0.10615 =hc (1)
hc(8)=0 =hc (0)
Shift by 4 to
make it causal
n’ =n+4
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 71
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 72
Contd..
Multiply filter coefficients now with window function






−
−=
1
2
cos1
2
1
)(
M
n
nw
π
10 −≤≤ Mn
h(4)=0.5*w(4)=0.5
h(3)= 0.31830*w(3)=0.27168 =h (5)
h(2)=0*w(2)=0 =h(6)
h(1)=0.10615*w(1)=0.01554 =h (7)
h(0)=0*w(0)=0 =h (8)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 73
Frequency Sampling Technique
In this method, desired frequency response is sampled to obtain DFT
coefficients, which are then passed through IDFT to get impulse response
Desired
Frequency
Response
Hd(ejw)
Sampling
DFT coefficients
H(k)
IDFT Filter coefficients
h(n)
Let us sample desired frequency response Hd(ejw) at N points
wk , k=0 ,1 , 2 ….N-1( N being length of filter)
N
k
wk
π2
= 1,,.........1,0 −= Nk
kww
jw
d eHkH
=
= )()(
~
Sampled desired frequency response
1,,.........1,0 −= Nk
)( /2 Nkj
d eH π
= 1,,.........1,0 −= Nk
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 74
Contd..
)(
~
kHLet us consider, as a DFT coefficients , then
Nknj
N
k
ekH
N
nh /2
1
0
~
)(
1
)( π
∑
−
=
= 1,,.........1,0 −= Nn
For the implementation of filter , taking z transform of h(n)
n
N
n
Nknj
N
k
zekH
N
−
−
=
−
=
∑ ∑ 





=
1
0
/2
1
0
~
)(
1 π
∑
−
=
−
=
1
0
)()(
N
n
n
znhzH
By changing the order of summation , we get
∑ ∑
−
=
−
=
−






=
1
0
1
0
/2
~ 1
)()(
N
k
N
k
nNknj
ze
N
kHzH π
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 75
Contd..
( )∑ ∑
−
=
−
=
−






=
1
0
1
0
1/2
~ 1
)()(
N
k
N
k
nNkj
ze
N
kHzH π
∑
−
=
−
−






−
−
=
1
0
1/2
2~
1
11
)(
N
k
Nkj
kjN
ze
ez
N
kH π
π
∑
−
=
−
−






−
−
=
1
0
1/2
~
1
11
)(
N
k
Nkj
N
ze
z
N
kH π
∑
−
=
−
−








−
−
=
1
0
1/2
~
1
)(1 N
k
Nkj
N
ze
kH
N
z
π
This equation can be
directly used for realization
of FIR filter
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 76
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 77
Contd..
Realization Structure
x(n) +
Z-M
N
1
+
Z-1
Nj
e /0.2π
)0(
~
H
+
Z-1
Nj
e /1.2π
)1(
~
H
+
Z-1
NNj
e /)1(2 −π
)1(
~
−NH
+
+
y(n)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 78
Problem
Design a low pass digital filter with cut-off frequency wc = π/2 using
frequency sampling technique for N=9.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 79
Solution
∑
−
=
−
−








−
−
=
1
0
1/2
~
1
)(1
)(
N
k
Nkj
N
ze
kH
N
z
zH πDerive for realization
)(
~
kHCalculate 1,,.........1,0 −= Nk
As given ,





=
0
1
1
)(ωdH
otherwise
πωπ
πω
2||2/3
2/||0
≤≤
≤≤






=
N
k
HkH d
π2
)(
~
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 80
Contd..
k or
0 0 No 1
1 π/4.5 No 1
2 π/2.25 No 1
3 π/1.5 Yes 0
4 π/1.125 Yes 0
5 π/0.9 Yes 0
6 π/0.75 Yes 0
7 π/0.642 No 1
8 π/0.562 No 1
9
2 kπ 2/π>
)(
~
kH2/3π<
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 81
Copyright© with Authors. All right reserved
For education purpose.
Commercialization of this material is
strictly not allowed without permission
from author.
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 82
Contd..
Realization
x(n) +
Z-M
N
1
+
Z-1
Nj
e /0.2π
)0(
~
H
+
Z-1
Nj
e /1.2π
)1(
~
H
+
Z-1
NNj
e /)1(2 −π
)1(
~
−NH
+
+
y(n)
10/21/2009
e-TECHNote from IRDC India
info@irdcindia.com 83
End of Chapter 04
Queries ???

More Related Content

PDF
Design of FIR filters
PDF
quantization
PPTX
CPLD (COMPLEX PROGRAMMABLE LOGIC DEVICES)
PPTX
Properties of dft
PDF
DSP_FOEHU - Lec 13 - Digital Signal Processing Applications I
PPTX
Digital signal processing
PDF
Basics of Digital Filters
PDF
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
Design of FIR filters
quantization
CPLD (COMPLEX PROGRAMMABLE LOGIC DEVICES)
Properties of dft
DSP_FOEHU - Lec 13 - Digital Signal Processing Applications I
Digital signal processing
Basics of Digital Filters
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform

What's hot (20)

PPTX
Low noise amplifier
PDF
Circular Convolution
PPT
Pulse amplitude modulation
PDF
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
PDF
Chapter2 - Linear Time-Invariant System
PPTX
Matched filter detection
PPT
PPTX
Discrete time filter design by windowing 3
PDF
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
PDF
Chapter 5 counter
DOCX
digital filter design
PPTX
Counters
PPT
Digital signal processor part 3
PPT
PDF
Computing DFT using Matrix method
PPTX
Registers siso, sipo
PPTX
EC8791 UML-model train controller
PPTX
IIR filter
PPT
Counters
PPTX
Addressing sequencing
Low noise amplifier
Circular Convolution
Pulse amplitude modulation
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
Chapter2 - Linear Time-Invariant System
Matched filter detection
Discrete time filter design by windowing 3
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Chapter 5 counter
digital filter design
Counters
Digital signal processor part 3
Computing DFT using Matrix method
Registers siso, sipo
EC8791 UML-model train controller
IIR filter
Counters
Addressing sequencing
Ad

Viewers also liked (20)

PDF
Digital Signal Processing Tutorial:Chapt 1 signal and systems
PPT
digital filters
PDF
Fast Fourier Transform
PDF
Time frequency analysis_journey
PPT
interferences entre-symboles
PDF
Digital Signal Processing Tutorial:Chapt 2 z transform
PDF
One sided z transform
PDF
Discrete Time Fourier Transform
PPTX
Sound and hearing by mairasadiq
PPTX
Fir filter design (windowing technique)
PPTX
Dct and adaptive filters
PPT
tsa analyse-temps-frequence
PPTX
Eye diagram
PPT
Digital Filters Part 1
DOC
Chapter 5 (maths 3)
PDF
Dft and its applications
PPTX
Design of Filters PPT
PPT
Digital Filters Part 2
PDF
The Fast Fourier Transform (FFT)
PPTX
Discrete Fourier Transform
Digital Signal Processing Tutorial:Chapt 1 signal and systems
digital filters
Fast Fourier Transform
Time frequency analysis_journey
interferences entre-symboles
Digital Signal Processing Tutorial:Chapt 2 z transform
One sided z transform
Discrete Time Fourier Transform
Sound and hearing by mairasadiq
Fir filter design (windowing technique)
Dct and adaptive filters
tsa analyse-temps-frequence
Eye diagram
Digital Filters Part 1
Chapter 5 (maths 3)
Dft and its applications
Design of Filters PPT
Digital Filters Part 2
The Fast Fourier Transform (FFT)
Discrete Fourier Transform
Ad

Similar to Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR) (20)

PPTX
ANALYTIC SIGNAL GENERATION- DIGITAL SIGNAL PROCESSORS AND ARCHITECTURE ...
PDF
filtering of non stationary signal
PPTX
Digital filters and FIR Filter Design in Future Multicarrier Communication Sy...
PPTX
Dss
PPT
12936608 (2).ppt
PPTX
Design of digital filters
PPT
PDF
DSP - Realization of Finite Impulse Response Filter
PDF
Filter Implementation And Evaluation Project
PDF
Time domain analysis and synthesis using Pth norm filter design
PDF
Performance analysis of new proposed window for
PPTX
Digital signal processing realization of FIR filters
PDF
IRJET- Filter Design for Educational Set Via Labview Software Program
PPTX
Importance of FIR filters power point.pptx
PDF
Performance analysis of new proposed window for the improvement of snr &amp; ...
PDF
PPT s05-machine vision-s2
PPTX
Signal Processing Assignment Help
PPTX
Signal Processing Homework Help
PDF
DSP_note_for_lab especially ofr Lab finals
ANALYTIC SIGNAL GENERATION- DIGITAL SIGNAL PROCESSORS AND ARCHITECTURE ...
filtering of non stationary signal
Digital filters and FIR Filter Design in Future Multicarrier Communication Sy...
Dss
12936608 (2).ppt
Design of digital filters
DSP - Realization of Finite Impulse Response Filter
Filter Implementation And Evaluation Project
Time domain analysis and synthesis using Pth norm filter design
Performance analysis of new proposed window for
Digital signal processing realization of FIR filters
IRJET- Filter Design for Educational Set Via Labview Software Program
Importance of FIR filters power point.pptx
Performance analysis of new proposed window for the improvement of snr &amp; ...
PPT s05-machine vision-s2
Signal Processing Assignment Help
Signal Processing Homework Help
DSP_note_for_lab especially ofr Lab finals

Recently uploaded (20)

PDF
01-Introduction-to-Information-Management.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Lesson notes of climatology university.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
TR - Agricultural Crops Production NC III.pdf
01-Introduction-to-Information-Management.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
102 student loan defaulters named and shamed – Is someone you know on the list?
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Types and Its function , kingdom of life
Supply Chain Operations Speaking Notes -ICLT Program
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Sports Quiz easy sports quiz sports quiz
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPH.pptx obstetrics and gynecology in nursing
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Lesson notes of climatology university.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial diseases, their pathogenesis and prophylaxis
TR - Agricultural Crops Production NC III.pdf

Digital Signal Processing Tutorial: Chapt 4 design of digital filters (FIR)

  • 1. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 1 Chapt 04 Design of Digital Filters ( FIR) B.E. Comps, Mumbai Uni PrePrepared by IRDC India
  • 2. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 2 Chapt 04 Design of Digital Filters •Design of FIR filters •Design of IIR filters from analog filters •Frequency transformation •Design of digital filters based on least-squares method •Digital filters from analog filters •Properties of FIR filters •Design of FIR filters using windows •Comparison of IIR and FIR filters •Linear phase filters
  • 3. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 3 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 4. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 4 What is filter ? Basic building block of DSP: Input is given to filter and output of the system would be signal obtained from input and filter's impulse response. Filter Input Output [ 1 1] Input Output [ 1 -1] Input Output Integrator ( Low pass filter) Differentiator (High pass filter)
  • 5. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 5 Contd.. Different impulse response different characteristics Characteristic of the filter – Frequency domain characteristics Frequency Characteristic Phase Characteristic
  • 6. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 6 Frequency Characteristic H(w) Wπ Frequency characteristic plot between frequencies and magnitude For given system if particular frequency is passed thorough the system, its magnitude at output can be obtained from corresponding magnitude from frequency characteristic Note: most of the time input wont be single pure sinusoidal/frequency but would be a set of frequencies
  • 7. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 7 Phase Characteristic ϕ(w) Wπ Phase characteristic plot between frequencies and phase shift For given system if particular frequency is passed thorough the system, its delay/phase shift at output can be obtained from corresponding phse from phase characteristic Note: most of the time input wont be single pure sinusoidal/frequency but would be a set of frequencies π− π
  • 8. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 8 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 9. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 9 Ideal Characteristics Frequency Phase Sharp cutoff Linear phase Sharp cutoff is requirement for almost all the applications Non-linear phase characteristic distorts the signal. Linear phase characteristic has constant group delay.
  • 10. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 10 Effect of Linear Phase Characteristic Let us pass signal , made up of summing frequency 1 Hz, 2Hz & 3 Hz, through filters with different phase characteristics
  • 11. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 11 Contd..
  • 12. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 12 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 13. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 13 Contd..
  • 14. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 14 Contd..
  • 15. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 15 Contd..
  • 16. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 16 Contd..
  • 17. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 17 Challenge …..
  • 18. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 18 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 19. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 19 Verify ….
  • 20. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 20 M file used in MATLAB for this simulation clear all; close all; figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3])); title(' Inoput Signal Composition'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3])); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3])); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])])); figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3]+pi/8)); title(' Filtered Signal with phase characteristic pi/8'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3]+pi/8)); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3]+pi/8)); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)]));
  • 21. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 21 Contd.. figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3]+pi/4)); title(' Filtered Signal with phase characteristic pi/4'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3]+pi/4)); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3]+pi/4)); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)])); figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3]+pi/2)); title(' Filtered Signal with phase characteristic pi/2'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3]+pi/2)); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3]+pi/2)); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)]));
  • 22. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 22 Contd.. figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3]+pi/8)); title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3]+pi/4)); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3]+pi/2)); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)])); figure, subplot(4,1,1); plot(sin(2*pi*1*[0:0.01:3]+pi/4)); title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)'); subplot(4,1,2); plot(sin(2*pi*2*[0:0.01:3]+pi/2)); subplot(4,1,3); plot(sin(2*pi*3*[0:0.01:3]+pi/1)); subplot(4,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)]));
  • 23. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 23 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 24. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 24 Chapt 04 figure, subplot(6,1,1); plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])])); title('I am Input Signal , which of followings looks like me ?'); subplot(6,1,2); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)])); %title(' Filtered Signal with phase characteristic pi/8'); subplot(6,1,3); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)])); %title(' Filtered Signal with phase characteristic pi/4'); subplot(6,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)])); %title(' Filtered Signal with phase characteristic pi/2'); subplot(6,1,5); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)])); %title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)'); subplot(6,1,6); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)])); %title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)');
  • 25. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 25 Chapt 04 figure, subplot(6,1,1); plot(sum([sin(2*pi*1*[0:0.01:3]);sin(2*pi*2*[0:0.01:3]);sin(2*pi*3*[0:0.01:3])])); title(' Input Signal '); subplot(6,1,2); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/8);sin(2*pi*3*[0:0.01:3]+pi/8)])); title(' Filtered Signal with phase characteristic pi/8'); subplot(6,1,3); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/4)])); title(' Filtered Signal with phase characteristic pi/4'); subplot(6,1,4); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/2);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/2)])); title(' Filtered Signal with phase characteristic pi/2'); subplot(6,1,5); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/8);sin(2*pi*2*[0:0.01:3]+pi/4);sin(2*pi*3*[0:0.01:3]+pi/2)])); title(' Filtered Signal with phase characteristic w(linear phase with group delay 1)'); subplot(6,1,6); plot(sum([sin(2*pi*1*[0:0.01:3]+pi/4);sin(2*pi*2*[0:0.01:3]+pi/2);sin(2*pi*3*[0:0.01:3]+pi/1)])); title(' Filtered Signal with phase characteristic 2w(linear phase with group delay 2)');
  • 26. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 26 Linear Phase Conclusion If filter doesn't have linear phase characteristic( constant group delay) then signal shape gets distorts. e.g. First 3 filtered outputs If filter has linear phase characteristic( constant group delay) then signal shape would be preserved. e.g. Last 2 filtered outputs Linear phase can be obtained easily by FIR filter by having symmetric/anti-symmetric property in its impulse response.
  • 27. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 27 FIR Filter FIR filter has finite number of samples in its impulse response Advantages: • The question of stability and realizability never arise for FIR filters ( it is always stable and realizable) • It gives linear phase relationship with frequency , which can be achieved by having symmetric or anti-symmetric impulse response of the filter Disadvantages : • Long sequences for h(n) are generally required to adequately approximate sharp cut-off filters •Hence , higher computation complexity •The delay of linear phase FIR filters need not always be an integer number of samples . This non-integral delays can lead to problems in some signal processing applications
  • 28. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 28 Characteristic of FIR filter Let { h(n)} be a causal finite durations sequence of length N( 0 to N-1). Its z-transform ∑ − = − = 1 0 )()( N n n znhzH --------(1) Its Fourier transform, ∑ − = − = 1 0 )()( N n jwnjw enheH Which is periodic in frequency with period of 2π )()( )2( mjj eHeH πωω + = ......3,2,1,0 ±±±=mfor --------(2) Consider h(n) be real and its magnitude and phase , )( )()( ωθjjwjw eeHeH ±=
  • 29. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 29 Contd.. From eq (2) , since wnjwne jwn sincos −=− symmetric Anti- symmetric Magnitude of Fourier transform is symmetric and the phase is an anti-symmetric function )()( jwjw eHeH − = πω ≤≤0 )()( ωθωθ −−= Consider , we have to have linear phase response i.e. αωωθ −=)( where α is constant ( phase delay in samples)
  • 30. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 30 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 31. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 31 Contd.. We would find , condition/restriction on impulse response such that it will give linear phase response Mathematically, ∑ − = − = 1 0 )()( N n jwnjw enheH αωjjw eeH − ±= )( Requirement ∑ − = − = 1 0 )()( N n jwnjw enheH Given ∑∑ − = − = −= 1 0 1 0 )sin()()cos()( N n N n wnnhjwnnh             − =− ∑ ∑ − = − =− 1 0 1 01 )cos()( )sin()( tan N n N n wnnh wnnh αω
  • 32. Since n=0, sin(wn)=0 Hence , limit starts from 1 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 32 Contd..             = ∑ ∑ − = − = 1 0 1 0 )cos()( )sin()( )tan( N n N n wnnh wnnh αω             + =∴ ∑ ∑ − = − = 1 1 1 1 )cos()()0( )sin()( )tan( N n N n wnnhh wnnh αω There are two possible solutions 1) α=0 , h(0) can be arbitrary & h(n)=0 for n≠0 In this case filter will have order 0 and it would be just amplifier and not a filter. This is not too useful result
  • 33. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 33 Contd.. 2) α≠0             ==∴ ∑ ∑ − = − = 1 0 1 0 )cos()( )sin()( )cos( )sin( )tan( N n N n nnh nnh ω ω αω αω αω ∑∑ − = − = =∴ 1 0 1 0 )cos()sin()()sin()cos()( N n N n nnhnnh αωωαωω 0)}cos()sin()sin()){cos(( 1 0 =−∴∑ − = αωωαωω nnnh N n 0)sin()( 1 0 =−∴∑ − = nnh N n ωαω 0)(sin)( 1 0 =−∴∑ − = nnh N n αω
  • 34. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 34 Contd.. From this equation , unique solution is obtained for the set of conditions 1) α= (N-1)/2 i.e. for any value of sequence , there is only one value of phase delay α , which is the condition to obtain linear phase. 2) h(n)=±h(N-1-n) for 0 ≤ n ≤ N-1 i.e. impulse response sequence must have a special kind of symmetry for the value of α For linear phase filter , impulse response should be either symmetric or anti-symmetric. As impulse response can be of odd or even length, there are four possible types of impulse response which will have linear phase characteristic.
  • 35. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 35 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 36. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 36 Linear Phase Filters – Impulse Responses 1) Symmetric and Even N 2) Anti-symmetric and Even N 3) Symmetric and Odd N 4) Anti-symmetric and Odd N
  • 37. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 37 Symmetric and Even & Odd N 0 1 2 3 4 5 6 7 8 9 10 N=11 ( Odd) α= 5 Center of symmetry 0 1 2 3 4 5 6 7 8 9 N=10 ( Even) α= 4.5 Center of symmetry
  • 38. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 38 Anti-Symmetric and Even & Odd N 0 1 2 3 4 5 6 7 8 9 10 N=11 ( Odd) α= 5 Center of symmetry 0 1 2 3 4 5 6 7 8 9 N=10 ( Even) α= 4.5 Center of symmetry
  • 39. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 39 Proofs of Linear phase characteristics for all four types Refer Rabinar and Gold
  • 40. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 40 Position of zeros in Linear phase filters ∑ − = − = 1 0 )()( N n n znhzHWe have )1()2()3( 4321 )0()1()2( )4()3()2()1()0( −−−−−− −−−− ±±±−−− −−−++++= NNN zhzhzh zhzhzhzhh →± Symmetry/ anti-symmetry in impulse response 2/)1( )( −− = N zzH [ ] [ ] [ ] } )2( )1( )0({ 2/)5(2/)5( 2/)3(2/)3( 2/)1(2/)1( −−−−−+ ±+ ±+ ± −−− −−− −−− NN NN NN zzh zzh zzh -----------(1)
  • 41. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 41 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 42. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 42 Contd.. If z is replaced by z-1 in eq 1 we get 2/)1(1 )( −− = N zzH [ ] [ ] [ ] } )2( )1( )0({ 2/)5(2/)5( 2/)3(2/)3( 2/)1(2/)1( −−−−−+ ±+ ±+ ± −−− −−− −−− NN NN NN zzh zzh zzh -----------(2) Comparing eq 1 & 2 we get )()( )1(1 zHzzH N −− ±= H(z) and H(z-1) are identical within a delay of (N-1) samples and multiplier ±1 (r,-Ɵ) (r,Ɵ) (1/r,Ɵ) (1/r,-Ɵ)
  • 43. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 43 Ideal Filter Consider ideal low-pass filter characteristic H(w) Wc w    = 0 1 )(ωH πωω ωω ≤< ≤ c c By taking inverse fourier transform we get impulse response of the above filter as     = n n c cc c nh ω ω π ω π ω sin )( 0 0 ≠ = n n
  • 44. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 44 Why ideal filter is not physically realizable ? Two observations of above h(n) that makes ideal filter not realizable •Length of h(n) is infinite •Impulse response is not causal. To make is causal , shifting response could be one way, but shifting by infinity amount is not possible .
  • 45. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 45 Filter Specifications
  • 46. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 46 Contd..
  • 47. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 47 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 48. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 48 Design of FIR filter FIR filters can be designed by using following methods •Window method ( Fourier Series Method) •Frequency sampling method •Optimal filter design
  • 49. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 49 Windowing Technique • Desired frequency response with specifications Hd(w) •Take inverse Fourier transform of Hd(w) to obtain filter impulse response hd(n) •Since , impulse response hd(n) is infinite in duration, window w(n) is used to truncate it and gives impulse sample response of the FIR filter. i.e. hw(n)= hd(n). w(n) Since window function w(n) will have finite samples (say M ), we get    = 0 )().( )( nwnh nh d w otherwise Mn 2/,......2,1,0 ±±±= • Give a shift of M/2 samples to hw(n) to make it causal )2/()( Mnhnh w −=
  • 50. Name of Window Time domain sequence h(n) , 0 ≤ n ≤ M-1 Approx Transition width of main lobe Peak Sidelobe (dB) Rectangular 1 4π/M -13 Barlett ( traingualr) 8π/M -27 Blakman 8π/M -32 Hamming 8π/M -43 Hanning 12π/M -58 Kaiser -- -- 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 50 Different Windows 1 4 cos08.0 1 2 cos5.042.0 − + − − M n M n ππ 1 2 1 2 1 − − − − M M n 1 2 cos46.054.0 − − M nπ       − − 1 2 cos1 2 1 M nπ             −               − −−      − 2 1 2 1 2 1 22 M I M n M I o o α α
  • 51. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 51 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 52. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 52 Frequency response to impulse response 1) Ideal low pass filter    = 0 1 )(ωdH otherwise cωω ≤≤ ||0H(w) -π -Wc Wc π w ∫− = π π ω π ωω deHnh nj dd )()( 2 1 c c c c jn e de nj nj ω ω ω π ω ω ω π ω −− == ∫ 2 1 2 1       − = − jn ee njnj cc ωω π2 1       − = − j ee n njnj cc 2 11 ωω π
  • 53. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 53 Contd.. n n d c nh π ωsin )( = for 0≠n for 0=n ∫− = c c denh nj d ω ω ω π ω2 1 )( ∫∫ −− == c c c c ddeh j d ω ω π ω ω ω π ωω .1)0( 2 10. 2 1 π ω π ω π ωω cc d cc h === −− 2 2 )0( 2 )(       = n n nh c c d π ω π ω sin )( 0 0 ≠ = n n
  • 54. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 54 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 55. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 55 Contd..     = −− 0 )( )( 2 1 ω ω Nj d e H otherwise cωω ≤≤ ||0 If then       − − = − − )( )(sin )( 2 1 2 1 N N c c d n n nh π ω π ω otherwise n N 2 1− =
  • 56. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 56 High Pass Filter H(w) -π -Wc Wc π w    = 0 1 )(ωdH otherwise c πωω ≤≤ || ∫− = π π ω ωω π deHnh nj dd )( 2 1 )(         += ∫∫ − π ω ω ω π ω ωω π c c dede njnj .1.1 2 1         += − − π ω ωω π ω π c c jn e jn e njnj 2 1 [ ]njnjnjnj cc eeee jn ωππω π −+−= −− 2 1             − −      − −= −− j ee j j ee j jn njnjnjnj cc 2 2 2 2 2 1 ππωω π
  • 57. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 57 Contd.. ( )nn n nh cd πω π sinsin 1 )( + − = n n nh c d π ωsin )( − = 0sin =nπQ for all integers n for 0=n         += ∫∫ − π ω ω ω π ω ωω π c c dedeh jj d 0.0. .1.1 2 1 )0(         += ∫∫ − π ω ω π ωω π c c dd .1.1 2 1 ( )cc ωππω π −++−= 2 1 ( )cωπ π 22 2 1 −= π ωc −=1       − − = n n nh c c d π ω π ω sin 1 )( 0 0 ≠ = n n
  • 58. -π -Wc2 -Wc1 Wc1 Wc2 π w 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 58 Band-Pass Filter H(w)    = 0 1 )(ωdH otherwise cc 21 || ωωω ≤≤ ∫− = π π ω ωω π deHnh nj dd )( 2 1 )(         += ∫∫ − − 2 1 1 2 .1.1 2 1 c c c c dede njnj ω ω ω ω ω ω ωω π         += − − 2 1 1 2 2 1 c c c c jn e jn e njnj ω ω ωω ω ω π [ ]njnjnjnj cccc eeee jn 1221 2 1 ωωωω π −+−= −−             − −      − −= −− j ee j j ee j jn njnjnjnj cccc 2 2 2 2 2 1 1122 ωωωω π
  • 59. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 59 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 60. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 60 Contd.. ( )nn n nh ccd 12 sinsin 1 )( ωω π −= 0≠n ( ) π ωω ωω π 12 12 )(2 2 1 )( cc ccd nh − =−= 0=n
  • 61. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 61 Band-stop filter ( )nn n nh ccd 21 sinsin 1 )( ωω π −= 0≠n 1)( 21 + − = π ωω cc d nh 0=n Proceed in same way ….
  • 62. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 62 Hilbert Transform -π π w H(w) j -j   − = j j Hd )(ω 0 0 ≤≤− ≤≤ ωπ πω ∫− = π π ω ωω π deHnh nj dd )( 2 1 )(       −= ∫∫− π ω π ω ωω π 0 0 .. 2 1 dejdej njnj         −= − πω π ω π 0 0 2 jn e jn ej njnj [ ]11 2 1 +−−= − njnj ee jn ππ π             + −= − 2 22 2 1 njnj ee n ππ π
  • 63. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 63 Contd.. ( )n n nhd π π cos1 1 )( −= 0)( =nhd 0=n ( ))cos(1 1 22 nn n ππ π +−= ( ))(sin)(cos1 1 2 2 2 2 nn n ππ π +−= ( ))(sin)(sin 1 2 2 2 2 nn n ππ π += n n nhd π π )(sin2 )( 2 2 = 0≠n
  • 64. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 64 FIR differentiator πωπ ≤≤−jwHd =)(ω ∫∫ −− == π π ω π π ω ωω π ωω π dejdeHnh njnj dd . 2 1 )( 2 1 )( π π ωω ω π −       −= 22 . 2 1 nj e jn e j njnj       −+−= − − jn e e jn e e jn j nj nj nj nj π π π π ππ π .. 2 ( )      −−      + = − − njnj njnj ee jn ee n ππ ππ π π 1 2 2 2 1
  • 65. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 65 Contd..             − −      + = −− j ee n ee n nh njnjnjnj d 2 2 2 2 2 1 )( ππππ π π     −= n n n n πππ π sin 2 cos2 2 1 [ ]0cos2 2 1 −= n n ππ π n n nhd πcos )( = 0)( =nhd 0=n 0≠n
  • 66. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 66 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 67. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 67 Problem a) Design a low pass , linear phase , FIR filter of length 9 ( order 8) with cut-off frequency of 5kHz and sampling frequency 20 kHz. Use Hann window with Find the delay involved. a) Find magnitude and phase response of this filter and obtain the plots. Derive necessary expressions b) Find the cut-off frequency of a designed filter       − −= 1 2 cos1 2 1 )( M n nw π 10 −≤≤ Mn
  • 68. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 68 Solution Ideal low pass filter with cutoff frequency ,fc= 5kHz and sampling frequency fs=20kHz    = 0 1 )(ωdH otherwise cωω ≤≤ ||0H(w) -π -Wc Wc π w ∫− = π π ω π ωω deHnh nj dd )()( 2 1 c c c c jn e de nj nj ω ω ω π ω ω ω π ω −− == ∫ 2 1 2 1       − = − jn ee njnj cc ωω π2 1       − = − j ee n njnj cc 2 11 ωω π As fs=20 kHz is equivalent to 2π, fc=5kHz corresponds to wc=2π*5/20=0.5 π
  • 69. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 69 Contd.. n n d c nh π ωsin )( = for 0≠n for 0=n ∫− = c c denh nj d ω ω ω π ω2 1 )( ∫∫ −− == c c c c ddeh j d ω ω π ω ω ω π ωω .1)0( 2 10. 2 1 π ω π ω π ωω cc d cc h === −− 2 2 )0( 2 )(       = n n nh c c d π ω π ω sin )( 0 0 ≠ = n n
  • 70. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 70 Contd.. Using above equation , obtain desired filter coefficients from h(-4) to h(4) for filter with wc=0.5 π and length 9 hd(0)=0.5 hd(1)= 0.31830 =hd (-1) hd(2)=0 =hd (-2) hd(3)=0.10615 =hd (-3) hd(4)=0 =hd (-4) hc(4)=0.5 hc(5)= 0.31830 =hc (3) hc(6)=0 =hc (2) hc(7)=0.10615 =hc (1) hc(8)=0 =hc (0) Shift by 4 to make it causal n’ =n+4
  • 71. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 71 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 72. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 72 Contd.. Multiply filter coefficients now with window function       − −= 1 2 cos1 2 1 )( M n nw π 10 −≤≤ Mn h(4)=0.5*w(4)=0.5 h(3)= 0.31830*w(3)=0.27168 =h (5) h(2)=0*w(2)=0 =h(6) h(1)=0.10615*w(1)=0.01554 =h (7) h(0)=0*w(0)=0 =h (8)
  • 73. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 73 Frequency Sampling Technique In this method, desired frequency response is sampled to obtain DFT coefficients, which are then passed through IDFT to get impulse response Desired Frequency Response Hd(ejw) Sampling DFT coefficients H(k) IDFT Filter coefficients h(n) Let us sample desired frequency response Hd(ejw) at N points wk , k=0 ,1 , 2 ….N-1( N being length of filter) N k wk π2 = 1,,.........1,0 −= Nk kww jw d eHkH = = )()( ~ Sampled desired frequency response 1,,.........1,0 −= Nk )( /2 Nkj d eH π = 1,,.........1,0 −= Nk
  • 74. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 74 Contd.. )( ~ kHLet us consider, as a DFT coefficients , then Nknj N k ekH N nh /2 1 0 ~ )( 1 )( π ∑ − = = 1,,.........1,0 −= Nn For the implementation of filter , taking z transform of h(n) n N n Nknj N k zekH N − − = − = ∑ ∑       = 1 0 /2 1 0 ~ )( 1 π ∑ − = − = 1 0 )()( N n n znhzH By changing the order of summation , we get ∑ ∑ − = − = −       = 1 0 1 0 /2 ~ 1 )()( N k N k nNknj ze N kHzH π
  • 75. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 75 Contd.. ( )∑ ∑ − = − = −       = 1 0 1 0 1/2 ~ 1 )()( N k N k nNkj ze N kHzH π ∑ − = − −       − − = 1 0 1/2 2~ 1 11 )( N k Nkj kjN ze ez N kH π π ∑ − = − −       − − = 1 0 1/2 ~ 1 11 )( N k Nkj N ze z N kH π ∑ − = − −         − − = 1 0 1/2 ~ 1 )(1 N k Nkj N ze kH N z π This equation can be directly used for realization of FIR filter
  • 76. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 76 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 77. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 77 Contd.. Realization Structure x(n) + Z-M N 1 + Z-1 Nj e /0.2π )0( ~ H + Z-1 Nj e /1.2π )1( ~ H + Z-1 NNj e /)1(2 −π )1( ~ −NH + + y(n)
  • 78. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 78 Problem Design a low pass digital filter with cut-off frequency wc = π/2 using frequency sampling technique for N=9.
  • 79. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 79 Solution ∑ − = − −         − − = 1 0 1/2 ~ 1 )(1 )( N k Nkj N ze kH N z zH πDerive for realization )( ~ kHCalculate 1,,.........1,0 −= Nk As given ,      = 0 1 1 )(ωdH otherwise πωπ πω 2||2/3 2/||0 ≤≤ ≤≤       = N k HkH d π2 )( ~
  • 80. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 80 Contd.. k or 0 0 No 1 1 π/4.5 No 1 2 π/2.25 No 1 3 π/1.5 Yes 0 4 π/1.125 Yes 0 5 π/0.9 Yes 0 6 π/0.75 Yes 0 7 π/0.642 No 1 8 π/0.562 No 1 9 2 kπ 2/π> )( ~ kH2/3π<
  • 81. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 81 Copyright© with Authors. All right reserved For education purpose. Commercialization of this material is strictly not allowed without permission from author.
  • 82. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 82 Contd.. Realization x(n) + Z-M N 1 + Z-1 Nj e /0.2π )0( ~ H + Z-1 Nj e /1.2π )1( ~ H + Z-1 NNj e /)1(2 −π )1( ~ −NH + + y(n)
  • 83. 10/21/2009 e-TECHNote from IRDC India info@irdcindia.com 83 End of Chapter 04 Queries ???