Most hobby spectrum analyzers lean on a laptop to do the heavy math, or they crawl along in slow interpreted code. This one puts the whole job on a Raspberry Pi Pico 2 and still manages a 256 point Fast Fourier Transform in roughly 17 milliseconds. For a board this size, that is a quick result, and it feels livelier than the usual MicroPython audio demos.
The hardware is tidy. An INMP445 microphone feeds audio in over I2S at 8K samples per second, and the result lands on a 128x64 2.42-inch OLED with an SSD1306 driver, mounted on a clear acrylic stand with the round sensor above the circuitry. The part that stands out is the transform itself, written in ARM assembler on top of an existing MicroPython FFT library. Timing figures averaged over 100 cycles show capture at about 16.49 ms, the transform at 17.23 ms, and the display update at 42.40 ms, for a 76.13 ms cycle and a theoretical maximum of 13.1 FPS.
Testing is nicely concrete. A laptop runs a p5.js tone generator MicroSim that produces sine wave tones, and as the slider moves between roughly 400 Hz and 3925 Hz, the peak readout and the curve on the display shift to match. The maker set the top of the range at 4K because that suits classroom music demos, and points out that middle C on a piano is only 261 Hz.
The aim is teaching. The maker hopes to use the analyzer to introduce kids to data transformation and visualization, and sees moving data into frequency space as an entry point to signal processing. A friend is converting a unit into a music light show on a NeoPixel matrix.
Two things remain open. The maker has not yet tried changing the baud parameter to speed up the OLED, and a new version using DSP instructions, which most compilers do not use, is still in progress.
Project by Dan McCreary. Watch it on their YouTube channel: