for a long time I’ve been wanting to make my own audio spectrum analyser using an FPGA. I’ve done a fair bit of reading but until today had not managed to join the dots.
This gent has used an ESP to do it, his video and code make it ridiculously simple:
The are ~70 lines of code in his sketch, it’s that easy. The loop() can be broken down to three main tasks:
- Read 512 audio samples from the AD converter (lines 50-56 )
- Number crunch (FFT) to transform the signal (lines 57-59)
- Display the results on the OLED (lines 60-71)
Lines 72 and 74 are responsible for the ‘peak’ bars.
 - ESP32_Spectrum_Display_02.ino