From the time record
to the frequency spectrum.
A wave gauge records surface elevation through time. Fourier analysis asks which rhythms are present in that record. Follow one signal from sampled elevations to complex Fourier coefficients, then convert their squared magnitudes into a spectrum whose area measures variance.
A · Surface elevation at a fixed sensor
The dark line joins samples taken every 0.05 s; the coloured line isolates the selected known component. The vertical scale stays at ±1.75 m. At the default A-only phase, the crest, trough and 0.90 m crest-to-trough bracket appear on this graph. Optional orange zero-upcrossing lines separate complete waves for H1/3. This is a synthetic record.
B · Resolve the signal into sinusoidal components
C · FFT periodogram and the prescribed reference
The vertical markers sit at the inverse of each labelled period. Only Tp marks a highest component bar; the other two indicate moment-derived equivalent frequencies, not additional wave components. Each bar's area = a²/2 (m²), with fixed illustrative Δf = 0.010 Hz and S(f) in m²/Hz.
Turn on the FFT curve to see a finite-record estimate. The bars and reported Hm0/periods remain based on the exact prescribed components.
One component: one frequency bin and a perfectly repeating record.
This independent component experiment uses the prescribed zero level for crossings; Chapter 9 instead removes the finite sample mean before segmenting its record. The height Hm0 and periods are calculated from the prescribed variance distribution. H1/3 comes from complete individual waves in this finite sampled trace. Neither is a field observation. Tm02 is a spectral estimate, not the arithmetic mean of detected crossing periods.
For wave A, the crest is +0.45 m and the trough is −0.45 m: H = +0.45 − (−0.45) = 0.90 m.
The strongest bin is at 0.100 Hz; Tp = 1 / 0.100 = 10.00 s.
First define the spectral moments: m₀ = ∫S(f)df (total variance, the area under the spectrum), m₁ = ∫fS(f)df and m₂ = ∫f²S(f)df. Then Tm01 = m₀/m₁ and Tm02 = √(m₀/m₂). They use the whole spectrum, not just the highest bar.
An FFT is a calculation, not yet a spectrum.
The discrete Fourier transform compares the sampled signal with sine and cosine patterns at a set of frequencies. A complex coefficient records these two projections together: its magnitude describes the strength of the matching pattern and its argument describes phase. The fast Fourier transform is an efficient algorithm for computing exactly this transform. Panel B shows the known ingredients so that the result can be checked; the coefficient readout below it is calculated from the sampled signal, not copied from those ingredients.
To estimate variance density, first remove the sample mean, optionally taper the record, and then square and normalize the Fourier magnitudes. Combine matching positive and negative frequencies into a one-sided spectrum. Phase is absent from this density: two records can have the same underlying spectral variance but different arrangements of crests. For a short record, changing phase can also change leakage and its measured variance.
Read the spectrum as an area.
Variance is the average squared departure from the mean elevation. It measures the size of the fluctuations in m², not a crest-to-trough distance. In a spectrum, density times frequency width gives variance. A harmonic of amplitude 0.45 m contributes 0.45²/2 = 0.10125 m². Drawing that contribution in an illustrative 0.010 Hz-wide bin gives 10.125 m²/Hz. A narrower drawing bin would be taller without adding variance.
The zeroth moment m₀ counts every contribution equally. The first moment m₁ weights it by frequency; m₁/m₀ is the variance-weighted mean frequency. The second moment m₂ weights it by frequency squared, making it more sensitive to rapid oscillations and high-frequency noise. Thus Tm01 is the inverse mean frequency, whereas Tm02 is the inverse root-mean-square frequency. The latter relates to the mean interval between like-sense zero crossings for a stationary, differentiable Gaussian process; it is not an identity for a short deterministic record.
Derivation: coefficients, one-sided normalization and Parseval
Xk = Σn=0N−1 wn(ηn − η̄) exp(−i2πkn/M)
fk = k/(MΔt), U = (1/N)Σwn²
Ŝk = ck Δt |Xk|²/(NU)
Σk=0M/2Ŝk/(MΔt) = Σwn²(ηn−η̄)²/(NU)
Here ck = 2 for interior positive frequencies, and 1 at DC and Nyquist. N counts observed samples; M = 16,384 includes appended zeros. Rectangular weights are w = 1; the symmetric Hann taper is wn = [1 − cos(2πn/(N−1))]/2. Dividing by U corrects the taper's mean-square gain. For a rectangular window, the integral equals the demeaned sample variance with divisor N. For Hann it equals the window-weighted mean square divided by U, which need not equal the unweighted variance of this particular record. Mean removal before tapering does not guarantee zero DC after tapering.
For an unpadded rectangular DFT and an isolated, bin-centred sinusoid, a = 2|Xk|/N and φ = arg(Xk). Off-bin components, overlapping leakage and tapering require more care. A coefficient at a nearby padded bin is therefore not labelled as an exactly recovered physical component. All FFT-integral checks include the entire 0–10 Hz band; the figure zooms to 0.06–0.22 Hz.
Derivation: spectral moments and the illustrative bins
mn = ∫₀∞ fnS(f) df ≈ Σ fknSkΔf
Known discrete lines: mn = Σ finai²/2
Hm0 = 4√m₀; Tm01 = m₀/m₁; Tm02 = √(m₀/m₂)
The moment readouts use the exact line frequencies. The coloured 0.010 Hz rectangles are an area-preserving illustration, not an inferred bandwidth or an FFT grid. Integrating f² over a genuinely flat rectangle would add vΔf²/12 to its second moment; that artificial broadening is deliberately excluded. Period guides are placed at 1/T on the frequency axis and are not extra spectral peaks.
What can a finite record tell us?
Sampling and aliasing
At Δt = 0.05 s, the sampling frequency is 20 Hz and the Nyquist frequency is 10 Hz. Frequencies above Nyquist can masquerade as lower ones: a 19.9 Hz cosine sampled at 20 Hz has the same samples as a 0.1 Hz cosine of the same phase when that phase is zero. An analogue anti-alias filter must suppress unwanted high frequencies before sampling; an FFT cannot undo this ambiguity.
Duration and leakage
A 150 s observation has nominal Fourier spacing 1/150 ≈ 0.006667 Hz. A component that does not complete an integer number of cycles spreads across Fourier bins. Even a bin-centred sinusoid has sidelobes between those bins, visible on a zero-padded plot. Longer records narrow the spectral response, provided the sea state remains sufficiently stationary.
Windows and zero-padding
A Hann taper reduces the influence of the record's ends. It suppresses distant sidelobes but broadens the main peak, trading separation of nearby frequencies for reduced leakage. Appending zeros gives a finer plotting interval, here 20/16,384 ≈ 0.001221 Hz. It interpolates the same finite-record transform and creates no new observations or resolving power.
Uncertainty and changing seas
A raw periodogram of a random sea is a noisy estimate, even when the transform is exact. Averaging spectra from segments reduces sampling variability but sacrifices frequency resolution. Longer records can mix changing conditions, so duration, averaging and stationarity must be considered together. This five-component experiment demonstrates analysis errors and finite-record effects; it is not a stochastic confidence-interval model.
Experiment: does phase change a component's variance?
Add B, select it and change its phase to 180°. The record changes and the known variance bars stay fixed. Finite-record cross terms can change the estimated periodogram. For A and B alone over the default 150 s, both complete integer cycles, so their rectangular-window integrated variance remains 0.20250 m².
Experiment: where does leakage go when the record gets longer?
Add all five components and compare 150 s with 300 s. The nominal spacing halves, but not every component becomes bin-centred. Change to Hann and observe lower distant sidelobes with broader peaks. The reference moments do not change because the component amplitudes and frequencies have not changed.
Two lenses on the same motion.
Time domain: a zero-upcrossing analysis separates the record into individual waves. Each complete wave has a crest-to-trough height and a period. H1/3 is the average height of the highest third of those complete waves (top third rounded up for this short exercise).
Frequency domain: a variance-density spectrum describes how surface-elevation variance is distributed over frequency. The integral under S(f) is m₀, with units m². The widely used spectral significant wave height is Hm0 = 4√m₀.
Different period summaries: Tp is the inverse of the frequency at the largest spectral bin; Tm01 and Tm02 weight the whole spectrum, so they respond to changing frequency composition. Equal strongest bins produce a peak-frequency tie; this demonstration reports the lowest tied frequency.
Hm0 and H1/3 are not interchangeable identities. The former is derived from variance and commonly relates to significant heights under random-sea assumptions; the latter is a direct sample statistic. In a narrow-band linear Gaussian sea, the Rayleigh approximation brings the two close; breaking, nonlinearity and finite samples can change that relationship. Their difference is particularly clear for a single deterministic sinusoid, whose H1/3 is exactly 2a while Hm0 = 4a/√2.
Questions to test the model
- Start with A. Why is Hm0 larger than its single-wave height 2a?
- Add B. Which quantities increase, and why do we now have two equally high frequency bars?
- Add all five. Why do Tm01 and Tm02 respond even though the strongest frequency bin has not changed?
Go deeper: from bins to moments
How is a harmonic's variance converted into spectral density?
A sinusoid with amplitude ai has variance vi = ai²/2 in m² (averaged over complete cycles). A hypothetical flat bin of width Δf = 0.010 Hz has density Si = vi/Δf in m²/Hz. Changing a bin width changes the density height but not its area or variance.
The model sums exact known harmonic contributions. Computing a spectrum from an observed record instead requires frequency analysis, finite-record treatment and averaging. The chosen 0.010 Hz bins should not be mistaken for the resolution or output of an FFT of this trace.
Why do we integrate spectral moments?
m0 is total elevation variance. m1 and m2 shift the weighting toward higher frequencies. Here the exact discrete-harmonic expression Σfinvi supplies each moment. Tp = 1/fp is reported separately. These are frequency-based, not angular-frequency-based, moments.
Why can a short record disagree with spectral Hm0?
Because the fixed-phase five-wave record is deterministic and finite. Its beginning and ending waves may be incomplete, its measured heights depend on the phase pattern, and the prescribed harmonic variances represent component-wise long-time contributions rather than a finite-record variance estimator. The usual near-equivalence between Hm0 and significant individual-wave heights is a statistical approximation under appropriate random-sea conditions, not a mathematical identity.
Concepts and definitions follow Holthuijsen (2007), Waves in Oceanic and Coastal Waters, §3.5.1–3.5.4 (printed pp. 31–40), §4.2.2 (pp. 60–72), and Reeve, Chadwick & Fleming (2018), Coastal Engineering, §3.2–3.4 (printed pp. 73–88), with DFT/FFT context also supported by Holthuijsen Appendix C (spectral analysis, printed pp. 324–334). The distinction between wave-train and spectral analysis is also informed by CEM §II-1-3(c)(1–5), pp. II-1-77–88. All numbers and plots are original synthetic calculations. The coral FFT periodogram is calculated from the finite synthetic record; prescribed bars, spectral moments and reported Hm0/T values are not FFT-derived. Neither an averaged observational spectrum nor a statistically fitted spectrum is used.
Why do finite records give different variance estimates?
Start with components A, B and C in the wave experiment above (click + Add wave twice). Their prescribed, long-time variance is 0.247500 m². Sampling the same three waves for a finite duration and applying a window produces the following full-band estimates.
Synthetic A+B+C components at the original phases, sampled at Δt = 0.05 s. All variances are expressed in m².
| Method | Record | Variance (m²) |
|---|---|---|
| Component reference | Long-time harmonic sum | 0.247500 |
| Rectangular window | 150 s · 3,000 samples | 0.262648 |
| Hann window | 150 s · 3,000 samples | 0.258902 |
| Rectangular window | 300 s · 6,000 samples | 0.258954 |
| Hann window | 300 s · 6,000 samples | 0.247628 |
Reproduce the values: keep the original component phases, vary Record duration and Window, and compare with the full 0–10 Hz integral below the FFT plot. The visible frequency axis is zoomed; the reported integral includes the whole analysis range. For each record, the mean is removed; the Hann estimate is corrected by its mean-squared window amplitude U.
Observation duration
Δfnominal = 1/Tobs
- 150 s
- 0.006667 Hz
- 300 s
- 0.003333 Hz
Longer observations provide finer nominal frequency spacing. Finite-record estimates can still differ from their long-time reference.
Zero-padding
Δfgrid = 1/(16,384 × 0.05 s)
0.001221 Hz
Adding zeros produces a denser FFT plotting grid. It does not increase observation duration or independent spectral resolving power.
Interpretation: a Hann taper changes leakage and peak width, so its variance estimate need not match a rectangular estimate for a short, fixed-phase record. Increasing the number of samples does not guarantee monotonically decreasing error for a particular deterministic realization.
Reference: SciPy spectral-analysis guidance. The values above come from the published synthetic waves, not from measured buoy observations.
The frequency spectrum tells us how much variance belongs to each frequency but not which way it travels. An FFT of one elevation record alone does not supply this direction; additional directional measurements are required. In Chapter 12, explore what happens when a normalized directional spreading function is prescribed for each frequency.
One energy accounting system, two distinct wave heights
The time-mean total mechanical energy per unit horizontal sea area of a small-amplitude regular wave is E = ρgH²/8. For an irregular elevation-variance spectrum Sη(f), use m0 = ∫Sη(f)df, E = ρgm0 = ρgHm0²/16, and Hm0 = 4√m0. Both energies are in J m−2, with water density ρ (kg m−3) and gravity g (m s−2). These relationships assume linear gravity-wave energetics and consistent one-sided spectral normalization.
The common numerical label “2 m wave height” is insufficient to specify energy until its definition is given. In shallow-water shoaling and wave-action calculations, carry S(f,θ), m0 and their units consistently. For the no-current, normal-incidence regular-wave example, the conserved flux is E Cg (W m−1), where Cg is group speed (m s−1).
Scientific basis: Holthuijsen (2007), §§3.5, 5.5; Bosboom & Stive (2023), §§3.4, 5.2.1. Original numerical comparison; no published figure reproduced.