190 likes | 370 Views
Computer Sound Synthesis 2. MUS_TECH 335 Selected Topics. Filters continued. Complex Numbers Complex Plane. imaginary. x + yi. y. real. x. Cartesian coordinates. Im. polar form A q. A. q. Re. A = x 2 + y 2. y x. q = arctan( ). Im. A. y = A sin q. q. Re.
E N D
Computer Sound Synthesis 2 MUS_TECH 335 Selected Topics
Complex NumbersComplex Plane imaginary x + yi y real x Cartesian coordinates
Im polar form A q A q Re A= x2 + y2 y x q= arctan( )
Im A y = A sin q q Re x = A cos q Relationship of polar form to Cartesian form.
Complex Numbers Addition (a+bi) + (c+di) = (a+c) + (b+d)i Multiplication A1q1A2q2 = A1A2(q1+ q2) (a+bi)(c+di) = ac + adi + bci + bdi2 = (ac - bd) + (ad + bc)i . -1
Meaning of i? i represents a 90 degree rotational shift i i = i2 = -1 represents a 180 degree rotational shift .
imaginary z-plane unit circle frequency real Nyquist -3/2 SR -1/2 SR 0 1/2 SR 3/2 SR
Geometric Interpretation of Magnitude Response img z-plane = pole |P1| = zero |Z1 | real |Z1| | Z2| |P1| |P2| |H| proportional to
First-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
First-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
Take a look at Movie Demonstrations http://www.ece.msstate.edu/~hagler/Aug1996/011/cd/Demos/Z2freq/index.htm
2nd-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
2-zero band-reject a f 0 SR/2 2-pole band-pass (x+yi) a f 0 (x-yi) SR/2 -1 (x + yi)(x - yi) = x2 - xyi + xyi - y2i2 = x2 + y2
low Q high Q f freq BW Q = Q increases as pole approaches the unit circle * Used in SuperCollider: r * BW freq 1 = RQ = * Q q
Visit Pole-Zero Filter Design Applet http://www.earlevel.com/Digital%20Audio/PoleZero.html
two-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, qand r.
Programming 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; * * *
Biquad Filter 1 a1 a2 out k z-1 z-1 b1 b2 combined IIR/FIR 2nd-order