Rhythm Fourier Web 1.0.2

Explore changes in audio amplitude through Fourier analysis.

This browser edition of Rhythm Wave Lab 2 extracts instantaneous amplitude from audio, then analyzes its variation over time. Frequency here means the rate of amplitude change, rather than musical pitch. Two repetitions per second are 2 Hz, or 120 BPM equivalent. Amplitude variations caused by interference between sounds are included.

Getting started

  1. The page loads and analyzes rhythms2.wav automatically.
  2. Press Play. Audio never starts automatically.
  3. Use each graph's selectors to choose a target and Current Position or Whole Audio.
  4. After editing settings in the sidebar, press Analyze / Apply.

Choose your own file with Open Audio. The range dialog clips the chosen interval for playback and analysis without modifying the original file. The clipped timeline starts at zero. The source interval is recorded in the header, projects and numerical exports. Space toggles playback when focus is outside a control.

Graph targets

TargetContents
Audio & Instantaneous AmplitudeBlue: mono audio. White: instantaneous amplitude. Gray: negative amplitude guide.
Instantaneous Amplitude SpectrumCurrent Position uses STFT; Whole Audio uses an FFT of the complete selected interval. The dashed marker is the applied quarter-note tempo (BPM / 60 Hz).
Fixed FrequencyEvaluates the requested frequency exactly. Time Waveform overlays white amplitude on the left axis and the orange coefficient on the right axis. Phase shows a circle at the current position or a phase history for the whole interval.
Base Frequency — HarmonicsInteger multiples of a fundamental defined by tempo, meter and note length. Note glyphs label each component's period.

Complex coefficients can be shown as magnitude, magnitude with phase hue, real part or imaginary part. Hue starts at red for zero phase and increases with positive phase. Phase is treated as invalid at magnitudes at or below 0.1% of that trace's maximum, or 10−15. Phase histories are disconnected at invalid samples and wrapping boundaries.

Single, two-panel and four-panel layouts retain independent selections while switching between layouts. The default is a single harmonics graph; other layouts start empty. Units, time span, frequency limits, logarithmic frequency axis and Auto Y-range are independent per panel. Frequency limits are entered in Hz; BPM equivalent multiplies the displayed frequency by 60. Click a time axis to seek.

Base / Harmonics

Tempo is measured in quarter notes per minute. For a p/q meter, the period of one bar is T=(p/q)×240/BPM seconds. If the chosen note has length b relative to a whole note, T=b×240/BPM. Harmonic n is evaluated at n/T Hz. Orders beyond the analysis frequency limit are omitted.

Tempo is not detected automatically. Note glyphs label periods and do not establish which notes were played. Hover over a harmonic to see its frequency and period.

Defaults: 110 BPM, 4/4, one bar, 32 harmonics. Fixed Frequency defaults to 110 BPM equivalent. Loading rhythms2 sets tempo to 110; loading stone sets it to 128. Subsequent manual edits are allowed and are not reset by reanalysis.

Fourier settings

SettingDefault and effect
Smoothing σ0 seconds. Gaussian smoothing of instantaneous amplitude.
Normalize by mean amplitudeOff. When enabled, sets the mean amplitude to 1.
STFT window / time step4 seconds / 0.05 seconds. A longer window separates nearby frequencies more clearly but averages changes in time. A larger step reduces computation.
WindowHann; Gaussian is also available.
Zero-padding1×; 2× and 4× increase frequency sampling density, not the resolving power of the original time window.
Analysis limit40 Hz; maximum 200 Hz.
Whole-audio windowHann; rectangular is also available.
Subtract mean / remove DCBoth enabled.

Mathematical convention

Channels are averaged arithmetically to mono x(t). A finite Hilbert FIR provides the quadrature component H[x].

A(t) = √(x(t)² + H[x](t)²)
Z(t₀, k) = Σⱼ (A(t₀ + uⱼ) − mean) wⱼ exp(−2πi k uⱼ) / Σⱼ wⱼ
F(k)     = Σⱼ (A(tⱼ) − mean) Wⱼ exp(−2πi k tⱼ) / Σⱼ Wⱼ

Mean is zero when subtraction is disabled. The phase reference is the window center for STFT and the clipped interval's beginning for the whole FFT. Positive-frequency complex coefficients are shown without a factor-of-two correction. Fixed frequencies and harmonics are evaluated at their actual frequencies, without snapping to FFT bins.

The Hilbert FIR has approximately 0.683 seconds of support and a Kaiser window with β=12. Low-pass filtering retains an observation band through 200 Hz before decimation to approximately 1024 Hz. Audio and analysis windows use reflected boundaries, which influence results near edges. Opposite-phase channels may cancel when averaged to mono.

Projects and exports

A self-contained .irhythm project includes the clipped audio, amplitude, analysis, applied settings and panel configurations. It can be exchanged with desktop v0.5.3. Unapplied edits are not saved. Range changes after opening a project are limited to its stored audio; reopen the original file to extend beyond it.

CSV / NPZ exports preserve real and imaginary coefficients, magnitudes, valid phases, actual axes, settings and source interval. Read NPZ using NumPy's np.load(path, allow_pickle=False). SVG / PNG export the chosen graph, including horizontally scrolled harmonics outside the visible viewport.

Browser-specific behavior

Publishing

Extract the publishing ZIP and upload its contents with their directory structure intact. Keep index.html, assets/ and samples/ together. In the repository's Settings → Pages, select Deploy from a branch, main and /(root), then Save. Alternatively, place everything in docs/ and choose /docs. No build step is required. See GitHub's publishing-source guide.

For local development, serve this directory with python -m http.server 8000 and open http://localhost:8000/. Visitors to the published website do not need Python or FFmpeg.

Rhythm Fourier Web 1.0.2 · Analysis based on Rhythm Wave Lab 2 v0.5.3. fflate 0.8.2 (MIT) is bundled locally. Third-party notice.