Title: Digital Filters
1Digital Filters
- Well decide on some desired spectral
characteristics - Well use tools or mathematics to create a filter
that is as close as possible
2Why we may design filters
- Low pass filters
- Remove high frequency noise
- Create muffled sounds
- Separate bass
- Blur images
- High pass filters
- Remove rumble, wind noise
- Edge enhancement
- Others
- Band pass filters
- Tone controls
3Well start by analyzing filters
- We want to understand what happens
- What we are usually interested in
- Magnitude frequency response
4Digital Filters and Rates
- An interesting thing about digital signals
- Playing at different rates simply scales
- A 1000 Hz sine wave at fs 8000 is identical to
a 0.125 Hz sine wave at fs1 - What we really care about is that the sine wave
is 1/8 the sample rate!
5Normalization
- Well assume a sample rate of 1 sample per second
(or 2p radians per second) for all future
mathematics! - What!?!?
Normalized Time
6Normalized sample rate
- 44,100 no more!
- Suppose I want to generate a filter that
emphasizes 440 Hz with fs44100 - This is equivalent to a filter that emphasizes
440/44100 at fs 1 or 2p radians/second - Normalization
- Were only interested in what happens from
frequency 0 to frequency 0.5
7Examples
- Suppose we have a filter with a magnitude
response of 0.78 at 0.0226 Hz (assuming fs1) - What would be the equivalent frequency if we ran
the filter at fs44100? - 0.0226 44100 997Hz
TT
8Now were only interested in integral delays
- yt xt a1xt-1
- ejwta1ejw(t-1)
- H(w) 1 a1e-jw
- H(w) (1 a12 2a1cos(w))1/2
- w ranges from 0 to p
x
y
a1
Delay 1
9Frequency response for a11
H(w) (1 a12 2a1cos(w))1/2
yt xt a1xt-1
2
Low pass response!
1
Amplitude
0
0
0.5
Percentage of fs
10Frequency response for a1 -1
H(w) (1 a12 2a1cos(w))1/2
yt xt a1xt-1
2
High pass response!
1
Amplitude
0
0
0.5
Percentage of fs
11More general
- More general equation for delay of 1
- yt a0xt a1xt-1
- If input is ejwt
- xta0a1e-jw
- Well use z ejw as an operator for delay
- yt a0a1z-1 xt
12Some conventions
- When z ejw
- Let X represent the entire sequence xt
- a0X implies every sample xt gets multiplied by a0
- Let Y represent the entire sequence yt
- Well use
- Y a0a1z-1 X
- H(z) a0a1z-1 Transfer Function or Equation
- Y H(z) X
13Flowgraphs with z
x
y
3
z-1
x
y
3
TT
5
z-1
- yt xt 3xt-1 5xt-2
- H(z) 13z-15z-2
z-2
14Example Transfer Functions
- yt a0xt a1xt-1
- H(z) a0a1z-1
- yt xt - xt-1 xt-2
- H(z) 1-z-1z-2
- yt xt 17xt-25
- H(z) 117z-25
TT
15How to determine frequency response
- Step 1 Determine transfer function
- Step 2 Get rid of negative exponents
- Step 3 Factor numerator, determine zeros,
multiplicand - Step 4 Plot the zeros of the numerator on the
z-plane - Step 5 For every frequency, take the products
of the distances to the zeros times any
multiplicand
16Step 1 Determine the transfer function
- yt xt 0.5xt-1
- H(z) 10.5z-1
17Step 2 Get rid of negative exponents
Multiply by z/z
18Step 3 Factor numerator, determine zeros
- H(z) (z 0.5)/z
- This is zero for z -0.5
19Step 4 Plot the zeros of the numerator on the
z-plane
- We call all z values that result in a zero value
the zeros of the transfer function - We can plot those on a unit circle
z-0.5
20Step 5 For every frequency, take products of
distances to the zeros
- Frequencies are points on the circle
- Distance to the points is the gain of the filter
f0.2 e0.2(2p)j cos(0.2(2p))jsin(0.2(2p))
0
0.5
z-0.5
21A more complex filter
- yt xt xt-1 xt-2
- H(z) 1z-1z-2
- (z2z1)/z2
- Binomial theorem time!!
-
22Two zeros!
- For any frequency ejw, take product of distances
to all zeros!
0.33
0
0.5
23Frequency response
24Handling any multiplied gain
- When factoring, you must get into this form
- a(zz1)(zz2)(zzn)/zn
- a is a gain multiplied by the filter
25Another more complex filter
- yt 2xt xt-1 2xt-2
- H(z) 2z-12z-2
- (2z2z2)/z2
- 2(z20.5z1)/z2
- Binomial theorem again
-
26Two zeros!
- For any frequency ejw, take product of distances
to all zeros the gain value (2)!
0
0.5
27Frequency response