A real-time retro-style spectrum analyzer with CRT glow aesthetics, logarithmic band distribution and smooth dBFS visualization.
Designed for music sessions, stream overlays and pure visual enjoyment.
Spectralux is a real-time audio spectrum analyzer built with Python, Pygame, NumPy and SoundCard.
It captures system loopback audio, performs FFT-based spectral analysis with proper dBFS normalization, and renders a retro-inspired visual interface with:
- Logarithmic frequency bands
- Waveform display
- CRT-style glow
- Scanlines and vignette
- Dynamic layout scaling
- Real-time loopback capture (WASAPI tested on Windows)
- Logarithmic frequency band spacing
- Proper dBFS normalization
- Adjustable attack / decay smoothing
- Peak hold markers
- Configurable FFT size and sampling rate
- Retro CRT glow simulation
- Optional waveform with trail persistence
- Scanlines and vignette effects
- Fully resizable window
- Dynamic layout split (header / waveform / spectrum)
- Parameter-driven visual tuning
Currently optimized and tested on:
- Windows (WASAPI loopback)
Other platforms may work depending on audio backend support in
soundcard, but Windows is the primary target at the moment.
An installer script is included for convenience:
install-and-run.bat
This script:
- Creates a virtual environment (
.venv) - Installs required dependencies
- Launches the application
No manual setup required.
- Python 3.9+
- pygame
- numpy
- soundcard
git clone <your-repo-url>
cd spectrum-analyzer
Windows
python -m venv .venv
.venv\Scripts\activate
Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python src/spectralux.py
Controls:
- F → Toggle fullscreen\
- ESC → Exit
All visual and audio parameters are configurable directly inside the source file.
You can adjust:
- Number of bands
- Frequency range
- dB display range
- Glow intensity
- Attack / decay behavior
- Scanline density
- Waveform appearance
- Layout proportions
The entire visual style is parameter-driven and easy to tweak.
The UI consists of:
- Fixed header area\
- Waveform area (percentage-based)\
- Spectrum analyzer area (remaining space)
The layout dynamically adapts to window resizing while preserving proportions.
- Segment height automatically adjusts if the window becomes very small.
- The spectrum plot is clamped to stay within its allocated area.
- Designed as a visually pleasing analyzer rather than a scientific measurement tool.
MIT License
Copyright (c) 2026 Alexander Stroschke
