## Timing SDR recordings with GPS

Following a discussion on Twitter about how to use satellite signals to check that distributed receivers are properly synchronized, I have decided to write a post about how to use GPS signals to timestamp an SDR recording. The idea is simple: we do a short IQ recording of GPS signals, and then process those signals to find the GPS time corresponding to the start of the recording. This can be applied in many contexts, such as:

• Checking if the 1PPS synchronization in an SDR receiver is working correctly.
• Timestamping an SDR recording without the need of a GPS receiver or 1PPS input, by first recording GPS signals for some seconds and then moving to the signals of interest (this only works if you’re able to change frequency without stopping the sample stream).
• Measuring hardware delays between the 1PPS input and the ADC of an SDR (for this you need to know the hardware delay between the antenna connector and 1PPS output of your GPSDO).
• Checking if synchronization is repetitive across restarts or power cycles.

We will do things in a fairly manual way, using a couple of open source tools and a Jupyter notebook. The procedure could certainly be automated more (but if you do so, at some point you might end up building a full fledged GPS receiver!). The post is written with a walk-through approach in mind, and besides the usefulness of timestamping recordings, it is also interesting to see hands-on how GPS works.

## Waterfalls from the December 2021 eclipse frequency measurement

The HamSci Ham Radio Scienze Citizen Investigation community organized earlier this month the December 2021 Eclipse Festival of Frequency Measurement. The goal of this activity was to measure the frequency of HF time signals such as WWV and RWM over the course of ten days. The experiment lasted from December 1 to December 10, so it included the total eclipse over Antarctica of December 4, which happened between 5:29 and 9:37 UTC.

I participated in this activity with my HF station, which consists of a Hermes-Lite 2 beta2 DDC/DUC SDR transceiver and an end-fed random wire antenna about 17 metres long. I used a 10 MHz reference from a GPSDO as described in this post to lock the Hermes-Lite 2 sampling clock. Instead of measuring frequency in real time, I recorded IQ data at 200 sps for the WWV carrier at 5000, 10000 and 15000 kHz and for the RWM carrier at 4996, 9996 and 14996 kHz, so that the data could be post processed later with any kind of algorithms. I have published my recordings in the “December 2021 Eclipse Festival of Frequency Measurment IQ recording by station EA4GPZ” dataset in Zenodo.

In this post I process the IQ recordings to produce waterfalls that give us an overview of the data. The frequency measurement will be done in a later post.

## Hermes-Lite 2 external 10 MHz reference

Interested by the forthcoming HamSci December 2021 eclipse festival of frequency measurement, I have decided to enable and test the external 10 MHz input of my Hermes-Lite 2 DDC/DUC HF transceiver. This will allow me to use a GPSDO (the Vectron MD-011 which has appeared in other posts) to reference the Hermes-Lite 2 in order to measure frequency accurately.

## QO-100 spring eclipse season

A few days ago, the spring eclipse season for Es’hail 2 finished. I’ve been recording the frequency of the NB transponder BPSK beacon almost 24/7 since March 9 for this eclipse season. In the frequency data, we can see that, as the spacecraft enters the Earth shadow, there is a drop in the local oscillator frequency of the transponder. This is caused by a temperature change in the on-board frequency reference. When the satellite exits the Earth shadow again, the local oscillator frequency comes back up again.

The measurement setup I’ve used for this is the same that I used to measure the local oscillator “wiggles” a year ago. It is noteworthy that these wiggles have completely disappeared at some point later in 2020 or in the beginning of 2021. I can’t tell exactly when, since I haven’t been monitoring the beacon frequency (but other people may have been and could know this).

A Costas loop is used to lock to the BPSK beacon frequency and output phase measurements at a rate of 100 Hz. These are later processed in a Jupyter notebook to obtain frequency measurements with an averaging time of 10 seconds. Some very simple flagging of bad data (caused by PLL unlocks) is done by dropping points for which the derivative exceeds a certain threshold. This simple technique still leaves a few bad points undetected, but the main goal of it is to improve the quality of the plots.

The figure below shows the full time series of frequency measurements. Here we can see the daily sinusoidal Doppler pattern, and long term effects both in the orbit and in the local oscillator frequency.

If we plot all the days on top of each other, we get the following. The effect of the eclipse can be clearly seen between 22:00 and 23:00 UTC.

By adding an artificial vertical offset to each of the traces, we can prevent them from lying on top of each other. We have coloured in orange the measurements taken when the satellite was in eclipse. The eclipse can be seen getting shorter towards mid-April and eventually disappearing.

We see that the frequency drop starts exactly as soon as the eclipse starts. In many days, the drop ends at the same time as the eclipse, but in other days the drop ends earlier and we can see that the orange curve starts to increase again near the end of the eclipse. This can be seen better in the next figure, which shows a zoom to the time interval when the eclipse happens, and doesn’t apply a vertical offset to each trace. I don’t have an explanation for this increase in frequency before the end of the eclipse.

The plots in this post have been done in this Jupyter notebook. The frequency measurements have been stored in this netCDF4 file, which can be loaded with xarray.

## Update on the QO-100 local oscillator wiggles

This post is a follow up to my study of the “wiggles” observed in the local oscillator of the QO-100 NB transponder. After writing that post, I have continued measuring the frequency of the BPSK beacon with my station almost without interruptions. Now I have some 44 days of measurements, spanning from April 9 to May 23. This data can be interesting to look at, so I’m doing this short post to share the data and look at it briefly.

The Jupyter notebook with all the data can be found here. The data is also linked in my jupyter_notebooks Github repository, which now uses git-annex to store the data in my home server. See the README for instructions on how to download some or all of the data files in the repository.

The whole time series can be seen in the figure below. We note that the typical Doppler sinusoidal curve varies slowly due to orbit perturbations and sometimes suddenly as a consequence of a station-keeping manoeuvre. I tweeted about one of the manoeuvres a while back.

There are now too many days in order to see things clearly when the frequency curves for each day are overlaid, but hopefully the figure below gives a good idea. We can see that the wiggles still happen approximately between 21:00 and 06:00 UTC, and between 11:00 and 17:00 UTC.

If we add an artificial offset of -15 Hz per day to the curves to prevent them from overlapping, we obtain the figure below. We see that the pattern of the wiggles keeps changing slightly, but also remains quite similar.

In my last post about this topic I said that it seemed that the wiggles repeated with a period of a sidereal day. Now it is clear that it is not the case. The wiggles seem to repeat roughly with a period of a solar day (24 hours). In fact, in 44 days sidereal time “advances” 2.88 hours with respect to solar time. However, it is clear that the wiggles haven’t shifted that much in time.

## Wiggles in the QO-100 local oscillator

Some days ago, Hans Hartfuss DL2MDQ sent me an email about some frequency measurements of the QO-100 NB transponder BPSK beacon that he had been doing. The BPSK beacon is uplinked from Bochum (Germany) through the transponder, and as the beacon is generated using a very good Z3081A GPSDO as a reference, the frequency drift observed on the beacon downlink is caused by Doppler and the drift of the local oscillator of the transponder.

In his measurements, Hans observed some small oscillations or “wiggles” that didn’t seem to be caused by Doppler. Decided to investigate this, I started to do some measurements of my own. This post is an account of my measurements and findings so far.

## Coherence and QO-100

My tweet about the AMSAT-BR QO-100 FT8 QRPp experiment has spawned a very interesting discussion with Phil Karn KA9Q, Marcus Müller and others about weak signal modes specifically designed for the QO-100 communications channel, which is AWGN albeit with some frequency drift (mainly due to the imperfect reference clocks used in the typical groundstations).

Roughly speaking, the conversation shifted from noting that FT8 is not so efficient in terms of EbN0 to the idea of using something like coherent BPSK with $$r=1/6$$ CCSDS Turbo code, then to observing that maybe there was not enough SNR for a Costas loop to work, so a residual carrier should be used, and eventually to asking whether a residual carrier would work at all.

There are several different problems that can be framed in this context. For me, the most interesting and difficult one is how to transmit some data with the least CN0 possible. In an ideal world, you can always manage to transmit a weaker signal just by transmitting slower (thus maintaining the Eb/N0 constant). In the real world, however, there are some time-varying physical parameters of the signal that the receiver needs to track (be it phase, frequency, clock synchronization, etc.). In order to detect and track these parameters, some minimum signal power is needed at the receiver.

This means that, in practice, depending on the physical channel in question, there is a lower CN0 limit at which communication on that channel can be achieved. In many situations, designing a system that tries to approach to that limit is a hard and interesting question.

Another problem that can be posed is how to transmit some data with the least Eb/N0 possible, thus approaching the Shannon capacity of the channel. However, the people doing DVB-S2 over the wideband transponder are not doing it so bad at all in this respect. Indeed, by transmitting faster (and increasing power, to keep the Eb/N0 reasonable), the frequency drift problems become completely manageable.

In any case, if we’re going to discuss about these questions, it is important to characterize the typical frequency drift of signals through the QO-100 transponder. This post contains some brief experiments about this.

## Oscillations and relativistic effects in Galileo broadcast clocks

A few days ago, Bert Hubert, the creator of galmon.eu, discovered a sinusoidal oscillation in the clock drift $$a_{f1}$$ parameter of the broadcast ephemerides of Galileo satellites. This variation has a frequency that matches the orbital period of 14 hours and 7 minutes. At first, I suggested that it might be caused by relativistic effects, which are given by$-\frac{\sqrt{\mu}}{c^2}e\sqrt{A}\sin E,$where $$\mu$$ is the Earth’s gravitational parameter, $$c$$ is the speed of light, $$e$$ is the eccentricity, $$A$$ is the semi-major axis, and $$E$$ is the eccentric anomaly. In fact, the order of magnitude of the oscillations that Bert was seeing seemed to agree with this formula.

However, then I realised that this relativistic effect is not included in the broadcast clock model. It needs to be included back by the receivers. Therefore, it shouldn’t appear at all in the broadcast clock. Something didn’t seem quite right. This post is an in-depth look at this problem.

## QO-100 BPSK beacon frequency measured at Bochum

The experiments about measuring the frequency stability of the local oscillator of the QO-100 NB transponder with a Vectron MD-011 GPSDO I made a few days ago indicated that the Allan deviation of the local oscillator was probably better than $$10^{-11}$$ for $$\tau$$ between 1 and 100 seconds. The next step in trying to characterize the stability of the local oscillator is to use a reference clock which is more stable than the Vectron.

I contacted Achim Vollhardt DH2VA asking him if it was possible to record the downlink of the BPSK beacon at Bochum, so as to have a recording referenced to the Z3801A GPSDO in Bochum, which is much more stable than the Vectron. He and Mario Lorenz DL5MLO have been very kind and they have taken the effort to make a recording for me. This post is an analysis of this recording made at Bochum.