Decoding WWVB, part 2

I worked on detecting the timing information from the WWVB signal. Being able to locate the start of the second is important because it is the clock the data is encoded against.

I have a few recordings of WWVB I'm testing against, and I started with the lowest noise one. Below is two seconds of the AM signal. The magenta is the signal strength, and the cyan is the slope of the signal strength (limited to +1/-1). The code is now looking for the signal to go down for at least 100ms and then back up for at least 70ms. The arrows mark the detected top of the second, which is 100ms before the lowest point.

Next, I looked at all 5 minutes of the data, to see how stable this detection is. The errorbar style was used when the signal took some time before its slope was positive for 70ms.

There's a slight drift in this data, suggesting the sampling clock and WWVB's are slightly off. By eyeballing it, it looks like around 10ms drift in 310 seconds, which is 32.3ppm (which is reasonable for a clock error). The edges of the start of the second can at least be detected within 30ms for this recording, which puts an upper bound on how exact the clock can be.

Next, I looked at a noisier signal:

You can see that there's extra frequencies in this data (noise). The slope swings from positive to negative more, and the algorithm only detected one of the two seconds.

Zooming out to see how it does over all 14 minutes:

There's a nice edge in this data at around 0.9s, and it looks like the start of the signal can be detected to around 75ms.

The code and recordings are at https://github.com/ddrown/wwvb