Title: Computer Sound Synthesis 2
1Computer Sound Synthesis 2
- MUS_TECH 335 Selected Topics
2Filters continued
3Complex NumbersComplex Plane
imaginary
x yi
y
real
x
Cartesian coordinates
4Im
polar form A q
A
q
Re
A x2 y2
y x
q arctan( )
5Im
A
y A sin q
q
Re
x A cos q
Relationship of polar form to Cartesian form.
6Complex Numbers
Addition (abi) (cdi) (ac) (bd)i
Multiplication A1?q1 A2?q2 A1A2?(q1
q2) (abi)(cdi) ac adi bci bdi2 (ac -
bd) (ad bc)i
.
-1
7Meaning of i?
- i represents a 90 degree rotational shift
- i i i2 -1 represents a 180 degree
- rotational shift
.
8imaginary
z-plane
unit circle
frequency
real
Nyquist
0
-1/2 SR
-3/2 SR
3/2 SR
1/2 SR
9Geometric Interpretation of Magnitude Response
img
z-plane
pole
P1
zero
Z1
real
Z1 Z2 P1 P2
H proportional to
10First-order Non-recursive Filter
zero
a
high-pass
a 1
Z
f
0
SR/2
z-plane
a
a -1
low-pass
Z
f
0
SR/2
z-plane
11First-order Recursive Filter
pole
low-pass
a
P
b .9
f
0
SR/2
Z-plane
high-pass
a
P
b -.9
f
0
SR/2
Z-plane
12Take a look at Movie Demonstrations
- http//www.ece.msstate.edu/hagler/Aug1996/011/cd/
Demos/Z2freq/index.htm
132nd-order Filters
2-zero filter
a1
k
a2
z-1
z-1
non-recursive
k
2-pole filter
z-1
z-1
b1
b2
recursive
142-zero band-reject
a
f
0
SR/2
2-pole band-pass
(xyi)
a
f
0
(x-yi)
SR/2
-1
(x yi)(x - yi) x2 - xyi xyi - y2i2 x2 y2
15low Q
high Q
f
freq BW
Q
Q increases as pole approaches the unit circle
r
Used in SuperCollider
BW freq
1
RQ
Q
q
16Visit Pole-Zero Filter Design Applet
- http//www.earlevel.com/Digital20Audio/PoleZero.h
tml
17two-pole filter
y(n)
k
x(n)
z-1
z-1
-b1
-b2
difference equation
y(n) k x(n) - b1 y(n-1) - b2 y(n-2)
b1 2r cos q b2 -r2
The coefficients depend on the position of the
poles, here expressed in polar form, q and r.
18Programming Implementation
output
input
old1
old2
z-1
z-1
k
feedback loop
-b1
-b2
Program Flow
output k input - b1 old1 - b2 old2 old2
old1 old1 output
19Biquad Filter
1
a1
a2
out
k
z-1
z-1
b1
b2
combined IIR/FIR 2nd-order