THD (internal sinusoid)

Use this to compute THD if the sinusoid is generated from WinMLS.