DSPRelated.com
Forums

Digital Filtering implementation

Started by DSP_newbie September 19, 2005
Hi pals !

Jere i am with a maybe very stupid question:
I want to code a real time, equalizer (let's say 10th bands) followed by 
a crossover filter, in a digital way.
So.. after having thought a while... i could consider two way to 
implement it :
* The first, the "conventionnal way" : usinf normal IIR or FIR filters, 
to construct the EQ and Xover. this solution will lead to low delay and 
low computing CPU usage (as long as the order of filters are small of 
course !)
* The  other, that i think is better:
To use a FFT on for exemple 512 (for ex) sample and with this, i can 
work directly in the freq domain, and make *perfect* filters ! in that 
case i will both make the EQ and Xover operation in the same time, and 
then apply an IFFT on that 512 (for ex) samples to recover my time signal...
Hence with that last method, i can achieve perfect filtering.. with more 
delay (512 in term of samples) and some more computation.
But I think that i miss something in former method... I mean it's sound 
strange to be able to make a *perfect* filtering ... so I would like to 
know what are the drawback of my 2nd method ?

Thanks a lot for any feedback on that post !

Fred.
"DSP_newbie" <fred_nach@hotmail.com> wrote in message 
news:dgmajm$p74$1@reader1.imaginet.fr...
> Hi pals ! > > Jere i am with a maybe very stupid question: > I want to code a real time, equalizer (let's say 10th bands) followed by a > crossover filter, in a digital way. > So.. after having thought a while... i could consider two way to implement > it : > * The first, the "conventionnal way" : usinf normal IIR or FIR filters, to > construct the EQ and Xover. this solution will lead to low delay and low > computing CPU usage (as long as the order of filters are small of course > !) > * The other, that i think is better: > To use a FFT on for exemple 512 (for ex) sample and with this, i can work > directly in the freq domain, and make *perfect* filters ! in that case i > will both make the EQ and Xover operation in the same time, and then apply > an IFFT on that 512 (for ex) samples to recover my time signal... > Hence with that last method, i can achieve perfect filtering.. with more > delay (512 in term of samples) and some more computation. > But I think that i miss something in former method... I mean it's sound > strange to be able to make a *perfect* filtering ... so I would like to > know what are the drawback of my 2nd method ?
In general you can't do frequency domain filtering any better (in terms of frequency response) than in the time domain. There may be other advantages but that's not one of them. Reason: If you make sharp edges in the frequency domain, that implies very long impulse response in the time domain. If your blocks aren't long enough there will be temporal aliasing as a result - probably not something you want. The transform pair of the filter in time *and* frequency need to make sense. Fred

Fred Marshall wrote:
> "DSP_newbie" <fred_nach@hotmail.com> wrote in message > news:dgmajm$p74$1@reader1.imaginet.fr... > >>Hi pals ! >> >>Jere i am with a maybe very stupid question: >>I want to code a real time, equalizer (let's say 10th bands) followed by a >>crossover filter, in a digital way. >>So.. after having thought a while... i could consider two way to implement >>it : >>* The first, the "conventionnal way" : usinf normal IIR or FIR filters, to >>construct the EQ and Xover. this solution will lead to low delay and low >>computing CPU usage (as long as the order of filters are small of course >>!) >>* The other, that i think is better: >>To use a FFT on for exemple 512 (for ex) sample and with this, i can work >>directly in the freq domain, and make *perfect* filters ! in that case i >>will both make the EQ and Xover operation in the same time, and then apply >>an IFFT on that 512 (for ex) samples to recover my time signal... >>Hence with that last method, i can achieve perfect filtering.. with more >>delay (512 in term of samples) and some more computation. >>But I think that i miss something in former method... I mean it's sound >>strange to be able to make a *perfect* filtering ... so I would like to >>know what are the drawback of my 2nd method ? > > > In general you can't do frequency domain filtering any better (in terms of > frequency response) than in the time domain. There may be other advantages > but that's not one of them. > > Reason: If you make sharp edges in the frequency domain, that implies very > long impulse response in the time domain. If your blocks aren't long enough > there will be temporal aliasing as a result - probably not something you > want.
Another is that the FFT is a sampling of the continuous frequency domain response function. You can specify those samples but you may, and probably will, find a good deal of ripple and deviation between your specified samples. This can be shown by doing the IFFT to the time domain, zero extending the filter by a few powers of two and taking the FFT again. The amount of this ripple also increases with frequency domain edge sharpness. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein