Main content

## Electrical engineering

### Course: Electrical engineering > Unit 6

Lesson 1: Fourier series- Fourier Series introduction
- Integral of sin(mt) and cos(mt)
- Integral of sine times cosine
- Integral of product of sines
- Integral of product of cosines
- First term in a Fourier series
- Fourier coefficients for cosine terms
- Fourier coefficients for sine terms
- Finding Fourier coefficients for square wave
- Visualizing the Fourier expansion of a square wave

© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Fourier Series introduction

The Fourier Series allows us to model any arbitrary periodic signal with a combination of sines and cosines. In this video sequence Sal works out the Fourier Series of a square wave. Created by Sal Khan.

## Want to join the conversation?

- Can you do a series on Fourier Transform and its application too? saw your Laplace Series and absolutely loved it.

Fourier Transform would be even more awesome!!(47 votes)- Here's a youtube channel on signals and systems, which has videos on the fourier series, transform and applications:

https://www.youtube.com/watch?v=JCmOTe-odUE&list=PLWPirh4EWFpHr_1ZCkuF9ToYUrmujv9Aa&index=101(0 votes)

- Are there any videos on the fourier transform?(19 votes)
- As of this writing there is nothing yet on Khan Academy for the Fourier Transform.(12 votes)

- Will we ever have practice exercises for this material available on Khan Academy? I've used this website to study a host of topics from my differential equations class but none of those have practice material exercises available.(13 votes)
- What is the relation of Fourier Series (specially this video) with the concept of the Fourier transform?(3 votes)
- Hello Brando,

The Fourier Series is a shorthand mathematical description of a waveform. In this video we see that a square wave may be defined as the sum of an infinite number of sinusoids.

The Fourier transform is a machine (algorithm). It takes a waveform and decomposes it into a series of waveforms. If you fed a pure sinusoid into a Fourier transform you would get an output that describes a single sinusoid. If you fed a square wave into a Fourier transform you would get an output that could be described as by a Fourier series. Which is to say, a square wave is composed of an infinite sum of sinusoids.

Regards,

APD(16 votes)

- What is the baseline constant?(2 votes)
- Sal calls the first term, a_0, of the Fourier series the "baseline constant". This is a nickname for the term. In electronics it is also called the "DC offset". The a_0 term is not multiplied by a sine or cosine, so it is just a constant numbered added to the result.

If a_0 = 1, f(t) shifts upwards on the y axis. If a_0 = -1 then f(t) shifts down.

If you set a_0 equal to the average value of the square wave (half way between the maximum and minimum value) this shifts the square wave up until the minimum value falls right on the time axis. This is what he shows in the drawing. This means the constant a_0 controls where the "baseline" of the function ends up, hence the nickname, baseline constant.(4 votes)

- why we are using the Fourier series? whats the

application?(2 votes)- The Fourier series teaches you about the frequency content of waveforms that are not sine waves. When you see a square(-ish) wave you know it is contains frequency information at the odd harmonics of its fundamental frequency, 3rd, 5th, 7th harmonic, etc.

We understand a lot of circuits based on how they behave vs. frequency. These are called "filters", composed of R, L, and C. For example, in a digital circuit you drive square waves into wires and load gates. Those wires and gates act like filters. If you want the square wave to still look square-ish at the other end of the wire, that filter better allow at least the third and fifth harmonic of the square wave to pass through.(2 votes)

- why is it 2pi instead of just 2?(2 votes)
- Sines and cosines have periods of 2pi, which means they repeat after intervals of 2pi. You could, however, have a sinusoidal like sin((pi*x)/2), which would provide a period of 2 instead of 2pi.(2 votes)

- how come the function has som many values(straight line) at 0, 2Pi, 4Pi. Isn't it supposed to be a single point instead of line(2 votes)
- How are waves related to square representation?(1 vote)
- The theory of Fourier Series says
**any**periodic function (square, triangle, ramp, anything periodic) can be exactly reproduced by a sum of weighted sines and cosines. It often takes an infinite number of sines and cosines, but the match is exact. Pretty remarkable.

This theory is why we focus so intensely on understanding the math of sine and cosine. Because we know we can create any other periodic signal by adding up different-sized sines and cosines.(2 votes)

- So if the period of signal is not 2*pi, say T, then should the series consist of terms with phase n*2 pi/T *t ?(1 vote)
- Yes, T for adjusting the time period in the equation and n for calculating the multiples of the time period for making the fourier series approximation!(1 vote)

## Video transcript

- [Voiceover] So I have
the graph of y is equal to f of t here, our horizontal
axis is in terms of time, in terms of seconds. And this type of function
is often described as a square wave, and we see that
it is a periodic function, that it completes one
cycle every two pi seconds. And so we could say its
period is equal to two pi, if we wanna put the units
we could say two pi, two pi seconds per cycle,
we could write it like that. We could also just write s for seconds. And its frequency is
gonna be one over that. So we could write its
frequency is equal to one over two pi cycles per second,
cycles per second, it could also be described as hertz. And what we're gonna
explore in this video, is can we take a periodic
function like this and represent it as an infinite
sum of sines and cosines of different periods or
different frequencies? So to write that out a
little bit more clearly, can we take our f of t,
so can we take our f of t, and write it as the sum
of sines and cosines? So can we write it, so
it's going to be sum, let's say baseline constant,
that'll shift it up or down, and as we'll see, that's
going to be based on the average value of the
function over one period. So a sub zero, and
then, let's start adding some periodic functions here. And so let's take a sub
one times cosine of t. Now, why am I starting with cosine of t? And I could also add a sine of t, so plus b sub one, of sine of t. Why am I starting with
cosine of t and sine of t? Well, if our original function
has a period of two pi, and I just set up this one so it does have a period of two pi, well
it would make sense that it would involve some functions
that have periods of two pi. And these weights will tell
us how much they involve it. If a one is much larger
than b one, well it says, okay, this has a lot more
of cosine of t in it, than it has of sine of t in it. And that by itself isn't going
to describe this function, because we know what this would look like. This would look like
a very clean sinusoid, not like a square wave. And so what we're gonna do
is we're gonna add sinusoids of frequencies that are
multiples of these frequencies. So let's add a sub two, so
another waiting coefficient, times cosine of two t. This has a frequency of one over two pi, this has twice the frequency, this has a frequency of one over pi. And then a sub three
times cosine of three t. And I'm gonna keep going
on and on and on forever. And I'm gonna do the same
thing with the sines. So plus b two sine of two t
plus b three sine of three t. And you might be saying,
well, okay, this seems like a fun little mathematical exercise, but why do folks even do this? Well this was first
explored, and they're named, series like this, infinite
series where you represent something by essentially
weighted sines and cosines, this was explored originally by Fourier, and they're called Fourier Series. And they were interesting
to him in the study of differential equations,
because a lot of differential equations are easy to solve
when you involve sines and cosines, but not as
obvious to solve when you have more general functions, like
maybe a square wave here. But if you could
represent that square wave as sums of sines and cosines, then all of a sudden you
might be able to find more general solutions to
your differential equations. Another really interesting
thing about this, and this is really the
foundation of signal processing, it's very used, it's heavily
used in electrical engineering, is you can view these
coefficients as they are, they're weights on
these cosines and sines, but another way to think about it is, they tell you how much
of different frequencies that this function contains. So, for example, if a one
is much bigger than a two, then that tells you that
that function contains a lot more of the one over
two pi hertz frequency than the one over pi frequency. Or maybe a three is bigger
than a one or a two. And so you can start to
say, hey, this helps us start to think of a function
not just in terms of the time domain which f of t does,
but it can start bringing us to saying well, how much do
we have of each frequency? And as we'll see with Fourier
Series and eventually, Fourier Transforms, that's
going to get us into the frequency domain,
where we can start doing some signal processing. So we're going to explore
all of that in future videos. In order to understand how we can actually find these coefficients, we're
gonna review a little bit of our trigonometry, especially
integrating trig functions, and then we're gonna solve for these, and we're gonna see how
good we can approximate our function f.