SkillAgentSearch skills...

SpectrumAnalyzer

Not yet another spectrum analyzer — an experimental DSP & graphics playground. It combines real-time C++ performance with Python flexibility, offering fully customizable FFT visualizations without recompilation. Perfect for audio engineers, DSP researchers, graphics developers, students, and hobbyists.

Install / Use

/learn @sylwekkominek/SpectrumAnalyzer

README

SpectrumAnalyzer

Description

SpectrumAnalyzer is a real-time frequency spectrum visualization tool written primarily in C++ for data processing and rendering, with optional Python-based audio acquisition.

By default, the application captures audio via PortAudio, computes its frequency spectrum using FFT, and visualizes it using OpenGL. It supports multiple input sources, including microphones and system playback audio (e.g., Spotify, YouTube).

The architecture is flexible — although processing and visualization are done in C++, audioConfig.py lets users replace the default input with any Python-defined source, such as playback streams, virtual devices, or custom sensors.

The app allows you to customize parameters — such as bar count, frequency ranges, and colors — using simple text configuration files stored in the config folder.

If something goes wrong, you can delete a file or the entire folder, and the app will recreate default settings. Each configuration file includes a description of its purpose. You can also create your own custom color themes if the default ones are not enough. For additional help, you can copy the file contents into ChatGPT for guidance.

SpectrumAnalyzer is useful for learning, signal analysis, experimentation, and entertainment — whether analyzing live microphone input, playback audio, or other types of signals. This project is licensed under the GNU General Public License v2 (GPLv2).

It also uses the following third-party libraries:

  • PortAudio – MIT License
  • glText – zlib License
  • FFTW – GNU General Public License v2 (GPLv2)

A ready-to-download version for Windows is available here:


Full documentation is available in the Wiki: https://github.com/sylwekkominek/SpectrumAnalyzer/wiki

<img width="1308" height="578" alt="Screenshot from 2026-02-22 15-48-11" src="https://github.com/user-attachments/assets/8cd85afe-9097-49ff-badf-b50a3f4afcfa" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 15-49-38" src="https://github.com/user-attachments/assets/75e24b74-38a9-48e8-823d-94c5addb50f0" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 15-51-12" src="https://github.com/user-attachments/assets/a4807e57-f707-413a-afb9-820872229edc" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 15-51-35" src="https://github.com/user-attachments/assets/2d7574ff-a860-42a7-96f7-3ada8bc3d9be" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 15-52-50" src="https://github.com/user-attachments/assets/0ecc22ea-ce0d-4695-9669-af548b2229e9" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 15-53-17" src="https://github.com/user-attachments/assets/44635e40-92f1-46e4-827a-c7a2a8329fd6" /> <img width="1308" height="578" alt="Screenshot from 2026-02-22 16-00-45" src="https://github.com/user-attachments/assets/beabc067-7627-4fa9-bf95-6affd2f24b11" />

For programmers:

For typical users: Ubuntu 24.04 or Windows 11 with WSL2.

sudo apt update && sudo apt install -y g++ cmake python3 python3-dev libglfw3-dev portaudio19-dev libfftw3-dev pkg-config git

git clone https://github.com/sylwekkominek/SpectrumAnalyzer.git

Compilation and running:

cd SpectrumAnalyzer && mkdir build && cd build && cmake .. && cmake --build . -j 4

(This step is only required for Raspberry Pi users: export MESA_GL_VERSION_OVERRIDE=4.5)

./spectrum-analyzer

do not forget to configure your input audio device By default, the application runs in fullscreen mode with a resolution of 1920x1080 (Full HD). You can change this resolution by editing the config.py file.


For typical users: Windows

Download and install msys2 from https://www.msys2.org/#installation

Open msys2 terminal and run:

 pacman -Syu

Close msys2 terminal and reopen it

pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-python mingw-w64-x86_64-fftw mingw-w64-x86_64-glfw mingw-w64-x86_64-portaudio git

Compilation and running:

If you are using a newer Python version, you need to specify a different folder name.

export PATH=/C/msys64/mingw64/bin:$PATH
export PYTHONHOME=/C/msys64/mingw64
export PYTHONPATH=/C/msys64/mingw64/lib/python3.12:/C/msys64/mingw64/lib/python3.12/lib-dynload

git clone https://github.com/sylwekkominek/SpectrumAnalyzer.git
cd SpectrumAnalyzer && mkdir build && cd build && cmake .. && cmake --build . -j 4
./spectrum-analyzer

For advanced users:

Compilation of unit tests and running:

sudo apt update && sudo apt install -y libgtest-dev libgmock-dev
cd SpectrumAnalyzer && mkdir build && cd build && cmake .. -DENABLE_TESTS=ON && make -j4 && cd tests
./spectrum-analyzer-tests

Docker - Running an App with Microphone

Depending on your system configuration, you may need to adjust the Docker arguments (especially for GUI and audio support).

cd SpectrumAnalyzer

docker build -t spectrum-analyzer -f docker/spectrum-analyzer/Dockerfile .

xhost +local:docker

docker run  -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix   --device /dev/dri  --device /dev/snd   spectrum-analyzer

Docker - Running an App with Audio Loopback

Depending on your system configuration, you may need to adjust the Docker arguments (especially for GUI and audio support).

cd SpectrumAnalyzer

docker build -t spectrum-analyzer-loopback -f docker/spectrum-analyzer-loopback/Dockerfile .

xhost +local:docker

docker run -it --device /dev/dri --device /dev/snd -v /tmp/.X11-unix:/tmp/.X11-unix -v $XDG_RUNTIME_DIR/pulse:/run/user/1000/pulse -e DISPLAY=$DISPLAY -e PULSE_SERVER=unix:/run/user/1000/pulse/native spectrum-analyzer-loopback

Docker - running tests

cd SpectrumAnalyzer

docker build -t spectrum-analyzer-tests -f docker/spectrum-analyzer-tests/Dockerfile .

docker run spectrum-analyzer-tests
View on GitHub
GitHub Stars32
CategoryProduct
Updated8d ago
Forks1

Languages

C++

Security Score

95/100

Audited on Mar 23, 2026

No findings