One of the features of the Analog Discovery 2 that convinced me to buy it (rather than, say, a Rigol digital scope) was the ability to couple the waveform generator to the scope to do network analysis. The basic idea of network analysis is to measure voltages at the output and the input of a 2-port network taking their ratio at different frequencies to get the response of the network.

Here is a generic 2-port network with a shared ground. If a sine wave is applied to the input, then the output will also be a sine wave (for a linear network) of the same frequency, but a different amplitude and phase.
If you model a linear system with complex numbers, then the output of any linear network driven by is
, and the ratio of the output to the input is
. A network analyzer drives a network with a succession of different sine waves, recording the amplitude ratio
and the phase shift $\phi$ for each frequency.
I haven’t often needed a network analyzer, but I have many times done something very similar: impedance spectroscopy, which looks at the ratio of the voltage to the current at different frequencies. The loudspeaker and electrode labs in the course both do this, but only recording the amplitude ratio, not the phase change, as hand measurements with voltmeters do not provide a way to determine the phase.
Because the network analyzer just takes the ratio of Channel 2 divided by Channel 1 and both are differential input channels, we can use it as an impedance spectrometer. We just put the device under test (DUT) in series with a known impedance (comparable to the one to be measured), drive the series chain with the waveform generator, and measure the voltage across the two impedances. We then have .
For example, here is the result of running the network analyzer for an 8Ω loudspeaker with a 33Ω known impedance:

At frequencies above about 1MHz, I don’t believe that the test setup is really measuring the behavior of the loudspeaker.
For impedance spectroscopy, the default display with the amplitude in dB is not particularly friendly, so I saved the data, fitted a model to it with gnuplot, and plotted it:

Amplitude data and fitted model. Note that the impedance does not rise as fast as a simple inductor for L1 would imply.
Compare the plot above with the hand-measured ones at Better model for loudspeaker or Loudspeaker analysis. We can see the limitations of the model even more clearly when we look at the phase change:

At low frequencies, the model and the measurements fit well, but at high frequencies, the phase only goes to 50°, not 90° as would be expected of an inductor.
I also measured a tiny 8Ω loudspeaker that I had bought to experiment with ultrasonics (see Redoing impedance test for tiny loudspeaker):

The main resonance around 1390Hz is clearly visible, but there appear to be some higher resonances as well. We can do a more focussed sweep to see them clearer:

The model for the tiny loudspeaker fits the phase measurements better than for the larger loudspeaker, but the phase still only gets to 66°, not 90°.
I also tried one of the ultrasonic transmitters (see Ultrasonic transmitter impedance again for hand measurements):

With a 33Ω current-sense resistor, the low frequency end of the impedance spectrum is just noise—there is almost no voltage drop across the 33Ω resistor.

Using 1nF capacitor as a reference impedance, rather than a resistor, results in much more comparable voltages across the whole frequency range, and a cleaner impedance spectrum. But at low frequencies, we’re really seeing the impedance of oscilloscope inputs, rather than the ultrasonic transmitter.
I also tried using the network analyzer as a proper network analyzer, where the network consisted of the tiny loudspeaker acoustically coupled to an electret microphone which had a 10kΩ pullup to 5V:

The 9.5–10kHz peak was distinctly audible (even though I’m rather deaf in that range), so the resonance was in the loudspeaker not the microphone.
I get somewhat different results with the larger 8Ω loudspeaker:

I have a much more uniform response across frequencies, but it looks like I get a fairly strong response even at very high frequencies. I wonder if I’m seeing an electrical rather than acoustic coupling.
Finally, the ultrasonic transmitter:
[…] Loudspeaker impedance with Analog Discovery 2, I described measuring the impedance of loudspeakers with the network analyzer function of the […]
Pingback by Headphone impedance with Analog Discovery 2 | Gas station without pumps — 2016 December 28 @ 22:41 |
[…] Loudspeaker impedance with Analog Discovery 2, I looked at the impedance of various loudspeakers including an ultrasonic transducer. Today I […]
Pingback by Ultrasonic rangefinder with Analog Discovery 2 | Gas station without pumps — 2016 December 30 @ 23:38 |
[…] my previous experience indicated that the network analyzer was not very useful past that frequency (Loudspeaker impedance with Analog Discovery 2). I put a 22Ω resistor in series with the loudspeaker and measured the voltage across it on […]
Pingback by Changing the loudspeaker lab | Gas station without pumps — 2017 June 28 @ 21:38 |