PAGE 1

9.2 General Fourier Series and Convergence

Consider a function \( f(x) \) with period \( 2\pi \), given on the interval \( -\pi < x < \pi \). The Fourier series representation is:

\[ f(x) \sim \frac{1}{2}a_0 + \sum_{n=1}^{\infty} \left[ a_n \cos(nx) + b_n \sin(nx) \right] \]

Where the coefficients are defined as:

\[ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx) \, dx \]
\[ b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(nx) \, dx \]

Generalizing the Period

Let's relax the period \( = 2\pi \) part. Let the period be \( 2L \) (where \( L \) is the half period). The function is given on the interval \( -L < t < L \).

Define a change of variables: \[ t = \frac{L}{\pi} x \]

A Cartesian coordinate graph showing the linear relationship between x and t. The horizontal axis is labeled x with tick marks at -\pi and \pi. The vertical axis is labeled t with tick marks at -L and L. A green line segment passes through the origin (0,0), connecting the point (-\pi, -L) to (\pi, L), illustrating the transformation t = \frac{L}{\pi}x.

Coordinate Mapping:

  • When \( x = -\pi \), \( t = -L \)
  • When \( x = \pi \), \( t = L \)
PAGE 2

Let \( x = \frac{\pi}{L} t \), so \( dx = \frac{\pi}{L} dt \). The formulas we had become:

Fourier Series Representation

\[ f(t) \sim \frac{1}{2} a_0 + \sum_{n=1}^{\infty} \left[ a_n \cos\left( \frac{n\pi}{L} t \right) + b_n \sin\left( \frac{n\pi}{L} t \right) \right] \]

Substituting into the coefficient formula:

\[ a_n = \frac{1}{\pi} \int_{-L}^{L} f(t) \cos\left( \frac{n\pi}{L} t \right) \cdot \frac{\pi}{L} dt \]

Fourier Coefficients

\[ a_n = \frac{1}{L} \int_{-L}^{L} f(t) \cos\left( \frac{n\pi}{L} t \right) dt \]\[ b_n = \frac{1}{L} \int_{-L}^{L} f(t) \sin\left( \frac{n\pi}{L} t \right) dt \]

Example

Consider the periodic function \( f(t) \) defined as:

\[ f(t) = \begin{cases} -1 & -4 < t < 0 \\ 1 & 0 < t < 4 \end{cases} \]

This function has a period of 8, which implies \( L = 4 \).

A graph of a periodic square wave function f(t) on a Cartesian coordinate system. The horizontal axis is labeled t and the vertical axis is labeled f(t). The function alternates between a value of 1 for intervals like (0, 4) and -1 for intervals like (-4, 0). The period is 8 units, with L = 4. Tick marks on the t-axis are shown at -4 and 4. The graph shows horizontal segments at y = 1 and y = -1 across several periods.
Graph of the square wave function \( f(t) \) with period 8.
PAGE 3

Fourier Series Coefficients Calculation

Calculation of \( a_0 \)

\[ a_0 = \frac{1}{4} \int_{-4}^{4} f(t) \, dt = 0 \]

Note: The integral represents the net area under \( f(t) \).

Calculation of \( a_n \)

\[ a_n = \frac{1}{4} \int_{-4}^{4} f(t) \cos\left( \frac{n\pi}{4} t \right) \, dt \]
\[ = \dots = 0 \quad \text{no cosine terms} \]

Calculation of \( b_n \)

\[ b_n = \frac{1}{4} \int_{-4}^{4} f(t) \sin\left( \frac{n\pi}{4} t \right) \, dt \]
\[ = \dots = \frac{2}{n\pi} [1 - \cos(n\pi)] = \frac{2}{n\pi} [1 - (-1)^n] = \begin{cases} \frac{4}{n\pi} & n \text{ is odd} \\ 0 & n \text{ is even} \end{cases} \]

Fourier Series Representation

\[ f(t) \sim \sum_{n=1}^{\infty} \frac{2}{n\pi} [1 - (-1)^n] \sin\left( \frac{n\pi}{4} t \right) \]
\[ \sim \sum_{n \text{ odd}}^{\infty} \frac{4}{n\pi} \sin\left( \frac{n\pi}{4} t \right) \sim \frac{4}{\pi} \sin\left( \frac{\pi}{4} t \right) + \frac{4}{3\pi} \sin\left( \frac{3\pi}{4} t \right) + \frac{4}{5\pi} \sin\left( \frac{5\pi}{4} t \right) \]
PAGE 4

Fourier Series Approximation of a Square Wave

Visualizing the convergence of partial sums for a periodic function with period \( T = 8 \).

Graphical Representation

A graph titled 'Fourier Series Approximation of a Square Wave (T=8)'. The horizontal axis (t) ranges from -8 to 8, and the vertical axis (f(t)) ranges from -1.0 to 1.0. It plots the original piecewise square wave (dashed gray) and four Fourier approximations: N=1 (blue sine wave), N=3 (orange), N=11 (green), and N=51 (red). The N=51 approximation is very close to the square wave but exhibits sharp oscillations (Gibbs phenomenon) at the vertical transitions.
Figure 1: Comparison of partial sums \( S_N(t) \) for \( N = 1, 3, 11, \) and \( 51 \) terms.

Key Observations

The square wave \( f(t) \) is defined over one period as:

\[ f(t) = \begin{cases} 1 & 0 < t < 4 \\ -1 & -4 < t < 0 \end{cases} \]
  • Convergence: As the number of terms \( N \) increases, the Fourier series approximation more closely resembles the ideal square wave.
  • Gibbs Phenomenon: Notice the persistent overshoots at the points of discontinuity (e.g., at \( t = 0, \pm 4, \pm 8 \)). Even as \( N \to \infty \), the magnitude of this overshoot remains approximately 9% of the jump height.
  • Harmonic Content: Because the square wave is an odd function, its Fourier series contains only sine terms with odd frequencies.

Note on Periodicity

The graph illustrates two full periods of the function. Since \( T = 8 \), the fundamental frequency is \( \omega_0 = \frac{2\pi}{T} = \frac{\pi}{4} \).

PAGE 5

Fourier Series Representation of a Periodic Function

Consider the piecewise function defined as:

\[ f(t) = \begin{cases} -1 - t & -1 < t < 0 \\ 1 - t & 0 < t < 1 \end{cases} \]

The function has a period of 2, which implies \( L = 1 \).

Visual Representation

A graph of the periodic sawtooth function  f(t) . The horizontal  t -axis ranges from approximately -3 to 3, and the vertical  f(t) -axis ranges from -1 to 1. The function consists of repeating downward-sloping line segments. Within one period from  t = -1  to  t = 1 , the function drops from 0 to -1 as  t  goes from -1 to 0, then jumps to 1 at  t = 0  and drops to 0 at  t = 1 . This pattern repeats every 2 units.
Figure 1: Graph of the periodic function \( f(t) \) with period 2.

Fourier Coefficients Calculation

The Fourier coefficients for the function are calculated as follows:

\[ a_0 = \frac{1}{1} \int_{-1}^{1} f(t) \, dt = 0 \]
\[ a_n = \frac{1}{1} \int_{-1}^{1} f(t) \cos(n\pi t) \, dt = \dots = 0 \]
\[ b_n = \frac{1}{1} \int_{-1}^{1} f(t) \sin(n\pi t) \, dt = \dots = \frac{2}{n\pi} \]

Fourier Series Expansion

The resulting Fourier series for \( f(t) \) is:

\[ f(t) \sim \sum_{n=1}^{\infty} \frac{2}{n\pi} \sin(n\pi t) \sim \frac{2}{\pi} \sin(\pi t) + \frac{2}{2\pi} \sin(2\pi t) + \frac{2}{3\pi} \sin(3\pi t) + \dots \]
PAGE 6

Fourier Series: Sawtooth Wave Convergence (T=2)

The following graph illustrates the convergence of a Fourier series approximation to a periodic sawtooth wave with a period of \( T = 2 \). The visualization compares the original sawtooth function \( f(t) \) with its partial sums for different numbers of terms \( N \).

A line graph titled 'Fourier Series: Sawtooth Wave Convergence (T=2)'. The x-axis represents time 't' from -3 to 3, and the y-axis represents 'f(t)' from -1.0 to 1.0. The original sawtooth wave is shown as a dashed gray line with a linear slope from -1 to 1 over each period of 2. Four Fourier series approximations are plotted: N=1 (blue sine wave), N=2 (orange curve with two peaks), N=5 (green curve with five oscillations), and N=50 (red curve). As N increases, the approximation becomes closer to the sawtooth wave, though the red N=50 curve shows significant high-frequency oscillations (Gibbs phenomenon) near the discontinuities at t = -2, 0, and 2.
Figure 1: Comparison of Fourier series approximations for a sawtooth wave with varying numbers of terms \( N \).

Key Observations

  • As the number of terms \( N \) increases, the partial sum more closely follows the linear slope of the sawtooth wave.
  • The Gibbs phenomenon is visible as sharp oscillations near the points of discontinuity (e.g., at \( t = 0, \pm 2 \)).
  • The fundamental frequency (\( N=1 \)) provides the basic sinusoidal shape, while higher harmonics add the necessary detail to create the sharp 'sawtooth' edges.
PAGE 7

Observations on Fourier Series

Two things we notice: Fourier series cuts through the middle (average) at discontinuity.

\[ \frac{f(t^-) + f(t^+)}{2} \]

Why?

1st example

A hand-drawn graph showing a periodic function with a jump discontinuity at the y-axis. The graph displays oscillations near the jump, characteristic of a Fourier series approximation (Gibbs phenomenon). The curve passes through the origin (0,0), which is the average of the jump from -1 to 1.
\[ f(t) \sim \sum_{n=1}^{\infty} \frac{2}{n\pi} [1 - (-1)^n] \sin\left(\frac{n\pi t}{4}\right) \]

Note on the sine term:

\[ \sin\left(\frac{n\pi t}{4}\right) = 0 \text{ at } t = 0 \]

So the whole series goes to 0:

\[ \frac{-1 + 1}{2} = 0 \]

2nd : the overshoot before discontinuity

PAGE 8

Gibbs Phenomenon

The overshoot does NOT go away as \( n \) increases (it gets closer to the discontinuity).

It's always \( \approx 9\% \) of the jump.

\( \rightarrow \) Gibbs phenomenon

We can hear this artifact in "low-fi" or 8-bit sound.