Sviluppi in serie di Fourier en

From "Physics, Waves, Music": a website about the physics of waves and sound, acoustics of musical instruments, musical scales, harmony and music.

AI-translated from Italian. Original page: Sviluppi_in_serie_di_Fourier

Statement of Fourier's theorem

Given a function y(t)

  1. periodic with period T
  2. bounded
  3. integrable on [0,T]

then y(t) can be expanded in a Fourier series, that is

y(t)=a0+∑n=1∞[ancos⁡(ωnt)+bnsin⁡(ωnt)] (1)

where an and bn are suitable coefficients that depend on the analytic form of the periodic function y(t), and

ωn=2πnT.

The sinusoids of the series therefore have frequencies fn=ωn/(2π)=n/T, integer multiples of the fundamental frequency f0=1/T.

The sinusoid whose frequency equals the fundamental frequency f0 is also called the fundamental harmonic or first harmonic; the sinusoids whose frequencies are multiples of the fundamental frequency are called higher harmonics (second, third, etc.) or also partials. An oscillation (wave) made up of several harmonics will be called a complex wave. Each complex wave will have its own harmonic content, characterized by the different values of the amplitudes and phases of the various harmonics into which it can be decomposed.

Calculation of the coefficients of the Fourier expansion

To calculate the coefficients an and bn, keep in mind that:

  • if the function y(t) is odd, as the sine function is, a series of sines only will be obtained (that is, the coefficients an are all zero);
  • if the function y(t) is even, as the cosine function is, a series of cosines only will be obtained (that is, the coefficients bn are all zero).

In general, the coefficients are calculated by means of the following integrals:

a0=1T∫0Ty(t)dt which is nothing but the mean value of the function y(t) over the periodicity interval [0,T].
an=2T∫−T2T2y(t)cos⁡(ωnt)dt (2)
bn=2T∫−T2T2y(t)sin⁡(ωnt)dt (3)

Examples of Fourier series

We present some notable expansions that you will also find used in our virtual laboratory to build the default waveforms.

In what follows we will always assume that:

  • the waveforms have period T (their analytic expression will be given only over one periodicity interval which, to exploit any symmetries of the function, has been "centred" at the origin, that is, it will go from -T/2 to T/2);
  • the mean value of the function is always zero, so that the coefficient a0 is always zero;
  • the amplitude of the function is 1.

Triangle wave

With the previous assumptions, the triangle wave can be represented analytically by the expression

y(t)={1+4Ttif−T2≤t<01−4Ttif0≤t≤T2

Since the function is even, a series of cosines only will be obtained. Calculating the integrals (2) and (3) indeed leads to the result

bn=0
an={8n2π2nodd0neven

The result obtained therefore shows that the series contains only cosines and that only odd harmonics are present. You can check these results directly with the app (selecting forme d'onda:triangolo (waveforms: triangle)):

  • note that only odd harmonics are present;
  • by moving the mouse over the slider of each harmonic you can check that the amplitude of the n-th harmonic is indeed given (apart from rounding errors) by
an=8n2π2
  • that the phase of each harmonic is zero (the app works precisely with cosine functions)
waveform in time amplitudes of the Fourier components (cosine)

Square wave

With the previous assumptions, the square wave can be represented analytically by the expression

y(t)={−1if−T2≤t<01if0≤t≤T2

Since the function is odd, a series of sines only will be obtained. Calculating the integrals (2) and (3) indeed leads to the result

an=0
bn={4nπnodd0neven

The result obtained therefore shows that the series contains only sines and that only odd harmonics are present. You can check these results directly with the app (selecting forme d'onda:Onda quadra (waveforms: square wave)):

  • note that only odd harmonics are present;
  • by moving the mouse over the slider of each harmonic you can check that the amplitude of the n-th harmonic is indeed given (apart from rounding errors) by
an=4nπ.
  • It is curious to note that the amplitude of the fundamental is larger than the amplitude of the whole square wave;
  • the phase of each harmonic is equal to −π2. This is correct, remembering
    • that the app expands in series using only cosine functions;
    • the trigonometric identity cos⁡(α−π2)=sin⁡(α)
waveform in time amplitudes of the Fourier components (cosine)

Sawtooth wave

With the previous assumptions, the "sawtooth" wave can be represented analytically by the expression

y(t)={2Ttif−T2≤t<T2

Since the function is odd, a series of sines only will be obtained. Calculating the integrals (2) and (3) indeed leads to the result

an=0
bn={2nπnodd−2nπneven

The result obtained therefore shows that the series contains only sines and that all harmonics, even and odd, are present.

waveform in time amplitudes of the Fourier components (sine)

You can check these results directly with the app (selecting forme d'onda:Dente di sega (waveforms: sawtooth)):

  • note that now all harmonics are present;
  • by moving the mouse over the slider of each harmonic you can check that the amplitude of the n-th harmonic is indeed given (apart from rounding errors) by
an=2nπ.
  • that the phase of the harmonics is alternately −π2 and π2 . This is correct, remembering
    • that the app expands in series using only cosine functions;
    • the trigonometric identities
cos⁡(α−π2)=sin⁡(α)
cos⁡(α+π2)=−sin⁡(α)

Taking the amplitudes as positive, the app "shifts" the minus sign of the bn with even n onto the phase of the cosine wave.

Check your understanding

Problem. A square wave of amplitude 1 has a frequency of 100 Hz. What are the frequencies and amplitudes of its first three non-zero components? Solution. Only the odd harmonics are present, with amplitudes 4/(nπ): 100 Hz with amplitude 4/π ≈ 1.27; 300 Hz with amplitude about 0.42; 500 Hz with amplitude about 0.25.

Problem. By how many dB is the third harmonic weaker than the fundamental in the triangle wave? And in the square wave? Which of the two waves has a "darker" sound? Solution. Triangle: the amplitude ratio is 1/n2 = 1/9, that is 20 log10(1/9) dB ≈ −19 dB. Square: 1/3, that is about −9.5 dB. In the triangle wave the higher harmonics are much weaker: the sound is darker, more similar to that of a sinusoid.

Problem. A constant 0.5 is added to a square wave, so that it oscillates between −0.5 and 1.5. Which Fourier coefficients change? Solution. Only a0, the mean value, changes, becoming 0.5. All the other coefficients stay the same because the integral of a constant times a sine or a cosine over a period is zero. A constant cannot be heard: it is like slightly changing the atmospheric pressure.


"Physics, Waves, Music": a website about the physics of waves, acoustics of musical instruments, musical scales, harmony and music.