This document derives the Fourier Series coefficients for several functions. The functions shown here are fairly simple, but the concepts extend to more complex functions.

Consider the periodic pulse function shown below. It is an even function with period *T*. The function is a pulse function with amplitude *A*, and pulse width *T _{p}*. The function can be defined over one period (centered around the origin) as:

{A,\quad |t| \le {{{T_p}} \over 2}} \cr

{0,\quad |t| \gt {{{T_p}} \over 2}} \cr

} } \right.,\quad \quad - {T \over 2} < t \le {T \over 2}$$

The periodic pulse function can be represented in functional form as *Π _{T}(t/T_{p})*. During one period (centered around the origin)

{1,\quad |t| \le {1 \over 2}} \cr

{0,\quad |t| \gt {1 \over 2}} \cr

} } \right.,\quad \quad - {T \over 2} < t \le {T \over 2}$$

*Π _{T}(t)* represents a periodic function with period

{1,\quad |t| \le {{{T_p}} \over 2}} \cr

{0,\quad |t| > {{{T_p}} \over 2}} \cr } } \right.,\quad \quad - {T \over 2} < t \le {T \over 2}$$

This can be a bit hard to understand at first, but consider the sine function. The function *sin(x/2)* twice as slow as *sin(x)* (i.e., each oscillation is twice as wide). In the same way *Π _{T}(t/2)* is twice as wide (i.e., slow) as

The Fourier Series representation is

$${x_T}(t) = {a_0} + \sum\limits_{n = 1}^\infty {\left( {{a_n}\cos \left( {n{\omega _0}t} \right) + {b_n}\sin \left( {n{\omega _0}t} \right)} \right)} $$ Since the function is even there are only *a _{n}* terms.

The average is easily found,

$$a_0=A\frac{T_p}T$$The other terms follow from

$${a_n} = {2 \over T}\int\limits_T {{x_T}\left( t \right)\cos \left( {n{\omega _0}t} \right)dt} ,\quad n \ne 0$$Any interval of one period is allowed but the interval from *-T/2* to *T/2* is straightforward in this case.

Since *x _{T}(t)=A* between

{a_n} &= {2 \over T}\int\limits_{ - {{{T_p}} \over 2}}^{ + {{{T_p}} \over 2}} {A\cos \left( {n{\omega _0}t} \right)dt} \cr

&= \left. {{2 \over T}{A \over {n{\omega _0}}}\sin \left( {n{\omega _0}t} \right)} \right|_{ - {{{T_p}} \over 2}}^{ + {{{T_p}} \over 2}} \cr

&= {2 \over T}{A \over {n{\omega _0}}}\left( {\sin \left( { + n{\omega _0}{{{T_p}} \over 2}} \right) - \sin \left( { - n{\omega _0}{{{T_p}} \over 2}} \right)} \right) \cr\end{align} $$

Since *sine* is an odd function, *sin(a)-sin(-a)=2sin(a)*, and using the fact that *ω _{0}=2π/T* and

This result is further explored in two examples.

Consider the case when the duty cycle is 50% (this means that the function is high 50% of the time, or *T _{p}=T/2*),

{a_n} = 2{A \over {n\pi }}\sin \left( {n\pi {{{t_p}} \over T}} \right) = 2{A \over {n\pi }}\sin \left( {{{n\pi } \over 2}} \right) \cr

n = 0,\,1,\,2,\,3,\,4,\,5,...\quad \sin \left( {{{n\pi } \over 2}} \right) = 0,1,0, - 1,0,1,... = \left\{ {\matrix{

{ - {1^{{{n - 1} \over 2}}},\quad n\;odd} \cr

{0,\quad n\;even} \cr } } \right. \cr

{a_n} = \left\{ {\matrix{

{2{A \over {n\pi }}\left( { - {1^{{{n - 1} \over 2}}}} \right),\quad n\;odd} \cr

{\quad 0,\quad n\;even,\;n \ne 0\;} \cr } } \right. \cr} $$

The values for *a _{n}* are given in the table below. Note: this example was used on the page introducing the Fourier Series. Note also, that in this case

n |
a_{n} |

0 | 0.5 |

1 | 0.6366 |

2 | 0 |

3 | -0.2122 |

4 | 0 |

5 | 0.1273 |

6 | 0 |

7 | -0.0909 |

Average + 1^{st} harmonic
up to 3^{rd} harmonic
...5th harmonic
...7^{th}
...21^{st }

The graph shows the function *x _{T}(t)* (blue) and the partial Fourier Sum (from

as well as the highest frequency harmonic, $a_Ncos(N\omega_0t)$ (dotted magenta). Lower frequency harmonics in the summation are thin dotted blue lines (but harmonics with $a_n0$ are not shown. You can change *n* by clicking the buttons. As before, note:

- As you add sine waves of increasingly higher frequency, the approximation improves.
- The addition of higher frequencies better approximates the rapid changes, or details, (i.e., the discontinuity) of the original function (in this case, the square wave).
- Gibb's overshoot exists on either side of the discontinuity.
- Because of the symmetry of the waveform, only odd harmonics (1, 3, 5, ...) are needed to approximate the function. The reasons for this are discussed below
- The rightmost button shows the sum of all harmonics up to the 21st harmonic, but not all of the individual sinusoids are explicitly shown on the plot. In particular harmonics between 7 and 21 are not shown.

Now consider the case when the duty cycle is 40%, *A=1*, and *T=2*. In this case *a _{0}=average=0.4* and for

The values for *a _{n}* are given in the table below (note: this example was used on the previous page).

n |
a_{n} |

0 | 0.5 |

1 | 0.6055 |

2 | 0.1871 |

3 | -0.1247 |

4 | -0.1514 |

5 | -0.0000 |

6 | 0.1009 |

7 | 0.0535 |

Average + 1^{st} harmonic
up to 2^{nd} harmonic
...3^{rd} harmonic
...4^{th}
...21^{st }

The graph shows the function *x _{T}(t)* (blue) and the partial Fourier Sum (from

Note that because this example is similar to the previous one, the coefficients are similar, but they are no longer equal to zero for n even.

In problems with even and odd functions, we can exploit the inherent symmetry to simplify the integral. We will exploit other symmetries later. Consider the problem above. We have an expression for *a _{n}*,

If *x _{T}(t)* is even, then the product

so

$${a_n} = {4 \over T}\int\limits_0^{{T \over 2}} {{x_T}\left( t \right)\cos \left( {n{\omega _0}t} \right)dt} $$which generates the same answer as before. This will often be simpler to evaluate than the original integral because one of the limits of integration is zero.

Consider, again, the pulse function. We can also represent *x _{T}(t)* by the Exponential Fourier Series

We find the *c _{n}*

As before the integral is from *-T/2* to *+T/2* and make use of the facts that the function is constant for *|t|<T _{p}/2* and zero elsewhere, and the

{c_n} &= {1 \over T}\int\limits_{ - {T \over 2}}^{ + {T \over 2}} {{x_T}(t){e^{ - jn{\omega _0}t}}dt} = {1 \over T}\int\limits_{ - {{{T_p}} \over 2}}^{ + {{{T_p}} \over 2}} {A{e^{ - jn{\omega _0}t}}dt} \cr

&= \left. {{A \over { - Tjn{\omega _0}}}{e^{ - jn{\omega _0}t}}} \right|_{ - {{{T_p}} \over 2}}^{ + {{{T_p}} \over 2}} = {A \over { - j2\pi n}}\left( {{e^{ - jn{\omega _0}{{{T_p}} \over 2}}} - {e^{ + jn{\omega _0}{{{T_p}} \over 2}}}} \right) \cr\end{align} $$

Euler's identities dictate that *e ^{+jθ}-e^{-jθ}=2jsin(θ)* so

Note that, as expected, *c _{0}=a_{0}* and

Consider the triangle wave

The average value (i.e., the *0 ^{th}* Fourier Series Coefficients) is

Between *t=0* and *t=T/2* the function is defined by *x _{T}(t)=A-4At/T* so

Perform the integrations (either by hand using integration by parts, or with a table of integrals, or by computer) and use the fact that *ω _{0}·T=2·π*

Since *sin(π·n)=0* this simplifies to

This answer is correct, but noting that

$$n = 0,1,2,3,4,5,6,7,...\quad \quad \sin {\left( {{{\pi {\mkern 1mu} n} \over 2}} \right)^2} = 0,1,0,1,0,1,0,... = {{{ 1 -{\left( { - 1} \right)}^n}} \over 2}$$yields an even simpler result

$${a_n} = \left\{ {\matrix{{4A{{1 - {{\left( { - 1} \right)}^n}} \over {{\pi ^2}{\mkern 1mu} {n^2}}},\quad {\rm{n odd}}} \cr

{0,\quad {\rm{n even}}} \cr } } \right.$$

If *x _{T}(t)* is a triangle wave with

n |
a_{n} |

0 | 0 |

1 | 0.8106 |

2 | 0 |

3 | 0.0901 |

4 | 0 |

5 | 0.0324 |

6 | 0 |

7 | 0.0165 |

Average + 1^{st} harmonic
up to 3^{rd} harmonic
...5^{th} harmonic
...7^{th}
...9^{th}

Note: this is similar, but not identical, to the triangle wave seen earlier.

Note:

- As you add sine waves of increasingly higher frequency, the approximation gets better and better, and these higher frequencies better approximate the details, (i.e., the change in slope) in the original function.
- The amplitudes of the harmonics for this example drop off much more rapidly (in this case they go as
*1/n*(which is faster than the^{2}*1/n*decay seen in the pulse function Fourier Series (above)). Conceptually, this occurs because the triangle wave looks much more like the 1st harmonic, so the contributions of the higher harmonics are less. Even with only the 1st few harmonics we have a very good approximation to the original function. - There is no discontinuity, so no Gibb's overshoot.
- As before, only odd harmonics (1, 3, 5, ...) are needed to approximate the function; this is because of the symmetry of the function.

Thus far, the functions considered have all been even. The diagram below shows an odd function.

In this case, a Fourier Sine Series is appropriate

$${x_T}(t) = \sum\limits_{n = 1}^\infty {{b_n}\sin \left( {n{\omega _0}t} \right)} \quad \quad {b_n} = {2 \over T}\int\limits_T {{x_T}\left( t \right)\sin \left( {n{\omega _0}t} \right)dt} $$It is easiest to integrate from *-T/2* to *+T/2*. Over this interval $x_T(t)=2At/T$.

Performing the integration (and using the fact that *ω _{0}·T=2·π*) the integral yields

Using two simplification, *sin(π·n)=0* and *cos(π·n)=(-1) ^{n}* gives

In this case since *x _{T}(t)* is odd and is multiplied by another odd function (

If *x _{T}(t)* is a sawtooth wave with

n |
b_{n} |

1 | 0.6366 |

2 | -0.3183 |

3 | 0.2122 |

4 | -0.1592 |

5 | 0.1273 |

6 | -0.1061 |

7 | 0.0909 |

Average + 1^{st} harmonic
up to 2^{nd} harmonic
...3^{rd}
...4^{th}
...5^{th}
...20^{th}

Note: this is similar, but not identical, to the sawtooth wave seen earlier.

Note:

- As you add sine waves of increasingly higher frequency, the approximation gets better and better, and these higher frequencies better approximate the details, (i.e., the change in slope) in the original function.
- Since this function doesn't look as much like a sinusoid as the triangle wave, the coefficients decrease less rapidly (as
*1/n*instead of*1/n*^{2} - There is Gibb's overshoot caused by the discontinuity.

So far, all of the functions considered have been either even or odd, but most functions are neither. This presents no conceptual difficult, but may require more integrations. For example if the function *x _{T}(t)* looks like the one below

Since this has no obvious symmetries, a simple Sine or Cosine Series does not suffice. For the Trigonometric Fourier Series, this requires three integrals

$$\begin{align}{x_T}(t) &= {a_0} + \sum\limits_{n = 1}^\infty {\left( {{a_n}\cos \left( {n{\omega _0}t} \right) + {b_n}\sin \left( {n{\omega _0}t} \right)} \right)} \cr

{a_0} &= {2 \over T}\int\limits_T {{x_T}\left( t \right)dt} \cr

{a_n} &= {2 \over T}\int\limits_T {{x_T}\left( t \right)\cos \left( {n{\omega _0}t} \right)dt} ,\quad n \ne 0 \cr

{b_n} &= {2 \over T}\int\limits_T {{x_T}\left( t \right)\sin \left( {n{\omega _0}t} \right)dt} \cr\end{align} $$

However, an exponential series requires only a single integral

$$\displaylines{{x_T}(t) = \sum\limits_{n = - \infty }^{ + \infty } {{c_n}{e^{jn{\omega _0}t}}} \cr

{c_n} = {1 \over T}\int\limits_T {{x_T}\left( t \right){e^{ - jn{\omega _0}t}}dt} \cr} $$

For this reason, among others, the Exponential Fourier Series is often easier to work with, though it lacks the straightforward visualization afforded by the Trigonometric Fourier Series.

In this case, but not in general, we can easily find the Fourier Series coefficients by realizing that this function is just the sum of the square wave (with 50% duty cycle) and the sawtooth so

n |
a_{n} |
b_{n} |

0 | 0.5 | ---- |

1 | 0.6366 | 0.6366 |

2 | 0 | -0.3183 |

3 | -0.2122 | 0.2122 |

4 | 0 | -0.1592 |

5 | 0.1273 | 0.1273 |

6 | 0 | -0.1061 |

7 | -0.0909 | 0.0909 |

From the relationship between the Trigonometric and Exponential Fourier Series

$$c_0=a_0 \ and \ c_n = \frac{a_n}2 - j\frac{b_n}2 for n \neq 0, \quad with \ c_{-n}=c_n^*$$n |
c_{n} |

-7 | -0.0455 + 0.0455j |

-6 | -0.0531j |

-5 | 0.0637 + 0.0637j |

-4 | -0.0796j |

-3 | -0.1061 + 0.1061j |

-2 | -0.1592j |

-1 | 0.3183 + 0.3183j |

0 | 0.5 |

1 | 0.3183 - 0.3183j |

2 | 0.1592j |

3 | -0.1061 - 0.1061j |

4 | 0.0796j |

5 | 0.0637 - 0.0637j |

6 | 0.0531j |

7 | -0.0455 - 0.0455j |

Average + 1^{st} harmonic
up to 2^{nd} harmonic
...3^{rd}
...4^{th}
...5^{th}
...20^{th}

Note: this is similar, but not identical, to the sawtooth wave seen earlier.

Note:

- As you add sine waves of increasingly higher frequency, the approximation gets better and better, and these higher frequencies better approximate the details, (i.e., the change in slope) in the original function.
- There is Gibb's overshoot caused by the discontinuities.

If the function *x _{T}(t)* has certain symmetries, we can simplify the calculation of the coefficients.

Symmetry |
Simplification |

x is even_{T}(t) |
$$\displaylines{ {a_0} = average \cr {a_n} = {4 \over T}\int\limits_0^{ + {T \over 2}} {{x_T}(t)\cos \left( {n{\omega _0}t} \right)dt} , \quad n \neq 0 \cr {b_n} = 0 \cr} $$ |

x is odd_{T}(t) |
$$\displaylines{ {a_n} = 0 \cr {b_n} = {4 \over T}\int\limits_0^{ + {T \over 2}} {{x_T}(t)\sin \left( {n{\omega _0}t} \right)dt} \cr} $$ |

x has half-wave symmetry. _{T}(t)A function can have half-wave symmetry without being either even or odd. |
$$\displaylines{ {a_n} = {b_n} = 0,\quad n\;even \cr {a_n} = {4 \over T}\int\limits_0^{ + {T \over 2}} {{x_T}(t)\cos \left( {n{\omega _0}t} \right)dt} ,\quad n\;odd \cr {b_n} = {4 \over T}\int\limits_0^{ + {T \over 2}} {{x_T}(t)\sin \left( {n{\omega _0}t} \right)dt} ,\quad n\;odd \cr} $$ |

The first two symmetries are were discussed previously in the discussions of the pulse function (*x _{T}(t)* is even) and the sawtooth wave (

Half-wave symmetry is depicted the diagram below.

The top function, *x _{T1}(t)*, is odd (

The reason the coefficients of the even harmonics are zero can be understood in the context of the diagram below. The top graph shows a function, *x _{T}(t)* with half-wave symmetry along with the first four harmonics of the Fourier Series (only sines are needed because

Now imagine integrating the product terms from *-T/2* to *+T/2*. The odd terms (from the 1st (red) and 3rd (magenta) harmonics) will have a positive result (because they are above zero more than they are below zero). The even terms (green and cyan) will integrate to zero (because they are equally above and below zero). Though this is a simple example, the concept applies for more complicated functions, and for higher harmonics.

The only function discussed with half-wave symmetry was the triangle wave and indeed the coefficients with even indices are equal to zero (as are all of the *b _{n}* terms because of the even symmetry). The square wave with 50% duty cycle would have half wave symmetry if it were centered around zero (i.e., centered on the horizontal axis). In that case the

Simplifications can also be made based on quarter-wave symmetry, but these are not discussed here.

Since the coefficients *c _{n}* of the Exponential Fourier Series are related to the Trigonometric Series by

{c_0} = {a_0} \cr

{c_n} = {{{a_n}} \over 2} - j{{{b_n}} \over 2}for\;n \ne 0 \cr

{c_{ - n}} = c_n^* \cr} $$

(assuming *x _{T}(t)* is real) we can use the symmetry properties of the Trigonometric Series to find

However, in addition, the coefficients of *c _{n}* contain some symmetries of their own. In particular,

- The magnitude of the
*c*terms are even with respect to n:_{n}*|c*._{-n}|=|c_{n}| - The angle of the
*c*terms are odd with respect to n:_{n}*∠c*._{-n}=-∠c_{n} - The real part of
*c*is even (_{n}*Re(c*) and the imaginary part is odd (_{-n}) = Re(c_{n})*Im(c*)_{-n}) =-Im(c_{n}) - If
*x*is even, then_{T}(t)*b*and_{n}=0*c*is even and real._{n} - If
*x*is odd, then_{T}(t)*a*and_{n}=0*c*is odd and imaginary._{n}

Let's examine the Fourier Series representation of the periodic rectangular pulse function, *Π _{T}(t/T_{p})*, more carefully.

Since the function is even, we expect the coefficients of the Exponential Fourier Series to be real and even(from symmetry properties). Furthermore, we have already calculated the coefficients of the Trigonometric Series, and could easily calculate those of the Exponential Series. However, let us do it from first principles. The Exponential Fourier Series coefficients are given by

$$\displaylines{

{\Pi _t}\left( {{t \over {{T_p}}}} \right) = \sum\limits_{n = - \infty }^{ + \infty } {{c_n}{e^{jn{\omega _0}t}}} \cr

with \cr
{c_n} = {1 \over T}\int_T {{\Pi _t}\left( {{t \over {{T_p}}}} \right){e^{ - jn{\omega _0}t}}dt} \cr
} $$

We can change the limits of integration to *-T _{p}/2* and

&= {1 \over { - jn{\omega _0}T}}\left( {{e^{ - jn{\omega _0}{{{T_p}} \over 2}}} - {e^{ + jn{\omega _0}{{{T_p}} \over 2}}}} \right) = {1 \over { - jn2\pi }}\left( {{e^{ - j{{n\pi {T_p}} \over T}}} - {e^{ + j{{n\pi {T_p}} \over T}}}} \right)\quad \quad \quad {\omega _0} = {{2\pi } \over T} \cr

&= {1 \over { - jn2\pi }}2j\sin \left( { - {{n\pi {T_p}} \over T}} \right) = {1 \over {n\pi }}\sin \left( {{{n\pi {T_p}} \over T}} \right) \cr

&= {{{T_p}} \over T}{{\sin \left( {{{n\pi {T_p}} \over T}} \right)} \over {{{n\pi {T_p}} \over T}}} \end{align} $$

The last step in the derivation is performed so we can use the *sinc()* function (pronounced like "*sink*"). This function comes up often in Fourier Analysis.

With this definition the coefficients simplify to

$${c_n} = {{{T_p}} \over T}{\mathop{\rm sinc}\nolimits} \left( {{{n{T_p}} \over T}} \right)$$The sinc function has several important features:

*sinc(x)=0*for all integer values of*x*except at*x=0*where*sinc(0)=1*. This is because*sin(π·n)=0*for all integer values of n. However at*n=0*we have*sin(π·n)/(π·n)*which is zero divided by zero, but by L'Hôpital's rule get a value of 1.- The first zeros away from the origin occur when
*x=±1*. - The function decays with an envelope of
*1/(π·x)*as*x*moves from the origin. This is because the*sin()*function has successive maxima with an amplitude of 1, and the sin function is divided by*π·x*.

The diagram below shows *c _{n}* vs

Duty cycle = 0.1
...0.25
...0.5
...0.75
...0.9

The graph on the left shows the time domain function. If you hit the middle button, you will see a square wave with a duty cycle of 0.5 (i.e., it is high 50% of the time). The period of the square wave is *T=2·π;*. The graph on the right shown the values of *c _{n}* vs

- As
*T*decreases (along with the duty cycle,_{p}*T*), so does the value of_{p}/T*c*. This is to be expected because_{0}*c*is just the average value of the function and this will decrease as the pulse width does._{0} - As
*T*decreases, the "width" of the_{p}*sinc()*function broadens. This tells us that as the function becomes more localized in time (i.e., narrower) it becomes less localized in frequency (broader). In other words, if a function happens very rapidly in time, the signal must contain high frequency coefficients to enable the rapid change. - Let us call the "width" of the
*sinc()*function the width of the main lobe (i.e., between the first two zero crossings around*ω=0*),*Δn=2·T/T*. If we call the width of the pulse_{p}*Δt=t*then_{p}

$$\left( {\Delta n} \right) \cdot \left( {\Delta t} \right) = \left( {2{T \over {{T_p}}}} \right) \cdot \left( {{T_p}} \right) = 2T = {\rm{constant}}$$

This tells us explicitly that the product of width in frequency (i.e.,*Δn*) multiplied by the width in time (*Δt*) is constant - if one is doubled, the other is halved. Or - as one gets more localized in time, it is less localized in frequency. We will discuss this more later.

© Copyright 2005 to 2019 Erik Cheever This page may be freely used for educational purposes.

Erik Cheever Department of Engineering Swarthmore College