Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Fourier Series

Complex Exponential Fourier Series

Write the Fourier series with complex exponentials, compute coefficients c_k, relate them to sine and cosine coefficients, and read magnitude and phase line spectra with Python.

The trigonometric series has two coefficients per harmonic and several formulas to remember. Using Euler's formula (see Complex Numbers and Phasors) we can collapse sines and cosines into complex exponentials and get one coefficient per harmonic, with a single formula. This is the form used almost everywhere in signals and systems.

The series and the formula

For a periodic x(t) with fundamental period T0 and w0 = 2 pi / T0:

x(t) = sum over k from -inf to +inf of c_k e^(j k w0 t)

c_k = (1/T0) integral over one period of x(t) e^(-j k w0 t) dt

The index k runs over negative as well as positive integers. The term c_k e^(j k w0 t) is a spinning arrow with starting amplitude and phase stored in the complex number c_k. Note that c_0 is the average value (DC), exactly a0 from the trigonometric form.

Substituting cos and sin in terms of exponentials shows that for k >= 1

  • c_k = (a_k - j b_k) / 2
  • c_{-k} = (a_k + j b_k) / 2

For a real signal this gives conjugate symmetry: c_{-k} = c_k*. Therefore |c_{-k}| = |c_k| (the magnitude spectrum is even) and angle(c_{-k}) = -angle(c_k) (the phase spectrum is odd). The amplitude of the k-th real sinusoid is 2 |c_k|: the negative-frequency partner carries the other half.

Line spectra

Plot |c_k| against frequency k f0 as vertical lines: the magnitude spectrum. Plot angle(c_k) the same way: the phase spectrum. Together they contain all the information in the signal. A text printout is enough to read them.

Python Coefficients of a square wave via the integral

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the phases of -90 degrees at positive k and +90 at negative k, and that even k give zero.

Computing coefficients with the FFT

For sampled data the integral becomes a sum over exactly one period, and that sum is the discrete Fourier transform. With N samples of one period, np.fft.fft(x) / N gives c_k for k = 0 ... N-1; indices above N/2 correspond to negative k.

Python FFT as a Fourier-series calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see c_0 = 1, c_{+-3} = 1 (since 2 cos gives amplitude 2 split into two halves) and c_{+-5} equal to -2j and +2j (the 4 sin term, 4 / 2 = 2, with a -j factor for sine). The numbers can be read straight from the exponential form of the signal.

Reconstruction

Sum the terms from -K to K and you obtain the same partial sum as the trigonometric version. Because the negative terms are the conjugates of the positive ones, the sum is real.

Python Rebuilding a sawtooth from complex coefficients

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

What the coefficients mean

flowchart LR
    A["x(t) periodic"] -->|"c_k = (1/T0) integral x e^(-jkw0t)"| B["coefficients c_k<br/>(magnitude and phase)"]
    B -->|"sum c_k e^(jkw0t)"| A

The coefficients and the signal carry exactly the same information: you can move in either direction.

Properties worth remembering:

  • Real signal: c_{-k} = c_k*.
  • Even real signal: c_k is real and even.
  • Odd real signal: c_k is purely imaginary and odd.
  • Larger |c_k| at high k means sharper features in time.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does c_0 represent?

    At k = 0 the exponential is 1, so c_0 = (1/T0) integral of x(t) dt, the average value.
  2. 2. For a real signal, c_{-k} equals:

    Conjugate symmetry makes the sum of c_k e^(jkw0t) and its partner real.
  3. 3. If a_k = 4 and b_k = 0 for some k, what is |c_k|?

    c_k = (a_k - j b_k) / 2 = 2, so |c_k| = 2; the partner c_{-k} holds the other half.
  4. 4. np.fft.fft(x) / N for one period of x gives:

    The DFT sum over one period, divided by N, equals the exponential Fourier series coefficients.

Summary

  • x(t) = sum of c_k e^(j k w0 t) with c_k = (1/T0) integral of x e^(-j k w0 t) dt.
  • c_k = (a_k - j b_k) / 2; real signals have c_{-k} = c_k*.
  • Magnitude and phase line spectra show amplitude and phase at each harmonic.
  • The FFT of one sampled period divided by N computes the coefficients.
  • Even real signals have real c_k; odd real signals have imaginary c_k.

Next: Common Fourier Series and the Gibbs Phenomenon