FOURIER/ LAB

SIGNALS, TAKEN APART.

Complex shapes.
Simple waves.

Every periodic signal has a frequency story. Draw a shape, separate its harmonics, and see what it takes to put it back together.

Explore the mathematics ↓

TIME DOMAIN

Square wave

A discontinuity, built from smooth waves.

256 SAMPLES / PERIOD
Input samplesReconstruction
Normalized time t / periodt = 0.250
ROOT MEAN SQUARE ERROR—

on the 256 sample points

RECONSTRUCTED ENERGY—

relative to input mean-square energy

INPUT MEAN / DC—

the zero-frequency component

FREQUENCY DOMAIN

The ingredients

Select a frequency to inspect or mute it.

IncludedOutside cutoff / mutedHeight = input amplitude
AMPLITUDE—
PHASE · RADIANS—
INPUT ENERGY SHARE—

PHASE IN MOTION

Rotating into place

0.250

The horizontal projection adds to DC to give the reconstructed signal at the marked time.

WHAT TO LOOK FOR

The edge tells the story.

PARSEVAL CHECK—

Difference between time-domain and frequency-domain mean-square energy.

TRY THISCompare 8 and 32 harmonics. Then switch to Fejér averaging to trade sharpness for smoother transitions.

A SMALL WINDOW INTO THE MATH

One signal.
Two descriptions.

This lab computes a normalized discrete Fourier transform directly. No server, external dataset, or approximate animation drives the numbers.

Ck = 1/N ∑ xj e−i2πkj/N

Each coefficient measures alignment with a complex sinusoid. For real input, positive and negative frequencies pair up; amplitude is 2|Ck| except at DC and Nyquist.

x̂(t) = w0C0 + ∑ wkAk cos(2πkt + φk)

Partial sums use weights of 1 through the cutoff K. Fejér averaging uses wk = 1 − k/(K + 1), gently reducing high-frequency components. Muting sets a weight to 0, including DC if selected.

Numerical conventions & limits

256 uniformly spaced samples cover [0, 1), with a periodic boundary. Frequencies are cycles per period, not hertz without a physical sampling rate. DC and the Nyquist bin each contribute |C|² to mean-square energy; other one-sided bins contribute 2|C|². Phase is undefined for zero-amplitude components.

RMSE is evaluated at sample positions. Energy shown is the reconstructed mean-square energy divided by input mean-square energy; a zero signal has no defined energy percentage. Connecting sampled input points does not reveal an underlying continuous signal. The DFT cannot recover information lost to aliasing.

Drawing edits individual samples with interpolation between pointer positions. Text controls accept equally spaced values and resample them periodically. Exports contain the actual computed values, coefficients, and reconstruction weights.