MATLAB code to demonstrate [Fourier series][1] representation of periodic signals (as a sum of sinusoidal functions). The animation shows an approximation of a square wave signal using the first 4-terms of its Fourier series. (Change the parameters near the top of the code to manipulate the animations and explore other variations). ![animation1][6] ![animation2][7] This was inspired by the following similar animations: - [Fourier Series Animation using Circles][2] - [Fourier series square wave circles animation][3] - [Fourier series visualisation with d3.js][4] - [Smooth motion of rotating circles][5] [1]: http://en.wikipedia.org/wiki/Fourier_series [2]: https://www.youtube.com/watch?v=LznjC4Lo7lE [3]: http://en.wikipedia.org/wiki/File:Fourier_series_square_wave_circles_animation.gif [4]: http://bl.ocks.org/jinroh/7524988 [5]: http://blog.matthen.com/post/42112703604/the-smooth-motion-of-rotating-circles-can-be-used [6]: http://i.imgur.com/qW8rFrp.gif [7]: http://i.imgur.com/tpVteqt.gif