ODP: Filters
Magnus Danielson
magnus at analogue.org
Tue Jan 12 22:01:15 CET 1999
>>>>> "JJ" == James Jackson <james at newd.demon.co.uk> writes:
JJ> At 10:54 11/01/99 +0100, you wrote:
>> Hi,
>> good luck on this project...
>> It's nice as soon as you'll manage to do it all
>>
>> Could you specify what you mean by Fourier Transform based filters?
JJ> Yes, I'll try, but I havn't learnt much about them yet. It would seem
JJ> through feedback from the list, that fourier transforms are not the best way
JJ> to do filtering on DSPs, but I'll try to explain anyway. Fourier transforms
JJ> allow you to extract the amplitude and other usefull stuff of any given
JJ> frequency when provided with a spectrum of audio (Or more usually, RF) data.
JJ> You can use this information to make any type of filter you want.
JJ> This may well be wrong, so mail the list if it is!
Well, the Fourier transform exist in two major versions and two
directions, it exist in both continous and discrete time. The
continous time is the actual Fourier transform. The discrete time
Fourier transform is often called DFT (Discrete time Fourier
Transform). The discrete time is really saying that the time is
sampled into discrete events, which is a much diffrent thing than
having continous time.
Now, you may preform the Fourier transform in either forward or
backword direction. If you have the function f(t) in the continous
time t you can transform it into the transfer function F(jw) with the
continous frequency w. This transfer function holds both the amplitude
and phase responce as a complex function of the frequency w (2*pi*f as
usual). The inverse Fourier transform takes the transfer function
F(jw) and returns the function f(t). The discrete time version of the
Fourier transform (DFT and IDFT) will do the same but for discrete
time and discrete frequency.
This FFT thing is just a name for a special set of methods to preform
an DFT analysis in a efficient way, it is the same thing but with
restriction on the number of points that the analysis is being done
for.
Now, how can this possibly apply to filters?
Well, a filter is said to have a transfer function, this function can
also be fully described (assuming that the filter is linear and time
invariant) by it's impulse responce h(t). The transfer function would
thus become H(jw). When you implement a FIR (Finit Impulse Responce)
filter you actually set up the taps from a sample per sample basis of
a delay line. The taps has weigths and is then summed
together. Analysis of this filter shows that the tap values are
equivalent to the impulse responce the filter has, so Fourier
transforming the tap values will give the transfer functions of those
taps. However, in filter design we are much more likely to start of
with some target curve for the transfer function and try to design the
filter parameters to approximate this function. In FIR filter design
you can do this by actually dream up the amplitude and phase responce,
inverse Fourier transform this into a impulse responce and assign it
to the FIR filter.
So, this sounds very optimal indeed, but infact, the hard part is
among others to keep the number of taps down to a minimum as well as
conveying the values in this amount of frequencies that now has gone
down (you have equalently amount of frequencies as well as taps, DC
included, an they are spread in a linear manor between DC and half of
the sampling frequency). So, at 256 frequencies you get 256 taps, and
256 taps means 256 multiplications (which is kind of expensive) and
255 additions (not as expensive). There are methods (Remez-exchange)
to design filters that match some specification but allows the
algorithm to pick a bit more freely, this may cut the number of taps
significantly. Also, if the filter is neatly done it is balanced so
that only half the number of multiplication needs to be done.
Then, many people beleive that Fourier transforms is all the is to
filters, but they should try using LaPlace-transform and its discrete
time version the z-transform.
Cheers,
Magnus
More information about the Synth-diy
mailing list