Post Go back to editing

ade9000 THD

Total Harmonic Distortion (THD)
A THD calculation is available on the IA, IB, IC, VA, VB, and
VC channels in the AITHD, BITHD, CITHD, AVTHD, BVTHD, and CVTHD registers, respectively. THD updates
once every second. The THD calculation is stored in signed 5.27 format. The
highest THD value is 0x2000 0000, which corresponds to a
THD of 400%. To calculate the THD value as a percentage, use
the following equation: %THD on Current Channel A = AITHD × 2^−27 × 100%

%THD on Current Channel A = AITHD × 2^−27 × 100%
2^(-27) = 0.00000000745
AITHD=536870912

I calculated THD from the data in the datasheet, so the values ​​are below.

The code is below

Is THD calculation correct? We wait for your advice.