Fourier coefficients can be evaluated using the *MFOURI command. Given two vectors defining data points to be fit (parameters CURVE and THETA) and two more vectors defining which terms of the trigonometric series are desired to be computed (parameters MODE and ISYM), the desired coefficients can be computed (parameter COEFF). The curve fitting cannot be perfect, as there are more data than unknowns. Thus, an error Ri will exist at each data point:
(16–10) |
where:
Ri = error term (residual) associated with data point i |
A = desired coefficients of Fourier series (parameter COEFF) |
θi = angular location of data points i (parameter THETA) |
L = number of terms in Fourier series |
F = sine or cosine, depending on ISYM (parameter ISYM) |
M = multiplier on θi (parameter MODE) |
Ci = value of data point i (parameter CURVE) |
m = number of data points (length of CURVE parameter array) |
Equation 16–10 can be reduced to matrix form as:
(16–11) |
where:
{R} = vector of error terms |
{G} = matrix of sines and cosines, evaluated at the different data points |
{A} = vector of desired coefficients |
{C} = vector of data points |
Note that m > L. If m = L, the coefficients would be uniquely determined with {R} = {O} and Equation 16–11 being solved for {A} by direct inversion.
The method of least squares is used to determine the coefficients {A}. This means that is to be minimized. The minimization is represented by
(16–12) |
where Aj is the jth component of {A}. Note that
(16–13) |
The form on the left-hand side of Equation 16–13 is the more convenient to use. Performing this operation on Equation 16–11,
(16–14) |
Minimizing this with respect to {A}T (Equation 16–12), it may be shown that:
(16–15) |
or
(16–16) |
Equation 16–16 is known as the "normal equations" used in statistics. Finally,
(16–17) |
[GT] could not have been "cancelled out" of Equation 16–16 because it is not a square matrix. However, [G]T[G] is square.
In spite of the orthogonal nature of a trigonometric series, the value of each computed coefficient is dependent on the number of terms requested because of the least squares fitting procedure which takes place at the input data points. Terms of a true Fourier series are evaluated not by a least squares fitting procedure, but rather by the integration of a continuous function (for example, Euler formulas, p. 469 of Kreyszig([24])).