A square wave can be represented as a sum of sine waves [1]. The equation for this is shown below.
![](https://i0.wp.com/www.onesdr.com/wp-content/uploads/2022/07/Square-wave-harmonics.png?resize=639%2C134&ssl=1)
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.
![](https://i0.wp.com/www.onesdr.com/wp-content/uploads/2022/07/Fourier_Series-Square_wave_3_H.png?resize=616%2C462&ssl=1)
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