Audio Spectrum Analyser

Hi all,
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:

  1. Read 512 audio samples from the AD converter (lines 50-56 [1])
  2. Number crunch (FFT) to transform the signal (lines 57-59)
  3. Display the results on the OLED (lines 60-71)

Lines 72 and 74 are responsible for the ‘peak’ bars.

Sooooo easy :wink:

[1] - ESP32_Spectrum_Display_02.ino

1 Like

Nice project. Takes me back to the 80’s when I spent a few months developing the fastest discrete fft implementation I could. Good times.

BTW, if you want to really dive into serious FFT methods I can loan you a book “Handbook of Real-Time Fast Fourier Transforms”. Being such an important DSP component it is no surprise to see so many ways of approaching it.