Cheaply generating coefficients for IIR/FIR given a cutoff frequency I'm working on a DSP-based senior project, and we'd like to allow the user to provide a 20-20kHz cutoff specification for IIR/FIR high and low-pass filters on the fly.  This would be a simple problem on a desktop, but we're working on a TI 5535 DSP chip.  So we're looking for a C library for generating coefficients.  We're currently looking at adapting this code from C++ to C and cutting out the input stuff, but if there's a better solution we'd love to hear it.

For IIR - Any of Butterworth / Bessel / Chebyshev would work.  Whatever has the fastest runtime / lowest complexity is optimal.  Accuracy is not important (educational product, so as long as the output changes when they change the cutoff, we're fine).  

For FIR - not really sure what to do here.  Raised cosine for the lowpass, ?? for the highpass.  

We're sampling stereo audio at 44.1kHz/channel.  I'm unsure what other parameters we can set constant to make calculations simpler.  The number of poles can be held constant, and the rolloff and other specifications aren't terribly important to us. 

The question - what are some existing methods or C libraries for generating filter coefficients from a cutoff frequency in the auditory range?
A computationally cheap way to generate quick &amp; dirty FIR filter coefficients is to evaluate a windowed Sinc function.  Any rectangle in the frequency domain (low/high/bandpass) has a Sinc impulse response in the time domain, which can be windowed to a length roughly proportionally inverse in size to the desired width of the transition bands, and then sampled for some FIR coefficients.

About a dozen lines of BASIC pseudo code on my web page to do this should be trivial to convert to plain C : http://www.nicholson.com/rhn/dsp.html#2