Source: https://salfordphysics.com/gsmcdonald/H-Tutorials/Fourier-series-tutorial.pdf