Skip to content

xdsopl/spectrum

Repository files navigation

spectrum - quick an dirty spectrum analyzer
Written in 2012 by <Ahmet Inan> <xdsopl@googlemail.com>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.

spectrum ist written from scratch and is held deliberately simple.
this means you have to look into the source and change the code to your needs.

you will find 2 implementations for spectral analysis:
- the STFT (short time fourier transform) for equispaced frequency bins.
- the CQT (constant q transform) for logarithmically spaced frequency bins.
please read "An efficient algorithm for the calculation of a constant Q transform" by Judith C. Brown and Miller S. Puckette.

with time i will add some more luxuries but for the moment:
- you can press SPACE to pause.
- you can press l to toggle linear / logarithmic power view
- you can press o to toggle linear / logarithmic frequency view
- you can press n to toggle view normalization
- you can press r to toggle rainbow colors / black white gradient
- you can open alsa devices and 16bit wav files.
- you can trade time resolution with frequency resolution by changing the parameter to the gauss window.

compile everything:
# make

look at spectrum of an audio file:
# ./spectrum audio.wav

look at spectrum recorded from default alsa device:
# ./spectrum

look at spectrum recorded from alsa device plughw:0,0:
# ./spectrum plughw:0,0

About

quick and dirty spectrum analyzer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published