The formula is actually very simple:where H1 is the fundamental and H2, H3, HN, etc. are the harmonics. You could calculate only odd-orders or even-orders or you could use a different weighting system. But this is the formula for finding total harmonic distortion. THD found here is a percentage.