Basic Digital Signal Processing: Filters
Digital filters are ubiquitous in musical signal-processing. The design
and implementation of filters is currently an very active area of research.
Digital filter theory forms the foundation for understanding much of
contemporary DSP work.
Links
In addition to the filter objects and instruments available in
Max/MSP and RTcmix, you can find many more at:
a fairly comprehensive database for third-party Max/MSP objects (commercial,
shareware and free). This is also a good place to search for objects
that may do a particular task that isn't done by the distributed
Cycling '74 objects.
The following are links to pages covering aspects of digital
filter theory:
Applications and Examples
Fun filter examples from class:
- week6a-examples.sit
-- StuffIt archive with the class max/msp and rtcmix patches
individual patches as text files (for Windows users)
We began class by discussing the basic types of filters:
- lo-pass (low-pass): only let frequencies below a certain cutoff
frequency get through, with a certain roll-off amount of
attentuation for frequencies above the cutoff. Often these lo-pass
filters have a resonant 'bump' right at the cutoff point.
- hi-pass (high-pass): inverse of lo-pass. duh.
- band-pass: only let frequencies in a certain pass-band
get through the filter, specified by a center frequency
and width. The width is usually given in Hz, but occasionally
it is specified as the "Q" of the filter. I'll leave it as an
exercise for you, the intrepid reader of this document
to figure out what the heck a "Q" is.
- band-reject: inverse of the band-pass filter.
Next we looked at how filters are implemented digitally, using filter
equations. Happy discussion of Finite Impulse Response (FIR)
and Infinite Impulse Response (IIR) equations followed, including
how past inputs ("feed forward", in FIR filters) and past outputs
("feedback", IIR filters) are used in filter design.
Two things are useful to try when looking at the action of a filter
equation. The first is to look at how the filter operates on the
lowest frequency possible and the highest frequency possible for
a given sampling rate. The lowest frequency possible is essentially
an unchanging number (called DC -- Direct Current)... the frequency
is so doggoned low that it doesn't even oscillate! Assuming an amplitude
range of our samples from -1.0 to 1.0, this would be represented
as the following number stream:
1.0 1.0 1.0 1.0 1.0 1.0 1.0 . . .
The highest frequency possible for a given sampling rate sits right at
the Nyquist frequency (1/2 the sampling rate). Assuming again the -1.0 to
1.0 range, and assuming that we got really lucky and our samples lined
up exactly right, it would yield the following number stream:
1.0 -1.0 1.0 -1.0 1.0 -1.0 1.0 . . .
Cranking these numbers through simple filter equations (such as those
discussed in Luke's tutorial above) show how these linear equations
can modify a time-domain number stream. Amazing stuff!
The second thing to try is to follow what happens to a unit impulse
(also called the
Dirac delta function
(band-limited in this case)
if you want to impress your mathematical friends) when sent into the filter
equation. This could be represented by the following number
stream:
0.0 0.0 1.0 0.0 0.0 0.0 . . .
(note the "1.0" impulse.) Seeing what happens to this stream after
being 'processed' through a simple filter equation will demonstrate
why FIR filters are called 'finite' and IIR filters are 'infinite'.
Here's a question for you -- are the comb filters we discussed
last week FIR or IIR filters?
For most of the work we do, we won't need to know about filter equations
and various digital filter design approaches (Butterworth filters,
elliptical filters, biquad filters, etc.) directly. Instead we will probably
be more concerned with acoustically-tangible qualities like
the center frequency, cutoff frequency, bandwidth, etc. But
it's sort of fun to fool around with these equations. Some people
find it to be such astounding fun that they make a living
at it.