EveryCircuit
Contact
Reviews
Home
eekee
modified 7 years ago

Square from sine waves with the right amplitudes

4
3
180
01:33:56
These are (close to) the right amplitudes to actually produce a square wave from an infinite number of odd harmonics. Somewhat short of infinity, we only have 4 harmonics here, but it proves the point that it could be done with infinite harmonics. (If you get more overshoot with more harmonics, they're not scaled correctly.) To make +-1v square wave: 1khz 1.23v 3khz 388mv 5khz 209mv 7khz 125mv 9khz 76mv No phase shift Derivation of the amplitudes: http://everycircuit.com/circuit/6122013801578496
published 7 years ago
jason9
7 years ago
This won’t make a 1V square wave, but if you make the voltage of the source the reciprocal of the frequency (1kH>1V, 3kH>333mV, etc.) it will produce a perfect sine wave with an infinite number of harmonics. However, the overshoot will gradually reduce not to zero, but to a fixed value greater than zero. Adding more harmonics won’t fix overshoot, just reduce it slightly so it’s ever so slightly closer to the fixed value.
hurz
7 years ago
Depends on how exact you need this 1V. But right the math behind needs 1/n falling sequence. Ringing is caused if begin and end of periode do not fit together and cause a jump. Mathematicaly "discontinuously" cause ringing and overshot. Else a high number of harmonics does help to come closer to original waveshape
eekee
5 years ago
The more I look at the 1/n sequence, the worse it looks. It has peaks on every rising and falling edge which don't correspond to anything IRL. The peaks don't go away with increasing accuracy. With infinite harmonics, the peaks might reduce to zero width, but I still don't like it.

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy