슬라이드 1 - Chonbuk
Download
Report
Transcript 슬라이드 1 - Chonbuk
Nonrecursive Digital Filters
Digital Filters & Filter Equation
General Equation
N
a
k 0
- FIR
- Convolution
k
y[n k ]
M
y[n] bk x[n k ]
H ( z)
M
b z
k 0
b
k 0
k 0
Transfer
function
M
k
k
k
x[n k ]
M
Y ( z ) X ( z ) bk z k
k 0
H ()
M
b
k 0
k
exp( jk)
Frequency
response
Nonrecursive Filter
• Disadvantage
: takes computation time
• Advantage
: stable (zeros only)
linear phase (no phase distortion)
same phase shift to all frequencies
H ( )
M
b
k M
k
exp( jk)
b M e jM .... b 2 e j 2 b1e j b0 b1e j b2 e j 2 .... bM e jM
b0 2b1 cos 2b2 cos 2 ... 2bM cos M
M
b0 2 bk cos k
k 1
Moving Average Filter
Impulse response of moving average filter
H ()
1
1 2 cos 2 cos2 ... 2 cos M
(2M 1)
M
1
1 2
cos(k)
k 1
(2M 1)
2M+1 coefficients, symmetric to n=0
Smoothness of the signal correlated to the increment of M
Width of mainlobe negatively correlated to M
increment of M narrow band lowpass filter
Frequency Response of Moving Average Filter
5-point
(M = 2)
21-point
(M = 10)
No zeros at z=0
since passband around 0
Frequency Response of Moving Average Filter
= 0 peak value = 1
unwanted side lobe first side lobe 22% of main lobe
5 terms 4 zeros
missing zero at z = 1
21 terms 20 zeros
passband contains at = 0
Zeros lie actually on the unit circle true nulls in the corresponding frequency
ex)
1
x(n) x(n 1) x(n 2) x(n 3) x(n 4)
5
1
Y ( z ) X ( z ) 1 z 1 z 2 z 3 z 4
5
y ( n)
1 z4 z3 z2 z 1
H ( z)
5
z4
Ideal Lowpass Filter Method
H ( )
1
h[n]
1
2
1
2
1.0
H () exp(jn)d
1
1 exp( jn)
1
exp
(
j
n
)
d
1
2
jn
1
1
1
exp( j1n) exp( j1n)
2jn
1 exp( j1n) exp( j1n)
n
2j
1
h[n]
sin(n1 ) 1 sin c(n1 )
n
1
Design of Highpass/Bandpass Filters using Lowpass Filter
h[n]
Lowpass Filter
H ()
1
sin( n1 ) cos( n 0 ) (bandwidth : 21
n
1
2 h[k ] cos(k)
k 1
center frequency : 0 )
Replace bk with hn
Limit to 2M+1 terms, and start from n=0
| H () |
1
M
2 h[k ] cos(k)
k 1
Center frequency : 0 600
bandwidth : 1 300
Lowpass Filter Design
Sampling rate : T 1 sec f s 106 Hz
Cutoff frequency : 100 KHz
2f
2 105
c T
0.2
fs
106
H
0.2
hLP n
0
0.2
1
1
sin n1
sin 0.2n
n
n
Highpass Filter Design
highpass filter H
Cutoff frequency 0.5
H
0
hHP n
0.5
1
1
n
sin n1 cos n 0 1
sin 0.5n
n
n
0 1800 1
n
hHP 0 0.5
hHP 1
1
hHP 2 0
hHP 3
1
3
Bandpass Filter Design
Cutoff frequency : 160 f1 200Hz
Sampling rate : 800 Hz
Duration of impulse response : 50m sec
0.4 0.5
0.45
2
Center frequency
0
Bandwidth
21 0.5 0.4 0.1
hBP n
1
0.1
0.05
2
1
sin 0.05n 2 cos 0.45n
n
Frequency Transformation
Recursive Digital Filters
General Form of Filters
M
H ( z)
b
k 0
N
a
k 0
k
Z k
k
Z k
K ( z z1 )( z z 2 )( z z 3 )
( z p1 )(z p 2 )(z p 3 )
a0 y[n] a1 y[n 1] ... a N y[n N ] b0 x[n] b1 x[n 1] ... bM x[n M ]
Recursive filter
powerful : separate control over the numerator and denominator of H(z)
If the magnitude of the denominator becomes small at the appropriate frequency
produce sharp response peaks by arranging
Example #1
Find the difference equation of Bandpass Filter
(a) Center frequency : = /2,
-3dB Bandwidth : /40,
(b) No frequency component at = 0, =
40
-
rad 4.50
Maximum gain : 1
r
origin
Assume BC is straight line
d=1-r
(r > 0.9)
2d = 2 (1-r)
2 (1-r) [rad] = /40 = 3.14/40, r = 0.961
No frequency component at = 0 and = - two zeroes at z = +1 and -1
Example #1
M
H ( z)
b Z
k
k
k 0
N
a Z
k
K ( z z1 )(z z2 )(z z3 )
( z p1 )(z p2 )(z p3 )
①
k
k 0
• -3dB band-width : /40
• Maximum gain : 26.15 (28.35dB)
• in equaiton ①, K = (6.15)-1 = 0.03824
Y ( z)
0.03824( z 1)(z 1)
H ( z)
X ( z)
z
0
.
961
exp
j
z
0
.
961
exp
j
2
2
0.03824( z 2 1)
z 2 0.9235
• The corresponding difference equaion is :
y[n+2] + 0.9235y[n] = 0.03824{x[n+2] - x[n]}
subtracting 2 from each term in brackets
y[n] = -0.9235y[n-2] + 0.03824{x[n] - x[n-2]}
Example #2
Design a band-reject filter which stops 60Hz powerline noise from ECG signal
- 10Hz cutoff bandwidth at -3dB point
- Poles and zeros as in the picture
(solution) -
2(1 r )
H ( z)
fs = 1.2 kHz
fmax : 600Hz
2 : 1200 = o: 60
o (60Hz) = 0.1
10
, r 1
0.97382
600
120
Y ( z)
{ z exp( j 0.1 ) }{ z exp( j 0.1 ) }
X ( z ) { z 0.97382exp( j 0.1 ) }{ z 0.97382exp( j 0.1 ) }
z 2 2 z cos(0.1 ) 1
z 2 1.9021z 1
2
2
z 1.9476cos(0.1 ) z 0.94833 z 1.8523z 0.94833
y[n+2] - 1.8523 y[n+1] + 0.94833 y[n] = x[n+2] - 1.9021 x[n+1] + x[n]
y[n] = 1.8523 y[n-1] - 0.94833 y[n-2] + x[n] - 1.9021 x[n-1] + x[n-2]
Types of Filters
Butterworth
Chebyshev – 1st order
Chebyshev – 2nd order
Elliptic
Butterworth, Chebyshev, Elliptic Filters
analog
Butterworth
Chebyshev
Elliptic
ripple
H ( )
H ( )
H ( )
digital
1
| H ( ) |
1/ 2
2n
1
1
1
| H ( ) |
1/ 2
2
2
1 Cn
1
1
1/ 2
2n
tan( )
2
1
C
tan( )
2
1
1/ 2
t an( )
2
2
2
1 Cn
t an( C )
2
1
1/ 2
2
2
1
R
L
n
1
1 (1 2 ) 1/ 2
C0 ( x) 1 및 C1 ( x) x
Cn ( x) 2 x Cn 1 ( x) C n 2 ( x)
Example #3
Find the minimum order of Filter
Cutoff frequency 1= 0.2
Frequency response of less than 30dB at = 0.4
2
H (0.4 )
1
1
t an 0.2 2 n 1/ 2 {1 2.2362 n }1/ 2
{1 [
] }
t an 0.1
1 30
log10
(
) 0.03162
20
1
0.03162
{1 2.2362 n }1/ 2
1 2.2362 n 1000,
1
2
n 4.29, n 5
30 20log10 x
x 10
30
20
Bilinear Transformation
H ( s)
K s z1 s z 2 s z3 ...
s p1 s p2 s p3 ...
s
z 1
z 1
s jw
z e j
H(s)
H(z)
0
0
Bilinear Transformation
e j 1 e j / 2 ( e j / 2 e j / 2 )
jw j
j / 2 j / 2 j / 2
e 1 e (e
e
)
2 jsin( / 2)
j t an( / 2)
2cos( / 2)
w t an( / 2)
0
0
t an / 2 t an 1
4
2
Impulse-invariant Filters
Another method of deriving a digital filter from an analog filter
A sampled version of that of the reference analog filter
Impulse-invariant Filters
Impulse-invariant Filters
K ( s z1 )s z2 s z3
K3
K1
K2
H ( s)
( s p1 )s p2 s p3
s p1 s p2 s p3
Ki
s p
i 1
i
Transfer function of
analog filter
Impulse-invariant
filter
Impulse-invariant Filters
The impulse response of each analog subfilter takes a simple exponential
form
For the i-th subfilter
hi (t ) K i exp(pi t )
0
t0
t0
hi [ n] hi (t ) |t nT K i exp(npiT )
0
H i ( z)
n0
n0
K
n 0
i
exp(npiT ) z
n
K [exp(np T ) z
n 0
i
Ki
Ki z
1 exp(piT ) z 1
z exp(piT )
A zero at the origin of the z-plane
A polse at z exp piT
i
1 n
]
Design of Recursive Digital Filters
Butterworth LP Analog Filter Design (prototype)
| H LP ( jw) | 2
1
1 ( w / wc ) 2 N
Prototype : when
| H LP ( jw) |2
or
| H LP ( jw) |
1
(1 [ w / wc ]2 N )1/ 2
c 1
1
1 w2 N
or
frequency responses at N = 1, 2, 3
| H LP ( jw) |
1
(1 w2 N )1/ 2
Determination of Poles
| H LP ( jw) |2 H LP ( s) H LP (s)
1 s
When N : odd
N=2;
s0 e
s0 e
0s
2N
1 e
j 2k
1 s 2 N 0 s 2 N 1 e j 2k
When N : even
N=1;
2N
1
1
1
|
js
2N
1 w2 N
1 js
1 s2
j
j
0
1
20
22
s1 e
1
e
j
4
j
1
1
se
j
2k
2N
N
sk e
sk e
j
2k
1
0.707 j 0.707
s1 0.707 j 0.707, s2 0.707 j 0.707, s3 0.707 j 0.707
N=3;
only 3 effective terms
2N
j
k
N
Determination of Poles
H s
1
1 s
1st order
H s
1
s 0.707 j 0.707s 0.707 j 0.707
2nd order
Example
1rad / sec 2f
f 0.159Hz
Design a lowpass Butterworth filter : -3dB at 1 rad/sec (prototype filter)
gain of less than 0.1 for the frequency greater than 2 rad/sec
20log10 0.1 20dB
Order of filter
log10 10M dB /10 1
N
2 log10 a
log10 1020 /10 1
N
3.31
2 log10 2
H LP s
N 4
1
s 4 2.613 s 3 3.414 s 2 2.613 s 1
Chebyshev LP Analog Filter Design (prototype)
| H LP ( jw) |2
N : order,
1
1 2C N2 ( w)
or
| H LP ( jw) |
1
1
2
C N2 ( w)
1
2
: cutoff frequency, r : ripple amplitude ( : ripple parameter)
Order of filter
CN 1 (w) 2CN CN 1
CN (w) cosN cos1
rdB 10log10 1 2
Chebyshev Prototype Denominator Polynomials
Example
Maximum passband ripple : 1dB,
Cutoff frequency : less than 1.3 rad/sec
Attenuation in stopband : 40dB for greater than 5 rad/sec
rdB 10log10 1 2
ripple parameter
2 0.2589
cutoff frequency : -3dB point is half the magnitude
CN 1 (w) 2CN CN 1
H LP j 0.5
2
H LP j 0.707
C1 ( w)
| H LP ( jw) |2
1
| 1.3 0.69 0.5
1 2C12 ( w)
C2 ( w) 2 2 1
| H LP ( jw) |2
1
| 1.3 0.41 0.5
1 2C22 ( w)
Passband characteristic
1
| 5 1.6 103 10 4
2
1 C2 ( w)
1
| H LP ( jw) |2
| 5 1.6 105 10 4
2
2
1 C3 ( w)
| H LP ( jw) |2
2
H LP s
3rd order
K
s 3 0.988 s 2 1.238 s 0.491
2nd order
Analog Filter Frequency Transformation
form
LP
P
LP
c
LP
P
LP
P
2 BP 0 2
B BP
LP
P
c
HP
B BS
2
2 BS 0
s form
s
c
c
s
s 2 0
Bs
2
Bs
2
s 2 0
Example
Butterworth bandpass filter
f u 900Hz
u 2 900 5655rad / sec
fl 600Hz
l 2 600 3770rad / sec
fo ?
02 u l 21.32106 rad / sec
/ sec
B u l 1885rad
Maximum attenuation of 0.2dB for
f o f 800Hz
Minimum attenuation of 50dB for
0 f 200Hz
800Hz 5026rad / sec
200Hz 1256rad / sec
Prototype equivalent frequency
LP
P
2 BP 0 2
1 2 BP 21.32106
B BP
1885
BP
Filter order
log10 10M dB /10 1
N
2 log10 a
a 0.418 M dB 0.2 N 1.75
a 8.35 M dB 50 N 2.71 3rd order
f0
0
735 Hz
2