Hey,
I have code for FFT and I want to draw frequency range 500-10000Hz on display 800px.
I apply FFT on 16384 samples.
In my FFT are many peaks in all spectrum and I want to see them all on display.
My code:
Then I make some calculations for values and save to array vReal.
Now I need to draw it on display:
In this case I can see on display just frequency from 10 to approx 800Hz.
I need somehow average it or zoom it to see 500-10000 Hz with main peaks.
Any idea how to do it?
Thanks!
I have code for FFT and I want to draw frequency range 500-10000Hz on display 800px.
I apply FFT on 16384 samples.
In my FFT are many peaks in all spectrum and I want to see them all on display.
My code:
Code:
fft_config_t *real_fft_plan = fft_init(16384, FFT_REAL, FFT_FORWARD, fft_input, fft_output);
for (int k = 0 ; k < 16384 ; k++)
real_fft_plan->input[k] = (float) vReal[k];
fft_execute(real_fft_plan);
Then I make some calculations for values and save to array vReal.
Now I need to draw it on display:
Code:
for(int i= 10;i < 795; i++) // draw from 10 to 795 px - but I have 8192 (nFFT/2) values
{
tft.drawLine(i,25, i, 155,RA8875_BLACK);
tft.drawLine(i,155, i, 155 - vReal_G[i],RA8875_YELLOW);
}
In this case I can see on display just frequency from 10 to approx 800Hz.
I need somehow average it or zoom it to see 500-10000 Hz with main peaks.
Any idea how to do it?
Thanks!