M06 · Mathematics alongside
Frequencies, phase and scale
A stripe pattern has a spatial frequency. Its position is encoded by phase, not only spectrum brightness.
Mathematical support for the textbook chapters: start with a small calculation, then an interactive example and precise definitions.
Work through a small example
The row 3, 1, 3, 1 is a constant background plus an alternating pattern. What are their contributions?
- Constant background
- Alternating-pattern weight
- Reconstruct
Coefficient 1 measures the presence of the selected pattern. A constant row has zero contribution from this pattern because positive and negative products cancel. An image uses patterns along two coordinates.
A complex number stores magnitude and angle
Number can be drawn as an arrow with length |z| and angle arg z. Euler's formula gives . Fourier transforms use this for periodic-pattern magnitude and phase. At zero magnitude phase is undefined; its color must not imply a signal.
Spatial frequency is cycles per pixel or per physical length. The same pattern with a different pixel size has a different physical frequency. Zero frequency is the constant component; shifting an image changes phases while preserving magnitudes under a periodic model.
Change phases while retaining amplitudes. The amplitude spectrum stays fixed while detail locations can change: magnitude and angle carry different information. This example is not an interactive proof of Parseval's identity or every Fourier property.
Same magnitude, different phase
Shift the stripe phase. Then remove phase in the inverse transform.
Exact values are in the point inspector
Blue − · white 0 · red +; scale -0.3…0.3
- Mean + x variation + y variation
Exact values are in the point inspector
Grayscale 0…1: black to white.
Inspect the selected point
What the plot shows
The image line marks this same row. Select a higher or lower point to move the cross-section; compare values at the same column.
- Mean
- x stripe
- Sum
- Selected column: 8
Shifting stripes barely changes their spectral magnitudes. Phase sets their position; zeroing phase changes the image while retaining magnitudes.
Parameters and details
Assembly: mean + horizontal stripe + vertical stripe. A contribution's sign determines whether brightness is added or subtracted. Phase shifts stripes without changing amplitude. Empty phase cells have zero coefficients, whose phase is undefined.
Select an image point. Arrows move it; Home and End reach row edges. Viewing does not change the calculation.
Changing the example requires JavaScript and Canvas. Computed images remain available above.
DFT requires a normalization convention
Definitions and details
For N samples choose , with inverse factor . In two dimensions the inverse factor is . FFT is a fast algorithm for the same DFT, not a different transform.
With this convention, Parseval gives . Real signals have conjugate frequency pairs. Editing only one coefficient can produce a complex inverse. Displaying only its real part without explanation hides the changed problem.
Frequency convolution needs matching boundaries
Definitions and details
Multiplying DFTs corresponds to circular convolution. Linear convolution of finite arrays needs enough zero padding and aligned kernel placement; in 1D the length is at least N+M−1. Edge repetition, reflection and circular extension are different operators.
A sharp frequency cutoff can create ringing near edges. A low-pass filter smooths detail; a high-pass filter emphasizes changes and noise. Spectrum magnitudes are often log-scaled only for display: log-scaled values must not be substituted as original coefficients.
Localization and frequency resolution trade off
Definitions and details
A global sinusoid specifies frequency precisely but not a local event's position. Windowed transforms and wavelets localize contributions at a cost to frequency resolution. A precise uncertainty bound depends on definitions and normalization; it is not a claim that accuracy is impossible.
A Gaussian pyramid repeatedly smooths and downsamples. A filter bank splits a signal into bands; exact reconstruction needs compatible filters and boundaries. Haar wavelets separate a pair's average and difference, but coefficient images are not ordinary photographs.