A square wave can be represented as a sum of sine waves [1]. The equation for this is shown below.
Note that only odd integer harmonics are used to compute a square wave.
Use this tool to calculate harmonics of a square wave. Enter
- Fundamental frequency
- Amplitude
and the tool will compute frequency values up to the 11th harmonic as well as the amplitude coefficient.
A good approximation results when the first three terms are used, although in many situations, even the first two terms produce an adequate representation as shown in the picture below.
This can be seen in the calculator above where the amplitude of each additional term is lower. As a result it has a smaller effect on the total sum.
Related Calculators
References
[1] Square Wave on Wikipedia