Академический Документы
Профессиональный Документы
Культура Документы
John Chiverton
School of Information Technology
Mae Fah Luang University
Lecture Contents
Introduction
Summary
Outline
Introduction
Summary
( )
|H ( ) |
H(
Inv ), Line
aria
a
nt S r Tim
e
yst
em
|H ( ) |
Low Frequencies
Ou
tpu
t, Y
Low Pass
Band Pass
X(
|H ( ) |
Middle Frequencies
High Frequencies
Inp
ut,
High Pass
Linear Time
Invariant System
Output, y[n]
A recursive filter uses past output values (y[n i]) for the
calculation of the current output y[n]:
I
a[k]y[n k] =
k=0
M
X
b[k]x[n k]
k=0
M
X
b[k]x[n k]
k=0
N
X
a[k]y[n k].
k=1
H() =
M
P
b[k] exp(jk)
k=0
exp(0) +
N
P
k=1
=
a[k] exp(jk)
b[k] exp(jk)
k=0
N
P
1+
k=1
.
a[k] exp(jk)
z-transform Representation
Fourier based frequency representation:
M
P
H() =
b[k] exp(jk)
k=0
N
P
1+
.
a[k] exp(jk)
k=1
H(z) =
b[k]z k
k=0
N
P
1+
.
a[k]z k
k=1
FIR Filter
x[n]
x[n1]
T
x1/4
x[n2]
T
x[n3]
x[n]
x1/4
x1/4
x1/4
x1/4
x[n1]
T
y[n]
y[n] =
1
(x[n] + x[n 1] + x[n 2] + x[n 3])
4
y[n1]
x[n3]
T
x1/4
x1/4
x(1/10)
x[n2]
T
x1/4
+
T
y[n]
y[n] =
(x[n] + x[n 1] + x[n 2] + x[n 3])
1
y[n 1]
10
x[n1]
T
x1/4
x[n2]
T
x1/4
x1/4
x(1/10)
y[n1]
x[n3]
T
x1/4
+
T
y[n]
z1
x1/4
x[n1]
x[n2]
z1
x1/4
x1/4
x(1/10)
y[n1]
z1
x1/4
z1
x[n3]
y[n]
However!
I
Outline
Introduction
Summary
1. Filter specification
2. Coefficient calculations
3. Convert transfer function to suitable filter structure
4. Error analysis
5. Implementation
Filter Specification
Frequency domain parameters - for filter description.
1+ p
passband ripple
1
1 p
attenuation
I Pass band - low
attenuation (gain1)
s1
p1
Pass Band
Tr
a
W nsit
idt ion
h
Stop Band
Tr
an
W sitio
idt
h n
p2
s2
Stop Band
Filter Specification
Frequency domain parameters - for filter description.
1+ p
passband ripple
1
I p passband ripple
1 p
I s stopband ripple
I s1 lower stop band
edge frequency
I p1 lower pass band
edge frequency
I p2 upper pass band
edge frequency
s1
p1
Pass Band
Tr
a
W nsit
idt ion
h
Stop Band
Tr
an
W sitio
idt
h n
p2
s2
Stop Band
edge frequency
Outline
Introduction
Summary
calculated with:
r
= 1 cf
|H ( ) |
or
bw
r
=1
2
where bw = 2cf is the -3dB
bandwidth of the filter.
1
Band Pass
0
(DC)
0cf
0+cf
0
zeros
(z r exp(j/2))(z r exp(j/2))
(z 1)(z + 1)
.
(z 0.80365 exp(j/2))(z 0.80365 exp(j/2))
(z 1)(z + 1)
.
(z 0.80365j)(z + 0.80365j)
H(z) =
Y (z)
,
X(z)
Y (z)
(z 1)(z + 1)
z2 1
=K
=K 2
.
X(z)
(z 0.80365j)(z + 0.80365j)
z + 0.64585
Then
Y (z)(z 2 + 0.64585) = X(z)K(z 2 1).
Remembering that each z 1 is a unit delay, so that each z is a unit advance, then
the difference equation is:
y[n + 2] + 0.64585y[n] = K(x[n + 2] x[n])
which can be made causal by making n = n 2 so that
y[n] + 0.64585y[n 2] = K(x[n] x[n 2]).
K is not known, but can be used to make the peak pass band gain to be unity.
H() =
b[k] exp(jk)
k=0
N
P
1+
.
a[k] exp(jk)
k=1
where K = 0.17708.
|H ( ) |
tion
No
ua
tten
Band Stop
atio
No
nu
Atte
Attenuation
0
(DC)
0cf
0+cf
0
at 0 = /10:
H(z) = K
(z exp(j/10))(z exp(j/10))
poles
pair) at 0 = /10,
H(z) = K
(z exp(j/10))(z exp(j/10))
(z r exp(j/10))(z r exp(j/10))
I The poles are scaled with radius r to control the width of the band
stop,
/20
w
r
=1
= 0.92146
=1
2
2
I resulting in:
H(z) = K
(z exp(j/10))(z exp(j/10))
(z 0.92146 exp(j/10))(z 0.92146 exp(j/10))
H(z) = K
z 2 1.9021z + 1
z 2 1.7527z + 0.84909
y[n+2]1.7527y[n+1]+0.84909y[n] = K(x[n+2]1.9021x[n+1]+x[n])
letting n = n 2, making it causal:
y[n]1.7527y[n1]+0.84909y[n2] = K(x[n]1.9021x[n1]+x[n2]).
I With frequency response:
M
P
H() =
b[k] exp(jk)
k=0
N
P
1+
k=1
=
a[k] exp(jk)
Magnitude frequency
response of the notch or
bandstop filter:
Outline
Introduction
Summary
Bilinear transformation
Laplace Transform
I
Discrete (z-plane)
Imaginary Axis
ON
GI
RE
BL
E
EG
I
ON
UN
ST
A
ER
I
EG
ON
UN
ER
BL
Real Axis
E
BL
A
ST
ST
Analogue (s-plane)
UN
ST
AB
L
ON
ON
GI
RE
GI
ST
UN
LE
AB
RE
ON
GI
RE
E
L
AB
L
AB
ST
N
IO
EG
ER
T
S
UN
Laplace Transform
Discrete
z-transform Z(h[n])
z-plane H[z]
Difference equation, h[n]
Analogue
Laplace transform L(h(t))
s-plane H(s)
Differential equation h(t)
Problem!
I
2
.
s = j = j tan
Ts
2
where is analogue frequency, is digital frequency and
Ts = 1/fs is the sampling period.
OR
to find the z-transform H(z):
s = j = 2fs
1 z 1
1 + z 1
.
z
)(2f
1
s 1+z 1 z2 )...
1+z 1
=
1
1z 1
(2fs 1z
p
)(2f
p2 )...
1
s
1
1
1+z
1+z
cf
s + cf
into a digital filter (z-plane form) with digital cut-off frequency cf = 0.2
using the bilinear transformation.
A.
1. Calculate analogue cut-off frequency cf from digital cut-off frequency
cf = 0.2:
cf = 2fs tan(cf /2) = 2fs tan(0.1) = 2fs A
2. Therefore analogue transfer function:
H(s) =
2fs A
s + 2fs A
1
2fs A
1
2fs 1z
1+z 1
+ 2fs A
2fs
2fs
A(1 + z 1 )
(1
+ A(1 + z 1 )
z 1 )
Y (z)
A + Az 1
=
X(z)
1 + A + (A 1)z 1
Stability Analysis
Rearranging to determine the poles for stability analysis gives:
H(z) =
I So there is 1 pole at z +
A1
1+A
z+1
A
.
1 + A z + A1
1+A
= 0 or z = A1
.
1+A
(1)
A1
A
(x[n] + x[n 1])
y[n 1],
1+A
1+A
where A = tan(0.1).
This is now a difference equation we can use to filter a signal.
Bilinear Transformation
The analogue transfer function from step 2 in earlier slide was:
H(s) =
2fs A
s + 2fs A
2fs A
=
H() = H(s)
.
j + 2fs A
s=j
The Fourier `frequency
can then be converted to the digitial frequency using
H() = H()
=2fs tan(
2fs A
A
`
`
=
j2fs tan 2 + 2fs A
j tan 2 + A
Y (z)
A + Az 1
.
=
X(z)
1 + A + (A 1)z 1
This can be converted to the frequency response using (see earlier slides and
lecture 04)
M
P
H() = H(z)
=
z=exp(jk)
k=0
N
P
b[k] exp(jk)
a[k] exp(jk)
k=0
So:
I b[0] = b[1] = A,
I a[0] = 1 + A,
I a[1] = A 1.
A + A(cos() j sin())
(1 + A) + (A 1)(cos() j sin()).
(A + A cos())2 + (A sin())2
((1 + A) + (A 1) cos())2 + ((A 1) sin()))2 .
which is the same as the frequency response calculated directly from the
bilinear transformation. The Bilinear transformation is more quicker here.
1
2n ff1/2
1+
cf
Chebyshev
Magnitude frequency response: |H()| =
|H ( ) |
magnitude response
2
1+2 Cn
Ideal
1.0 1/2
2
(1+ )
Chebyshev
0.707
Butterworth
cf
frequency
cf
o1/2
2n 1/2
1+
cf
Chebyshev
2
1+2 Cn
1
2n 1/2
tan(/2)
1+ tan( /2)
cf
cf
i1/2
2
1+2 Cn
tan(/2)
tan(cf /2)
i1/2
Characteristic
Multiplications
Coefficient quantification sensitivity
Overflow errors
Stability
Linear phase
Simulate analog filter
Coefficient memory
Design complexity
IIR
least
can be high
FIR
most
very low
can be high
by design
no
yes
very low
always
always
no
least
moderate
most
simple
Outline
Introduction
Summary
Lecture Summary