The French mathematician Fourier discovered that any periodic waveform can be expressed as a series of harmonically related sinusoids.
Any periodic waveform can be expressed as the following:
The first term a0/2 is the constant DC or average component of f(t). The terms with coefficients a1 and b1 represent the fundamental frequency components of f(t). Coefficients a2 and b2 are the second harmonic components at frequency 2w. The frequency doubling on the second order harmonic is computed as a result of the multiplication of sinusoids.
In order to determine the coefficients of a harmonic series ai and bi, multiply both sides of the above formula by 2sin(2wt). In this case for simplicity, let w = 1.
Next, integrate from zero to 2*pi.
The following relations are then found:
The Fourier series are often expressed in exponential form:
The MATLAB function int(f,t,a,b) is often a useful tool, where f is the function, t is the symbolic variable, and a and b are the bounds of integration.