Harmonics are created by non-linear devices. Amplifiers
run in their "linear" region will still create harmonics at a low level.
An amplifier can be parameterized at V= X0 +X1*V(0) + X2V(0)^2 + X3V(0)^3
where the coefficients Xn tell how much of each term is created.
Suppose we have 2 tones Acos(at) and Bcos(bt). Plugging
them into the above equation gives the strengths of the various frequency
components generated by the device. All of the amplitudes should be multiplied
by the corresponding Xn.
Each of these needs to be multiplied by the Xi coef of the amplifier/device.
Linear: (Acos(at) + Bcos(bt))
The individual freq terms are then:
square:[Acos(at) + Bcos(bt)]^2:
If there is just a single tone, then the values generated are the same
as the first line of each section above: