For the moment I will not use averaging as there is much better way to increase the SNR of the measured signal.
I start with a square wave signal. The fundamental is set to 0dBfs (fill the entire screen). The fundamental has a SNR of more than 100dB. Harmonics attenuate by 1/N or 20dB/decade. This means an S21 (or 'gain') can be measured over a 4 decades frequency range and you have still 20dB of dynamic range left at the end.
For example when measuring an audio amplifier flatness from 10Hz to 20kHz. At 10Hz the SNR is >100dB and at 20kHz the SNR is lowered to 34dB. Is 34dB at 20kHz enough? That all depends on how much attenuation you want to see at that highest frequency.
With the current hardware I have (happy with the cheap DH0804) I have a 12 bit DAC running up to 1.25Gs. To prevent aliasing and noise folding, it's best to limit the frontend bandwidth to 20MHz and choose a sample rate of at least 40Ms/s. The Rigol has 62.5Ms/s at 1ms/div horizontal timebase (sampling rate cannot be set manually but follows from the horizontal timebase setting and the number of channels enabled).
Memory depth of 25Ms is the max when two channels are enabled (what I need).
25Ms/(62.5Ms/s)=0.4s That means FFT bin size is 2.5Hz (and the lowest bin also starts at 2.5Hz). You can measure the entire amplifier over 4 decades (10k) with at least 34dB SNR.
An extra addition is to capture twice. Once with 10Hz and once with 10kHz. The result will be merged into one plot ranging from 10Hz to 100MHz (or actually 20MHz due to channel bandwidth filtering).
The user should do this:
- Put generator at 10Hz
- Press capture
- Put generator at 10kHz
- Press capture
The FFT bins are exactly the same so this should be doable to extend the useful range.