esp32-mic-fft
esp32-mic-fft copied to clipboard
Program works fine but frequency bins on web browser are 4X too high
Hello Daniel- This is a great contribution. I was just looking for example code to use the ESP32-EYE microphone and your blog post nailed that. In the blog post itself, your code shows a sample rate of 40000. At that rate, the web browser bands would be correct as labelled. However, on the github site, the code is written for a sample rate of 10000. At that lower rate, all the labels for the bands must be divided by 4- i.e. each bin is 10000/512 or 19.53 Hz. So the bins from 200 up are 200 X 19.53 or 3906 Hz, not 16K (which is not possible to sample at a 10000 Hz rate - Nyquist) Many thanks Brian Millier
I can also loosely confirm there is some issue with the frequency bins, I think. Using a tone generator, I don't see the charts change as expected as I sweep the whole frequency range of human hearing. A few % of this I would expect to be due to poor or no calibration of the mic itself, but I would still expect it to correspond better than it does presently. In general, low and high frequencies seem to correspond to the left and right sides of the charts correctly, but they appear under the wrong frequency bands. The middle section of the chart I fail to trigger at all...
I'm using an INMP441 though, so perhaps this difference can be attributed to the different setup?