The Spectral Habit · Part 1

Fourier: When Waves Are The Right Coordinates

The Fourier transform is not a machine for making graphs spiky. It is a way to describe a signal by the simple patterns that survive shifting.

Transform View Fourier Interactive

A signal drawn over time looks like a sequence of values: high here, low there, flat for a while, sharp in the middle. That view is honest, but it is not always the view in which the signal is easiest to understand.

01A signal is a hard way to see a mixture

Imagine hearing a chord on a piano. The pressure wave that reaches your ear is one wiggling curve. If you only stare at that curve, the chord is tangled: every instant contains the combined effect of several notes.

Your ear does not experience the chord as an arbitrary wiggle. It hears pitches. It hears that some notes are loud, some are soft, and some are missing. The Fourier view formalizes that move. It asks for the ingredients that make the wiggle, not just the values the wiggle takes.

This is already the central habit. The original coordinates say what is the signal doing at each time? Fourier coordinates say how much of each frequency is present?

02Why waves are special

Fourier uses sine and cosine waves because they behave cleanly under shifting, differentiation, and many physical systems. If you shift a sine wave, it is still the same frequency. If you differentiate it, it is still a wave of the same frequency. If you pass it through many linear filters, it does not turn into five other frequencies; it usually comes out scaled and delayed.

That makes waves good coordinates. They are not good because nature secretly draws everything with perfect sinusoids. They are good because many operations treat each sinusoid independently.

The useful sentence

A Fourier transform is useful when the operation you care about mixes time samples together but treats frequencies separately.

03What the transform asks

For a continuous signal, the Fourier transform compares the signal against every possible frequency. For each frequency, it asks: if I line up a wave of this frequency against the signal, how much agreement is there?

The formal version looks compact:

X(f) = ∫ x(t) e-2πift dt

The exponential is a rotating wave. The integral is a long accumulation of agreement. If the signal contains that frequency, the rotations line up often enough to leave a large value. If it does not, the positive and negative parts mostly cancel.

The transform is therefore not a decoration placed on top of the signal. It is a change of coordinates. The same object is being described in a basis made from waves.

04A small playground

The fastest way to make Fourier less mystical is to build a signal out of a few waves and then remove some of them. The top plot below is the time-domain signal. The bars show the three frequencies that created it. The pale line is what remains after a low-pass filter keeps only frequencies at or below the cutoff.

Build a signal from waves
The filter keeps low frequencies first.
signal filtered spectrum

When the cutoff is low, the sharp little ripples disappear first. That is not because they are less real. It is because they live in high-frequency coordinates. Filtering becomes a choice about which coordinates to keep.

05The trick with convolution

The Fourier transform becomes indispensable when a problem contains convolution. Convolution is what happens when an output value is formed by blending many neighboring input values. Blurring an image, smoothing a signal, and passing audio through a simple linear system are all convolution-shaped operations.

In the original view, convolution is spread out: each output sample depends on a neighborhood of input samples. In the Fourier view, the same operation becomes pointwise multiplication. Each frequency is scaled by the filter's response at that frequency.

time domain: y = x * h
frequency domain: Y(f) = X(f) H(f)

This is the first big reason the transform view matters. It turns a mixing operation into an independent-coordinate operation. The signal did not become simpler in some moral sense. It became simpler relative to the operation we wanted to perform.

06The code version

In code, the finite version is the discrete Fourier transform. You usually call a fast implementation, but the story is the same: convert samples into frequency coordinates, edit those coordinates, then come back.

import numpy as np

n = 512
t = np.linspace(0, 1, n, endpoint=False)

signal = (
    1.0 * np.sin(2 * np.pi * 3 * t) +
    0.6 * np.sin(2 * np.pi * 13 * t) +
    0.3 * np.sin(2 * np.pi * 40 * t)
)

spectrum = np.fft.rfft(signal)
freqs = np.fft.rfftfreq(n, d=1 / n)

keep = freqs <= 15
filtered_spectrum = spectrum * keep
filtered = np.fft.irfft(filtered_spectrum, n=n)

The important line is not the FFT call. It is spectrum * keep. The filter is easy because the transform chose coordinates where frequency components can be kept, shrunk, or removed independently.

07What to carry forward

Fourier is often taught as a formula before it is taught as a habit. The habit is simpler: when the time-domain description makes the problem feel tangled, ask whether waves are the coordinates that make the operation clean.

This does not mean every transform is secretly Fourier. DCT changes the boundary story: finite data often behaves better when it is reflected instead of repeated. Laplace changes the time story: systems with decay, growth, and initial conditions need more than pure frequency.

But the question will return. What are the simple behaviors here? What coordinates does the operation treat independently? Fourier's answer is waves. The rest of the series is about learning when another answer is better.

Next in the series: DCT, where the world is finite, edges matter, and cosine tiles become the natural language of an image block.