VisTrails Home

User:Tohline/Appendix/Ramblings/FourierSeries

From VisTrailsWiki

Jump to: navigation, search

Contents

Fourier Series

Whitworth's (1981) Isothermal Free-Energy Surface
|   Tiled Menu   |   Tables of Content   |  Banner Video   |  Tohline Home Page   |

Representations

The following Fourier series representations have been drawn primarily from pp. 458 - 460 of the 1971 (19th) edition of the CRC's Standard Mathematical Tables, published by the Chemical Rubber Co., Cleveland, Ohio, U.S.A.

Standard

If ~f(x) is a bounded periodic function of period ~2L, it may be represented by the Fourier series,

Standard Fourier Series Expression

~f(x)

~=

~
\frac{a_0}{2} + \sum_{n=1}^{\infty} \biggl[ a_n\cos \biggl(\frac{n\pi x}{L}\biggr) + b_n\sin  \biggl(\frac{n\pi x}{L}\biggr) \biggr] \, ,

where,

~a_n

~=

~
\frac{1}{L} \int_{-L}^{L} f(x) \cos\biggl( \frac{n\pi x}{L} \biggr) dx

    for ~n = 0, 1, 2, 3, \dots \, ;

~b_n

~=

~
\frac{1}{L} \int_{-L}^{L} f(x) \sin\biggl( \frac{n\pi x}{L} \biggr) dx

    for ~n = 1, 2, 3, \dots

LaTeX mathematical expressions cut-and-pasted directly from
NIST's Digital Library of Mathematical Functions

As an additional primary point of reference, note that according to §1.8(i) of NIST's Digital Library of Mathematical Functions, a Fourier Series is defined as follows:

~f(x)

~=

~\tfrac{1}{2}a_{0}+\sum^{\infty}_{n=1}\biggl[ a_{n}\cos\bigl(nx\bigr)+b_{n}\sin\bigl(nx\bigr) \biggr],

~a_n

~=

~\frac{1}{\pi}\int^{\pi}_{-\pi}f(x)\cos\bigl(nx\bigr)\mathrm{d}x,

~b_n

~=

~\frac{1}{\pi}\int^{\pi}_{-\pi}f(x)\sin\bigl(nx\bigr)\mathrm{d}x.

Alternate

Alternatively, if we set ~a_n = c_n \cos\phi_n and ~b_n = - c_n \sin\phi_n, then,

~a_n\cos \biggl(\frac{n\pi x}{L}\biggr) + b_n\sin  \biggl(\frac{n\pi x}{L}\biggr)

~=

~
c_n \cos\phi_n \cos \biggl(\frac{n\pi x}{L}\biggr) - c_n \sin\phi_n \sin  \biggl(\frac{n\pi x}{L}\biggr)

 

~=

~
c_n \cos \biggl(\frac{n\pi x}{L} + \phi_n \biggr) \, ,

in which case we may rewrite the Fourier series expression in the form,

Alternate Fourier Series Expression

~f(x)

~=

~
\frac{a_0}{2} + \sum_{n=1}^{\infty} c_n\cos \biggl(\frac{n\pi x}{L} + \phi_n\biggr)  \, ,

where,

~c_n = \sqrt{a_n^2 + b_n^2}

      and      

~\phi_n = \tan^{-1}\biggl(\frac{-b_n}{a_n}\biggr) \, .

Complex

Here we make use of the exponential/complex relation — also referred to as Euler's equation,

~e^{i\alpha} = \cos\alpha + i \sin\alpha \, ,     ~\Rightarrow     ~e^{-i\alpha} = \cos\alpha - i \sin\alpha \, ,

in which case we may write,

~\cos\alpha = \frac{1}{2} \biggl[ e^{i\alpha} + e^{-i\alpha}\biggr] \, ,

      and      

~\sin\alpha = \frac{1}{2i} \biggl[ e^{i\alpha} - e^{-i\alpha}\biggr]\, .

Employing these definitions of the trigonometric relations ~\cos\alpha and ~\sin\alpha, the standard representation of the Fourier series may be rewritten as,

Complex Fourier Series Expression

~f(x)

~=

~
\frac{1}{2}\sum_{n = -\infty}^{n = + \infty} d_n e^{i\omega_n x} \, ,

where, for ~n = 0, \pm 1, \pm 2,  \pm 3, \dots~,

~\omega_n

~=

~
\frac{n\pi }{L} \, ,

and the complex coefficients,

~d_n = a_{n} -i b_{n}

~=

~
\frac{1}{L} \int_{-L}^{L} f(x) \cos\biggl( \frac{n\pi x}{L} \biggr) dx
- i\frac{1}{L} \int_{-L}^{L} f(x) \sin\biggl( \frac{n\pi x}{L} \biggr) dx

 

~=

~
\frac{1}{L} \int_{-L}^{L} f(x) \biggl[ \cos\biggl( \frac{n\pi x}{L} \biggr)
- i\sin\biggl( \frac{n\pi x}{L} \biggr)\biggr] dx

 

~=

~
\frac{1}{L} \int_{-L}^{L} f(x)e^{-i\omega_n x} dx \, .

LaTeX mathematical expressions cut-and-pasted directly from
NIST's Digital Library of Mathematical Functions

As an additional primary point of reference, note that according to §1.8(i) of NIST's Digital Library of Mathematical Functions, this alternative form is,

~f(x)

~=

~\sum^{\infty}_{n=-\infty}c_{n}e^{inx},

~c_n

~=

~\frac{1}{2\pi}\int^{\pi}_{-\pi}f(x)e^{-inx}\mathrm{d}x.


Let's demonstrate that this rewritten (complex) expression for ~f(x) matches the standard Fourier series expression. First, we will refer to the above standard definitions of ~a_n and ~b_n as, respectively, ~a_{|n|} and ~b_{|n|}, and recognize that, as the summation is extended to negative numbers, the following mapping is appropriate:

~a_n ~ \rightarrow ~ a_{|n|}

      and      

~b_n ~ \rightarrow ~ b_{|n|} \, ,

    for ~n > 0 \, ;

~a_n ~ \rightarrow ~ a_{|n|}

      and      

~b_n ~ \rightarrow ~ - b_{|n|} \, ,

    for ~n < 0 \, .

Hence, we have,

~2f(x)

~=

~
\sum_{n = -\infty}^{n = + \infty} (a_n - ib_n)e^{i\omega_n x}

 

~=

~
\sum_{n = 1}^{n = + \infty} (a_{|n|} - ib_{|n|})e^{i\omega_{|n|} x} 
+ a_0
+ \sum_{n = \infty}^{n = 1} (a_{|n|} + ib_{|n|})e^{- i\omega_{|n|} x}

 

~=

~
\sum_{n = 1}^{n = + \infty} (a_{|n|} - ib_{|n|}) [ \cos (\omega_{|n|} x) + i\sin (\omega_{|n|} x)]
+ a_0
+ \sum_{n = 1}^{n = \infty} (a_{|n|} + ib_{|n|}) [ \cos (\omega_{|n|} x) - i\sin (\omega_{|n|} x)]

 

~=

~
a_0 +
\sum_{n = 1}^{n = + \infty}\biggl\{  (a_{|n|} - ib_{|n|}) [ \cos (\omega_{|n|} x) + i\sin (\omega_{|n|} x)]
+ (a_{|n|} + ib_{|n|}) [ \cos (\omega_{|n|} x) - i\sin (\omega_{|n|} x)] \biggr\}

 

~=

~
a_0 +
\sum_{n = 1}^{n = + \infty}\biggl\{2a_{|n|} \cos (\omega_{|n|} x)  + 2b_{|n|} \sin (\omega_{|n|} x)] \biggr\}

~\Rightarrow ~~~ f(x)

~=

~
\frac{a_0}{2} +
\sum_{n = 1}^{n = + \infty}\biggl\{a_{|n|} \cos (\omega_{|n|} x)  + b_{|n|} \sin (\omega_{|n|} x)] \biggr\} \, .

Q.E.D.

From Williams & Tohline (1987)

This discussion parallels the discussion of a Fourier series analysis that was presented by H. A. Williams & J. E. Tohline (1987, ApJ, 315, 594) — see especially their §III — in the context of their discussion of nonlinear dynamic instabilities in rotating polytropes.

Standard Setup

A useful way of analyzing the growth and pattern speed of nonaxisymmetric structures is to Fourier transform the (discrete) density distribution, ~\rho(\theta_L), in angle space, ~\theta_L = L \delta\theta, where, ~\delta\theta \equiv 2\pi/L_\mathrm{max}. On the discrete angular grid, the Fourier transform equations are

~a_m

~=

~
\frac{2}{L_\mathrm{max}} \cdot \sum_{L=1}^{L_\mathrm{max}} \rho(\theta_L)  \cos(m\theta_L) \, ,

~b_m

~=

~
\frac{2}{L_\mathrm{max}} \cdot \sum_{L=1}^{L_\mathrm{max}} \rho(\theta_L) \sin(m\theta_L) \, .

Notice that, ~a_0 = 2\bar\rho, where ~\bar\rho is the average density. The density function can be reconstructed via the expression,

~\rho(\theta_L)

~=

~
\frac{a_0}{2} + \sum_{m=1}^{L_\mathrm{max}/2} \biggl[ a_m \cos(m\theta_L) + b_m\sin(m\theta_L) \biggr] \, ,

so the ~a_m and ~b_m coefficients can, and should be, interpreted as amplitudes of various Fourier modes ~(m).

Example #1

Here we are interested in examining a density distribution, ~\rho(\theta), that varies smoothly over the angular coordinate interval, ~0 < \theta \le 2\pi, and whose distribution is strictly periodic over all other ~2\pi intervals. Suppose that we do not have a functional specification of this continuous density distribution but, instead, are given the value of the density, ~\rho_i(\theta_L), at ~L_\mathrm{max} = 8, equally spaced discrete angular-coordinate locations, ~\theta_L = (2\pi L/L_\mathrm{max}).

Figure 1a

Modes

Specifically, suppose that the eight values of the the density and corresponding discrete angular-coordinate locations are those identified by the eight open circular markers in Figure 1a and listed, respectively, in columns 3 and 2 of Table 1. Feeding these eight discrete values of ~\rho_i and ~\theta_L into the above Fourier transform equations, we have determined the ~a_m and ~b_m coefficient values and have listed them in columns 5 and 6, respectively, of Table 1.

Table 1:  Data Associated with Example #1

Discrete Evaluation

   

Fourier Amplitudes

   

Reconstruction

~L ~\theta_L = \frac{2\pi L}{L_\mathrm{max}} ~\rho_i(\theta_L) ~m ~a_m ~b_m ~\rho(\theta_L)
      ~0 6.0000 0.0000 ~
~1 ~0.7854 ~2.6595 ~1 0.2318 -0.7133 ~2.6595
~2 ~1.5708 ~1.8867 ~2 0.4000 0.0000 ~1.8867
~3 ~2.3562 ~2.3317 ~3 0.0000 0.0000 ~2.3317
~4 ~3.1416 ~3.1682 ~4 0.0000 0.0000 ~3.1682
~5 ~3.9270 ~3.3405 ~5 0.0000 0.0000 ~3.3405
~6 ~4.7124 ~3.3133 ~6 0.4000 0.0000 ~3.3133
~7 ~5.4978 ~3.6683 ~7 0.2318 +0.7133 ~3.6683
~8 ~6.2832 ~3.6318 ~8 6.0000 0.0000 ~3.6318

Notice the following:

  • Given that the initial discrete density distribution, ~\rho_i(\theta_L), is real (as opposed to complex) and has been given only at ~L_\mathrm{max} = 8 angular locations over the coordinate range, ~0 < \theta_L \le 2\pi — it repeats in a periodic fashion outside of this range — the Fourier series can have, at most, ~L_\mathrm{max} = 8 independent coefficient values. In Table 1, the cells with light-blue backgrounds contain these eight independent values. Elaboration: For each Fourier mode over the range, ~1 \le m \le (\tfrac{1}{2}L_\mathrm{max} - 1), there are two relevant, independent coefficients, namely, ~a_m and ~b_m, giving, in our Example #1, six of the expected eight coefficient values. The other two unique coefficient values arise from ~m = 0 and ~m = \tfrac{1}{2}L_\mathrm{max}. In both of these "edge" cases, only the ~a_m coefficient provides relevant information; ~b_m is irrelevant because, when ~m=0, the argument of the sine function is always zero, and when ~m = \tfrac{1}{2}L_\mathrm{max}, the argument of the sine function is ~m\theta_L = \tfrac{1}{2}L_\mathrm{max} \cdot 2\pi L/L_\mathrm{max} = \pi L.

According to the standard setup presented above, for this particular example analysis the density reconstruction is obtained via the expression,

~\rho(\theta_L)

~=

~\frac{a_0}{2} + a_1\cos(\theta_L) + b_1\sin(\theta_L)
+ a_2\cos(2\theta_L) + b_2\sin(2\theta_L)
+ a_3\cos(3\theta_L) + b_3\sin(3\theta_L)
+ a_4\cos(4\theta_L)

 

~=

~
3 + [0.2318\cos(\theta_L) - 0.7133\sin(\theta_L)] + 0.4\cos(2\theta_L)
\, .

The values of ~\rho(\theta_L) listed in the last column (column 7) of Table 1 have been calculated from this expression and, indeed, across the board they match the originally specified, discrete values of ~\rho_i(\theta_L). Notice, however, that this last expression not only can be used to generate correct values of the density at the originally identified discrete angular coordinate locations, it also offers an analytic prescription of a continuous function for the density distribution across the entire angular-coordinate domain. In addition to redisplaying the initially specified discrete values of the density (open circular markers) from Figure 1a, Figure1b presents this continuous function's modal decomposition. Specifically, the horizontal (black) dashed line is the ~m = 0 contribution; the green curve shows the sum of the two (sine and cosine) terms that represent the ~m=1 component; and the purple curve displays the ~m = 2 contribution.

Figure 1b

Modes

When added together, these three modal contributions give the continuous density distribution depicted by the dotted black curve in Figure 1b; as desired, this continuous curve runs through all eight initially specified discrete values of the density.

Alternatively, Introduce Phase Shift

Alternatively, we can switch from the Fourier series coefficients, ~a_m and ~b_m, to the coefficient/phase definitions, ~c_m and ~\phi_m, such that,

~c_m

~=

~
[a_m^2 + b_m^2]^{1 / 2} \, ,

and,

~\phi_m

~=

~
\tan^{-1}\biggl( \frac{-b_m}{a_m} \biggr) \, ,

      for … ~a_m > 0 \, ,

~\phi_m

~=

~
\tan^{-1}\biggl( \frac{-b_m}{a_m} \biggr) +\pi \, ,

      for … ~a_m < 0 \, .


Notice that, when ~a_m = 0, ~\tan^{-1}(-b_m/a_m) = \pi/2. Using ~c_m and ~\phi_m, the discrete density distribution can be exactly reconstructed via the Fourier series,

~\rho(\theta_L)

~=

~
\frac{c_0}{2} + \sum_{m=1}^{L_\mathrm{max}/2} c_m \cos\biggl[m\theta_L + \phi_m\biggr] \, .

In Table 2, we have reprinted the values of the coefficients, ~a_m and ~b_m, that were calculated above in connection with "Example #1", and, from this data for each Fourier mode, we have calculated/tabulated the corresponding values of ~c_m and ~\phi_m. It is straightforward to demonstrate that the eight discrete values of the density, ~\rho_(\theta_L), that are reconstructed from these new coefficient/phase values precisely match the eight density values, ~\rho_i(\theta_L), that served as input to our "Example #1" discussion.

Table 2
~m ~a_m ~b_m ~c_m ~\phi_m
~0 ~6 ~0 ~6 ~0
~1 ~0.2318 ~-0.7133 ~0.7500 ~0.4\pi
~2 ~0.4 ~0.0 ~0.4 ~0.0
~3 ~0.0 ~0.0 ~0.0 undefined
~4 ~0.0 ~0.0 ~0.0 undefined

Example #2

Taken from p. 464 of Edition 19 of the CRC Standard Mathematical Tables (1971)

The figure/equation pair displayed here, on the right, is an example of a "Fourier expansion for a basic periodic function" that has been presented on p. 464 of the CRC Standard Mathematical Tables (19th Edition). The following derivation, analysis, and discussion has been motivated by this published CRC example.

Referring back to the standard representation presented above, suppose that ~f(x) is a square wave (unity amplitude) that extends over the range ~\pm c, where, ~c < L. (The dashed-black curve in Figure 2, below, displays one cycle of this function for the specific case of c/L = 1/3.) Replacing ~x by the angle,

~\theta \equiv \frac{n\pi x}{L} \, ,

the two coefficients are (for all n > 0),

~a_n

~=

~
\frac{1}{L} \int_{-c}^{c} \cos\biggl( \frac{n\pi x}{L} \biggr) dx

 

~=

~
\biggl( \frac{1}{n\pi} \biggr) \int_{-(n\pi c/L)}^{(n\pi c/L)} \cos ( \theta ) d\theta

 

~=

~
\biggl( \frac{1}{n\pi} \biggr) \biggl[\sin ( \theta ) \biggr]_{-(n\pi c/L)}^{(n\pi c/L)}

 

~=

~
\biggl( \frac{2}{n\pi} \biggr) \sin \biggl( \frac{n\pi c}{L} \biggr) \, ,

~b_n

~=

~
\frac{1}{L} \int_{-c}^{c} \sin\biggl( \frac{n\pi x}{L} \biggr) dx

 

~=

~
\biggl( \frac{1}{n\pi} \biggr) \int_{-(n\pi c/L)}^{(n\pi c/L)} \sin ( \theta ) d\theta

 

~=

~
-\biggl( \frac{1}{n\pi} \biggr) \biggl[\cos ( \theta ) \biggr]_{-(n\pi c/L)}^{(n\pi c/L)}

 

~=

~
0 \, .

For the special case of ~n = 0, we have,

~a_0 = \frac{1}{L}\int_{-c}^c dx = \frac{2c}{L} \, ,

    and    

~b_0 = 0 \, .


Hence, the Fourier series expression for the square-wave function, itself, is,

~f(x)

~=

~
\frac{a_0}{2} + \sum_{n=1}^{\infty} \biggl[ a_n\cos \biggl(\frac{n\pi x}{L}\biggr) + b_n\sin  \biggl(\frac{n\pi x}{L}\biggr) \biggr]

 

~=

~
\frac{c}{L} + \sum_{n=1}^{\infty} \biggl( \frac{2}{n\pi} \biggr) \sin \biggl( \frac{n\pi c}{L} \biggr) \cos \biggl(\frac{n\pi x}{L}\biggr) \, .

Figure 2:   Approximate Series Expressions for a Square-Wave

~\frac{c}{L} = \frac{1}{3}

Square Wave Fourier Series Expression

The dotted-red curve displays the behavior of the (approximate) function ~f(x), as the series expression is truncated for various values of the index, ~n, as indicated by the (time-varying) integer legend. The dashed-black "square wave" shows the input function, which should be the behavior of ~f(x) when the series expression includes an infinite number of terms.

Notice the following:

  1. If we define,

    ~\alpha_n \equiv \frac{n\pi c}{L} \, ,

    then, as a function of ~\alpha, the Fourier mode amplitude is,

    ~a_n(\alpha_n)

    ~=

    ~\biggl( \frac{2c}{L} \biggr) \frac{\sin \alpha_n}{\alpha_n} = \biggl( \frac{2c}{L} \biggr) \mathrm{sinc}(\alpha_n)  \, .

  2. The inverse transform may also then be rewritten as,

    ~f(x)

    ~=

    ~
\frac{2c}{L}\biggl[ \frac{1}{2} +\sum_{n=1}^{\infty} \mathrm{sinc}(\alpha_n) \cos \biggl(\frac{n\pi x}{L}\biggr) \biggr] \, .

  3. The sinc function goes to zero each time its argument, ~\alpha_n, is an integer multiple of π. This means that the first zero arises at ~n = L/c, if ~L is an integer-multiple of ~c. This also means that the discrete array that marks the Fourier mode amplitude, ~a_n, will resolve the central amplitude peak only if ~c/L \ll 1.

Example #3

Now, let's reverse the example provided as Example #2. Specifically, let's look for the Fourier series expression for the function,

~g(x) \equiv c~\mathrm{sinc}(\alpha) \, ,

for ~\alpha \equiv \pi x/c, over the range, ~-m \pi \le \alpha_n \le + m \pi. Furthermore, we will assume that ~g(x) is a periodic function of period ~2mc, in which case it may be represented by the Fourier series,

~g(x)

~=

~
\frac{a_0}{2} + \sum_{n=1}^{\infty} \biggl[ a_n\cos \biggl(\frac{n\pi x}{L}\biggr) + b_n\sin  \biggl(\frac{n\pi x}{L}\biggr) \biggr] \, ,

where,

~a_n

~=

~
\frac{1}{L} \int_{-L}^{L} g(x) \cos\biggl( \frac{n\pi x}{L} \biggr) dx

    for ~n = 0, 1, 2, 3, \dots \, ;

~b_n

~=

~
\frac{1}{L} \int_{-L}^{L} g(x) \sin\biggl( \frac{n\pi x}{L} \biggr) dx

    for ~n = 1, 2, 3, \dots

One-Dimensional Aperture

General Concept

Hence, we have,

~A(y_1)

~=

~A_0 \sum_j
a_j e^{-i[2\pi y_1 Y_j/(\lambda L)]} 
\, ,

 

~=

~A_0 \sum_j
a_j \biggl[ \cos\biggl(\frac{2\pi y_1 Y_j}{\lambda L} \biggr) - i  \sin\biggl(\frac{2\pi y_1 Y_j}{\lambda L} \biggr) \biggr]
\, ,

where, now, ~A_0 = e^{i2\pi L/\lambda}. When written in this form, it should immediately be apparent why discrete Fourier transform techniques (specifically FFT techniques) are useful tools for evaluation of the complex amplitude, ~A.

See Also

  • Tohline, J. E., (2008) Computing in Science & Engineering, vol. 10, no. 4, pp. 84-85 — Where is My Digital Holographic Display? [ PDF ]


Whitworth's (1981) Isothermal Free-Energy Surface

© 2014 - 2019 by Joel E. Tohline
|   H_Book Home   |   YouTube   |
Context: | PGE | SR |
Appendices: | Equations | Variables | References | Binary Polytropes | Ramblings | Images | Images (2016 Layout) | ADS |

Personal tools