If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

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?

  • blobby green style avatar for user autoltzeeshan
    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!!
    (46 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seed style avatar for user JamesOwler97
    Are there any videos on the fourier transform?
    (19 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user Luis Gomez
    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)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Brando
    What is the relation of Fourier Series (specially this video) with the concept of the Fourier transform?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • purple pi purple style avatar for user APDahlen
      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)
  • blobby green style avatar for user Rami Sobhani
    What is the baseline constant?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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)
  • male robot hal style avatar for user Tanuj Kumar Pandey
    why we are using the Fourier series? whats the
    application?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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)
  • hopper cool style avatar for user Ethan La Chapelle
    why is it 2pi instead of just 2?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user omprakash.nekkanti
    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)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Jorge Fernando Celi Ruiz
    How are waves related to square representation?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • spunky sam orange style avatar for user Willy McAllister
      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)
  • blobby green style avatar for user reubenct
    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)
    Default Khan Academy avatar avatar for user

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.