Yes, you are absolutely right that my idea of spectrum shift was mathematically flawed. That's why I was thinking would it be possible to remove the DC-blocking capacitor from the mixer output in order to improve low-frequency performance near DC. The output of the 120 kHz low-pass filter will then have a DC offset, but it can be removed after sampling the signal by computing the average of the buffered samples and then subtracting this average from the samples.
Spectrum analyzer would a nice by-product for this project, but with the existing LTDZ's hardware design/architecture the spectrum analyzer will suffer the same problem that you addressed above ie. lack of image-rejection without proper filtering at the input.
The existing design does actually
not suffer from images. Since it is a direct conversion (zero-IF) receiver, all images which are mapped by the mixer into the RBW filters' passband happen to lie inside the passband anyway (just at a different position), therefore they are supposed to be included in the power calculation and don't need to be excluded. For measuring the power at the low-pass filter output, the design is OK in this regard.
What I wanted to say is that this IF signal is not suitable for sub-dividing the sampled RBW passband into smaller sub-bands, e.g. via FFT.
That's a different use case for which the images inside the RBW passband do matter.
[ Asking Google, I did find approaches
here and
here to detect potential images post fact in the spectrum and to cut them out. ]
The AC coupling unfortunately splits the frequency response of the RBW bandpass in the midde, so that it has two lobes eventually. It is however difficult to deal with DC offsets. At (say) 1V full scale, one could only tolerate 10µV offset error, if the aim is an error of -100dB. That's not trivial. Adding a capacitor is much easier.
Scalar network analyzer with adjustable RBW is the major goal, so that it would be possible to use this simple, inexpensive and readily available hardware for measuring RF filters, use it as a simple antenna analyzer, and make it usable for other RF measurements for amateur radio purposes.
Why adjustable bandwidth for NA? The basic functionality of a simple NA is that you send a single frequency (i.e. more ore less zero bandwidth) to the DUT, and you measure the signal coming out out the DUT, which is the same single frequency which you did send to the DUT (only amplitude and phase are different). Then you step to the next freyency and repeat the procedure again and again. Ideally, images should not be a problem either. Why should a potential image frequency come out from the DUT if you don't send it into the DUT? ADC aliasing is mitigated too - for the same reason - granted that the frequency plan is carefully chosen. Harmonics still need to be considered in the frequency plan, since not all DUTs are perfectly linear. And the NA's signal generator does not necessarily generate a pure sine wave either.
One thing which does indeed not fit well is the combination of the AC coupled filter with the zero-bandwidth CW signal and a zero-IF receiver. Since the filter has a null at DC it can't detect the zero bandwidth signal which is down-mixed to exactly DC. Therefore I'd rather pick a non-zero IF for the NA use case (i.e. add an offset to the receiver LO). NanoVNA V2.2 for instance uses 12kHz IF, which is sampled @300kSa/s by the MCU (
it is also STM32F103 based, IIRC), and
25 50 samples (
one two 12kHz periods) are correlated with a windowed complex sine wave
1) to obtain one measurement (btw, since the NanoVNA is a VNA, the ADC needs to run continuously in order not to lose phase in the pause when the receiver is switched to a different signal source).
EDIT: Regarding "it is also STM32F103 based, IIRC":
I checked again. The schematic mentions both, STM32F103C8 and GD32F303CCT6, but it is obviously the latter. Sorry for the mistake.
EDIT:
1) That's basically a Goertzel dedector, i.e. a DFT for a single frequency. The chosen window function eventually acts as bandpass filter.
EDIT: Regarding "Scalar network analyzer with adjustable RBW is the major goal":
If you intend anyway to sample the pre-filtered IF with the ADC, then why limit to "scalar", and not do "vector"?
External directional bridge and RF switches to switch the (single) receiver input between reference signal, refelected singal, DUT output,... are required for both.
As long as TX oscillator, RX oscillator and ADC clock are frequency-locked to the same xtal by rational factors, no frequency drift between them is to be expected either, and phase can be retained.
Eventually I don't see any difference in the required hardware then - it's just software. Do i miss anything?