A demonstration showing how several components can be compsed to build a simulated spectrogram
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bench Added in the hooks for the hires demo Aug 13, 2018
.gitignore First commit Jul 19, 2018


This project will contains a Verilator FFT to screen spectrogram demonstration. To build, type "make" in the main directory. This will build a file "main_tb" in the bench/cpp directory. Running that program will simulate the entire design, all the way from A/D to display output, all using Verilator. You will need to install Verilator and gtkmm to do this.

There's a pictoral overview of the project in the doc directory here, showing all of the components of this design. Most of those components can also be seen in the top-level simulatable file, as a processing flow that works its way through that file. Listed separately, these components are:

  1. A/D, 1Msps, taken from the wbpmic repository
  2. A filter, taking the A/D input at 1MHz down by a factor of 23x to 40kHz
  3. A hanning window function, drawn from the dblclockfft repository, that not only applies the hanning window but also creates an FFT overlap of 50%
  4. An FFT, if 1k points which should therefore yield about 43Hz resolution
  5. A very-rudimentary conversion to dB
  6. A controller to write the incoming data to screen memory
  7. Read from screen memory
  8. False colormap
  9. ... and the final component, the display. Since this is a verilator simulation, the actual display code is written in C++. It was also borrowed, this time from the vgasim repository

This project is in response to all of those students who keep asking how to do this on Digilent's forum(s), while believing that it is impossible to simulate their designs. In particular, this design can be completely simulated from A/D to video output. VCD files can be generated, which will tell you every trace within this design--useful for debugging. Many of the design components have also been formally verified, so include several of the FFT components.


This project is shared under the GPLv3 license. Please feel free to contact me if that license is insufficient for your needs.