File:Fourier31.gif
Summary
Description |
Magyar: A négyszögjel közelítése Fourier-sorral 31 tagig. English: The Fourier series approximation of a square wave. |
Date | |
Source | Own work |
Author | Harp |
The separate pictures was made with this program (fourier.py):
#!/usr/bin/env python # coding: utf-8 from __future__ import division import pylab from pylab import show, plot, linspace from pylab import zeros from pylab import sin, pi def fourier(n=15): x = pylab.linspace(-pi, pi, 1024) y = pylab.zeros(1024) pylab.grid(False) pylab.hold(False) for i in range(1,n+1,2): y += sin(i*x)/i pylab.plot(x,4/pi*y, "b") pylab.title(u"Fourier series approximation of square wave, %02d addends" %n) pylab.savefig("fourier%02d.png" % n) #pylab.show() if __name__ == "__main__": for i in range(1,33,2): fourier(i)
Then thise pictures was unified with ImageMagick into one gif as follows:
convert -delay 30 -loop 0 *.png fourier.gif
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.