The pictures shows two handy 3-digit true AC bridge LCR meters in my lab; but if they were not available, the entry level scope and AWG can easily replace them. And if the scope already has a built in arbitrary waveform generator, I am wondering why the LCR meter functionality is not built in within the scope firmware.
The idea of using digital scope with the software running on a PC to measure impedance of the the inductors, capacitors and circuits with them is not new, but is worth considering when there is no dedicated LCR bridge meter in the lab, or when unusually high excitation frequency (above 100kHz in a typical LCR meter) is required.
Most "bridge" instruments today do not really have any bridges, they measure the the impedance Zx by computing the vector of the voltage (Trace B) in the voltage divider excited by the sinewave reference voltage. When the excitation voltage and frequency (Trace A) and reference resistance R_Ref is known, the Zx may be calculated.
The AWG tuned to desired measurement frequency will excitation of the divider circuit.
The variants of this process are described in great detail here.
When the scope acquired the (ideally as long as possible) traces of reference and divider output, the data should be transferred to PC.
The vector of the voltage on Trace B can be computed as Discrete Single-frequency Fourier integral, by multiplying the data point-by-point, and then summing all points together. With dual trace scope, one can get the in-phase (I) Real component directly.
out_I = numpy.sum(numpy.multiply(trace_A, trace_B))
The quadrature (Q) imaginary component will be obtiained in the same way if trace_A contained the samples of the cosine signal. They can be captured on the trace A one more pass, with another output of AWG driving the 90-degree shifted signal. For saving time, it may be easier to do the phase shift by 90 degree numerically, and get the second component:
out_Q = numpy.sum(numpy.multiply(shift90(trace_A), trace_B))
The ratio of Q to I will give the vector angle Theta.
Interestingly, capturing long trace will increase the resolution of the result, so even 8-bit oscilloscope may give 4-digit resolution of the impedance value.
The further computations should assume the desired equivalent model of inductance and capacitance. Usually, one will need inductance Lx and series active resistance Rx for inductance, and capacitance Cx and tan(delta) or D-factor.
After writing this note, I found that Tektronix already did a great job and published an application note describing the conversion of phase angle (theta) into the Cx and Lx for given equivalent model. However, they did not do the operations on the PC on entire long capture, and therefore, the accuracy of their measurement will be worse. Note that when the measurement is done as described above, the output voltage of AWG is cancelled out in the result, because it contributes as a multiplier into both I and Q. One needs to accurately know the frequency of excitation signal and R_Ref. The gain of the Trace B may be also canceled out if two measurements are taken - either on different frequencies, or with two different values of R_Ref.
We will leave the elaboration to the homework of curious reader.