Spiralyst Lab logo Spiralyst Lab ← All gallery Scope · audio

Scope

Sound Broken Into Color

Live audio capture from Spiralyst Lab.

A spectrum analyzer breaks sound into its constituent frequencies, showing how much energy sits at each pitch — deep bass on the left, bright treble on the right. Where the oscilloscope shows sound in time, the spectrum shows it in frequency: the sound's fingerprint.

Fourier's Idea

Joseph Fourier's idea — that any signal, however complicated, can be rebuilt by adding together pure sine waves of different frequencies — sits underneath every spectrum analyzer. The spectrum mode runs that idea in reverse: it takes the incoming waveform and measures how much of each frequency is present, drawing a bar — or a curve — whose height is the energy at that pitch. A booming kick drum lights up the left; a crash cymbal shimmers across the right; a voice shows a cluster of peaks where its harmonics and formants live.

Your own ear does exactly this. The cochlea is a coiled frequency analyzer, its hair cells tuned from low pitches at one end to high at the other — so a spectrum display is, in a real sense, a picture of what your hearing is doing. That is also why the frequencies are often laid out logarithmically rather than evenly: each doubling of frequency is one musical octave, and a logarithmic axis gives every octave equal width, matching how we actually perceive pitch.

The transform that makes this possible in real time is the Fast Fourier Transform, and it runs constantly under the hood of the whole studio — the same frequency data that drives the audio-reactive fractals is exactly what these bars are drawn from.

The Math

$$X(k) = \sum_{n=0}^{N-1} x[n] \cdot e^{-i\,2\pi k n / N}$$

The discrete Fourier transform projects a block of \(N\) time samples onto sinusoids, producing one complex number \(X(k)\) per frequency bin \(k\).

$$\text{height} \propto |X(k)|$$

Each bar's height is the magnitude of that bin — how much energy the signal carries at that frequency. The phase is discarded; only loudness per pitch is shown.

$$f = f_{\min}\left(\frac{f_{\max}}{f_{\min}}\right)^{b/B}$$

In logarithmic mode the buckets are spaced by a constant frequency ratio from about 30 Hz to 20 kHz, so each octave occupies the same width — the way the ear hears it.

How Spiralyst Lab draws it

Spiralyst Lab reuses the frequency data the audio engine already computes — a 2048-point FFT delivered as byte-magnitude bins — so the spectrum mode adds no new audio cost. It groups those bins into the chosen number of bars, in linear or logarithmic frequency, normalizes them with the Gain control, and draws them as bars or a smooth curve. Auto-gain tracks overall loudness so the display breathes with the music, and the Width and Height controls let the bars fill any canvas shape.

Did you know?

The Fast Fourier Transform that makes this display possible was popularized by Cooley and Tukey in 1965 and is often ranked among the most important algorithms of the twentieth century. It quietly powers MP3 audio, JPEG images, Wi-Fi, and medical imaging.

Get Spiralyst Lab — $24.99/yr Scopes overview ← All gallery

Math typesetting on this page is rendered by KaTeX 0.17.0 (MIT).