Exploring Audio with 3D Visualization in Python
In recent days I’ve been experimenting with an approach to translate sounds into visual data structures, creating interactive plots that draw themselves in real time as the audio is played.
Technical flow:
Audio preprocessing (normalization and conversion to mono).
Spectral analysis with STFT (Short-Time Fourier Transform) to capture the evolution of frequencies over time.
Extraction of spectral features:
Spectral Centroid → the “center of mass” of the spectrum (related to the “brightness” of the sound).
Spectral Spread → dispersion around the centroid (how spread out the frequencies are).
Spectral Flatness → measure of tonality vs. noisiness (tonal sounds ≈ 0, noise ≈ 1).
Interactive 3D rendering with Plotly, where:
X-axis = time (s)
Y-axis = centroid (Hz)
Z-axis = spread (Hz)
Color = flatness (heatmap)
Integration with an player in HTML, so that the visualization is drawn in sync with the playback.
Practical applications:
Bioacoustics: analyzing bird songs and acoustic biodiversity
Audio engineering: noise characterization (e.g., engines, turbines, airplanes)
Music: live artistic visualizations during performances
Data science: exploring time–frequency relationships in complex signals
Tech stack: Python · NumPy · SciPy · Plotly · Google Colab
The result is an interactive, synchronized 3D graph that transforms any audio into a dynamic visual experience bridging science, technology, and art.
Here’s an example of the visualization:
