cancel
Showing results for 
Search instead for 
Did you mean: 

How to learn fft?

ÖDemi.1
Associate II

Can you help me with fft? I don't know exactly how to use it. my goal is to separate the different frequencies.

can you share sample code.

1 ACCEPTED SOLUTION

Accepted Solutions
gregstm
Senior III

If you want to get a general feel for the capabilities of FFT, I would recommend getting the audio editor "Wavosaur". It has an FFT analysis tool where you can easily change the length of the FFT for experimentation. You can record some audio you want to analyse and plug it into the program and step through the waveform with the FFT tool and examine how the FFT frequency peaks evolve. There are probably many other audio editors that can do the same thing - but this one has been simple, free and very educational for me.

As far as the actual code goes - there should be DSP libraries here somehere to do the FFT. Using an M4 processor (or above) will make the FFT much more efficient (the floating point SQRT function alone saves a huge amount of mucking around when calculating the magnitude of the frequencies).

I decided to eventually move to the Fast Hartley Transform (FHT) - because I found it simpler to implement and efficient. I discussed how to get started with it here: https://community.st.com/s/question/0D50X0000B0xqPrSQI/fast-hartley-versus-fast-fourier

View solution in original post

1 REPLY 1
gregstm
Senior III

If you want to get a general feel for the capabilities of FFT, I would recommend getting the audio editor "Wavosaur". It has an FFT analysis tool where you can easily change the length of the FFT for experimentation. You can record some audio you want to analyse and plug it into the program and step through the waveform with the FFT tool and examine how the FFT frequency peaks evolve. There are probably many other audio editors that can do the same thing - but this one has been simple, free and very educational for me.

As far as the actual code goes - there should be DSP libraries here somehere to do the FFT. Using an M4 processor (or above) will make the FFT much more efficient (the floating point SQRT function alone saves a huge amount of mucking around when calculating the magnitude of the frequencies).

I decided to eventually move to the Fast Hartley Transform (FHT) - because I found it simpler to implement and efficient. I discussed how to get started with it here: https://community.st.com/s/question/0D50X0000B0xqPrSQI/fast-hartley-versus-fast-fourier