Hey guys!
Here's a spectrogram & spectrum analyzer I implemented on a cheap FPGA using the hardware description language VHDL.
The video show it analyzing a bunch of ocean sounds. Note the visible sonar signals. The second half of the clip shows an OSINT recording I found of an undisclosed warship/submarine sonar.
FIR filters in action:
https://imgur.com/a/gedTv8N
Music with visible overtones from instruments:
https://imgur.com/a/nPDdHSR
Singing pilot whales:
https://imgur.com/a/wBNu3mk
Highlights:
Filter bank: FIR filters with runtime adjustable cutoff frequencies
N-point FFT: a radix-2 Cooley-Tukey implementation. Uses a time-shared butterfly implementation, which works just fine when sampling at 48.8 kHz. Instantiated as 1024 points
DVI/HDMI video drivers: coded from looking at the HDMI specs. Had it collecting dust from a previous retro Breakout implementation I did. Also uses an ascii ROM and tile-scaling to generate text
On-board ARM core: configures ADC/DAC and handles FIR coefficients. LPF coefficients generated via Kaiser windowing and HPF from LPF spectral inversion!
Internal Signal Generator: used in early design stages to produce reference signals when debugging the FFT. Can produce chirps, noise, tones, sinc etc... A mux can be toggled between ADC and Signal Generator samples with the push of a button.
1D Spectrum Analyzer & 2D Spectrogram: uses a log2() compressor to store 240 batches of FFT output in order to view it in a waterfall plot.
Test framework:
I found that using a Python framework was incredibly powerful for this specific development. I could generate filter coefficients or FFT twiddle factors in Python then load those along with a reference input, simulate the FPGA gate logic and then parse the output data and automatically check against a reference. This also allowed me to use plotting to view frequency/phase responses etc.
I wanted to code everything from scratch in VHDL. Being new to FPGAs it was way harder than I thought but the end results turned out pretty neat! This project was basically an amalgamation of different ideas I had. I just wanted to do something in order to learn more about different subjects. I also wanted to view the tones produced by a nasty guitar tone on my Fender.
Further improvements would be stuff like window functions, Ethernet stream to a PC etc. I'd also love to run RF through this setup, but that'd require another FPGA board I guess...
Lmk if you have any questions :-)
P.S. I see that I misspelled "Waterfall" in the GUI. Oh well...