Help with Arduino Inverse FFT

Hi All,

I am using OpenMusicLab's FFT library to do FFT on an analog microphone (ADMP401) connected to my Arduino Mega. I need to then remove a certain set of frequencies falling below 100 Hz and then do an Inverse FFT to retain my filtered signal.

The whole purpose here is to remove the arduino board noise caused due to other components which is impacting the noise output.

I am able to get the FFT output with the example code mentioned in OpenMusicLab website. Unable to do an inverse FFT though. I tried this method mentioned here: http://stackoverflow.com/questions/30544456/how-to-inverse-fft-in-arduino

But it didnt help. Can someone please throw some light on this.

Thanks in advance.

~Rahul

Please read the sticky post, "How to use this forum - please read," shown at or near the top of the subject listings for this, and for most, sections of the forum. Please pay particular attention to item #11, "Tips for getting the most out of your post." Please note that you will generally be more successful if you follow this recommendation: "... with coding problems, if possible post a "minimal" sketch that demonstrates the problem - not hundreds of lines of code."

There are a number of things that could interfere with your ability to run the reverse FFT. My personal favorite is that you're working with magnitude data rather than the complex transformed data. Another might be that there's a factor of N, or maybe 1/N, depending on your point of view, that has to be applied to a round trip through the FFT and its inverse. There are other possibilities, too. Without code, there's no telling which one is affecting your program.

I'd recommend that you post a sketch that runs the FFT on known test data, and then runs an inverse FFT, and reports the results of each transformation.

The FFT is a complicated way to implement a low-pass high-pass filter. You might want to consider whether a two-pole infinite-impulse-response filter will suit your needs.

Edit: Fix the filter type. As other posters have noted, the OP wants a high-pass filter.

What is the sampling rate and the maximum frequency of interest? You might find that doing a low-pass digital filter would be a lot faster than doing an FFT followed by an inverse FFT.

Pete

I need to then remove a certain set of frequencies falling below 100 Hz and then do an Inverse FFT to retain my filtered signal.

What are you doing with the output signal? Is that a digital or analog signal? If it's analog audio you'd need a DAC and I'd be very surprised if you can get anything "listenable" from the "slow" Arduino with all of the processing involved in FFT/reverse FFT.

The FFT is a complicated way to implement a low-pass filter.

I agree, it's a complicated way to implement a filter. But, he wants a high pass filter to block the low frequencies. ;)

he wants a high pass filter

Yup. Thanks

Pete

No, it souns to me like he needs a band stop, or notch filter.

remove a certain set of frequencies falling below 100 Hz

Yes, the "certain set of frequencies" suggests that it's not all frequencies below 100Hz. A bandpass or notch might well be required.

Pete