0% found this document useful (0 votes)
87 views

Unit IV Fir Design Lecture Notes

This document discusses linear phase FIR filters. It covers: 1) Linear phase filters have a linear relationship between phase and frequency, resulting in uniform delay for all frequencies. 2) For an FIR filter to have linear phase, the phase of its frequency response must be of the form ∠H(e^jω) = -ω*constant. 3) References are provided for further reading on FIR filter design using windowing techniques and frequency sampling.

Uploaded by

ramuamt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Unit IV Fir Design Lecture Notes

This document discusses linear phase FIR filters. It covers: 1) Linear phase filters have a linear relationship between phase and frequency, resulting in uniform delay for all frequencies. 2) For an FIR filter to have linear phase, the phase of its frequency response must be of the form ∠H(e^jω) = -ω*constant. 3) References are provided for further reading on FIR filter design using windowing techniques and frequency sampling.

Uploaded by

ramuamt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

AVR 1

UNIT IV FIR FILTER DESIGN


Syllabus:
Symmetric & antisymteric FIR filters – Linear phase filter – Windowing technique –
Rectangular – Kaiser windows – Frequency sampling techniques – Structure for FIR
systems.

Phase I Coverage:

 Linear phase filter –


 Windowing technique – Rectangular –
 Frequency sampling techniques
 Structure for FIR systems.(Partial coverage)
 Symmetric & antisymteric FIR filters –
 Kaiser windows
Reference:

 John G Proakis and Dimtris G Manolakis, “Digital Signal Processing Principles


Algorithms and Application”, 3rd Edition, PHI/Pearson Education, 2000.

 Johny R.Johnson, “Introduction to Digital Signal Processing”, Prentice Hall of


India/Pearson Education, 2002.(Good coverage and simple explanation of FIR
design and frequency sampling technique)

http://www.udel.edu/idsardi/sinewave/sinewave.html
AVR 2

Linear phase filter


FIR vs IIR:
FIR IIR
S.No
Finite Duration Impulse Response Infinite Duration Impulse Response
M −1
y ( n )= ∑ x ( n−k ) h ( k )

y ( n )=∑ x ( n−k ) h ( k )
0. k=0
k=0
h ( n ) is finite ¿
h(n) is of infinite duration (0¿ ∞)
outside the range : 0 ¿ M −1 ¿
H(z) is a rational function
M−1

H(z) is not a rational function ∑ bk z−k


k=0
M−1
H ( z )=
H ( z )= ∑ b k z
( )
−k N
1.
1+ ∑ a k z
−k
k=0
Where, M : Length of the filter k=1
Where, N : Order of the filter
a k is zero for FIR system
Implemented without use of any Implemented with the use of recursive
2.
recursive (or feedback) structures (or feedback) structures
Advantages: Disadvantages:
 Linear Phase and hence no  No Linear Phase and hence
phase distortion phase distortion
 Stability  Chance to become unstable
3.
Disadvantages: Advantages:
 Poor stopband attenuation due  Comparatively good stopband
to more side Lobes attenuation
 More Hardware  Less Hardware
Most often FIR filters are preferred compared to IIR filters due to its linear phase
property..

Linear Phase Condition for FIR Filter:


Linear Phase:
Relation between phase and frequency is linear which causes uniform delay for all
frequency components.

If Phase , ∠ H ( e ) =−ω∗Constant ,then linear phase .


Group Delay:
−d ∠ H ( e jω )
τ g=delay=

Derivation for Condition for Linear Phase Filter:
M −1 M −1
System Function, H ( z )= ∑ b k z−k = ∑ h (k )z −k
k=0 k=0
jω jω
z=ℜ =e ( assume r=1 )
M−1
Frequency Respons e , H ( e )= ∑ h ( n ) e
jω − jωn
, ( k is replaced by n just for convenience )
n=0

Since e jθ =cosθ+ jsinθ , Basic Math Recall:


M −1 M −1 M −1
H ( e jω )= ∑ h ( n ) ( cos ( ωn )− jsin ( ωn ) )= ∑ h ( n ) cos ( ωn )− j ∑ h ( n ) sin ( ωn ) x=a+ jb=|x|e j ∠ x
n=0 n=0 n=0

|x|= √ ( ℜ ( x ) ) + ( ℑ ( x ) )
2 2
H ( e )=|H ( e )|e
jω jω j ∠ H ( e jω )

Since we are interested only about the phase (or angle) of the Frequency
response, ∠ x=tan
−1
( )
ℑ(x)
ℜ(x)

( ℑ ( H (e ))
)

∠ H ( e )=ta n
jω −1

ℜ ( H ( e jω ) ) Re(x) = a Im(x) = b
AVR 3

( )
M −1
− ∑ h ( n ) sin ( ωn )
∠ H ( e )=ta n
jω −1 n=0
M−1

∑ h ( k ) cos ( ωn )
n=0

tan−1 ¿

( )
M−1

∑ h ( n ) sin ( ωn )
∠ H ( e )=−ta n jω −1 n=0
M−1

∑ h ( n ) cos ( ωn )
n=0

For a linear phase FIR filter, ∠ H ( e )=−ωτ , where , τ is a constant integer .


( ) ( )
M −1 M −1

−1
∑ h ( n ) sin ( ωn )
−1
∑ h ( n ) sin ( ωn )
n=0 n=0
−ωτ =−ta n M −1
→ωτ =ta n M −1

∑ h ( n ) cos ( ωn ) ∑ h ( n ) cos ( ωn )
n=0 n=0
M −1 M −1

∑ h ( n ) sin ( ωn )
sin ( ωτ ) n=0
∑ h ( n ) sin ( ωn )
n=0
tan ( ωτ )= → =
M−1
cos ( ωτ ) M −1
∑ h ( n ) cos ( ωn ) ∑ h ( n ) cos ( ωn )
n=0 n=0
M −1 M−1

∑ h ( n ) cos ( ωn ) sin ( ωτ ) = ∑ h ( n ) sin ( ωn ) cos ( ωτ )


n=0 n=0
M −1 M −1

∑ h ( n ) cos ( ωn ) sin ( ωτ ) − ∑ h ( n ) sin ( ωn ) cos ( ωτ )=0


n=0 n=0
M −1

∑ h ( n ) (¿ cosωn sinωτ−sinωn cosωτ )=0 ¿


n=0

M −1

∑ h ( n ) (¿ sinωτ cosωn – cosωτ sinωn)=0 ¿


n=0
M −1 M −1

∑ h ( n ) sin ( ωτ−ωn )=0 → ∑ h ( n ) sin ω (τ −n)=0


n=0 n=0 If sinA=−sinB
then, A=−B
h ( 0 ) sin ( ωτ ) + h ( 1 ) sinω ( τ −1 ) +…+h ( M −2 ) sinω ( τ−( M −2 ) ) + h ( M −1 ) sinω ( τ−( M(−θ
( Sincesin )) =0
−1)=−sinθ)
One way to prove above equation is:
h ( 0 ) =h ( M −1 )∧sinωτ=−sinω ( τ−( M −1 ) ) and similarly substituting,

h ( 0 ) sinωτ + h ( 1 ) sinω ( τ −1 ) +…+h ( 1 ) ¿


h ( 0 ) sinωτ + h ( 1 ) sinω ( τ −1 ) +…−h ( 1 ) sinω ( τ−1 )−h ( 0 ) sinωτ=0

For the above substitution to be true:


h ( n ) =h ( M −1−n )∧ωτ =−ω ( τ−( M −1 ) )τ =−τ + M −1
2 τ=M −1
( M −1 )
τ=
2
(Assume M = 5, then n = 0,1,2,3,4  h(0) = h(4), h(1) = h(3) , h(2) =h(2) and τ =
5−1
=2  h ( 0 ) sin 2 ω+h ( 1 ) sinω+h ( 2 ) sinω ( 0 ) +h ( 3 ) sin (−ω )+ h ( 4 ) sin (−2 ω )=0 
2
Hence the condition is satisfied.)
AVR 4

M
IF M is even, then τ = (¿ our problems , M isusually odd)
2
Usually M is chosen to be odd to avoid half-sample delay.

Such a Linear phase FIR filter is called Symmetric FIR Filter.

Anti-Symmetric FIR Filter: h ( n ) =−h( M −1−n)

FIR Filter Design technique is to find the values of h(n) for n: 0 to M-1 (h(n) is called as Filter
coefficients). From this, H(z) can be found which can be implemented using any of the structures
(like Direct form…) .
Digital FIR Filter Design: Windowing Technique-Rectangular
FIR Filter Design:
We are going to design Digital FIR Filter using two techniques:
 Window Method
 Frequency Sampling Method

Window Method: Introduction

General Digital Filter Frequency Response looks like:


{
− jωτ
H ( e )= 1.e , for a band of frequency be allowed ¿ 0 , for a band of frequency not ¿ be allowed ¿

¿
For Linear Phase symmetric FIR filter, Group delay:
M −1
τ= , for M odd
2
M
τ = −1 , for M even
2
where, M is the length of FIR filter or Length of impulse response.

Magnitude: |e jθ|=1
It affects the amplitude of the input signal. |H ( e jω )|=1 for frequency ¿ be allowed .
Phase:
It causes the delay in the input signal.
∠ H e )=−ωτ =Linear Phase for frequency ¿ be allowed
( jω

Window Method:

Inverse Fourier Truncation using Z Transform


Transform Window

Fig:4.1 Window Method


1. Desired Frequency response is given, for example, for a low pass filter,

{ {
− jω ( M −1) − jω ( M −1)

H d ( e )= 1 e ,0 ≤|ω|≤ ω c =
jω 2 2
1e ,−ω c ≤ ω ≤+ ωc
0 , otherwise 0 ,−π ≤ ω ←ωc ∧¿∧¿∧¿ ωc ≤ ω< π
π
1
2. Taking Inverse ℱ Transform , hd ( n ) = ∫ H ( e jω ) e jωn dω ,−∞≤ n ≤+ ∞
2 π −π d
ωc
1 ( M −1 )
h d ( n )= ∫ e− jωτ e jωn dω , since τ= 2
2 π −ω c

[ ] [ ]
ωc ωc j ωc ( n −τ ) − j ωc ( n−τ )
1 1 e jω ( n−τ ) 1 e −e
h d ( n )= ∫
2 π −ω
e
jω ( n−τ )
dω=
2 π j ( n−τ )
=
2π j ( n−τ )
c −ωc

h d ( n )=
2π [ j ( n−τ )
=
]
1 2 j sin ( ω c ( n−τ ) ) sin ( ωc ( n−τ ) )
π ( n−τ )
In the above equation, if n=τ , thenbecomesinfinite , which isimpossible ∈digital domain .

Recall Math: L’Hospital’s Rule

h ( x )x=τ =
N ' ( x)
' |
AVR 5

Hence we need to find h d ( n ), for n=τ using L' Hospital ' s Rule ,

h d ( n )at n=τ =
ωc cos ( ω c ( n−τ ) )
π |
n=τ
ωc
h d ( τ )=
π

{
sin ( ωc ( n−τ ) )
, n ≠ τ ∧¿−∞≤ n ≤+ ∞
h d ( n )= π ( n−τ )
ωc
, n=τ
π
In above equation, n varies from−∞ ¿+∞ .This results in IIR which has to be converted to FIR by
means of truncation (Windowing).

3.The resulting response is multiplied by window function (to truncate).


Simple window function is rectangular function which is given by:
w ( n )= 1 ,0 ≤ n ≤ M −1
0 , Otherwise {
So when multiplying by this term, only the values of h d ( n ) for n :0 ¿ M −1is retained. Other values
are zeroed.
h ( n ) =hd ( n ) w ( n )

{
sin ( ω c ( n−τ ) ) ωc
h (n)= , n ≠ τ∧¿∧0 ≤ n≤ M −1∧¿ , n=τ
π ( n−τ ) π
0 , otherwise (n<0 , n> M −1)

4.After that, to implement FIR filter, system function is found using:


M−1
H ( z )= ∑ h ( n ) z
−n

n=0

To find Frequency Response of the Designed FIR Filter:

+∞
H ( e jω )= ∑ h ( n ) e− jωn
n=−∞

{
+∞
hd ( n ) w ( n ) e− jωn where , w ( n ) = 1 , 0 ≤ n≤ M −1
H ( e jω )= ∑
n=−∞ 0 ,Otherwise
(Considering Rectangular Window)
M −1
¿ ∑ hd ( n ) w ( n ) e
− jωn

n=0
+∞
H ( e jω )= ∑ hd ( n ) w(n)e− jωn
n=−∞
π
1
Substituting, inverse Fourier transform for h d ( n )= ∫
2 π −π
H d ( e ) e dω
jθ jθn

+∞ π
1
¿ ∑ ∫
2 π −π
H d ( e ) e dω w( n)e
jθ jθn − jωn

n=−∞

{ }
π ∞
1
¿ ∫
2 π −π
∑ w ( n ) e− j (ω−θ) n H d ( e jθ ) dω
n=−∞
π
1
H ( e )=

∫ H ( e jθ ) W ( e j (ω−θ )) dθ=H d ( e jθ)∗W ( e jθ )
2 π −π d
So Frequency response of designed FIR filter can be obtained using convolution of desired
frequency response and Window Frequency response.
(Actually H ( e jω )=H d ( e jω) should be equal, this is possible only ifW ( e jω )is a impulse function
of value:2 πδ ( ω ) )
AVR 6

Gibbs Phenomenon:
When using rectangular window, there is large oscillation
near the band edge of the filter (while observing the
frequency response of the desired filter). This is called Gibbs Phenomenon. This is due to
transition of rectangular window, which is not gradual (rather abrupt). So other windows are
proposed which has gradual transition.
Fig: 4.2 Gibb’s Phenomenon

Commonly used Window Functions:

( M2 πn−1 ), n=0 ¿ M −1
Hann Window: w ( n )=0.5−0.5 cos Hanning window is a wrong
name of Hann Window.
Hamming Window:w ( n )=0.54−0.46 cos (
M −1 )
2 πn
, n=0 ¿ M −1

Blackman Window:w ( n )=0.42−0.5 cos ( ) +0.08 cos (


M −1 )
2 πn 4 πn
, n=0¿ M −1
M −1
Bartlett Window (or Triangular Window):

{
2n M −1 2n M −1
w ( n )= M −1 , n=0 ¿ 2− , n= ¿ M −1 ¿
2 M −1 2
¿

2|n−τ| ( M −1 )
¿ 1− ,n=0 ¿ M −1∧τ=
M −1 2
w ( n )=0 , outside the limit :n< 0∧n> M −1.
Window function also follows symmetry property: w ( n )=w ( M −1−n )

Fig:4.3 Window shape. (Only for rectangular window, transitions are abrupt and hence Gibbs
Phenomenon)

In window method, main lobe transition width and side lobe height should be as small as
possible but they are inversely changing parameter.
Problem:
1. Using a Hamming Window technique, design a Low pass filter with pass band gain of unity,
cutoff frequency of 1000Hz and working at a sampling frequency of 5 KHz. The length of the
impulse response should be 7.
Solution:
2 π F c 2 π 1000
ω c =2 π f c = = =0.4 π (rad / s)∧M =7
Fs 5000

{
− jωτ
For alow pass filter , H d ( e )=
jω e ,−ω c ≤ ω ≤ +ω c
0 ,−π ≤ ω← ωc ∧ω c ≤ ω ≤ π ∧¿∧¿
M −1 7−1
where , τ = = =3
2 2
AVR 7

+∞
1
h d ( n )= ∫
2 π −∞
H d ( e jω ) e jωn dω
+ω c + ωc
1 1
¿ ∫
2 π −ω
e− jωτ e jωn dω= ∫ e jω(n− τ) dω
2 π −ω
c c

[ ] [ ]
ωc jω ( n −τ ) ωc j ω c ( n−τ ) − j ωc ( n−τ )
1 1 e 1 e −e
h d ( n )= ∫
2 π −ω
e
jω ( n−τ )
d ω=
2 π j ( n−τ )
=
2π j ( n−τ )
c −ω c

h d ( n )=
2π [ j ( n−τ )
= ]
1 2 j sin ( ω c ( n−τ ) ) sin ( ωc ( n−τ ) )
π ( n−τ )
,n≠τ

'
Using L Hospitals rule :h d ( n ) for ( n=τ )= [ ω c cos ( ωc ( n−τ ) )
π ] n=τ
=
ωC
π
Substituting, ω C =0.4 π , M =7 , τ=3 ,

{ {
sin ( 0.4 π ( n−3 ) )
, n≠ 3 sin ( 0.4 π ( n−3 ))
h d ( n )= π ( n−3 ) = , n ≠3
π ( n−3 )
0.4 π
, n=3 0.4 , n=3
π
Since M=7,
h d ( 0 )=h d ( 6 )=−0.0624
h d (1 ) =hd ( 5 ) =0.0935
h d ( 2 )=hd ( 4 ) =0.3027
h d (3 )=0.4
Window Function:

Hamming Window :w ( n ) =0.54−0.46 cos ( M2 πn−1 ), n=0 ¿ M −1


w ( n )=0.54−0.46 cos ( π3n ) ,n=0 ¿ 6
Since window function follows symmetry property:
w ( 0 )=w (6 )=0.08
w ( 1 ) =w ( 5 )=0.31
w ( 2 ) =w ( 4 )=0.77
w ( 3 )=1
Digital Filter coefficient ,h ( n )=hd ( n ) w ( n ) [Window Method ]
h ( 0 ) =h ( 6 )=hd ( 0 ) w ( 0 )=−0.00499=−0.005
h ( 1 )=h ( 5 )=0.02898=0.029
h ( 2 )=h ( 4 ) =0.23308
h ( 3 )=0.4
The above problem ends here.
If asked to find the system function and Frequency response:
7
System Function: H ( z ) =∑ h ( n ) z−n
n=0

¿ h ( 0 ) +h ( 1 ) z−1+ h ( 2 ) z−2 +h ( 3 ) z−3+ h ( 4 ) z− 4+ h ( 5 ) z −5 + h ( 6 ) z −6


¿ h ( 0 ) +h ( 1 ) z−1+ h ( 2 ) z−2 +h ( 3 ) z−3+ h ( 2 ) z− 4+ h ( 1 ) z−5 +h ( 0 ) z−6
Design is over here.
Suppose frequency response is asked: (Refer symmetrical and antisymmetrical filter (given last)
to write the below equation)
H (ω)=e
−j3ω
{ h ( 3 ) +h ( 0 ) [ 2cos 3 ω ] +h ( 1 ) [ 2 cos 2 ω ] +h ( 2 ) [ 2 cosω ] }
¿e
− j3 ω
{ 0.4−0.01 cos 3 ω+ 0.058cos 2ω +0.466 cosω }
Desired Response of Filters:

High Pass Filter: H d ( e ) =



{
e− jωτ ,−π ≤ ω ≤−ω C ∧¿∧ωc ≤ω ≤ π , = e− jωτ , π ≤|ω|≤ ωC ∧¿
0 ,Otherwise 0 ,Otherwise {
AVR 8

{
− jωτ
e ,−ω c ≤ ω ≤−ωC ∧+ω c 1 ≤ ω ≤+ω c2∧¿
Band Pass Filter: H d ( e ) =

2 1

0 ,Otherwis e

Band Stop or Band Reject: Filter: H d ( e ) =



{
e− jωτ ,−π ≤ ω ≤−ω C2 ,−ωc 1 ≤ ω ≤ ω c1∧¿∧ω c2 ≤ ω ≤ π ,
0 ,Otherwise

Disadvantage of Window Method:

 In Rectangular Window, Gibbs phenomenon is a major problem


 Large side lobes
 Wide transition width
 No separate control of passband and stopband ripples.
AVR 9

FIR Filter Design: Frequency Sampling Technique

Frequency Sampling Inverse DFT Z-Transform

Fig:4.4 Frequency Sampling Technique

1 ¿Given desired frequency response , H d ( e jω )

2) Sampling the desired response (Frequency Sampling) can be done in two ways:

ωk=
2 πk
ωk =
2π k+
1
2
=
( )
2 π ( 2 k +1 ) π ( 2 k +1 )
=
M M 2M M
(Type 1 design) (Type 2 Design)

Sample d Frequency Response ,~


H ( k ) =H d ( e j ω ) k

~
3) Inverse DFT of   H ( k ) :(Type I Design)
M−1 j 2 πnk
1
h (n)=
M
∑~
H (k ) e M
, n=0,1, … , M −1
k=0

( )
M−1
1
remember , h ( n )= ∑ H ( k ) e
jω n
, for all n k

M k=0
~
For any filter, h(n) should be real. For h(n) to be real, H ( k ) should be in complex conjugate pairs,
then
~ ~ ~¿ M −1
H ( 0 ) isreal and H ( M −k ) = H ( k ) , k =1,2, … , for M odd
2

~ ~ ~¿ M ~ M
H ( 0 ) isreal∧ H ( M −k )= H ( k ) , k =1,2 ,… , −1∧ H
2 2
=0 for M even ( )
Filter Coefficients, h(n) can be given by:
{ }
j 2 πn j 2 πn 2 j 2 πn(M −2) j 2 πn ( M−1 )
1 ~ ~ ~ ~ ~
h (n)= H ( 0 )+ H ( 1 ) e M + H ( 2 ) e M + …+ H ( M −2 ) e M + H ( M −1 ) e M
M
j 2 πnk j 2 πn (M −k) j2 πnM j 2 πnk j 2 πnk − j 2 πn
If k =M −k , then ~
H ( k ) e N =~ H ( M −k ) e N =~ =~ =~
− j2 πn−
H ( M −k ) e M M
H ( M −k ) e M
H ( M −k ) e M
Since, e j 2 πn=cos 2 πn+ jsin 2 πn=1 , where n is aninteger
j 2 πn − j 2 πn
~
H ( 1 ) e M =~ H ( M −1 ) e M
j2 πn2 − j 2 πn 2
~ ~
H ( 2 ) e M = H ( M −2 ) e M
~ ~ ~ ~
Since H ( M −k ) = H ¿ ( k ) , then, H ( M −1 )= H ¿ ( 1 )∧for other terms also ,
{ }
j 2 πn j 2 πn 2 − j 2 πn 2 − j 2 πn
1 ~ ~ M ~ M ~¿ M ~¿
h (n)= H ( 0 )+ H ( 1 ) e + H ( 2) e + …+ H ( 2 ) e + H (1 ) e M
M
∵ ( a+ jb ) ( cosθ+ jsinθ )+ ( a− jb )( cosθ− jsinθ )=2∗Real Term of {( a+ jb ) ( cosθ+ jsinθ ) }

{ { }+2 ℜ {~H (2 ) e }+…}


j 2 πn j 2 πn 2
1 ~ ~ M M
h (n)= H ( 0 ) +2 ℜ H ( 1 ) e
M
Generalizing the equation:

{ }
M −1

{ } for M odd
2 j 2 πn k
1 ~ ~
h (n)= H (0)+ ∑ 2 ℜ H ( k ) e M
M k=1

{ }}
M
−1

{
2 j 2 πnk
1 ~ ~
h ( n) = H ( 0) + ∑ 2 ℜ H ( k ) e M
for M even
M k=1
AVR 10

M +1 M −1
Thus filter coefficients can be found using
2
¿
2 ( )
+1 points rather using M points. This
~
simplification is done using Symmetry property of the h(n) and H ( k) .
4) Z-Transform to find the system Function:
M−1
H ( z )= ∑ h ( n ) z−n
n=0

Type 2 Design:

ωk=
2π k+( 12 ) = 2 π (2 k +1 ) = π (2 k + 1)
M 2M M

( )
π ( 2k +1)
~ j
2 ¿ Frequency Sampling : H ( k )=H d ( e ) =H d e
jω k M

~
3) Inverse DFT of H ( k ) :
M−1 j 2 πnk
1
h (n)=
M
∑~
H (k ) e M
, n=0,1, … , M −1
k=0
Condition for h(n) to be real is:
~
H ( M −k −1 )=~ H ¿ ( k ) , k =0,1 , … ,
M −1
2
−1∧~H
M −1
2
=0 for M odd ( )
~ ~¿ M
H ( M −k −1 )= H ( k ) , k =0,1 , … , −1 for M even
2
Filter coefficient , h ( n ) is given by :
M −3

{ } for M odd
2 jnπ ( 2 k+1 )
1 ~
h (n)=
M
∑ 2 ℜ H (k ) e M

k=0
M
−1

{ } for M even
2 jnπ ( 2 k+1 )
1
h (n)= ∑ 2 ℜ ~ H (k)e M
M k =0
4) Z-Transform to find the system Function:
M−1
H ( z )= ∑ h ( n ) z−n
n=0

Structure for FIR Filter (Partially covered)

FIR system Implementation:


M −1 M −1
y ( n )= ∑ x ( n−k ) h ( k )= ∑ x ( k ) h ( n−k )
k=0 k=0
Using the first way of representation, h(k) is a constant but x(n-k) is depends on output, y(n)
For realization, we need:
 Delaying unit
 Multiplier
 Adder

y ( n )=x ( n ) h ( 0 ) + x ( n−1 ) h ( 1 )+ x ( n−2 ) h ( 2 ) +…+ x ( n−( M −1 ) ) h ( M −1 )

x(n-(M-1))

h(M-1)
h(1) h(2)

h(0)
M −1
Fig: 1.7 FIR Direct Form implementation of y ( n )= ∑ x ( n−k ) h ( k )
k=0
AVR 11

FIR filter with Linear Phase property can be implemented with less hardware compared to Non
Linear phase FIR filter.
AVR 12

Symmetric and Anti-symmetric Linear Phase Filter:


Need to find Frequency response for symmetric and antisymmetric filter:
General FIR Filter:
FIR filter in time domain:
M −1
y ( n )=bo x ( n ) +b 1 x ( n−1 ) +…+ b M −1 x ( n−M +1 )= ∑ bk x ( n−k )
k=0
M −1
y ( n )= ∑ h ( k ) x ( n−k )
k=0
Taking Z Transform on both sides,
M −1 M −1
Y ( z )= ∑ h ( k ) X ( z ) z = X ( z ) ∑ h ( k ) z
−k −k

k=0 k=0
M −1
Y (z)
= ∑ h ( k ) z−k
H ( z )=
X ( z ) k=0
−1 −2 − ( M −2) − ( M −1 )
H ( z )=h ( 0 ) +h ( 1 ) z + h ( 2 ) z +…+h ( M −2 ) z +h ( M −1 ) z
For alinear phase filter , h ( n ) =±h ( M −1−n ) , n=0,1… M −1
i .e . h ( 0 )=± h ( M −1 ) ,h ( 1 )=±h ( M −2 ) , . .
−1 −2 − ( M −2) − ( M −1)
H ( z )=h ( 0 ) +h ( 1 ) z + h ( 2 ) z +… ± h (1 ) z ±h ( 0 ) z
H ( z )=h ( 0 ) { 1 ± z−( M −1) } +h ( 1 ) { z ± z−( M−2) }+… h
−1 M
2
−1 {.. ± .. } ( )
( Assume M even above )

{ { }+h ( 1 ) {z }+ … h( M2 −1) {.. ± ..}}


− ( M −1) ( M −1) − ( M −1) + ( M−1−2) −( M −1−2)

H ( z )=z 2
h (0) z 2
±z 2 2
±z 2

[ ] for M even
−1
− ( M−1) 2 ( M−1−2 n) − ( M −1−2 n)
H ( z )=z 2
∑ h ( n) z 2
±z 2

n=0
Similarly for M odd,

{( }
M −3

[ ] for M odd
− ( M−1) ( M −1−2 n) −( M −1−2 n)

)
2
M −1
H ( z )=z 2
h + ∑ h ( n) z 2
±z 2
2 n=0

To find the frequency response of Symmetry Linear Phase FIR Filter:


h ( n ) =h ( M −1−n ) , substitute , z=e jω ,then
M

∑ h( n) [e ]
−1
− jω ( M −1 ) 2 ( M −1−2n ) ( M−1−2 n)
jω − jω
2 2 2
H ( ω ) =e +e
n=0 Basic Math:
M

∑ h( n) [e ]
−1
− jω ( M −1 ) 2 ( M −1−2n ) ( M−1−2 n)
jω − jω jθ
H ( ω ) =e 2 2
+e 2 e =cos θ+ jsinθ
n=0
M
−1
− jω ( M −1 ) 2
H ( ω ) =e 2
∑ 2 h ( n ) cosω ( M −1−2
2
n
) for M even
n=0
− jω ( M −1 )
H ( ω ) =e 2
Hr (ω )
Let, H r ( ω ) is real function of ω∧is given by :
M
−1
2
H r ( ω )= ∑ 2 h ( n ) cosω
n=0
( M −1−2
2
n
) for M even
M−3
2
Similarly , H r ( ω )=h ( M2−1 )+ ∑ 2 h ( n) cosω ( M −1−2
n=0 2
n
) for M odd
Phase:
θ ( ω )=−ω ( M2−1 )=−ωτ → Linear Phase
AVR 13

To find the frequency response of Anti-Symmetry Linear Phase FIR Filter:


h ( n ) =−h(M −1−n)
substitute , z=e jω ,then
Basic Math:
M

∑ h( n) [e ]
−1
− jω ( M −1 ) 2 ( M−1−2n ) ( M −1−2n )
jω − jω jθ
H ( ω ) =e 2 2
−e 2
e =cos θ+ jsinθ
n=0
j( )
π
M
− jω ( M −1 ) 2
−1

[ jω
( M−1−2n )
− jω
( M −1−2n )
]
j=cos () π
2
+ jsin ()
π
2
=e
2

H ( ω ) =e 2
∑ h( n) e 2
−e 2

( π2 )=0 , sin ( π2 )=1


n=0
M
− jω ( M −1 ) 2
−1 cos
H ( ω ) =e 2
∑ 2 jh ( n ) sinω ( M −1−2n
2 )
n=0

M
−1
− jω ( M −1 )
()
π 2

∑ 2 h ( n ) sinω ( M −1−2 )
j
2 2 n
H ( ω ) =e e
n=0 2
j( + )
−ω ( M−1 ) π
2 2
Let , H ( ω ) =e H ( ω) r
M
−1
2
H r ( ω )= ∑ 2 h ( n ) sinω
n=0
( M −1−2
2
n
) for M even
M−3
2
Similarly , H r ( ω )=h ( M2−1 )+ ∑ 2 h ( n) sinω ( M −1−2
n=0 2
n
) for M odd
Phase:
−ω ( M −1 ) π
θ ( ω )= +
2 2

Note:
Y ( z ) M −1
= ∑ h (k ) z
−1 −k
Replace z by z ∈ H ( z ) =
X ( z ) k=0
M−1
H ( z−1 )= ∑ h ( k ) z+ k
k =0
− ( M −1)
Multiply by z on both sides ,
M−1
z − ( M−1)
H ( z ) = ∑ h ( k ) z −( M −1−k )
−1

k=0
Assume , n=M −1−k , then when k =0 , n=M −1
when k =M −1 , n=0
h ( k )=h ( M −1−n )=h ( n ) ( Sincelinear phase )

M−1
H ( z ) = ∑ h ( n ) z =H ( z )
− ( M−1) −1 −n
z
n=0

So , roots of H ( z ) are identical ¿ theroots of H ( z )


−1

Generally , roots meansolutions of a equation , but here ,means zero s .


Zeros of H ( z )=Zeros of H ( z−1 ) for an Linear Phase FIR filter
Consequently , zeros must appear∈reciprocal pairs .
1
If z 2 is a zero , then is also a zero∈ FIR filter as shownbelow
z2
AVR 14

Anti-Symmetric FIR filter can’t be used to design Low Pass Filter whereas Symmetric FIR
filter can be used to design Low Pass Filter and also other filters.
AVR 15

Kaiser window

Windowing using Kaiser Window or I o−sinh windows:

Kaiser window is an optimal window which have reduced main lobe transition and side lobe
width (in contrast to other windows discussed earlier).

{ {[ ( )] }
2 1
n−α 2
I o β 1−
w ( n )= α M −1
, 0 ≤ n≤
I o ( β) 2
0 , Otherwise

Where, I o ( x ) isthe modified Bessel function of the first kind of order zero .

[ ( )]
∞ k 2
1 x
I 0 ( x )=1+ ∑
k =1 k! 2

Design Specifications:

(i) Filter type: Low pass, high pass, bandpass or bandstop


(ii) Passband and stopband frequencies in Hz
(iii) Passband ripple and stopband attenuation in positive decibels: A’p and A’s
(iv) Sampling Frequency, Fs
(v) Filter Order: M (usually Odd Number)

Design Procedure:

(1) Determine δ

δ=min ( δ p , δ s )

( )
'

100.05 A −1p
−0.05 A's
where , δ p= '
0.05 A p
∧δ s =10
10 +1

(2) Calculate A s=−20 log δ s


(3) Determine the parameter α :

{
0 , for A s ≤21
α = 0.5842 ( A s −21 ) +0.07886 ( A s−21 ) , for 21< A s ≤50
0.4

0.1102 ( A s−8.7 ) , for A s >50


(4) Determine the parameter D from the Kaiser Design Equation

{
0.9222 , for A s ≤ 21
D= A s −7.95
, for A s >21
14.36
(5) Calculate the filter order for the lowest odd value of M
AVR 16

JUST KNOW IT:

{
− jωτ
For high pass filter: H d ( e

) = e ,−π ≤ ω ≤−ωc ∧ωc ≤ ω ≤ π
0 , Otherwise
AVR 17

Additional Problem:
Window Method:
1. Design a digital filter with

H d ( e ) =e
jω −j3ω
, 0≤|ω|≤
4

≤|ω|≤ π¿0,
4
Use Blackman Window with N=7. Realize the resulting filter in direct form.
Solution:

Frequency Sampling Technique:


2. A low pass filter has the desired response as given below:

{
−j3ω π
e , 0 ≤|ω|≤
H d ( e )= jω 2
π
0, ≤|ω|≤ π
2

Determine the filter coefficients h(n) for M =7, using Type1 Frequency Sampling Technique.

Solution:
Frequency Sampling
Inverse DFT

~
To find H ( k ) :

( )=H ( e ) where , k =0,1 , …6


j 2 πk j 2 πk
~
H ( k )= H d ( e j ω ) =H d e
k M 7
d

( SinceType 1 design :ω = 2Mπk ) k

First find the frequency terms:


2 πk
ωk=
7
2π 4π 6π
ω 0=0 , ω 1= =0.286 π ,ω 2= =0.57 π , ω3 = =0.857
7 7 7
8π 10 π 12 π
ω 4= =1.14 , ω5 = =1.43 π , ω 6= =1.71 π
7 7 7
k =0 , 1 ,6 belongs ¿ pass band
k =2,3,4,5 belongs¿ stop band
AVR 18

{ {
− j 6 πk
~ − j3ω
H ( k )= e , k =0,1,6 = e 7 , k =0,1,6
k

0 ,k =2,3,4,5 0 ,k =2,3,4,5
To find h(n):
~
h ( n ) =Inverse DFT of H ( k )
M−1 M −1 j 2 πk 6 j 2 πnk
1 1 1 ~
∑~ ∑~
n
h (n)=
M
jω n
H (k ) e =
M
k
H (k ) e M
= ∑ H (k )e
7 k=0
7

k=0 k=0

{ }
j 2 πn j 2 πn 6
1 ~ ~ ~
h (n)= H (0)+ H (1)e 7 + H (6) e 7
7
~ ~ ~ ~ ~ ~
Since H ( k ) = H ¿ ( M −k ) → H ( 1 )= H ¿ ( 6 ) → H ¿ ( 1 )= H ( 6 ) , M −k =k → 7−1=1→ 6=1

{ }
j 2 πn − j 2 πn
1
h (n)= 1+~
H (1)e 7
+~
H¿ (1) e 7
7

{ }
−j6 π j 2 πn + j6π − j 2 πn
1 7 7 7 7
h ( n ) = 1+e e +e e
7
1 {
h ( n ) = 1+ e
7
j(
2 π ( n−3)
7 )+ e− j( 2 π (n−3
7
)
)}= 1
7 {
1+2 cos ( 2 π ( n−3
7
)
)}
h ( n ) =0.1429+0.2857 cos ( 0.2857 π ( n−3 ) )
Design over here.

You might also like