**Page updated:**
March 20, 2021 **Author:** Curtis Mobley

View PDF

# Surfaces to Spectra: 1D

This page uses a contrived example to illustrate the preceding theory for a one-dimensional (1D) surface. Detailed comments on this simple example emphasize the mathematical subtleties and physical characteristics of Fourier transforms and wave variance spectra derived from surface elevations. A thorough understanding of this example takes us much of the way to understanding the case of a real ocean surface.

An ad hoc, one-dimensional wave proﬁle is constructed using the formula

The ${x}_{r}$ locations are given by $r\Delta x=rL\u2215N$, where $L$ is the length of the sea surface region being sampled and $N$ is the number of samples. ${\nu}_{f}=1\u2215L$ is the fundamental spatial frequency, that is, the spatial frequency or wavenumber of the wave with a wavelength of $L$. The amplitude of the wave at the ${j}^{th}$ frequency, $j=1,2,...,N\u22152$, is chosen to be

$$A\left(j\right)=0.1exp\left(-3j\u2215N\right)\phantom{\rule{0.3em}{0ex}},$$ |

and $A\left(0\right)=0$. The phase of the ${j}^{th}$ wave component is randomly distributed over $\left[0,2\pi \right)$ using

$$\varphi \left(j\right)=2\pi \mathcal{\mathcal{U}}$$ |

where $\mathcal{\mathcal{U}}$ is a uniform $\left[0,1\right)$ random number. A diﬀerent random number is drawn for each $j$ value.

The upper left panel of Fig. 1 shows the surface generated in this manner for $L=10\phantom{\rule{2.6108pt}{0ex}}m$, $N=16$, and a particular set of random phases. Note that $N$ is a power of 2 as will be needed for the FFT. The thin colored lines show the $N\u22152+1=9$ waves for each of the frequencies. The blue line is the wave for the fundamental frequency ${\nu}_{f}=1\u2215L=0.1\phantom{\rule{2.6108pt}{0ex}}{m}^{-1}$; the thin black line is the two-point wave at the Nyquist frequency ${\nu}_{Ny}=1\u2215\left(2\Delta x\right)=0.8\phantom{\rule{2.6108pt}{0ex}}{m}^{-1}$; the purple line is the constant $j=0$ wave, which is set to $z=0$ for the mean sea surface. The black dots connected by the thick black line show the sum of the individual waves. These points represent a discrete sampling of the continuous sea surface elevation.

In this example, the sampled region of the sea surface is $L=10\phantom{\rule{2.6108pt}{0ex}}m$ in length, but the $N=16$ samples do not include the point at $x=10\phantom{\rule{2.6108pt}{0ex}}m$. This is because the surface elevation at $x=L$ is always the same as at $x=0$ when using Fourier techniques. Resolving the surface as a sum of sinusoids that are harmonics of the fundamental frequency ${\nu}_{f}=1\u2215L$ gives sinusoids that always return to their initial value after distance $L$. Real sea surfaces are of course not periodic, but we do not know the true value at $L$ because it was not measured by the present sampling scheme. (Likewise, we do not know the true surface elevations at points in between the sampled locations.) When we use Fourier techniques to generate random surface realization, we are always generating a sea surface that is a periodic tiling; the tile dimension is $L$. This periodicity is useful if we want to generate a visual rendering of a large region of sea surface from a smaller computed region; the edges of the small tiles will match perfectly and the larger surface will often look reasonable, if you don’t look too closely. An example of a tiled two-dimension surface can be seen in Fig. 3.9 of Mobley (2016).

We now take the sequence of the $N=16$ real wave elevations $z\left(r\right)$ seen in Fig. 1 and feed them into an FFT routine. We soon get back 16 complex numbers, the $\u1e91\left({\nu}_{u}\right)=\u1e91\left(u\right)$ Fourier amplitudes, at a set of 16 corresponding frequencies ${\nu}_{u}$. The upper right panel of Fig. 1 plots the real part of the $\u1e91\left(u\right)$ complex numbers, and the lower-left panel plots the imaginary part.

Note ﬁrst that the FFT routine returned both negative and positive spatial frequencies:

$$\nu =\left(-\frac{N}{2}+1\right)\Delta \nu =-0.7\phantom{\rule{1em}{0ex}}{m}^{-1},...,-0.1,0,0.1,...,\frac{N}{2}\Delta \nu =0.8\phantom{\rule{2.6108pt}{0ex}}{m}^{-1}\phantom{\rule{0.3em}{0ex}},$$ |

for a total of $N=16$ discrete spatial frequencies. Note that the frequency spacing $\Delta \nu $ equals the fundamental frequency ${\nu}_{f}=1\u2215L$. The Fourier Transforms page discussed the interpretation of negative frequencies. (The order of the frequencies as returned by the FFT routine was the “FFT order” discussed on the Fourier Transforms page. The frequencies, and the corresponding amplitudes, were reordered to get the “math order” used for plotting.)

Note next that the real parts of the complex amplitudes $\u1e91\left(u\right)$ are even functions of frequency: $Re\left\{\u1e91\left(-{\nu}_{u}\right)\right\}=Re\left\{\u1e91\left(+{\nu}_{u}\right)\right\}$. The imaginary parts are odd functions of frequency: $Im\left\{\u1e91\left(-{\nu}_{u}\right)\right\}=-Im\left\{\u1e91\left(+{\nu}_{u}\right)\right\}$. In Fig. 1 the positive and negative frequencies are connected by a red arrow for one particular frequency pair, ${\nu}_{u}=\pm 0.6\phantom{\rule{2.6108pt}{0ex}}{m}^{-1}$. If a complex function $c\left(\nu \right)=a\left(\nu \right)+ib\left(\nu \right)$ has an even real part $a\left(\nu \right)$ and an odd imaginary part $b\left(\nu \right)$, then ${c}^{\ast}\left(-\nu \right)=c\left(\nu \right)$, i.e. the function is Hermitian. Thus the plots verify that the amplitudes are Hermitian, as is always the case for the Fourier transform of a real function. The Hermitian character of the complex amplitudes means that these $N=16$ complex numbers contain only 16 independent real and imaginary numbers, not 32 as would be the case for 16 arbitrary complex numbers. In general the FFT of $N$ real numbers (e.g., $N$ spatial samples of a sea surface) gives back $N$ independent numbers, so that the “information content” of the physical and Fourier representations is the same.

The positive frequency at $\frac{N}{2}\Delta \nu =0.8\phantom{\rule{2.6108pt}{0ex}}{m}^{-1}$ is the Nyquist frequency. There is, however, no value for the negative of the Nyquist frequency. Note also in the lower left panel that the imaginary part of the amplitude is identically zero at the Nyquist frequency. We will explain these values below.

The lower-right panel of the ﬁgure shows the values of $|\u1e91\left({\nu}_{u}\right){|}^{2}$. The values at the negative to positive frequencies are connected by the black dotted line. These points constitute the two-sided discrete variance spectrum,

“Two-sided”, denoted by the subscript 2S, refers to spectra showing both the negative and positive frequencies. The variance at zero frequency is the variance contained in the constant mean sea level. This value is zero because we have set the mean sea level to zero.

Oceanographers are often concerned only with the variance at a given magnitude of the spatial frequency, and not with whether the frequency is negative or positive. Nor is there any reason to plot the point at zero frequency, which is usually zero by choice of zero for the mean sea level. It is therefore customary to deﬁne the one-sided variance spectrum

$${\mathcal{\mathcal{S}}}_{1s}\left({\nu}_{u}\right)={\mathcal{\mathcal{S}}}_{2s}\left(-{\nu}_{u}\right)+{\mathcal{\mathcal{S}}}_{2s}\left({\nu}_{u}\right)\phantom{\rule{0.3em}{0ex}},$$ | (3) |

for $u=1,2,...,\frac{N}{2}-1$, and ${\mathcal{\mathcal{S}}}_{1s}\left({\nu}_{Ny}\right)={\mathcal{\mathcal{S}}}_{2s}\left({\nu}_{Ny}\right)$. Then only the positive frequencies are plotted. The points connected by the solid black line in the lower-right panel of Fig. 1 comprise the one-sided variance spectrum. In the present simulation, the two-sided spectrum is symmetric for positive and negative frequencies (except for the Nyquist frequency, which does not have a negative counterpart and is always a special case), and the one-sided function is simply twice the value of the two-sided function for the positive frequencies, except for the Nyquist frequency. When you read a paper and it refers to or plots “the variance (or energy or power) spectrum” without further comment, it is always the one-sided spectrum. However, on the next pages we will have to use two-sided spectra, in which case we will have to account for the magnitude diﬀerence in one- and two-sided spectra.

There is an important detail to note in the computation and plotting of $\mathcal{\mathcal{S}}\left(u\right)$, as in the lower-right panel of Fig. 1. The values of $\mathcal{\mathcal{S}}\left(u\right)$ were obtained by the discrete Fourier transform of Eq. (??), and $\mathcal{\mathcal{S}}\left(u\right)$ gives the variance contained in a ﬁnite frequency interval $\Delta \nu =1\u2215L$ at the discrete frequency ${\nu}_{u}$. $\Delta \nu $ equals the fundamental frequency and is the frequency interval used in the calculations and the plot. As noted in the discussion of the discrete transform, $\mathcal{\mathcal{S}}\left(u\right)$ is a point function. As was seen in Eq. (13) of the Fourier Transforms page, if we wish to convert the discrete $\mathcal{\mathcal{S}}\left(u\right)$ to an estimate of the continuous variance spectral density $\mathcal{\mathcal{S}}\left(\nu \right)$, we must divide by the discrete function by the frequency interval: $\mathcal{\mathcal{S}}\left(\nu \right)=\mathcal{\mathcal{S}}\left(u\right)\u2215\Delta \nu $. The units of $\mathcal{\mathcal{S}}\left(\nu \right)$ are then ${m}^{2}\u2215\left(1\u2215m\right)$, as expected for a spectral density function of spatial frequency. It is important to distinguish between a discrete variance point function and a continuous variance spectral density.

Now return to Eq. (1) and set all of the phases $\varphi \left(j\right)$ to zero. We are then adding together cosines to create the surface wave proﬁle, which is seen in the upper left panel of Fig. 2. The FFT of this proﬁle gives the real part of $\u1e91\left({\nu}_{u}\right)$ as positive numbers except for the 0 frequency, and the imaginary part is identically zero for all frequencies.

If we set all of the phases $\varphi \left(j\right)$ to $\pi \u22152$, we are then adding together sines to create the surface wave proﬁle, which is seen in the upper left panel of Fig. 3. The FFT of this proﬁle gives the real part of $\u1e91\left({\nu}_{u}\right)$ identically zero and the imaginary part is nonzero except for the 0 and Nyquist frequencies.

These two ﬁgures show that the real part of the complex amplitude $\u1e91\left({\nu}_{u}\right)$ tells us how much of $z\left({x}_{r}\right)$ is composed of cosine waves, and the imaginary part shows how much of $z\left({x}_{r}\right)$ is composed of sine waves. This explains why the imaginary part of the amplitude is zero at the Nyquist frequency. The two-point wave at the Nyquist frequency is inherently a cosine wave because, as noted previously, a two-point sine wave is sampled only at its zero values. The general case of a wave component with a phase that is neither 0 (nor a multiple of $2\pi $) nor $\pi \u22152$ (nor an odd integer multiple of $\pi \u22152$) can be written as a sum of cosine and sine waves, as in Eqs. (3) and (6) of the Wave Representations page. In that case, both the real and imaginary parts of the amplitudes are nonzero (except for the special cases of the 0 and Nyquist frequencies).

Note that in each of these three simulations, which diﬀer only by the phases of the component sinusoidal waves, the variance spectrum is exactly the same (except at the Nyquist frequency), as seen in the lower right panels of Figs. 1-3. That is to say, the variance contained in a wave does not depend on the reference coordinate system used to describe it, even though the Fourier amplitudes $\u1e91\left(u\right)$ do depend on the coordinate system. The variance depends only on the amplitude of the wave. The variance at the Nyquist frequency is largest when cosine waves are added and is zero when sine waves are added. In the ﬁrst case, we have the maximum possible amplitude of the two-point cosine wave, and in the latter case there is no two-point wave.