Save resource to class

Loading your classrooms…

Sign in to save

Bookmark this page so you can find it later.

LivePhysics staff accounts use their usual sign-in provider below.

Sign in to save

Bookmark this page so you can find it later.

LivePhysics staff accounts use their usual sign-in provider below.

Report an Error

Reported page · Lab

Fourier Transform Audio Visualizer

/labs/fourier-audio-visualizer/

This helps us reproduce what you saw. Clear the link to leave it out.

or drop them here

Up to 3 images or PDFs, 5 MB per file. 0 of 3 attached.

Fourier Transform Audio Visualizer

Pick a wave shape and see its harmonics as bars, then select Start to hear the tone or analyze your voice, an instrument, or any ambient sound through the microphone.

SineSquareSawtoothTriangleWave over 10 ms0.50−0.50510 msHarmonics from 20 Hz to 8 kHz, log axis20501002005001k2k5k00.30.61Frequency440 HzVolume0.15

Frequency 440 Hz, volume 0.15, sine wave

Sine wave at 440 Hz, volume 0.15. A sine wave has only the fundamental, one frequency.

The wave panel always shows 10 ms between plus and minus 0.5. Bars share one scale from 0 to 0.65 and show harmonics 1 to 16 up to 20 kHz. The live spectrum below uses decibels, so quiet harmonics look taller there. The live analyser's peaks can read a little lower than these ideal bars, because the browser's built-in waves are not perfectly ideal.

Source

Start plays the oscillator's tone at the volume you set.

Wave shape
Frequency (Hz)
Volume (gain)
Music presets
Frequency scale
Min freq (Hz)
Max freq (Hz)
FFT size (samples)
Live displays

Live analyser

Waveform (time domain)
Spectrum (frequency domain)
Spectrogram (frequency vs time)

Analysis

Source
oscillator
FFT size
2048
Resolution
After Start
Dominant frequency
After Start
Sample rate
After Start

The yellow line on the live spectrum marks the loudest frequency. Change the wave shape while the tone plays to hear and see the harmonics change.

Reference Guide

The Fourier Transform

Any periodic signal can be decomposed into a sum of sines and cosines.

X(f)=∫−∞∞x(t) e−2πift dtX(f) = \int_{-\infty}^{\infty} x(t)\, e^{-2\pi i f t}\, dt

The browser uses the discrete fast Fourier transform (FFT) operating on short windowed buffers of the audio waveform.

Harmonic Series

Real instruments produce a fundamental plus integer-multiple harmonics

fn=n⋅f0,n=1,2,3,…f_n = n \cdot f_0,\quad n = 1, 2, 3, \ldots

A square wave contains only odd harmonics. A sawtooth contains all harmonics. A pure sine has only the fundamental.

FFT Size and Resolution

The frequency resolution is the sample rate divided by the FFT size

Δf=fsN\Delta f = \frac{f_s}{N}

A 2048-point FFT at 48 kHz gives ≈ 23 Hz resolution. Larger FFT = finer frequency detail but coarser time resolution. This is the time-frequency uncertainty principle.

Speech and Music

Human voices typically span 80 to 1000 Hz fundamentals plus harmonics out to 8 kHz. Vowels have characteristic formant patterns.

Concert A is 440 Hz. Doubling the frequency raises a note by one octave.

The spectrogram sits below the live spectrum. New columns enter on the right and scroll to the left, so it shows how the spectrum changes over time. It stays off when your device asks for reduced motion.

Related Content