Calculate total harmonic distortion (THD) and individual harmonic levels for PV inverter AC output compliance.