Sei sulla pagina 1di 50

FILTER DESIGN

Ideal Filter Magnitude Response

Numeric Logaritmic
Non Ideal Filter Magnitude Response In Numeric

Stopband Passband

Transition Band
N Order Filter Design
Infinite Impulse Response Finite Impulse Response
Difference Equation Difference Equation

y (n)  a1 y (n  1)  .....  aN y (n  N )  y (n)  b0 x(n)  b1 x(n  1) 


b0 x(n)  b1 x(n  1)  .....  bN x(n  N ) .....  bN x(n  N )
N
y (n)   bi x(n  i )
N N
y (n)   ai y (n  i )  bi x(n  i )
i 1 i 0 i 0

Impulse Response
Transfer Function/ Frequency Response N
h(n)   bi (n  i )
N

 bi eij
i 0
Transfer Function/ Frequency Response
H ( )  i 0
N N
1   ai e  ij
H ( )   bi e  ij
i i i 0
Type of IIR Digital Filter

Butterworth Chebyschev 1

Chebyschev 2 Elliptic
Steps to Design IIR Digital Filter

1. Sketch Magnitude Response of Digital Filter as the


specification needed
2. Determine Digital Frequency of Required Filter
3. Convert digital frequency to analogue frequency
4. Backward Process : Determine Cut off Frequency of
Normalized LPF
5. Determine Filter Order
6. Design Normalized LPF Analogue Filter
7. Forward Process : Design Analogue Filter as needed
specification via analog to analog transformation
8. Design digital filter from analogue filter via analog to
digital transformation (bilinear/impulse invarian)
H ( ) IIR Design Steps
c n
fs
fp
Analog Domain
Rs
Backward
Rp H n ( s)
H ( z)
Forward/Analog to
Analog Transformation
s s
Analog to Digital
p Prewarp p Transformation

Rs Rs H ( s)
Rp Rp
Steps 1

Stopband Passband

Transition Band
Steps 2 and 3
Steps 2 Steps 3
(Digital Frequency) (Analog Frequency
rad/sample /Prewarping)
rad/s
2 f p  p 
p   p  2 Fs tan  
Fs  2 
2 f s  s 
s   s  2 Fs tan  
Fs  2 
Remember !
2  rad f p  Hz = s -1
Fs  sample/s
fp
 cycle/sample = siklus/sampel Digital Freq.
Fs
fp
2  rad.cycle/sample = rad/sample = p
Fs
 fp 
tan  2   rad/sample Analog Freq.
 2 Fs 
 fp 
2 Fs tan  2   sample/s x rad/sample = rad/s = p
 2 Fs 
2Fs can be removed  2Fs  1
Steps 4 : Backward
LPF
H  j   dB
G  j   dB
20 log
20 log
10
10

0 0

Rp Rp

Rs Rs
 rad/dt  rad/dt
1 C P S
Low-pass G(s) Low-pass H(s)
S
C 
P
Steps 4 : Backward
HPF
20 log G  j   dB
20 log H  j   dB
10 10

0 0
Rp Rp

Rs Rs
 rad/dt  rad/dt
1 C s p
Low-pass G(s)
High-pass H(s)
P
C 
S
Steps 4 : Backward
BPF
20 log G  j   dB 20 log10 H  j  dB
10

0 0
Rp Rp

Rs Rs
 rad/dt  rad/dt
1 C  s1 p1  p2 
s2
Low-pass G(s) Band-pass H(s)
  2S1   P1 P 2
A
 S1  P 2   P1 
C  min  A , B 
    P1 P 2
2
B S2

 S 2  P 2   P1 
Steps 4 : Backward
BSF
20 log G  j   dB 20 log10 H  j  dB
10

0 0
Rp Rp

Rs Rs
 rad/dt  rad/dt
1 C  p1  s2  p2
s1
Low-pass G(s)
Band-stop H(s)
 S1  P 2   P1 
A
  2S1   P1 P 2
C  min  A , B 
 S 2  P 2   P1 
B
  2S 2   P1 P 2
Steps 5 : Filter Order
Butterworth

  10 RP /10  1   Remember !!!


 log   RS /10  
  10 1  
n Rp & Rs must be in dB
  1  
 2 log   
  C     = up rounding
Steps 5 : Filter Order
Chebyschev 1-2
Remember !!!
n

 log g  g 2  1
 
 Rp & Rs must be in dB

 log  C 
  C 1
2
 


a2 1
g
2
 RS
a 2  10 10

 RP
 2  10 10
1
Steps 6 : LPF Normalized N order
Butterworth
At page 127, Fundamental DSP, Ludeman
1
H n ( s)  N 1 N 2
s  a1s
N
 a2 s  ...  aN 1s  aN
Steps 6 : LPF Normalized N order
Chebyschev 1/2
Kn
H n ( s)  N N 1 N 2
s  bN 1s  bN  2 s  ...  b2 s  b1s  b0
2

 b0 odd n

K n   b0
 even n
 1 
2

b0 could be found at page 140, Fundamental DSP, Ludeman, Next Slide


Steps 6 : LPF Normalized N order
Chebyschev 1/2 Table (ripple 0,5 dB & 1 dB)
Steps 6 : LPF Normalized N order
Chebyschev 1/2 Table (ripple 2 dB & 3 dB)
Steps 7 : LPF Required / Analog to
Analog Transformation
H (s)  H n (s) |s .............

FILTER FORWARD
s
LPF s
P
P
HPF s
s
s 2   P1 P 2
BPF s
s   P 2   P1 
s   P 2   P1 
BSF s 2
s   P1 P 2
Steps 8 : Digital Filter Required /
Analog to Digital Transformation
Bilinear Transformation H ( z )  H ( s) | z 1
s 2 Fs
z 1
p
Ak
Impulse Invariance
H ( s)  
k 1 s  sk
Transformation

p
Ak
H ( z)  
Can be removed, and
must be removed if
sk Ts 1
k 1 1  e z from step 2 2Fs was
already removed
Problem
• Digital Filter has Specification :
– Pass the signal more than 2 kHz and less than 6
kHz with passband attenuation more than -3 dB
– Stop the signal less than 100 Hz and more than 9
kHz with stopband attenuation less than -10 dB
– There is no ripple either in passband area or
stopband area
– Bilinear Transformation
– Sampling Frequency is 20 kHz
Problem
• Digital Filter has Specification :
– Pass the signal below 200 Hz and more than 8 kHz
with passband attenuation more than 3 dB
– Stop the signal between 2 kHz and 6 kHz with
stopband attenuation less than 6 dB
– There is no ripple at all band
– Bilinear Transformation
– Sampling Frequency is 20 kHz
• Design the digital filter !
• Check the filter !
Problem
• Digital Filter has Specification :
– Stop the signal below 1 kHz and more than 8 kHz with
stopband attenuation more than 10 dB
– Pass the signal between 4 kHz and 6 kHz with
passband attenuation less than 3 dB
– There is no ripple at all band
– Bilinear Transformation
– Sampling Frequency is 20 kHz
• Design the digital filter !
• Check the filter !
Problem
• Digital Filter has Specification :
– Pass the signal below 1 kHz with passband attenuation
more than -3 dB
– Stop the signal above 9 kHz with stopband
attenuation less than -14 dB
– There is ripple in passband area
– Bilinear Transformation
– Sampling Frequency is 20 kHz
• Design the digital filter !
• Check the filter !
Question
1. Design the digital Filter with explained steps !
2. Determine the magnitude when f=0, f=5 kHz,
and f=10 kHz, make a conclusion !
3. Realize the filter !
1. Gambarkan respon magnituda filter digital
sesuai spesifikasi yang diketahui
2. Ubah parameter frekuensi ke domain
analog
3. Hitung orde filter
4. Rancang Filter Analog LPF Ternormalisasi
5. Rancang Filter Analog Sesuai Spesifikasi
yang Diinginkan
6. Rancang Filter digital dari filter analog
sebelumnya dengan transformasi digital
(Impulse Invarian / Bilinier)
2 Methods FIR Filter Design
Windowing Method Frequency Sampling Method

H ( ) H ( )
Inverse Discrete
Time Fourier Sampling
Transform / ITFWD

hi (n) H (k )
Inverse Discrete
Windowing Fourier
Transform/IDFT/IFFT

h(n)  hi (n) w(n)


h( n)
FIR FILTER DESIGN
Steps
1. Sketch Magnitude Response of Digital Filter as the specification
needed
2. Determine the ideal impulse response hi(n) from Magnitude
Response 1st step by Inverse DTFT (look up the table)
3. Determine the delay /symmetrical axis (), filter order (N), Filter
length (M)
4. Determine and calculate the delayed impulse response in which
the delay was determined from 3rd step, from 0 to N (N-filter
order with N+1 filter length)
5. Calculate the coefficient of the window used from 0 to N (N-filter
order with N+1 filter length) (given)
6. Multiply the result of 4th and 5th step to determine the overall
filter coefficient
N-order Windowing Methods FIR Filter Design

H ( ) H ( ) hi (n)
Inverse Discrete
Time Fourier
Transform / ITFWD

 hi (n   )

window used :
Windowing
w( n)

Filter length : N+1 h(n)  hi (n   )w(n)


Steps 1-2 (Several Ideal Magnitude Response)
LPF



 j
,   c sin c  n    
Hi e   
1.e
hi  n  
j

 0, c    
  n  
Steps 1-2 (Several Ideal Magnitude Response)
HPF



 j
, c     sin   n      sin c  n    
Hi e   
1.e
j
hi  n  

 0,   c  n  
Steps 1-2 (Several Ideal Magnitude Response)
BPF

 0, 0    c1
  j
H i  e   1.e
j
, c1    c 2 hi  n  
sin c 2  n      sin c1  n   

 0,       n  
 c2
Steps 1-2 (Several Ideal Magnitude Response)
BSF

1.e  j , 0    c1



H i  e j    0, c1    c 2
1.e  j ,     
 c2

sin c1  n      sin c 2  n      sin   n    


hi  n  
 n  
Steps 1-2 (Several Ideal Magnitude Response)
All Pass Filter/Hilbert Transform

 2   n    
n 
 sin  
 j.e  j
, 0  2
H i  e j   ,
2
   j hi  n   
 j.e ,     0  n 
 0, n 
Steps 1-2 (Several Ideal Magnitude Response)
Differensiator

   j
, 0 
Hi  e   
j .e
 cos   n    
j

  j .e  j
,     0 ,n  

hi  n      n   
 n 
0,
Steps 3
Determining , N (Filter Order), M
(Filter length)

H i ( )


M  2  1 N  M 1
1.e ,   c
 j 2
Example : If H i  e   
j

 0, c    
Then   2
Steps 4
Calculating hi(n-)

Calculate hi (n   ) from n  0 to n  N
Then
hi (n   )
=
 hi ( ) hi (  1) hi (  2) ... hi (  N  1) hi (  N ) 
Steps 5
Calculating w(n)

Example : If window used is rectangular


1, 0  n  N
Then : w(n)  
0, otherwise
w(n)   w(0) w(1) ...... w( N ) 
Steps 6
Calculating h(n)=hi(n)w(n)

Example :
h( n)

 hi ( ) w(0) hi (  1) w(1) ...... hi (  N ) w( N ) 
Latihan
 Diketahui suatu filter dengan respon berikut
 3 j  
e -  
H ( )   2 2
 0  lainnya

1. Rancanglah filter tsb !


2. Ceklah filter hasil perancangan
FIR FILTER DESIGN
Frequency-Sampling Method: Basic Principle
Desired real-valued frequency response: H dr  e j 
Approximation of ideal
frequency response: r  
j
H e
Approximation error:
e  k  


 H dr e jk
  H e 
r
jk

Samples of H dr e  j m

k
47
Example: magnitude responses (linear scale)
M  15
Task of a): transition
region width= 2 / M
k=0 k=1 k=2 k=3

b) k=4
Task of b): transition
region width=4 / M
k=6 k=7

a) k=4 k=5 48
Sampling Frequency Formula
49

1 U
 2   n  k  
h( n)   H (0)  2   H (k )  cos  
N  k 1  N 
 N 1
 2 , N odd
U 
N
  1, N even
2
N = Length of FIR filter
Latihan

Potrebbero piacerti anche