This image shows the starting instrument selection screen.
Internal construction:
This is the control panel for the signal generator. The coarse and fine frequency controls enable precise frequency selection over a 1Hz-10KHz range.
And this for the network analyser. This works using a stepwise-swept sine wave generator. The "dwell" controls determine the duration of running at each frequency point in terms of time and cycles: a delay before reading provides high-Q circuits with time to stabilise.
Here are some samples. Firstly a classic second order passive low-pass filter. Bode and Nyquist:
A third-order Sallen-Key low-pass filter with 100Hz cutoff cascaded with a first-order passive high pass filter:
Lastly, for comedy value, I tried an audio test. Bear in mind that the speaker was not a particularly good one, the microphone was an ancient Grundig of unknown quality, the mic preamp was lashed up on a breadboard and the test was done indoors in a small resonant room. Exactly how not to do these things...
The wild phase changes are of course due to the time delay between the speaker and the mic: what's really needed is a means of displaying the departure from linear phase. For an even greater comedy effect here is the Nyquist plot. This shows the limitation of my instrument in that there are only 50 (logarithmic) frequency steps, so a nice neat spiral it is not!
For anyone still following there were two significant challenges. The first is getting phase measurements from the Pyboard, which does not currently support the more advanced ADC modes of the chip. I use DAC continuous mode to generate the sinewave, feeding it back into an ADC. I then detect a positive going transition and start an ADC timed read of the input signal. Some phase compensation is applied to try to offset errors caused (presumably) by a time delay in initiating the read. Phase is determined by correlating the input sample set with calculated sine and cosine values. In practice phase measurements lose accuracy above about 5KHz and below about -50dB amplitude, and I stop trying to perform the measurement outside certain thresholds of amplitude and frequency. I believe this performance could be improved with better linear circuit design and construction, more noise-immune phase detection algorithms and/or firmware supporting the dual ADC modes.
The second challenge resulted from the design of the display hardware which uses the two Pyboard DAC pins as part of a fast 8-bit digital port. Re-configuring this would affect Robert Hammelrath's driver and would require a new design of PCB. So I dynamically re-configure the pin as an analog output and suspend display operation while the instrument is producing output. This is less disruptive than you might think.