Using QA403 to measure impedance of an inductor?

Yes, have been using the QA403 to view the current waveform. It does indeed show a bit of distortion of the input sine. I have not yet tried with a sawtooth. Yes, I think there are a few more useful waveform shapes, a square wave should cause a triangular wave current waveform (remembering my SMPS stuff).

I have a very affordable discrete class-D from a member at diyaudio.

Here is a write-up of the method I’ve been using and it does seem to work well, nothing new here, but a bit easier than reading code I posed in the other thread.

First measure the time-domain voltage v(t) and current i(t) using the QA403. The current is measured by the voltage drop across a current sense resistor in series with the DUT. Shift into the frequency domain with an FFT,

V(f) = \text{FFT}(v(t)) \\ I(f) = \text{FFT}(i(t)) \\

The complex impedance is the ratio of the voltage V and current I (dropping the function-of notation, everything is now in the frequency domain),

Z = \frac{V}{I} = |Z|e^{\textbf{i}\phi}

Using,

\left| Z \right| = \sqrt{ R^2 + X_L^2 }
\phi = \tan^{-1} \left( \frac{X_L}{R} \right)

where R is the resistive component and X_L is the inductive reactance. We have two equations and two unknowns, giving,

X_L = \frac{\left| Z \right| \tan\left(\phi\right)}{\sqrt{\tan^2\left(\phi\right) + 1}}
R = \frac{\left| Z \right| }{\sqrt{\tan^2\left(\phi\right) + 1}}

therefore the inductance is,

L = \frac{X_L}{2 \pi f}