Generation of Square Wave using Odd Harmonics of Sine Wave and it's visualisation- p5.js

Soumik Sarkhel

Soumik Sarkhel

Kolkata, West Bengal

1 0
  • 0 Collaborators

Generation of Square Wave using Odd Harmonics of Sine Wave and it's visualisation. ...learn more

Project status: Concept

Graphics and Media

Code Samples [1]

Overview / Usage

A Fourier series is a periodic function composed of harmonically related sinusoids, combined by a weighted summation. With appropriate weights, one cycle (or period) of the summation can be made to approximate an arbitrary function in that interval.

For the generation of square wave, the odd harmonics of the sine wave are superimposed and hence a square wave is generated.
As the number of terms to be summed is increased, the shape becomes more and more square.

Methodology / Approach

The function of a square wave is transformed into a Fourier Series and implemented using p5.js, a javascript library.

Technologies Used

p5.js

Repository

https://editor.p5js.org/soumiksarkhel97@gmail.com/sketches/4kVZT5zXu

Comments (0)