I am trying to measure (estimate) THD of an audio path using a consumer sound card. The idea is that I do two measurements, one without the system being measured in the path and one with it:
Sound card DAC ---> Sound card ADC
Sound card DAC ---> Measured system ---> Sound card ADC
There is the same sine wave generated in both measurements. In each measurement, the ADC data is transformed using FFT (with Hann windowing function) and the THD is calculated by the standard THD(F/R) equation (https://en.wikipedia.org/wiki/Total_harmonic_distortion) from the amplitudes from the peaks of harmonics on the FFT.
The idea is that by doing two measurements, one with and one without the measured system, is that I could eliminate the TDH introduced by the non-ideal DAC, ADC and sine wave generated and (only) measure TDH of the measured system.
Since the THD is not a linear phenomenon, I assume this is not a correct way to estimate THD of the measured system:
THD_measured_system = THD_measurement_2 - THD_measurement_1
So my question is what would be the correct approach in eliminating the THD of the measurement system and if this is even a possible approach?
Would checking the difference between amplitudes of the harmonics between measurements 1 and 2 and calculating the THD from this difference work?