Jump to content

File:Synthesis square.gif

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Synthesis_square.gif (500 × 250 pixels, file size: 125 KB, MIME type: image/gif, looped, 53 frames, 15 s)

Summary

Description
English: Additive synthesis of a square wave, illustrating Fourier series expansion and Gibbs phenomenon. See also: Image:Synthesis sawtooth.gif, Image:Synthesis triangle.gif.
Date 19 December 2005 (upload date)
Source Own work
Author Lucas Vieira
Other versions
BASIC source
InfoField
click to expand
' The frames of the animation can be drawn
' by the code below in BASIC. The animation
' is made by collecting the frames in an
' image editor such as GIMP.

REM Constant
pi=4*atn(1)
REM Set up plotting area
screen 12
window (0,-2)-(5*pi,2)

REM Number of terms to use
for nt=1 to 25
 cls
 print "Harmonics:";nt

 REM Plot squarewave
 pset (0,0)
 for w=0 to 5*pi step .01
  line -(w,sgn(sin(w))),4
 next w

 REM Plot sum of terms
 pset (0,0)
 for w=0 to 5*pi step .01
  y=0
  for k=1 to nt
   y=y+sin((2*k-1)*w)/(2*k-1)
  next k
  y=4*y/pi
  line -(w,y)
 next w

 REM Freeze display (create a gif animation frame)
 delay .2
next nt

Licensing

GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
w:en:Creative Commons
attribution share alike
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.
This licensing tag was added to this file as part of the GFDL licensing update.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

19 December 2005

image/gif

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current20:43, 15 August 2013Thumbnail for version as of 20:43, 15 August 2013500 × 250 (125 KB)LucasVBModern update: higher resolution, higher quality, language-agnostic and more visually appealing
19:45, 3 September 2006Thumbnail for version as of 19:45, 3 September 2006472 × 200 (34 KB)LucasVBFixed animation so the series actually converges over the idealized square wave in the illustration. Thanks Steven Johnson for pointing that out.
10:26, 19 December 2005Thumbnail for version as of 10:26, 19 December 2005472 × 200 (35 KB)LucasVBAdditive synthesis of a square wave

Global file usage

The following other wikis use this file: