QIRX SDR Report
Are Phase-Coherent RTL-SDRs Possible ?
An Experimental Investigation
Motivation and Intent
Phase-coherent coupling of cheap standard RTL-SDR dongles would be a highly attractive goal, but is it achievable
in a reproducible and robust way for demanding projects? (Spoiler: In our opinion: No).
This report describes some experiments, using DAB signals as test sources, trying to help giving an answer to this question.
Main motivation was to come to a decision whether to select RTL-SDR hardware or not for possible future projects requiring phase-coherence, like interferometry.
Main intent was to perform some basic but simple experiments requiring continuous phase-coherence.
Antenna signal: Split and fed into two RTL-SDR receivers. The splitter is a simple BNC T-Connector.
RTL-SDR Receivers: Standard, cheap (no TCXO) dongles, sharing the same clock (see below).
rtl_tcp.exe: Unmodified TCP/IP servers, running as two instances on the same PC,
receiving on two different USB ports,
delivering their samples on different TCP/IP sockets. rtl_tcp is used identically like in the QIRX software.
QIRX, Modified with:
Two TCP/IP inputs,
DAB Coherence Checker (details see below),
GUI for the Coherence Checker,
Commander for rtl_tcp.exe, duplicating most of the commands for the two tcp/ip servers.
Common Clock: The only hardware modification has been to provide the two receivers with a common clock,
taken from one of the two dongles. For this modification,
previously published experiments have been reproduced, see here.
In short, the modification consists in removing the 28.8MHz crystal
from one of the receivers and instead making a connection to the other receiver with a running oscillator.
The quality of the signal has been verified with a scope (Bandwidth 300MHz).
Clock Signal: The left image shows the clock signal of a single receiver,
prior to the coupling. The right image shows the clock signals of the coupled receivers, with a good quality.
After the coupling, the amplitude has decreased from about 1.3Vp-p to about 0.9Vp-p.
Tests with that clock configuration and using only one of the two receivers showed no degradation of the reception.
DAB Coherence Checker
To check the phase-coherence of the two I/Q data streams, a graphical control was used:
Graphic display of the I/Q data, in the time domain.
The display was triggered from the DAB Null Symbol to achieve a steady indication.
Use of two different displays, one for the magnitude of the I/Q data of the first receiver,
the other one for the magnitude of the difference
of the I/Q data of both receivers.
In case of timely synchronisation and identical phase
(phase-coherence with a phase difference of zero), the second display should show all zero.
This is the case to be achieved here, as both receivers are fed with the same antenna signal.
In case of timely synchronisation and different phase (phase-coherence with a constant phase difference of non-zero),
the second display should show a constant amplitude different from zero.
In case of nearly timely synchronisation (fraction of a sample),
the second display should show a constant amplitude different from zero.
In case of timely synchronisation and a varying phase difference,
the second display should show a varying amplitude.
The arrival time of the I/Q data has to be exactly equal in both receivers.
When starting the experiments, it was assumed that to be “exact”
meant the two signals arrived within the time of one single sample, i.e. 1/2048000sec,
equaling about 500ns. It turned out that this understanding of “exact” was not sufficient.
To achieve arrival-time equality within one sample,
the following modifications have been inserted into the QIRX frontend
by modifying the time-domain sample streams before entering the frequency domain.
Graphical control of the I/Q data stream, triggered by the DAB Null Symbol.
In the software, the already present Null Symbol detector was used,
and the display triggered every 96ms (=DAB frame length), by counting the I/Q data packets.
Independent delay of both I/Q data streams in units of one,
ten and hundred samples, within a range of up to two seconds. This allowed to shift the null symbol of rx1
into the visible range of the "scope", and to adjust the relative time difference of rx2 accordingly.
Of course, the absolute starting of the I/Q data streams by the rtl_tcp server is random.
Signal Combination selections:
Either signal 1 or signal 2,
Added signals. This possibility was selected
to adjust the time difference to within the same sample.
Combined signals, combination by changing the input receiver
after every 4k I/Q data.
This possibility was selected for the decision about phase-coherence.
Only viewing the I/Q time domain data,
it showed to be very difficult to decide when a
zero delay between the receiver streams have been reached.
The spectrum of the added signals came as the rescue (see middle and bottom pictures).
In the middle picture, the top part shows the spectrum of the added signals. With the pronounced notches,
the delay between the two signals can be accurately adjusted to be zero (within one sample time), as shown in the bottom figure.
It might be noted that in a project using phase-coherence this procedure must be automated in some way.
Sampling Rate Error Correction
The use of the DAB null symbol in an “oscilloscope” display as shown above will result
in a stable and not moving indication only if the sampling rate of the receiver equals
exactly 2048000 samples per second, within the accuracy of the transmitter, which
is assumed to be very high. This error sampling rate is assumed to be the same as the clock error.
In fact, without a sampling rate error correction the time domain display slowly moves as expected
and does not stay stable. Although QIRX corrects the sampling rate for DAB in one of its control loops (see QIRX Operating Manual),
this cannot be used here, because the DAB processing is coming later in the processing chain of the signal.
As a consequence, a sampling rate error correction has implemented in the frontend.
The value of the correction is simply selected in such a way as to get a scope image as stable as possible.
In this way, as a side effect, the null symbol inspection allows to measure
the sampling rate of a receiver in the sub-Hertz region, the accuracy depending on the time span of the measurement.
The granularity of the correction depends on the receiver,
assuming that rtl_tcp forwards the given commands without modification.
It showed to be correctable in the Hertz region, which again astonishes having the price of the device in mind.
Necessary Further Modifications
Amplitude Adjustment: One of the signals can be adjusted,
to get equal amplitude of the two signals.
Phase Correction One of the signals can be corrected in phase.
Continuous Phase Correction: The phase difference of the two signals can be continuously
measured and corrected.
Possible Signal Combinations for the subsequent processing in the frequency domain:
Signal 1 + Signal 2,
Signal 1 and Signal 2 interleaved,
Ideally, after adjustment of the signals for identical amplitudes and for the time delay,
both receivers should present the same samples to the software,
perhaps with a constant phase difference.
The phase of rx2 would then have to be adjusted to minimize the difference signal.
As a result, the difference of both should give zero.
Such an “ideal” case is shown in the following figure.
The upper red display shows the null symbol of rx1.
The lower red display shows the difference between rx1 and rx2.
The difference signal is almost zero,
proving the reception of nearly identical samples in both receivers.
The signals of both receivers then have been interleaved
in such a way to provide alternating 4k samples from each receiver for the DAB.
The constellation shows perfect DAB demodulation, “the music played”.
If this picture had been reproducible,
then all would have been fine. Unfortunately, this was not the case.
To get a situation like in the "ideal case" shown above,
often up to ten attempts were necessary. The main reasons for less than perfect coherence:
1. Sub-sample time delay. In most of the cases, the situation looked similar like the one in the following figure.
The difference signal (lower graph) does not reach zero. Zero difference could not be reached by adjustment
of the two signals to the same amplitude and applying a constant phase correction on the rx2 signal.
The reason might be that the one sample granularity of the time correction is not sufficient.
No attempts to achieve a sub-sample time synchronisation have been performed.
The sub-sample time delay (if the interpretation is correct)
seemed to be completely random with respect to different runs of the system.
In a situation like the one of the above figure, no DAB demodulation is possible.
2. Varying phase differences between the two receivers during a run.
In most of the cases, the phase difference between the two signals was not constant after start.
Instead, this difference showed a strange behavior.
The difference angle seemed to rotate with – from run to run – different velocities.
To compensate, the angle has been measured for every hundred samples,
averaged and the signal of rx2 rotated around the negative of this angle.
This proved to be very efficient and compensated almost entirely the varying phase differences.
The strange observation is that with the two dongles only three different rotation speeds have been observed:
Zero, i.e. no varying phase during a run. This was the expected case, but could be only observed twice.
About one minute, i.e. a complete rotation circle of 360 degrees lasted one minute.
About two minutes per 360°.
In case of a sufficiently small residual time delay (see item #1 above)
the compensation of that varying angle resulted in a demodulation of the interleaved DAB signal,
a situation similar to the "ideal" case. The visible part of the constellation shows perfect demodulation of the interleaved signal.
The described experiments with two RTL-SDR receivers running on the same clock
have shown severe difficulties to achieve phase-coherence in a robust and reproducible way,
necessary for demanding applications like interferometry.
It has been possible to achieve phase-coherent operation of two I/Q data streams.
It has NOT been possible to achieve phase-coherent operation on every run of the system.
The system showed sub-sample time delay between the two receivers (if the interpretation of the observed behaviour is correct),
varying randomly between different runs. A time delay of the
two receivers sufficiently small for DAB demodulation of
interleaved signals could only be achieved by pure chance.
No attempts have been made to solve this problem during the experiments.
The system showed varying phase differences between the two receivers,
changing at a constant rate. Three different changing rates have been observed during the experiments.
A working solution has been found for this phenomenon,
consisting in an continuous permanent correction of the phase angles of every sample.
This imposes a considerable enhanced processing load.
The occurrence of three different relative phase angle rotation speeds seemed strange.
With the lack of documentation any attempt to interpret this behavior seems pure speculation.
A similar behaviour has been observed by others, see e.g. here,
and is attributed to
Kyle Keen's rtl_sdr library, to be found here seems to avoid the varying phases altogether.
The experiments were to serve as a decision to use coupled cheap RTL-SDR receivers
as hardware for possible further projects requiring robust and stable phase-coherence.
Although phase-coherence could be achieved with the described hardware setup,
the lack of reproducibility (i.e. many attempts necessary) and the occurence
of phenomena which are not easily explained (lack of documentation) led to the decision
not to use RTL-SDR for such projects, but instead use hardware having been designed
with such phase-coherent applications in mind, and being specified for this purpose.
Although we are well aware that the cost of such hardware is many times that
of RTL-SDR dongles, the decision is justified in the light of the expected reproducibility and
stability of the results.