Unit 3 - Notes

ECE220 11 min read

Unit 3: Fourier series representation of periodic signals

1. Introduction

The Fourier series is a mathematical tool that allows us to represent any well-behaved periodic signal as an infinite sum of harmonically related sinusoids or complex exponentials. This decomposition is fundamental to signal and systems analysis because it transforms a signal from the time domain into the frequency domain.

1.1. Periodic Signals

A continuous-time signal is periodic if there exists a positive value such that:

The smallest such value of is called the fundamental period. The fundamental frequency is given by:

1.2. The Core Idea: Synthesis and Analysis

The central concept of the Fourier series is that a complex periodic signal can be synthesized by adding up simple sinusoidal building blocks. These building blocks are the fundamental frequency () and its integer multiples (), known as harmonics.

  • Synthesis: Building a complex signal from its simple harmonic components.
  • Analysis: Decomposing a complex signal into its simple harmonic components.

This is possible due to the orthogonality of the basis functions (e.g., ), which allows us to "filter out" or calculate the amount of each harmonic present in the original signal.

2. Fourier Series Representation of Continuous-Time Periodic Signals

There are three common forms of the Fourier series. They are all mathematically equivalent.

2.1. Complex Exponential Fourier Series

This is the most compact and widely used form. Any periodic signal with fundamental period can be represented as:

Where:

  • is the harmonic number (an integer).
  • is the fundamental frequency.
  • are the basis functions (complex exponentials).
  • are the Fourier series coefficients, which are generally complex numbers.

To find the coefficients , we use the analysis equation:

The integration is performed over any single period of the signal, e.g., from $0$ to , or to .

Interpretation of Coefficients:

  • (The DC Component): For , the coefficient is the average value of the signal over one period.
  • for : Each coefficient represents the "amount" of the -th harmonic () present in the signal . It's a complex number encoding both the amplitude and phase of that harmonic.
  • Symmetry for Real Signals: If is a real-valued signal, the coefficients exhibit conjugate symmetry:

    This implies:
    • Magnitude is an even function: .
    • Phase is an odd function: .

2.2. Trigonometric Fourier Series

This form uses sines and cosines, which can be more intuitive for real signals.

The coefficients are calculated as:

  • (This is the same as )

2.3. Relationships Between Exponential and Trigonometric Forms

Using Euler's formula (), we can relate the coefficients:

2.4. Example: Fourier Series of a Periodic Square Wave

Consider a periodic square wave (pulse train) with amplitude , period , and pulse width .

Over one period from to , the signal is defined as:

Let's calculate the complex exponential Fourier coefficients .

Step 1: Calculate (DC component)

This is the average value of the signal.

Step 2: Calculate for


Using Euler's formula, :

Since , we have :

To express this in the standard sinc form, where :

This result holds for . Note that as , , so this formula also gives .

3. Convergence of the Fourier Series

An infinite series does not always converge to the function it represents. The conditions under which the Fourier series converges to are known as the Dirichlet Conditions.

3.1. The Dirichlet Conditions

If a periodic signal satisfies the following three conditions, its Fourier series is guaranteed to converge:

  1. Absolutely Integrable: The signal is absolutely integrable over one period.

    This ensures that the Fourier coefficients are finite.

  2. Finite Maxima and Minima: In any finite interval, has a finite number of maxima and minima. This condition (bounded variation) disallows infinitely fast oscillations.

  3. Finite Discontinuities: In any finite interval, has a finite number of finite discontinuities. This means the signal cannot have an infinite number of jumps.

Most signals encountered in engineering practice satisfy these conditions.

3.2. Gibbs Phenomenon

At a point of finite discontinuity (a jump), the Fourier series does not converge to the exact value of the signal. Instead, it converges to the midpoint of the jump.


where is the point of discontinuity.

Furthermore, near the discontinuity, the partial sum of the series exhibits overshoots and undershoots. This is known as the Gibbs Phenomenon.

Key characteristics of Gibbs Phenomenon:

  • As more terms () are added to the series, the approximation gets better everywhere except right at the discontinuity.
  • The overshoot height remains constant at approximately 9% of the jump size, regardless of how many terms are added.
  • The width of the overshoot region gets narrower and moves closer to the discontinuity as increases.

4. Properties of Continuous-Time Fourier Series

These properties are extremely useful for finding the Fourier series of complex signals without re-calculating the analysis integral. Assume and , both with period .

Property Time Domain Signal Fourier Series Coefficients Notes
Linearity The FS is a linear operator.
Time Shift A shift in time corresponds to a linear phase shift in frequency.
Frequency Shift Modulation in time is a shift in frequency.
Time Reversal Reversing time reverses the frequency spectrum.
Time Scaling with The signal is compressed/expanded, changing the fundamental frequency, but the coefficients' values remain the same.
Differentiation Differentiation enhances high-frequency components.
Integration , for Integration suppresses high-frequency components. Requires .
Multiplication Multiplication in time is periodic convolution in frequency.
Conjugation
Parseval's Relation Conservation of Power: The average power in the time domain equals the sum of the average powers of all harmonic components.

5. Software Simulation of Frequency Spectrum of Periodic Signals

The frequency spectrum of a periodic signal is a plot of its Fourier series coefficients versus frequency. Since the coefficients are complex, the spectrum is represented by two plots:

  1. Magnitude Spectrum: A plot of versus frequency ( or just ).
  2. Phase Spectrum: A plot of versus frequency ( or just ).

For periodic signals, the spectrum is a line spectrum because it only has non-zero values at discrete frequencies (the harmonics ).

5.1. Python Simulation Example

Let's simulate and plot the frequency spectrum for the square wave from our earlier example. We'll use a 50% duty cycle, meaning the pulse width is half the period . In this case, .

Our coefficient formula becomes:

PYTHON
import numpy as np
import matplotlib.pyplot as plt

# --- Signal Parameters ---
A = 5.0      # Amplitude
T0 = 2.0     # Period
tau = 1.0    # Pulse width (50% duty cycle)
w0 = 2 * np.pi / T0 # Fundamental frequency

# Number of harmonics to compute
N = 20
k = np.arange(-N, N + 1)

# --- Calculate Fourier Series Coefficients ---
# We must handle k=0 separately to avoid division by zero in the formula
# c_k = (A * tau / T0) * sinc(k * tau / T0)
# sinc(x) = sin(pi*x) / (pi*x)

# Create an array for coefficients
c_k = np.zeros(len(k), dtype=np.complex128)

# Calculate for k != 0
nonzero_k_indices = np.where(k != 0)
k_nonzero = k[nonzero_k_indices]
c_k[nonzero_k_indices] = (A / (k_nonzero * np.pi)) * np.sin(k_nonzero * np.pi * tau / T0)

# Calculate for k = 0 (the DC component)
c_k[np.where(k == 0)] = A * tau / T0

# --- Get Magnitude and Phase ---
magnitude_spectrum = np.abs(c_k)
phase_spectrum = np.angle(c_k)

# --- Plotting the Spectrum ---
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 8))
fig.suptitle('Frequency Spectrum of a Periodic Square Wave', fontsize=16)

# Plot Magnitude Spectrum
ax1.stem(k * w0, magnitude_spectrum, use_line_collection=True)
ax1.set_title('Magnitude Spectrum  $|c_k|$')
ax1.set_xlabel('Frequency (rad/s)')
ax1.set_ylabel('Magnitude')
ax1.grid(True)
ax1.set_xticks(np.arange(-N*w0, (N+1)*w0, 2*w0))
ax1.set_xticklabels([f'{int(i/w0)}$\omega_0$' for i in np.arange(-N*w0, (N+1)*w0, 2*w0)])


# Plot Phase Spectrum
ax2.stem(k * w0, phase_spectrum, use_line_collection=True)
ax2.set_title('Phase Spectrum  $\\angle c_k$')
ax2.set_xlabel('Frequency (rad/s)')
ax2.set_ylabel('Phase (radians)')
ax2.grid(True)
ax2.set_yticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi])
ax2.set_yticklabels(['$-\pi$', '$-\pi/2$', '0', '$\pi/2$', '$\pi$'])
ax2.set_xticks(np.arange(-N*w0, (N+1)*w0, 2*w0))
ax2.set_xticklabels([f'{int(i/w0)}$\omega_0$' for i in np.arange(-N*w0, (N+1)*w0, 2*w0)])


plt.tight_layout(rect=[0, 0, 1, 0.96])
plt.show()

5.2. Interpreting the Simulation Output

The resulting plots will show:

  • Magnitude Spectrum: A symmetric (sinc function) shape centered at 0. The largest component is at (the DC offset). The magnitude is zero for all even harmonics () because for a 50% duty cycle, is zero for even . This is a key insight: the signal's symmetry in the time domain (even function) eliminates certain harmonics.
  • Phase Spectrum: The phase will be 0 or because the coefficients for our centered square wave are purely real. A time-shift in the square wave would introduce a linear phase component, as dictated by the time-shift property.