Skip to main content

Fourier Series for Periodic Signals

Fourier series represent periodic signals as weighted sums of harmonically related complex exponentials. The idea is powerful because complex exponentials are eigenfunctions of LTI systems: when a sinusoidal component passes through an LTI system, only its amplitude and phase change. A periodic signal can therefore be analyzed component by component in frequency.

Continuous-time and discrete-time Fourier series share the same conceptual structure, but their details differ. Continuous-time periodic signals generally require infinitely many harmonics. Discrete-time periodic sequences have only finitely many distinct harmonics over one period because discrete-time frequency repeats every 2π2\pi.

Definitions

For a continuous-time periodic signal with fundamental period T0T_0 and fundamental angular frequency

ω0=2πT0,\omega_0=\frac{2\pi}{T_0},

the complex exponential Fourier series is

x(t)=k=akejkω0t.x(t)=\sum_{k=-\infty}^{\infty}a_k e^{j k\omega_0 t}.

The coefficients are

ak=1T0T0x(t)ejkω0tdt,a_k=\frac{1}{T_0}\int_{T_0}x(t)e^{-j k\omega_0 t}\,dt,

where T0\int_{T_0} means integration over any complete period.

For a discrete-time periodic sequence with fundamental period NN, the discrete-time Fourier series is

x[n]=k=0N1akej(2π/N)kn.x[n]=\sum_{k=0}^{N-1}a_k e^{j(2\pi/N)kn}.

The coefficients are

ak=1Nn=0N1x[n]ej(2π/N)kn.a_k=\frac{1}{N}\sum_{n=0}^{N-1}x[n]e^{-j(2\pi/N)kn}.

The coefficient sequence is periodic in kk with period NN:

ak+N=ak.a_{k+N}=a_k.

For real continuous-time signals, the coefficients satisfy conjugate symmetry:

ak=ak.a_{-k}=a_k^*.

For real discrete-time periodic sequences,

aNk=aka_{N-k}=a_k^*

with indices interpreted modulo NN.

The trigonometric continuous-time series is

x(t)=A0+k=1(Akcos(kω0t)+Bksin(kω0t)).x(t)=A_0+\sum_{k=1}^{\infty}\left(A_k\cos(k\omega_0 t)+B_k\sin(k\omega_0 t)\right).

The complex form is usually cleaner for system analysis, while the trigonometric form is sometimes easier to read physically.

Key results

The orthogonality of complex exponentials over one period is the key identity. In continuous time,

1T0T0ejkω0tejmω0tdt={1,k=m,0,km.\frac{1}{T_0}\int_{T_0}e^{j k\omega_0 t}e^{-j m\omega_0 t}\,dt = \begin{cases} 1, & k=m,\\ 0, & k\ne m. \end{cases}

In discrete time,

1Nn=0N1ej(2π/N)knej(2π/N)mn={1,k=m(modN),0,otherwise.\frac{1}{N}\sum_{n=0}^{N-1}e^{j(2\pi/N)kn}e^{-j(2\pi/N)mn} = \begin{cases} 1, & k=m \pmod N,\\ 0, & \text{otherwise}. \end{cases}

These identities isolate a single coefficient when the signal is multiplied by a conjugate harmonic and averaged over one period.

Parseval's relation connects time-domain average power to coefficient magnitudes. For continuous time,

Px=1T0T0x(t)2dt=k=ak2.P_x=\frac{1}{T_0}\int_{T_0}|x(t)|^2\,dt =\sum_{k=-\infty}^{\infty}|a_k|^2.

For discrete time,

Px=1Nn=0N1x[n]2=k=0N1ak2.P_x=\frac{1}{N}\sum_{n=0}^{N-1}|x[n]|^2 =\sum_{k=0}^{N-1}|a_k|^2.

If a periodic signal is the input to an LTI system with frequency response H(jω)H(j\omega), then

x(t)=kakejkω0tx(t)=\sum_k a_k e^{j k\omega_0 t}

produces

y(t)=kakH(jkω0)ejkω0t.y(t)=\sum_k a_k H(jk\omega_0)e^{j k\omega_0 t}.

For discrete time, the factor is H(ej2πk/N)H(e^{j2\pi k/N}). This result is one reason Fourier series appears immediately after LTI systems.

At jump discontinuities, the Fourier series converges to the midpoint of the left and right limits under standard Dirichlet conditions:

x(t0)+x(t0+)2.\frac{x(t_0^-)+x(t_0^+)}{2}.

Near jumps, partial sums show overshoot known as the Gibbs phenomenon. Increasing the number of harmonics narrows the oscillatory region but does not remove the limiting overshoot.

Coefficient patterns reveal signal structure. A real and even continuous-time signal has real and even coefficients. A real and odd signal has purely imaginary, odd-symmetric coefficients in the complex form. Half-wave symmetry often removes even harmonics. These facts are not just shortcuts; they are checks on whether the coefficient signs and factors are plausible.

The DC coefficient is the average value over one period. In continuous time,

a0=1T0T0x(t)dt.a_0=\frac{1}{T_0}\int_{T_0}x(t)\,dt.

In discrete time,

a0=1Nn=0N1x[n].a_0=\frac{1}{N}\sum_{n=0}^{N-1}x[n].

If a waveform spends equal positive and negative area over a period, a0a_0 should be zero. If the signal is always nonnegative, a negative a0a_0 is a warning sign.

Fourier series also separates waveform smoothness from spectral decay. Signals with jumps have coefficients that decay slowly, typically like 1/k1/\vert k\vert . Signals with more smooth derivatives have faster coefficient decay. This is why sharp edges require many harmonics to approximate accurately.

Visual

FeatureCT Fourier seriesDT Fourier series
Signal typeperiodic x(t)x(t)periodic x[n]x[n]
Fundamental frequencyω0=2π/T0\omega_0=2\pi/T_0Ω0=2π/N\Omega_0=2\pi/N
Synthesisk=akejkω0t\sum_{k=-\infty}^{\infty}a_k e^{jk\omega_0t}k=0N1akej(2π/N)kn\sum_{k=0}^{N-1}a_k e^{j(2\pi/N)kn}
Analysis1T0T0x(t)ejkω0tdt\frac{1}{T_0}\int_{T_0}x(t)e^{-jk\omega_0t}dt1Nn=0N1x[n]ej(2π/N)kn\frac{1}{N}\sum_{n=0}^{N-1}x[n]e^{-j(2\pi/N)kn}
Number of distinct harmonicscountably infiniteNN
Power relationP=k=ak2P=\sum_{k=-\infty}^{\infty}\vert a_k\vert ^2P=k=0N1ak2P=\sum_{k=0}^{N-1}\vert a_k\vert ^2

Worked example 1: CTFS coefficients of a square wave

Problem: Let x(t)x(t) be periodic with period T0=2πT_0=2\pi and

x(t)={1,0<t<π,1,π<t<0.x(t)= \begin{cases} 1, & 0<t<\pi,\\ -1, & -\pi<t<0. \end{cases}

Find the complex Fourier series coefficients.

Method:

  1. The fundamental frequency is
ω0=2π2π=1.\omega_0=\frac{2\pi}{2\pi}=1.
  1. Use the coefficient formula:
ak=12πππx(t)ejktdt.a_k=\frac{1}{2\pi}\int_{-\pi}^{\pi}x(t)e^{-jkt}\,dt.
  1. Split the integral:
ak=12π(π0(1)ejktdt+0πejktdt).a_k=\frac{1}{2\pi} \left( \int_{-\pi}^{0}(-1)e^{-jkt}\,dt +\int_{0}^{\pi}e^{-jkt}\,dt \right).
  1. For k0k\ne 0,
ejktdt=ejktjk.\int e^{-jkt}\,dt=\frac{e^{-jkt}}{-jk}.

Therefore

ak=12π(1ejkπjk+ejkπ1jk).a_k=\frac{1}{2\pi} \left( -\frac{1-e^{jk\pi}}{-jk} +\frac{e^{-jk\pi}-1}{-jk} \right).
  1. Since ejkπ=ejkπ=(1)ke^{jk\pi}=e^{-jk\pi}=(-1)^k,
ak=12π(1(1)kjk+(1)k1jk).a_k=\frac{1}{2\pi} \left( \frac{1-(-1)^k}{jk} +\frac{(-1)^k-1}{-jk} \right).

The two terms are equal, so

ak=12π2(1(1)k)jk=1(1)kjπk.a_k=\frac{1}{2\pi}\frac{2(1-(-1)^k)}{jk} =\frac{1-(-1)^k}{j\pi k}.
  1. For even kk, 1(1)k=01-(-1)^k=0. For odd kk, 1(1)k=21-(-1)^k=2:
ak={2jπk,k odd,0,k even.a_k= \begin{cases} \frac{2}{j\pi k}, & k \text{ odd},\\ 0, & k \text{ even}. \end{cases}
  1. The DC coefficient is
a0=12π(π+π)=0.a_0=\frac{1}{2\pi}\left(-\pi+\pi\right)=0.

Checked answer: The signal is odd, so coefficients are purely imaginary and odd-symmetric, which agrees with ak=2/(jπk)a_k=2/(j\pi k) for odd kk and zero otherwise.

Worked example 2: DTFS coefficients of a period-4 sequence

Problem: A periodic sequence has one period

x[0]=1,x[1]=2,x[2]=1,x[3]=0.x[0]=1,\quad x[1]=2,\quad x[2]=1,\quad x[3]=0.

Find its DTFS coefficients.

Method:

  1. The period is N=4N=4, so
ak=14n=03x[n]ej(2π/4)kn.a_k=\frac{1}{4}\sum_{n=0}^{3}x[n]e^{-j(2\pi/4)kn}.
  1. Simplify the frequency factor:
ej(2π/4)kn=ej(π/2)kn.e^{-j(2\pi/4)kn}=e^{-j(\pi/2)kn}.
  1. Compute each coefficient.

For k=0k=0:

a0=14(1+2+1+0)=1.a_0=\frac{1}{4}(1+2+1+0)=1.

For k=1k=1:

a1=14(1+2ejπ/2+ejπ+0).a_1=\frac{1}{4}\left(1+2e^{-j\pi/2}+e^{-j\pi}+0\right).

Use ejπ/2=je^{-j\pi/2}=-j and ejπ=1e^{-j\pi}=-1:

a1=14(12j1)=j2.a_1=\frac{1}{4}(1-2j-1)=-\frac{j}{2}.

For k=2k=2:

a2=14(1+2ejπ+ej2π)=14(12+1)=0.a_2=\frac{1}{4}\left(1+2e^{-j\pi}+e^{-j2\pi}\right) =\frac{1}{4}(1-2+1)=0.

For k=3k=3:

a3=14(1+2ej3π/2+ej3π).a_3=\frac{1}{4}\left(1+2e^{-j3\pi/2}+e^{-j3\pi}\right).

Use ej3π/2=je^{-j3\pi/2}=j and ej3π=1e^{-j3\pi}=-1:

a3=14(1+2j1)=j2.a_3=\frac{1}{4}(1+2j-1)=\frac{j}{2}.

Checked answer:

a0=1,a1=j2,a2=0,a3=j2.a_0=1,\qquad a_1=-\frac{j}{2},\qquad a_2=0,\qquad a_3=\frac{j}{2}.

Because x[n]x[n] is real, a3=a1a_3=a_1^*, as expected.

Code

import numpy as np

x = np.array([1, 2, 1, 0], dtype=complex)
N = len(x)
n = np.arange(N)
k = np.arange(N)

W = np.exp(-1j * 2 * np.pi / N * np.outer(k, n))
a = (W @ x) / N

print("DTFS coefficients:")
for idx, coeff in enumerate(a):
print(idx, np.round(coeff, 6))

x_rebuilt = np.exp(1j * 2 * np.pi / N * np.outer(n, k)) @ a
print("reconstruction:", np.round(x_rebuilt.real, 6))

Common pitfalls

  • Using Fourier transform formulas for a periodic signal without recognizing the spectrum is made of lines.
  • Forgetting the 1/T01/T_0 or 1/N1/N factor in the analysis equation.
  • Summing DTFS over infinitely many distinct harmonics. Only NN harmonics are distinct for period NN.
  • Assuming the Fourier series equals the original value exactly at a jump. It converges to the midpoint under standard conditions.
  • Losing conjugate symmetry checks for real signals; they are useful for catching sign errors.

Connections