[Math] Bandpass filter with Fourier and inverse.

signal processing

My understanding of signals is limited. I did a signal processing subject in engineering, but I can't say I got much from it. For me, the subject wasn't taught with enough 'real world' explanation – all mathematics.

I want to take a signal from an experiment I am running, and remove the high frequencies (all above 3Hz).

By applying a fft, I am able to transform my signal into a frequency domain, showing a frequency spectrum and a range of amplitudes. I was lead to believe that if make the amplitudes of the signals I don't want, zero, then inverse transform the signal, I should effectively filter the unwanted frequencies. I have tried this, and it doesn't seem to work.

My thought on why this doesn't work is: In the time domain, the signal can be deconstructed into it's harmonics, each having an transient amplitude over the time period. When transforming to the frequency domain, we loose the time component, so when inverse transforming, we don't have any transient information, essentially we get a periodic signal comprised of all the harmonics superimposed, but the amplitudes of the harmonics don't change in time. Is this correct?

If so, is there a way of determining the amplitude transients in the original signal, masking the frequencies in the frequency domain, then reapplying the amplitude transients in the time domain?

Best Answer

Your question doesn't contain enough detail to answer it. For example, you just just say you tried it and it didn't work. What exactly did you try? An FFT of your entire data set, or did you have to break it into chunks? If you broke it into chunks because it was a large set, there are many potential problems there and I can't begin to guess, but the correct procedure is complex. If you just did it in one go, did you pad your data? And so on.

That said, let me do my best to help you out with a few points:

  • it is usually a good idea to do this kind of filtering in the time or spacial domain, rather than the frequency domain. Why? Some of that is covered here: http://blog.bjornroche.com/2012/08/why-eq-is-done-in-time-domain.html

  • AnonSubmitter85 is not quite right in his comment when he says, "If you want to remove all frequencies above 3(Hz), then zeroing out the frequency bins that correspond to frequency values of 3(Hz) and higher will do that. That's just true by definition." What actually happens is a bit more complex: you guarantee that the signal at the frequency bins above 3Hz will be zero, but it says nothing about the values between the bins. In fact, a filter designed this way will have attenuation above 3Hz that fluctuates greatly depending on the exact frequency. This is known as filter ripple, and can be reduced in various ways, but not eliminated. Depending on how many bins and what your data looks like exactly, the effect of ripple may be little to no attenuation of high frequencies.

  • Time domain filters called IIR filters might "smear" the time response of your data, but it depends on the type and exactly what you are concerned about. If you are eliminating high frequencies to smooth out noise you are probably fine. Here is a blog post I wrote about basic audio filters that can guide you as well: http://blog.bjornroche.com/2012/08/basic-audio-eqs.html That post describes a class of IIR filters. If you are extremely concerned, you can filter your data twice: once regularly and then again with your data set reversed.

Related Question