Main content

### 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

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# First term in a Fourier series

The first term in a Fourier series is the average value (DC value) of the function being approximated. Created by Sal Khan.

## Want to join the conversation?

- The domain of the function is time, but how can time have negative value?(2 votes)
- If we say "now" is t = 0, then one second ago, t = -1. Negative time is any time in the past, relative to an arbitrary assignment of some time t = 0.(20 votes)

- Why does the a sub zero has a 1/2pi? Shouldnt it be 1/pi like according to the fourier series?(3 votes)
- Hi Fahmy... You ask a good question. Suppose the function f(t) is constant (no fluctuations), which means it is equal to a_0 (a sub zero). You integrate f(t) over the interval of t from 0 to 2pi, which is the area of a rectangle with height a_0 and base 2pi, getting answer 2pi times a_0 for the area. So you have to divide the value of the integral by 2pi (or multiply by 1/2pi) to recover a_0 as the value of the constant term in the Fourier series. The need to multiply by 1/2pi for the constant term comes about because the integral for the constant term introduces a factor 2pi.

In contrast, the integrals for the other terms introduce a factor pi if it is a pure frequency (sine wave, or cosine wave) that is being integrated. So with those terms (coefficients) of the Fourier series you have to divide by pi, or multiply by 1/pi, to recover the original signal.

Hope that helps,

KR.(9 votes)

- But what about a function f(t) which does not repeat every 2pi , but which decreases (or increases) ?(4 votes)
- Would the coefficient of the answer, that is, the final integral in the video, still be 1/(2pi) if the period of f(t) was NOT 2pi? (Assuming it's still a periodic function?)(3 votes)
- It still is unclear why so many texts define the a0 term as 1/2(a0). Why?(1 vote)
- I couldn't find that in my textbook (Oppenheim and Willsky), but if I was to guess... The first term of any Fourier Series is the average value of the periodic function. I'm guessing where you see a0/2, that its actually referring to half the amplitude of the signal, or A/2, where A is the amplitude (peak value) of a periodic function whose bottom is sitting on the time axis. Sal's square wave in these videos is like that. The wave is sitting on the time axis. He never actually mentions the amplitude of the square wave until three videos farther on at1:05in "Finding Fourier coefficients for a square wave. The amplitude is A = 3, and the average value is a0 = 1.5.(4 votes)

- Hi! At1:35, how do we know the integral can be distributed over infinitely many terms? Don't we need some special convergence conditions to do that?(2 votes)
- At about5:37we determine the average value, a_0 is 1/2pi multiplied by the integral of the function over one period, but the number 1/2pi confuses me. How is that average? Wouldn't the average just be 1/2 or something? Conceptually that number doesn't make sense and I need help understanding why 1/2pi would establish an average(1 vote)
- Sal assumes the period of the original square wave is 2pi.

The general formula for the average of a function represents the period of the function with the variable T.

avg(f(t)) = 1/T Int_0^T f(t) dt

Sal happens to assume a function where T = 2pi, so that's the number that appears in his result for the first term in the Fourier series, a_0.

Does it make more conceptual sense to have 1/T out in front of the integral?(2 votes)

- what would happen if the function is not a square function . Then would a(0) give the average value ? Thank You :)(1 vote)
- Yes, because the purpose of the average value is to ensure that the fourier series remains positive.(2 votes)

- What if we don't know f(t)?(1 vote)
- You might have a periodic signal, but you might not have an analytic expression for it. In this video the signal is given as a repeating square wave, but, if the signal is a note from a musical instrument or a vibration, or anything that appears to be periodic but complicated, you don't exactly know an equation for the signal. In that case you would resort to digital signal processing using a digital version of the Fourier Transform (called a DFT or FFT).

If the signal is periodic the Fourier Transform will reveal a sequence a sharp peak occurring at some fundamental frequency plus peaks at increasing harmonics of the fundamental. The amplitude of those peaks are the coefficients of a Fourier Series that approximates your signal.(2 votes)

- I see how you arrived at the answer, but I don't see how its the average or how you knew to place the line where you did, what is on the y axis?(1 vote)
- At5:25Sal has simplified the giant equation above and arranged it to isolate and solve for a_0. He looks at the right side of the equation and recognizes it (and puts a blue box around it). It is the same as the formula for the average value of f(t). If you have not come across this formula yet in your calculus studies, I'll just tell you... this is the formula for the average of an arbitrary f(t) that has a period of 1/2pi.

This formula is the extension to calculus of the way you average a list of numbers... add them up and divide by the number of numbers. In this case you add up all the tiny values of f(t)dt using the integral and divide by the period of f(t). In the specific case of this video Sal previously defined the period as 1/2pi.

The y-axis is the amplitude of the signal. For this square wave, just by inspection, you can tell the average value falls half way between the upper and lower value. The point of this video is to grind through the math to show how the first term of the Fourier series works out to be that half-way value.(2 votes)

## Video transcript

- Several videos ago,
we introduced the idea of a Fourier series. That I could take a periodic function, we started with the example of this square wave, and that I could represent it as the sum of weighted sines and cosines. And then we took a little bit of an interlude of building up some of our mathematical foundations, just establishing a bunch of properties of taking the definite integral over the period of that periodic function of sine and cosines and we established all of these properties. And now we're going to get the benefit from establishing all those because we're going to start actually finding at least a formula for
Fourier coefficients and then we can apply it to our original square wave to see that, hey, this could actually be a pretty straightforward thing. So right over here, I have rewritten a Fourier series expression, or I've rewritten a Fourier series for a periodic function f(t), let's say its period is 2π, and I'm going to use this in some of the properties that we have established to start solving for
these actual coefficients. And what I'm gonna do in this video, I'm gonna first try to solve for a-sub-0 and then in the next video, we're gonna solve for
an arbitrary a-sub-n. And either in that one or the next one, we'll also solve for an arbitrary b-sub-n. So to solve for a-sub-0, what we're going to do is take the definite integral of both sides from 0 to 2π. So 0 to 2π, dt of f(t), well that's gonna be the same thing as going from 0 to 2π of all of this stuff. And remember, this is an infinite series right over here, we have an infinite number of terms. And then we would have a dt out there. But we know from our
integration properties, taking the definite integral of a sum, even an infinite sum, is the same thing as the sum of the definite integrals. So that's going to be the same thing as taking this integral, dt plus this integral. And I could take the scaler out. Actually, let me just not do that, let me just write it like this. 0 to 2π, dt. 0 to 2π, dt. 0 to 2π, dt. This is getting a little monotonous, but it'll be worth it. 0 to 2π, dt. 0 to 2π, dt. 0 to 2π, dt. And we'll do it for every single one of the terms. And now what's nice is, we can look at our integration properties. This right over here, we could take these coefficients out. We could take this a-sub-1, put it in front of the integral sign. The a-sub-2, put it in front of the integral sign. The b-sub-1, put it in front of the integral sign. And then all you're left with is an integral from 0 to 2π of cosine of some integer multiple of t, dt. Well, we established
a couple of videos ago well, that's always
going to be equal to 0. The integral from 0 to 2π of cosine of some non-zero integer multiple of t, dt, that is equal to 0. And then the same thing is true for a sine of mt. So, this is gonna be fun. This is gonna be 0, based on what we just saw. If you just take that factor out of that integral, take that a-sub-1 out of the integral, it's gonna be a-sub-1 times 0. This is gonna be a-sub-2 times 0, that's gonna be 0. That's gonna be 0, that's gonna be 0, that's gonna be 0. Every term's gonna be 0, except for this one involving a-sub-0. And so, what is this going to be equal to? Well, let me write it this way. Let's take the integral of, the definite integral. Let me see where I have some space. So we're gonna take the definite integral from 0 to 2π of a-sub-0 dt, well that's the same thing. Once again, we can take
the coefficient out. And I can just put the dt like this and so that's going to be equal to a-sub-0 times t. Let me do that in magenta. Times t, evaluated at 2π and 0, which is going to be equal to a-sub-0 times 2π minus 0. Times 2π minus 0. Well, that's just 2π a-sub-0. So I could just write this a-sub-0 times 2π. So this expression right here is a-sub-0 times 2π. So let me scroll down a little bit. So I can rewrite this thing up here, the integral from 0 to 2π of f(t) dt which is equal to this integral. Well, we've just figured out that the integral from 0 to 2π of a-sub-0 dt is the same thing as a-sub-0 times 2π. Is equal to a-sub-0 times 2π. Times 2π. And so now, it's actually pretty straightforward to solve for a-sub-0. A-sub-0 is going to be equal to a-sub-0 is going to be equal to 1 over 2π, 1 over 2π times the definite integral from 0 to 2π, I'll just write the dt, of, let me write it a little bit, dt of f(t), oh I'll just write it like this. f(t) dt. And this is pretty cool because think about what this is. This over here, this is the average value of our function, this is the average value of f over the interval 0 to 2π. Average value of f over, over the interval, over we could say the interval from 0, the interval from 0 to 2π. And hopefully that actually makes intuitive sense. Because if I am, if you just think of
it from an engineering point of view, if you were just trying to engineer this, trying to just play around with these numbers, you know all of these cosines and sines, they oscillate between
positive 1 and negative 1. So in order to actually represent this function, you're gonna have to shift that oscillation. Sum of a bunch of oscillation is still gonna be an oscillation that's going to vary between positive 1 and our negative 1. And in order to shift it, well, that's what our a-sub-0 is going to do. And so what you, it makes sense that you would want to shift the oscillation so it oscillates around the average value of the function. Or you could say the average value of the function over, over an interval that's representative of a period of that function. And so that is what a-sub-0 is doing. A-sub-0 is just going to be that average value of the function.