Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Objectives
Digital Oscillators
Impulse
X(z)
Oscillator with
frequency 0
H(z)
Digital
Sinusoid
Y(z)
Y ( z) H ( z) X ( z)
X ( z ) Z [n] 1
so
Y ( z) H ( z)
Z 1 Y ( z ) Z 1 H ( z ) A sin( 0 n)u[ n]
A sin( 0 ) z
A sin( 0 ) z 1
Z A sin(0 n)u[n] H ( z ) 2
z 2 cos( 0 ) z 1 1 2 cos(0 ) z 1 z 2
A sin(0 ) z
H ( z)
1 2 cos(0 ) z 1 z 2
1.5
Amplitude
0.5
-0.5
-1
-1.5
20
40
60
80
100
Samples
120
140
160
180
Imaginary Part
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1.5
-1
-0.5
0
Real Part
0.5
1.5
Notch Filters
Notch filters are designed by pole/zero location
The zeros are located at the notch frequencies
Poles are placed close to the zeros locations, just inside
the unit circle, to control the notch width.
A gain factor is included to hold the filter gain to unity at
all other frequencies
Notch filters for multiple frequencies can be designed by
cascading filters or, equivalently, by convolving the a
and b coefficient vectors of individual filters
1.4
1.2
Magnitude
1
0.8
0.6
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Normalized Frequency ( rad/sample)
0.8
0.9
Imaginary Part
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1.5
-1
-0.5
0
Real Part
0.5
1.5
Filter Specifications
Transfer Functions
Analog Filter:
Y ( s ) b0 s m b1s m 1 b2 s m 2 ... bm
H (s)
n
X (s)
s a1s n 1 a2 s n 2 ... an
Digital Filter:
Y ( z ) b0 b1 z 1 b2 z 2 ... bM z M
H ( z)
X ( z ) a0 a1 z 1 a2 z 2 ... aN z N
[B,A] = BUTTER(N,Wn)
[B,A] = CHEBY1(N,R,Wn)
[B,A] = CHEBY2(N,R,Wn)
[B,A] = ELLIP(N,Rp,Rs,Wn)
N = filter order
R = pass band ripple (cheby1) or stop-band ripple
(cheby2) in dB. (Rp and Rs respectively for the elliptic
filter)
Wn = cut-off frequency (radians/sec for analog filters
or normalized digital frequencies for digital filters)
[B,A] = filter coefficients, s-domain (analog filter) or zdomain (digital filter)
1.4
1.2
Magnitude Response
1
0.8
0.6
0.4
0.2
0
8
10
12
Frequency, Hz
14
16
18
20
2 z 1
s
T z 1
or
2 sT
z
2 sT
Z - Plane
j
<0
|z| < 1
0
Bilinear Mapping
Pre-Warping Equation
2 z 1
2 e j 1
s j
j
T z 1
T e 1
2 e j / 2 [e j / 2 e j / 2 ]
j / 2 j / 2 j / 2
T e [e
e
]
2 j sin
2
2
cos
j2
tan
T
or
2
tan
T
2
or
T
2tan -1
Design Example
Filter Specifications:
Butterworth response
Pass-band edges = 400 Hz and 600 Hz
Stop-band edges = 300 Hz and 700 Hz
Pass-band ripple = 1 dB
Stop-band attenuation = -20 dB
Sampling Frequency = 2000 Hz
1.4
1.2
Magnitude
1
0.8
0.6
Band Edges
0.4
0.2
0
0.1
0.2
0.3
0.4
0.5
0.6
Frequency (kHz)
0.7
0.8
0.9
Design Example
Chebyshev II High-Pass Filter
Filter specifications:
20
Magnitude (dB)
-20
-40
-60
-80
-100
0.5
1.5
2
2.5
Frequency (kHz)
3.5
Filter Specification:
Low-pass response
Pass-band edge = 475 Hz
Stop-band edge = 525 Hz (i.e., a transition
width of 50 Hz)
Pass-band ripple less than 0.01 in absolute
terms ( = 20log10(1-.01) = 0.0873 dB)
Stop-band attenuation greater than -40 dB
(= 0.01 ripple in absolute terms)
Sampling frequency = 2000 Hz
[N,Fo,Ao,W] = FIRPMORD(F,A,DEV,Fs)
B = FIRPM(N,Fo,Ao,W)
N = order
F = band edges, in units of , or in Hz if Fs is
specified
A = amplitudes corresponding to the bands defined
by the edges in F [length(F) must be 2*length(A)-2]
DEV = deviation (ripple) in each band defined by F
in absolute units (not dB)
Fs = sampling frequency in Hz
20
0
Magnitude (dB)
-20
-40
-60
-80
-100
-120
0.1
0.2
0.3
0.4
0.5
0.6
Frequency (kHz)
0.7
0.8
0.9
-20
Magnitude (dB)
-40
-60
-80
-100
-120
0.1
0.2
0.3
0.4
0.5
0.6
Frequency (kHz)
0.7
0.8
0.9
Coefficient Quantization
The poles of an IIR filter must remain
within the unit circle in the complex plane
for stability
Quantization and round-off errors can
move the poles and create an unusable
design
0.6
0.5
Imaginary Part
Imaginary Part
0.4
0.2
0
-0.2
-0.5
-0.4
-0.6
-1
-0.8
-1
-1
-0.5
0
Real Part
0.5
-1
-0.5
0.5
Real Part
1.5
Summary
IIR filters can be design by pole-zero location
Digital oscillators: poles on the unit circle
Notch filters: zeros on the unit circle with nearby poles
to control notch width