Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
do FFT, if signal frequency is fin, then 2*fin, 3*fin .. N*fin inside the frequency band (or inband) are harmonic, sum the total power of harmonic, then you get total harmonic power, / signal power is harmonic distortion in db.
Another formula is sqrt(harmonic power)/sqrt(signal power), unit is %.