-1
$\begingroup$

i'm trying to filter a signal with a FFT. I window each block of signal (i use a 4096 points signal) and then remove some high frequencies by just multiplying the magnitude response.

the result is : the more i remove highs, the more i have glitches.

I know it's bad to EQ directly with the FFT but i just want to know why there are some glitches

i tried to zero the DC, i tried to window another time the input window by a short amount (maybe not the clever thing to do).

i have less clics when using a Nutall window, compared to a Hamming or Hanning, and the clics seems to appear every FFTSize/2 samples

so, why clics? and what is the remedy?

thank you gentlemen.

edit: i've searched everywhere without getting a proper solution.

edit 2 : you can try this matlab program, (i'm not very sure about the filtering part but if it's wrong correct it and it should glitch all the way) http://pastebin.com/8tBmjNqG

Jeff

$\endgroup$
  • $\begingroup$ First of all, note that there are much better ways of implementing an EQ than frequency domain processing. The very first thing to try is to modify your code so that no modification (filtering/EQ) is done on the FFT data. Are you able to resynthesize the original signal without any audible artifact? If this is not the case, then there is something wrong with your overlap-add implementation. Which window function do you use? What is your overlap ratio? $\endgroup$ – pichenettes Mar 25 '14 at 18:12
  • $\begingroup$ hello i added some edit. Basically i get glitches only when removing a lot of high frequencies and yes i know there are better ways to filter like in the time domain but i jus tlike to undestand things and right now i'd like to understand why there are clics when i remove lots of high frequencies $\endgroup$ – ionone Mar 25 '14 at 18:14
  • $\begingroup$ Filtering in the frequency domain might cause ringing artifacts, which might cause the signal to clip. Maybe that could explain your clicks. Or maybe you're zeroing the end of the FFT array - which corresponds to negative frequencies, not to high frequencies. We can't say much without seeing plots, sound clips or code. We can't speak out of experience because this is not how EQs are implemented. $\endgroup$ – pichenettes Mar 25 '14 at 18:23
  • $\begingroup$ the signal is not clipped that i'm sure of. the second part is clever but i'm quite confident that i'm using the FFT the right way, not zerowing some negative frequencies. (my FFT is a realFFT so i cannot get wrong with it)i'll try to give you some more to understand why it is happening $\endgroup$ – ionone Mar 25 '14 at 18:33
  • $\begingroup$ added some matlab code $\endgroup$ – ionone Mar 25 '14 at 18:44
0
$\begingroup$

Zero-ing isolated FFT bins can create a very long impulse response (above some noise floor), so your FFT length may need to be a lot longer than both the data window plus your current amount of zero-padding to prevent the impulse response from wrapping around circularly. Or your can use a filter response with shallower transition bands, which usually represents a shorter impulse response.

Normally, one uses a rectangular window when doing overlap-add FFT fast convolution filtering, not a Nutall or Von Hann window.

$\endgroup$
  • $\begingroup$ i've created 4 ola buffers with half silence at the end so that there is room for the decaying filter but i still got glitches (i tried with higher FFTs but it's still the same. If i use a rectangular window i get more glitches than ever. But i agree that convolution doesn't need a fancy windowing. So where do i go from there ? Should i add even more space at the end of the buffers (like FFTSize samples or 2xFFTSize samples)? Jeff $\endgroup$ – ionone Mar 26 '14 at 10:08
  • $\begingroup$ okay i found out how to deal with those. the trick is to create the filter FFT then do an ifft to it. then copy the first half and replace the second half with it. then copy the second half and replace the first half (of course you have to use temp files between the 2 copies) $\endgroup$ – ionone Mar 27 '14 at 13:10
0
$\begingroup$

You get clicks because of time domain aliasing. Google "overlap add" (e.g. http://en.wikipedia.org/wiki/Overlap%E2%80%93add_method) on how to properly EQ in the frequency domain.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.