ODP: Filters
Ethan Duni
eduni at ucsd.edu
Tue Jan 12 01:17:09 CET 1999
>Yes, I'll try, but I havn't learnt much about them yet. It would seem
>through feedback from the list, that fourier transforms are not the best way
>to do filtering on DSPs, but I'll try to explain anyway. Fourier transforms
>allow you to extract the amplitude and other usefull stuff of any given
>frequency when provided with a spectrum of audio (Or more usually, RF) data.
>You can use this information to make any type of filter you want.
>
>This may well be wrong, so mail the list if it is!
-i wouldn't say outright "wrong", but perhaps it could be more correct.. the
Fourier Transform allows you to look at amplitude vs. time data and
calculate amplitude vs. frequency data as well as phase vs. frequency data.
Once you are into the frequency domain, you can impose arbitrary filter
contours onto the data and then use an inverse Fourier Transform to get back
to the time domain.
In digression: this can be done in the time domain as well. The "filter
contour" above is the frequency response of the filter. The frequency
response of a (linear, time-invariant) system is the Fourier Transform of
its impulse response. The impulse response is defined as what happens at
the output of a system when you feed in an "impulse" -a spike of infinite
amplitude and zero duration with an integral of one. (this is where the
terms FIR- Finite Impulse Response and IIR- Infinite Impulse Response come
in). You can take the impulse response and the input signal and feed them
into the Convolution Integral to get the output. however, directly
evaluating the Convolution Integral is, at best, a very computationally
expensive process and as it turns out (should be apparent from this
digression) it is equivalent to taking the Fourier Transform of both data
and multiplying them together and then taking the inverse Fourier Transform
of the result. This is usually significantly faster and is how the
Convolution Intgeral is often calculated.
anyway, back to the point.. using an FFT based filter, while very cool, is
probably overkill for doing analog synth modelling (that is what you were
wanting to do, no?). Making an FFT filter do modulable resonance and cutoff
in real time (while really cool) would be a severe pain in the ass,
especially compared to using "FIR" and "IIR" methods, which will probably be
just as good for doing analog-synth style filtering (anyone have any
opinions here?).
On the other hand, another approach might be to not use an FFT at all; just
start in the frequency domain and build your oscillators as collections of
harmonics with various amplitudes and phases (i've written a windows
softsynth with labview that does this, incidentally.. not in real time
though. if anyone would like to play with it, let me know). The fourier
series for common shapes like triangles, sawtooths, pulses and (of course)
sines are well known and easy to plug into a frequency-domain array. then
you just multiply the thing by a filter contour and iFFT it. however, at
this point we are talking about building a K5000 (additive synth) instead of
an analog-style one. this also requires you to become familiar with the
frequency-scaling algorithms to keep the harmonics, well, harmonic.. but
controlling aliasing becomes somewhat trivial. also (as mentioned above),
there is the problem of getting the filter contour to interpolate properly
between different cutoffs and resonances.. i've never tried it, but i
imagine it would require some pretty tricky coding to do in real-time..
another thing about the fourier transforms in general is that they output
complex numbers, which complicates all the calculations (anyone familiar
with the SHARC instruction set care to comment?)
all depends on what you want to do i suppose.. i hope this was some help..
incidentally, i have a big design project coming up in the next couple of
years for my degree. what i've been thinking of doing is sort of along
these lines.. I'm calling it a convolution-synth for lack of a better term;
the idea is to start in the frequency domain as described above. what i'd
like to do is go and get the impulse responses of a whole bunch of filters,
instruments, drums, reverb units, etc. and then transform all of them and
keep them as a bank of filter contours. i'd also like to construct models
of (if not directly record) common real-world "impulses" (plucking violin
strings, blowing into a tube, hitting something with a stick, etc.). these
would then be used to initially fill the frequency-domain array (as well as
some algorithmically generated ones like sines, pulses, various noise,
etc.). then this would be multiplied by whatever frequency response (or
responses if there's time) you have decided to use and iFFT'd. of course
the magic would come in with interpolating between different shapes and
inputs with different controllers. also, ideally, the filter responses
would be "multi-sampled" in different registers, etc. another nice bonus
would be an external audio input tot he thing.. we'll see.. This whole thing
of course would be fed into adsr's etc. once back into the time-domain. of
course doing this in real-time is going to be the really hard part..
hope that made sense..
anyone have more ideas?
Ethan
More information about the Synth-diy
mailing list