tobozo / ESP32-Audio-Spectrum-Waveform-Display

using an ESP32 and OLED display together with an FFT to display 8-octaves of audio in the frequency domain
48 stars 12 forks source link

The calculated peak frequency is half the actual signal frequency #1

Closed JuriShalkin closed 4 years ago

JuriShalkin commented 4 years ago

Hello! It seems to me that reading data from the ADC does not work correctly: the reading frequency does not match the declared sampling frequency. I use an audio signal to evaluate the correct operation and get a peak frequency half that of the actual signal frequency. I took the initial ADC data from the array vReal and did the Fourier transform in the MS Excel and got the same result.

tobozo commented 4 years ago

Hello and thanks for your feedback.

Do you mean the captureSoundSample() code would need revision or could it be a clumsy adc setting in the setup() causing that?

JuriShalkin commented 4 years ago

Sorry, this is my mistake. I did not use your code, but this code https://github.com/G6EJD/ESP32-8266-Audio-Spectrum-Display

tobozo commented 4 years ago

@JuriShalkin have you tried this one? it uses separate tasks for analogRead and TFT rendering

https://github.com/CelliesProjects/M5visualisation_2core