Advice using FFT on the ESP32 - ESP-DSP Component

o.copleston
Posts: 21
Joined: Fri Aug 09, 2019 7:02 pm
Contact:

Advice using FFT on the ESP32 - ESP-DSP Component

Postby o.copleston » Fri Aug 09, 2019 8:51 pm

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?
Developer at SquidSoup
Person on Twitter | Instagram

drewandre
Posts: 5
Joined: Sat Mar 14, 2020 4:28 pm

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

Postby drewandre » Mon Mar 16, 2020 11:35 pm

Could you share any code samples? Tough to tell without seeing any examples.

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

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

Postby ESP_krzychb » Tue Mar 17, 2020 8:24 am

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:

Dmitry01
Posts: 1
Joined: Tue Mar 17, 2020 1:02 pm

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

Postby Dmitry01 » Tue Mar 17, 2020 1:12 pm

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

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 55 guests