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.

# Visualizing the Fourier expansion of a square wave

Visualize the Fourier expansion of a square wave. A square wave can be approximated by adding odd harmonics of a sine wave. Created by Sal Khan.

## Want to join the conversation?

• Sal, are you going to make videos about how to solve differential equations with help of Fourier transform?
• Gleb - The best place to make a request like this is in the KA help center. The link is down at the bottom of the page, under Support. There's a section called Community Discussion/Content Requests where you can put this suggestion. It will be reviewed by the Content team.
• can we see the general form for a function that doesn't have 2pi as its period?
• You could derive it for any interval, but you have to go back to the beginning and compute the definite integral of sin(mt) cos(nt) and their products, etc. just like Sal did in the first few videos, and then use those results.
• What is the Fourier Series used for?

Is it used to convert signals into data which can then be edited and transported digitally and then converted back to a signal at the destination?
• Hello Alasdair,

The Fourier series is a description of a waveform such as a square or triangle wave. It helps us think about electric circuits.

The Fourier transform is a mathematical construct (algorithm ) that allows us to convert a signal such as a square or triangle waveform to constituent sinusoids.

The actual conversion (real circuits) use Analog to Digital Converters (ADC) and Digital to Analog Converters (DAC) to convert real world signal to digital and then back again.

Regards,

APD
• Do we have Fourier series for only 2π periodic functions?
• Not really. For any functions of the period T = 2π/ω, you can replace the cos(nt) and sin(nt) with cos(nωt) and sin(nωt). The limits of integration will range between -π/ω and π/ω. Now instead of 1/π in front of the integral at the final step, you will have ω/π. For the examples in the videos, T = 2π gives us ω = 2π/2π = 1, hence why at the final step we have 1/π.
• How come there are no more videos on solving problems
• Sal, can we have some videos on solving partial differentiation equation by fourier transform? That would be very helpful.
• So how is this all related to the fourier transform of integral of e^(-i*2*pi*t*v) * s(t), where s is some function?
• As you know from Eulers formula e^ix=i*sin(x)+cos(x). So in that exponent-thing you have and a sine wave and a cosine wave, separated by the imaginary unit i. By taking the integral of that, you can simultaneously compute and the amplitudes for the sine, and that for the cosine. As answer you will get a complex number where the real part in for the cosine and the imaginary part for the sine.
• At Sal says, "You can type these things into Google..." and then he showed a bunch of graphs getting closer and closer to f(t). I tried typing the function (the first few terms anyway) into Google, and was just directed to a bunch of sites. Can you be more specific? I would love to try it!
(1 vote)
• Type one of these lines into Google.
f(t) = 3/2 + 6/pi sin t
f(t) = 3/2 + 6/pi sin t + 6/3 pi sin 3t
f(t) = 3/2 + 6/pi sin t + 6/3 pi sin 3t + 6/5 pi sin 5t
• These were really tremendous sessions. Thanks for your valuable approach.. Could you please let us know that Is it the same fourier transform which is being used in the PID controllers for calculating errors and adding it up to the assigned values in order to have the desired process values...
Thanks!
Regards,