Page 1 of 1

Advice using FFT on the ESP32 - ESP-DSP Component

Posted: Fri Aug 09, 2019 8:51 pm
by o.copleston
I have been developing a sound visualisation project using the FFT function from the ESP-DSP component. Audio is captured using an INMP441 which is then passed to the FFT function.

I am getting great data for higher frequencies but low frequency input cause a bunch of unwanted data to appear at higher frequencies.

Image
The above image is my FFT's output for an input frequency of 125Hz

I've tried a Hanning window before and after the FTT but the issue still persists.

I've really been struggling with the ESP-DSPs lack of documentation, does anybody have experience that could share some advice?

Re: Advice using FFT on the ESP32 - ESP-DSP Component

Posted: Mon Mar 16, 2020 11:35 pm
by drewandre
Could you share any code samples? Tough to tell without seeing any examples.

Re: Advice using FFT on the ESP32 - ESP-DSP Component

Posted: Tue Mar 17, 2020 8:24 am
by ESP_krzychb
o.copleston wrote:
Fri Aug 09, 2019 8:51 pm
I've really been struggling with the ESP-DSPs lack of documentation, does anybody have experience that could share some advice?
Hi o.copleston,
I assume you have already checked ESP-DSP documentation under https://docs.espressif.com/projects/esp ... index.html
If so, please comment how to improve it :idea:

Re: Advice using FFT on the ESP32 - ESP-DSP Component

Posted: Tue Mar 17, 2020 1:12 pm
by Dmitry01
I am getting great data for higher frequencies but low frequency input cause a bunch of unwanted data to appear at higher frequencies.
Hi o.copleston,
I assume that you forgot to use bit reverse operation after the FFT.
Your code should look like this:

Code: Select all

    for (int i=0 ; i< N ; i++)
    {
        y_cf[i*2 + 0] = your_signal_samples[i] * wind[i];
        y_cf[i*2 + 1] = 0;
    }

    dsps_fft2r_fc32(y_cf, N);
    dsps_bit_rev_fc32(y_cf, N); // <================= Bit reverce
    dsps_cplx2reC_fc32(y_cf, N);// <=============== Complex spectrum in y_cf
Here you have the complex spectrum in y_cf.

Regards,
Dmitry