Question edited based on first answer which raised a lot of good points about what problem I'm trying to solve. Also reordered some things to stick context of how I did this with FIR so far at the end, to make it more coherent.
Sorry if I'm not entirely sure what, directly, is the right question to ask. The cone is a bit wide.
I've been trying to implement variable audio filters on FPGA for an (unreasonable) synthesizer chip, allowing low-pass, high-pass, and band-pass with movable cutoff frequencies. The cutoff frequency might move around constantly with an LFO, so I recalculate the filter for every sample output; at the clock rate $48000Hz\times 288\times 12$ and the sample rate $40960Hz$, I have roughly 4,000 clock ticks to work with.
I've figured out how to do it with FIR 83-tap sinc filters (detailed here) with the coefficients calculated in real time, able to filter about 500 samples per $40960Hz$ sample-tick via a pipeline that requires 3 $18\times 18$ multipliers, running 6 of these pipelines in parallel. That was fun.
Now I want to figure out how to do it with an IIR filter like a Type-1 Chebyshev (based on some material I'd read) or a Butterworth. I've not yet been able to penetrate the math.
Internally I'm using 24-bit floating point with an 18-bit significand (17 bits plus 1 hidden bit), because I have 18×18 multipliers. I'm looking at a bias of (if this is correct—still working out how IEEE754 works) 57 to give a range of about 64 to about $7\times 10^{-18}$ positive and negative. I looked at doing this in fixed point, and started having trouble with not having enough precision to avoid piling up massive amounts of error over many additions and multiplications.
From what I've gathered, 6-pole seems (more than?) fine, or 3-pole and then run it back through itself, so this shouldn't be very intensive to use. I'm not sure about calculating it because I haven't been able to grasp precisely how to do that. Yet. Also not sure if I can combine IIR filters the same way as FIR sinc filters, which is just done by adding the kernels; inverting a low-pass to a high-pass or a low-cut to a band-cut is done by flipping the signs and adding 1 to the midpoint. All nice and easy stuff for the FIR approach, but I don't know if these principles translate to recursive filters.
Besides not understanding the math (I didn't understand the math behind a sinc filter until I read some code that does it and some other basic material), I'm not entirely sure how to do imaginary calculations on a real FPGA (or on paper). Based on some responses here so far I've found more stuff related to Butterworth filters and have started trying to unpack what that means.
Hilmar mentioned doing all that ahead of time and then moving the cutoff frequency by frequency warping; no idea how to do that, still asking Google. It sounds like a lower-cost approach (doesn't need 8,000 multipliers, doesn't take 5 years to finish calculating…) that might fit my needs…if I can find resources explaining that, or figure out how to actually apply the principle.
I guess what I need is:
- An approach to generating a filter appropriate for audio (synthesis) whose cutoff I can modify in a few calculations, or at least in a direct enough process that I can pipeline the calculations.
- The math behind modifying it so I can work from there to design said pipeline.
- A math degree I don't have!
Did it one way, now want to do it another way.