[time-nuts] WWVB Measurements using DSP recovery

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Mar 29 18:13:39 UTC 2011


In message <AANLkTi=Si24pPksDyae4Mvy_FB8W0qdSgF2vvDuT2+xP at mail.gmail.com>, paul
 swed writes:

>I have read the high level comments. But can we get deeper detail. Can it be
>done lets say in basic language etc. The comment I read that struck a cord
>was that all you did was sample and put the information in roughly 1000
>bins. Then I assume look for the bin with the most counts and called that
>center frequency. Perhaps plotting that number out.

If the averaging is done in a small FPGA, the rest can be done in
any programming language or even a spreadsheet.

Basically the buckets correspond to a timeinterval or time windown.

For instance 1MSPS and 1000 buckets, the buckets total a 1 millisecond
window.

A signal of 60 kHz will consequently have 60 periods over the 1000
buckets, so to derive the phase we multiply it with a 60 kHz
I+Q signal and take the average.  (I+Q = sin+cos = two signals
same frequency, 90 degrees apart)

This comes out to:

	freq = 60		# ...times higher  = 60 kHz
	sin_acc = 0.0
	cos_acc = 0.0
	for i in range(0,nbucket):
		sin_acc += bucket[i] * sin(freq * 2 * PI / nbucket)
		cos_acc += bucket[i] * cos(freq * 2 * PI / nbucket)
	phase_angle = arc_tan2(sin_acc, cos_acc)

The beauty of this receiver, is that you can then change 60 to 75
and redo the calculation on the same bucket values.

The reason this works is the Fourier theorem:  

	integral     (sin(n*x) * sin(m*x)) = zero
	x 0...2*PI

If we can transfer the bucket values to the computer,
you could put them in column A in a spread-sheet and calculate the
phase_angle for any number of frequencies you care for in columns
B....

With a 32Kx16 ram, we could have 20000 buckets, with a 10MSPS ADC
that would give 2 msec for the window, allowing any frequency
divisible by 500 Hz to be measured.

Now arguably, there are a lot less usable signals than one would
dream of, but that does not distract from the fact that this is
an incredibly cheap and usable frequency/phase VLF receiver.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the time-nuts mailing list