Spectrogram is a .NET library which makes it easy to create spectrograms from pre-recorded signals or live audio from the sound card. This library supports .NET Framework (4.5) and .NET Core (3.0).
Quickstart: The code below converts a WAV file to a spectrograph and saves it as an image. This code analyzed Mozart's Piano Sonata No. 11 in A major to produce the picture above.
var spec = new Spectrogram.Spectrogram(fftSize: 2048);
float[] values = Spectrogram.WavFile.Read("mozart.wav");
spec.Add(values);
spec.SaveImage("mozart.jpg");A demo program is included which monitors the sound card and continuously creates spectrograms from microphone input. It runs fast enough that the entire bitmap can be recreated on each render. This means brightness and color adjustments can be applied to the whole image, not just new parts.
This demo is available as a click-to-run EXE in /dev/compiled-demos/
This library may be useful for displaying QRSS signals. I added some QRSS audio to the /data folder to practice analyzing.
The image above is from 10 minutes of audio processed by the program below. The entire program took less than 2 seconds to run.
var spec = new Spectrogram.Spectrogram(
fftSize: 8192,
stepSize: 5000,
intensity: 2,
pixelLower: 1250,
pixelUpper: 1500
);
float[] values = Spectrogram.WavFile.Read("qrss.wav");
spec.Add(values);
spec.SaveImage("qrss.jpg");This demo program was created to demonstrate Spectrogram and ScottPlot working together.
render horizontally or verticallycreate bitmaps in real time from audio inputadvanced color (LUT) optionsadvanced intensity options (nonlinear scaling)- create a user control to display a spectrogram
- create a user control to adjust spectrogram settings
options for bitmap to scroll or to statically repeat- create a way to convert between frequency and pixel position
- optional display of axis labels (scales with ticks)
- Argo (website) - closed-source QRSS viewer for Windows
- SpectrumLab (website) - closed-source spectrum analyzer for Windows
- QrssPIG (GitLab) - open-source spectrograph for Raspberry Pi (C++)
- Lopora (website) - open-source spectrograph (Python 3)
- QRSS VD (GitHub) - open source spectrograph (Python 2)
- A spectrogram is an image
- A spectrograph is a machine
- Stop using the word spectrograph in software!




