Vector measurements with the rtl-sdr, 5
Here is a quick update on my project to measure the phase of a reflected RF signal using rtl-sdr and what is basically a simple home-brew vector network analyzer. I'm using a cheap RF bridge from eBay as the directional element in the measurement and a board I've developed to multiplex two signals into the rtl-sdr's single ADC. In my last post I've assembled the time multiplex board. I've also shown some basic tests of its performance using the ERASynth Micro microwave synthesizer, such as signal attenuation on the PCB traces and cross talk through the switches. Now I finally have tests to show of the complete vector measurement system, although only in pass-through (i.e. S12) mode without using the reflection bridge.
To test out if I can correctly measure the phase of the signal using my system, I performed several tests where I connected the DUT IN to OUT with different lengths of a coaxial cable. In theory, different lengths of the cable should introduce different delays into the signal. I should be able to measure the delay as a difference in the phase of the signal arriving into the DUT IN input.
I've swept the frequency of the signal generator from 100 to 1000 MHz, which covers most of the useful region of the rtl-sdr. For each frequency, I performed the vector measurement using the delay-and-divide method I outlined earlier. I ran the test with three lengths of SMA patch cables I had at hand: 15, 30 and 45 cm.
The measured amplitude in all cases should be around +10 dB. The reference signal, against which the input signal is compared, is attenuated by 10 dB in the multiplex board. Because of this, an unattenuated 0 dB signal passing between DUT OUT and IN compared to a -10 dB reference is seen as +10 dB by my device. I did this to optimize the receiver dynamic range, since many directional couplers and RF bridges have around 10 dB of coupling.
Anyway, this measurement is about what I would expect. For all lengths of cable the mean is around 10 dB. Cable loss is too small to be visible. The variations in amplitude of around ±2 dB depending on the frequency are more than I would like. They are probably because of multiple bad impedance matches somewhere in the signal path. I've also seen these in my previous measurements.
This is the phase component of the same measurement. It shows that the input signal lags versus the reference and that the phase difference increases with frequency. It's also clearly visible that the slope depends on the length of the cable. Such a linear phase characteristic is exactly the expected result for a constant signal delay. The phase plot has been unwrapped here using the numpy.unwrap method.
By dividing the measured phase with the angular frequency, the measurement can be shown directly in terms of time delay:
This is a very nice result. Each lengthening of the cable by 15 cm increased the average time delay by about 0.8 ns. This gives a relative velocity of propagation through the cable of around 0.63 c, which is a reasonable number. I don't have the exact data for my no-name patch cables. A cable with a solid polyethylene dielectric, typical for low-end cables, has the velocity factor of 0.66. This is close enough to my result and the electrical length of my cables isn't very well defined anyway.
Another interesting thing I can get from these results is the delay for a theoretical cable of length 0 cm. This is the intrinsic signal delay in my system and is about 0.15 ns based on these measurements. This should correspond to the difference in electrical lengths on my multiplex board between the reference signal path and the DUT connector path. If I estimate the velocity factor of the coplanar waveguides to be:
This gives a length difference of about 22 mm. This is again a reasonable result. By measuring PCB trace and connector lengths I roughly estimate the real difference to be about 30 mm.
In conclusion, I'm quite happy with these results. They show that my basic time multiplex idea works correctly for vector measurements. As far as the whole system is concerned there are still several rough spots however. Clock recovery code still needs some more polishing since running it on real data revealed some corner cases that didn't show up in simulations. Thankfully I see nothing fundamentally wrong with it as far as I can see and fixing it should be just a matter of writing some better software.
The bigger problem is the bad overall RF performance of the multiplex board. I've discussed before that there seems to be something very wrong with impedance matching which causes large deviations in measured signal amplitude. I still haven't completely figured out what's wrong there. One mistake I did found on the PCB design was that my coplanar waveguides don't have the width much larger than height over the ground plane (see e.g. slide 41 in RF/Microwave PC Board Design and Layout). This is one of the assumptions of the equations for their Z0 I used. This error might be what's causing some of my problems, but fixing it unfortunately means making a new PCB.
Another, even more puzzling problem, is that the RF bridge seemingly loses its directivity when used in this system, even at low frequencies. Since I made this vector measurement system specifically for reflection measurements (S11) this is kind of disappointing. I don't really understand yet why that happens. It's not because of switch cross-talk. I've measured that and it should be negligible. The mismatches on the board also shouldn't be affecting the bridge in this way, especially at low frequencies where they don't have much effect. Scalar measurements work just fine with rtl-sdr and ERASynth Micro. I've also measured that my bridge has reasonable directivity below 1 GHz when used without the multiplex.