From a spectral space to a calculation
A spectral method represents an approximation by global basis functions. To compute with it, however, we must decide how coefficients are obtained and what happens to frequencies the grid cannot distinguish. Consider a real or complex -periodic function on an equally spaced grid. Choose an odd number of points for now; this avoids the separate Nyquist convention needed for an even grid.
Definition 5.6.1
(Discrete coefficients, trigonometric interpolant and spectral derivative)
Let with , and let for . For samples , define
The spectral derivative of the samples is the vector with entries .
The coefficient normalization and the sign in the exponential matter. We differentiate the interpolating polynomial and then sample it. This operation is exact for a trigonometric polynomial in the chosen frequency range; it is not automatically the exact derivative of every function that produced those samples.
Why the interpolation formula works
Theorem 5.6.2
(Discrete orthogonality and interpolation)
For integers in , the discrete average of over the grid points is one when and zero otherwise. Hence for every sample vector. This interpolant is unique in the span of , .
Proof
(Proof by geometric sums)
The average is a geometric sum with ratio . It equals one when divides and otherwise is zero. Since , divisibility occurs only when the indices coincide. Applying the same geometric sum to the inverse expression gives
because these consecutive integers represent all residue classes modulo . Thus substitution of the coefficients yields . If two interpolants have the same samples, orthogonality recovers each coefficient of their difference as the discrete average of zero samples, which is zero.
Proof X-ray
What the frequency window does in the proof
Two facts carry the argument. The geometric sum vanishes unless divides the frequency difference, and the window contains exactly consecutive integers. The window is used twice and in opposite directions. For orthogonality, it is small enough: rules out every nonzero multiple of . For interpolation, it is large enough: it meets every residue class modulo , so the sum over is a complete sum and returns . Uniqueness uses only the first fact.
Widen the window and the first use fails. The frequencies and differ by , so on five points their exponentials coincide and the coefficient of either cannot be recovered. That failure is aliasing. Uniqueness is therefore uniqueness inside the chosen finite-dimensional space, not among all trigonometric polynomials.
Differentiation is particularly simple in coefficient form: replace by for the first derivative or by for the second. Transforming back produces nodal values. A fast Fourier transform can accelerate these sums, but it does not change the mathematical interpolant or repair under-resolution.
Counterexample mode
An even grid breaks the symmetric window
It is tempting to keep the same formulas for an even number of points with the window . Take , so , and samples of , namely . Since , five frequencies now share four points, and the discrete averages give with all others zero. The resulting has samples , twice the data, so interpolation fails; and vanishes at every node, so uniqueness fails too. The repair is the Nyquist convention: on an even grid, weight the two frequencies by each, which here returns .
A heat equation and its energy
For with and periodic boundaries, collocation in space gives the ODE . Here means applying the same spectral derivative twice. Since already lies in the span of , , a second application multiplies the coefficients by again. Measure grid functions by .
Proposition 5.6.3
(Semidiscrete energy decay)
Let solve with . Then
and the mean coefficient is constant in time.
Proof
(Proof from discrete Parseval)
The first equality is discrete Parseval: write , expand as a double sum over , average over , and use the orthogonality just proved to keep only the terms with . The coefficient equations are . Hence
Summing over gives the energy identity, and gives .
Concept lensAlgebraic
The spectral derivative as a skew-symmetric matrix
Applying the definition to the unit sample vectors writes as an explicit circulant matrix: for odd ,
The entries are real and change sign when and are exchanged, so ; its eigenvectors are the grid exponentials, with eigenvalues . With , skew-symmetry gives the energy decay without coefficients: .
The mean mode is constant; all other represented modes decay. This is an exact-arithmetic semidiscrete statement. It does not by itself prove accuracy for unresolved initial data or stability of a particular time integrator. With forward Euler and step , each coefficient is multiplied by . Therefore all modes are nonexpansive exactly when . Backward Euler instead has factors for every positive step, but time error still needs control.
Common mistake
(Transferring semidiscrete decay to a time stepper)
The inequality is a property of the ODE system, not of a method that integrates it. With , and forward Euler step , the mode is multiplied by , so its amplitude triples in magnitude at every step while the semidiscrete energy decays. The fully discrete method needs its own condition, here , or an implicit method.
Worked example 5.6.4
(Separate spatial and temporal errors)
Let , and . Both frequencies are represented. The exact semidiscrete solution is , which also samples the continuous solution for these initial data. With forward Euler and , one step changes the two amplitudes to and ; the exact amplitudes at that time are and . The grid resolves the initial function, yet the time step has a visible error.
Aliasing is not a small rounding error
Worked example 5.6.5
(Two different waves, identical samples)
On the same five-point grid, , hence . The samples of produce the interpolant and the computed derivative . The true derivative is . At they are and . No algorithm using only these samples can tell which of the two original waves generated them.
The same problem arises when multiplying represented functions: , but on the five-point grid. Pointwise multiplication followed by interpolation therefore yields , not the original frequency-four polynomial. Padding and filtering are possible remedies when designed for the nonlinear operation; simply taking a fast transform of the product does not remove the alias.
Common mistake
(Reading as the derivative of whatever was sampled)
The spectral derivative differentiates the interpolant, so it is exact only when the sampled function lies in the span of , . For on five points the computed value at is while the true derivative is . Neither a fast transform nor double precision changes this: the error comes from the frequencies the grid cannot represent, and only refinement or a resolved representation removes it.
When refinement helps
Proposition 5.6.6
(Grid derivative error from the coefficient tail)
Let with and , and let denote the unique integer in congruent to modulo . Then
Proof
(Proof by folding frequencies onto the window)
Absolute convergence justifies sampling and termwise differentiation, so . On the grid , hence . By orthogonality, exchanging the absolutely convergent sums, . Therefore
Subtracting, . The terms with vanish because there, which gives the first inequality. For , , so .
The tail tends to zero as . Faster coefficient decay can give a faster rate; the word “spectral” alone does not guarantee exponential convergence, especially for nonsmooth periodic extensions. The estimate assumes access to exact samples and does not include roundoff.
Worked example 5.6.7
(Geometric coefficients give a geometric rate)
Take . Summing the two geometric series with gives
The hypothesis holds: . The tail is , so the bound becomes
For () this is , which is no better than the trivial bound : on so coarse a grid the estimate says nothing. For it is , for it is , and for it is . Each additional pair of grid points roughly halves the bound, the geometric rate inherited from the coefficients.
Practice with solutions
Quick check
(With , what is the spectral derivative of samples of ?)
Reduce the frequency modulo .
Solution · Answer
At the nodes , so the interpolant is and its derivative samples are . The true derivative samples are ; the two are generally different.
Quick check
(For , , and forward Euler step , determine the factor of mode .)
Each mode is multiplied by .
Solution · Answer
It is , so repeated steps amplify that mode in magnitude. The semidiscrete energy inequality cannot be transferred to this unstable time discretization.
Quick check
(What does the spectral derivative do to a constant vector?)
Identify the only nonzero coefficient.
Solution · Answer
Its only coefficient is the zero mode, multiplied by ; the result is zero. In the heat equation this same mode remains constant, corresponding to conservation of the discrete mean.
Quick check
(On the five-point grid, for samples of , compare the interpolant of their square with the square of the interpolant.)
Use .
Solution · Answer
The interpolant of is itself, so the square of the interpolant is . The interpolant of the squared samples is . They agree at the five nodes but not at general points, so interpolation and multiplication do not commute.