Discussion:
[time-nuts] simple phase finder
jimlux
2018-12-05 13:19:35 UTC
Permalink
Here's some python code that I use to find the frequency, amplitude and
phase of a discrete sine in noise for 100MHz samples. It's basically a
sequential sliding correlator.

If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is. If I did 0.1 second chunks, I can probably identify the bit
transitions every second, because in 1/10th chunks, the phase will not
be one of two values.

This routine is not computationally efficient, it's pretty brute force -
a better approach would use a narrow band transform and do a correlation.

This routine also might get fouled up by the amplitude modulation (at
least in the "peak search" part of operation.

Another approach would be to implement a classical Costas Loop. I think
though, a sliding correlator of some sort might be a better solution -
for one thing, it "look forward and back in time"


fs = sample rate
M = number of samples
ftestmin, ftestmax is the range to search over in MHz
adc is a numpy array with the samples



# build an array of sample times
t = np.arange(0,M)
t = t/fs
# iteratively search a small range around the peak to find the best
fit for a sine wave.
# the resolution bandwidth for 32768 points is about 3 kHz, so
looking over
# to make life nicer, we'll round the start and stop frequency to a
# multiple of 100 Hz, then go in 10 Hz steps
ftestmin = 0.0001 * math.floor(ftestmin * 10000)
ftestmax = 0.0001 * math.ceil(ftestmax * 10000)

resid = adc - np.mean(adc)

ftest = np.arange(ftestmin,ftestmax,0.000010)
test1 = 0
testmax = 0
pi = np.pi
for i in range(0,len(ftest)) :
try1 = (np.cos(t * 2 * pi * ftest[i]) - 1.0j*np.sin(t * 2 * pi
* ftest[i]))
try1 = np.reshape(try1, (adc.size,1))
test1 = np.sum(resid * try1,axis=0) / M
if abs(test1[0]) > abs(testmax):
testmax = test1
ftestmax = ftest[i]
#

c = np.cos(t * 2 * pi * ftestmax)
s = np.sin(t * 2 * pi * ftestmax)

f1db = 20 * np.log10(np.sqrt(2) * abs(testmax))


freqreturn = ftestmax
ampreturn = f1db[0]
phasereturn = np.angle(testmax[0]) * 180 / pi

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Poul-Henning Kamp
2018-12-05 13:39:52 UTC
Permalink
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.

Instead continuously average the square of the signal into a 1
second long circular buffer.

Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.

Next find the amplitude modulation in the buffer with simple
thresholding and you now know the start of the second and the
60KHz phase, so you can lock a PLL to the carrier directly,
and having done so, the phase modulation falls right out by
simple multiplication.

The really interesting thing is that you can track a lot of carriers
this way using the same single circular buffer.

If you multiply it by 77.5 kHz sine+cosine, you get DCF77 phase
and amplitude. If you multiply it by 198kHz you get...

There's some very old plots here:

http://phk.freebsd.dk/loran-c/CW/
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@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.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
jimlux
2018-12-05 13:45:44 UTC
Permalink
Post by Poul-Henning Kamp
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.
True enough - this was just to get started.
Post by Poul-Henning Kamp
Instead continuously average the square of the signal into a 1
second long circular buffer.
Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.
yes.. assuming your ADC is running off a sufficiently stable source. I
was thinking about a very low cost implementation where the ADC is
running off a not very wonderful microcontroller clock.
Post by Poul-Henning Kamp
Next find the amplitude modulation in the buffer with simple
thresholding and you now know the start of the second and the
60KHz phase, so you can lock a PLL to the carrier directly,
and having done so, the phase modulation falls right out by
simple multiplication.
That would be the standard Costas loop approach - I wonder though, is
the signal strong enough that you can just clip it to remove the AM or
implement some sort of software AGC?

All manner of PLLs don't work as well when the input signal is of
varying amplitude. Maybe it works well enough here.
Post by Poul-Henning Kamp
The really interesting thing is that you can track a lot of carriers
this way using the same single circular buffer.
If you multiply it by 77.5 kHz sine+cosine, you get DCF77 phase
and amplitude. If you multiply it by 198kHz you get...
yes..
Post by Poul-Henning Kamp
http://phk.freebsd.dk/loran-c/CW/
The real intent was to show that you can do the processing with a very
simple implementation - no need to fire up SDR# or gnuradio.


_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Bob kb8tq
2018-12-05 14:32:28 UTC
Permalink
Hi
Post by jimlux
Post by Poul-Henning Kamp
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.
True enough - this was just to get started.
Post by Poul-Henning Kamp
Instead continuously average the square of the signal into a 1
second long circular buffer.
Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.
yes.. assuming your ADC is running off a sufficiently stable source. I was thinking about a very low cost implementation where the ADC is running off a not very wonderful microcontroller clock.
A stable clock probably is a pretty good bet on a “Time Nut” grade design. Indeed one objective might be to ultimately
read out the phase directly WRT that reference . Some sort of PPS tick likely would get into all this as well.
Post by jimlux
Post by Poul-Henning Kamp
Next find the amplitude modulation in the buffer with simple
thresholding and you now know the start of the second and the
60KHz phase, so you can lock a PLL to the carrier directly,
and having done so, the phase modulation falls right out by
simple multiplication.
That would be the standard Costas loop approach - I wonder though, is the signal strong enough that you can just clip it to remove the AM or implement some sort of software AGC?
All manner of PLLs don't work as well when the input signal is of varying amplitude. Maybe it works well enough here.
If the reference is stable / accurate (as above) then this really is not a PLL it’s more like a phase meter. Given
the low frequency the bounds on “stable / accurate” are a bit looser than one might think.

My *guess* is that you will have more luck with an approach that “finds” the phase modulation than finding the AM.
Just how you construct the buffer setup to do that would take a bit of thought. I’m not up to my first cup of coffee
quite yet :) …. How big a buffer does it take? I doubt you will run out of RAM … If it does become an issue, decimate
the 10 MHz (or whatever) samples while you are in “acquire” mode.

Things are a lot more convenient with a 12 MHz clock (or something like that) than with 1,5 or 10 MHz. Yes, it’s just math,
but more complicated math.

Bob
Post by jimlux
Post by Poul-Henning Kamp
The really interesting thing is that you can track a lot of carriers
this way using the same single circular buffer.
If you multiply it by 77.5 kHz sine+cosine, you get DCF77 phase
and amplitude. If you multiply it by 198kHz you get...
yes..
Post by Poul-Henning Kamp
http://phk.freebsd.dk/loran-c/CW/
The real intent was to show that you can do the processing with a very simple implementation - no need to fire up SDR# or gnuradio.
_______________________________________________
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions
jimlux
2018-12-05 14:51:09 UTC
Permalink
Post by Bob kb8tq
Hi
Post by jimlux
Post by Poul-Henning Kamp
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.
True enough - this was just to get started.
Post by Poul-Henning Kamp
Instead continuously average the square of the signal into a 1
second long circular buffer.
Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.
yes.. assuming your ADC is running off a sufficiently stable source. I was thinking about a very low cost implementation where the ADC is running off a not very wonderful microcontroller clock.
A stable clock probably is a pretty good bet on a “Time Nut” grade design. Indeed one objective might be to ultimately
read out the phase directly WRT that reference . Some sort of PPS tick likely would get into all this as well.
I was thinking more about "can you receive it with a SDR implementation
for <$50 and minimal heating of the soldering iron" without worrying too
much about measuring small phase shifts.

Once you've got to that - then you've got a basis for further improvements.

I'll try the RTL-SDR with a non-active antenna on Friday and see what I
can see here in Southern California. I know my old style "atomic" clock
does see the signal sometimes, so I can grab some sample when the clock
says it's live.


If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)

Why available by Friday? I'm going to be really busy starting next week
for a month commissioning a satellite launching next week, so this
weekend is my last opportunity to fool with actual technology.



_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow
Poul-Henning Kamp
2018-12-05 15:30:34 UTC
Permalink
--------
Post by jimlux
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)
There is one experiment I have thought about, but not tried: Wind a
big loop, run it directly into a sound card with microphone input.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@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.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
jimlux
2018-12-05 22:18:07 UTC
Permalink
Post by Poul-Henning Kamp
--------
Post by jimlux
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)
There is one experiment I have thought about, but not tried: Wind a
big loop, run it directly into a sound card with microphone input.
That's true.. many turns would give you more voltage.

Hmm, I've got a 3 foot long, 6" diameter tesla coil secondary with about
800 turns on it.

Aluminum foil over it for an electrostatic shield would be easy.


_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Bob kb8tq
2018-12-05 22:29:43 UTC
Permalink
Hi

One needs to take a bit of care with “big” loops. It’s surprising just how
fast the SRF comes down for some configurations ….. I doubt that is an
issue for your Tesla coil in free space, but it can mess things up pretty
fast when you start to shield things (as you probably should ….).

WWVB should b above 100uV/M in a good part of the country at least
part of a typical day. That’s not a crazy weak signal vs what one plays
with at HF or higher frequencies. The issue isn’t so much noise floor
(as in KTB) but the noise from junk devices here and there and propagated
noise from who knows where ….

Bob
Post by jimlux
Post by Poul-Henning Kamp
--------
Post by jimlux
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)
There is one experiment I have thought about, but not tried: Wind a
big loop, run it directly into a sound card with microphone input.
That's true.. many turns would give you more voltage.
Hmm, I've got a 3 foot long, 6" diameter tesla coil secondary with about 800 turns on it.
Aluminum foil over it for an electrostatic shield would be easy.
_______________________________________________
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow
David Van Horn
2018-12-05 22:47:31 UTC
Permalink
Be careful, shielding can lower the Q impressively due to parasitic capacitance.
Winding more than about a third of the length results in flux lines not coupling to the outboard turns.
Ferrite antennas are fascinating.

https://en.tdk-electronics.tdk.com/download/2176996/8d0ef9c30ea64c62edc15b3a2888f6d9/ferrites-impeder-cores-pp.pdf
Ferrite impeder cores may work better than solid cores, if the material works at frequency.
I've seen a magnetic version of the "Skin effect" in ferrites, and increasing the perimeter seems to work better than a solid rod.


-----Original Message-----
From: time-nuts <time-nuts-***@lists.febo.com> On Behalf Of jimlux
Sent: Wednesday, December 5, 2018 3:18 PM
To: Discussion of precise time and frequency measurement <time-***@lists.febo.com>
Subject: Re: [time-nuts] simple phase finder
Post by Poul-Henning Kamp
--------
Post by jimlux
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3
or 4 of them I've seen (Clifford labs, DX Engineering has one, I'm
sure MFJ has one)
There is one experiment I have thought about, but not tried: Wind a
big loop, run it directly into a sound card with microphone input.
That's true.. many turns would give you more voltage.

Hmm, I've got a 3 foot long, 6" diameter tesla coil secondary with about
800 turns on it.

Aluminum foil over it for an electrostatic shield would be easy.


_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Ian Stirling
2018-12-05 22:51:24 UTC
Permalink
I do not know what the fire risk is, covering it with foil or not.
I have a radio amateur friend who tried to use a coiled antenna
and it sparked in various places. He gave up using it.

Ian, G4ICV, AB2GR
--


_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Ian Stirling
2018-12-05 23:16:46 UTC
Permalink
if anyone uses a coiled antenna .. best keep it in sight and have a fire extinguisher handy.

Ian, G4ICV, AB2GR
--
  I do not know what the fire risk is, covering it with foil or not.
I have a radio amateur friend who tried to use a coiled antenna
and it sparked in various places. He gave up using it.
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions
Poul-Henning Kamp
2018-12-05 23:22:37 UTC
Permalink
--------
Post by Ian Stirling
if anyone uses a coiled antenna .. best keep it in sight and have a fire extinguisher handy.
That's when you transmit, not when you receive.

If having coiled wire were that dangerous, they would not sell it on drums.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@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.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Ian Stirling
2018-12-05 23:58:51 UTC
Permalink
On 12/5/18 6:22 PM, Poul-Henning Kamp wrote: > That's when you transmit, not when you receive.
Post by Poul-Henning Kamp
If having coiled wire were that dangerous, they would not sell it on drums.
That is true.
I posted because there seems to be a lot of radio amateurs on this list and I wanted to
warn them of transmitting with a coiled aerial.

Ian, G4ICV, AB2GR
--


_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.

John Ackermann N8UR
2018-12-05 22:35:39 UTC
Permalink
Post by jimlux
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)
I have a couple of the Clifton Labs antennas, and they are superb. Jack
Smith, K8ZOA, was the genius behind them. Unfortunately, Jack passed
away a couple of years ago. DX Engineering bought the business and I
think is still selling the antenna (he also had a lot of other gadgets
like low noise/high dynamic range HF preamps).

You won't get it by Friday, but there is a Ukranian ham who sells a very
inexpensive ($21!!!) active antenna on eBay:

https://www.ebay.com/itm/MiniWhip-Active-Antenna-HF-LF-VLF-mini-whip-shortwave-sdr-RX-portable-receiving-/222327564468

It is a knock-off of a design by PA0NHC. I have played with one, and it
seems to work OK.

(By the way, if you'd like an international amateur radio soap opera,
there is quite a lot of controversy around this Ukranian ham and another
who have eBay stores selling mainly VHF transverters as well as other
products like this antenna. Each accuses the other of stealing his
design, and claims that his is better. And PA0NHC is mad because one of
them sells his design fully built (he only offers bare PB). )

John

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Poul-Henning Kamp
2018-12-05 23:15:21 UTC
Permalink
--------
In message <3c33da4e-df22-1ae1-3d09-***@febo.com>, John Ackermann N8UR writes:

I built one of Chris Trask's designs some years ago, and it works fantastic well.

He has many antenna designs, see the bottom of:

http://www.home.earthlink.net/~christrask/

I picked the one on page six here:

http://www.home.earthlink.net/~christrask/Complementary%20Push-Pull%20Amplifiers.pdf

It goes from practically DC to around 150-200 MHz in my hand-soldered SMD implementation.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@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.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Brian Lloyd
2018-12-05 16:17:45 UTC
Permalink
Post by jimlux
Post by Bob kb8tq
Hi
Post by jimlux
Post by Poul-Henning Kamp
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.
True enough - this was just to get started.
Post by Poul-Henning Kamp
Instead continuously average the square of the signal into a 1
second long circular buffer.
Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.
yes.. assuming your ADC is running off a sufficiently stable source. I
was thinking about a very low cost implementation where the ADC is running
off a not very wonderful microcontroller clock.
Are you aware that the KiwiSDR receivers are locked to GPS and time-stamp
their samples? Some people are playing with TDoA location of HF emitters
using multiple KiwiSDRs out there.
Post by jimlux
Post by Bob kb8tq
A stable clock probably is a pretty good bet on a “Time Nut” grade
design. Indeed one objective might be to ultimately
Post by Bob kb8tq
read out the phase directly WRT that reference . Some sort of PPS tick
likely would get into all this as well.
Yeah, do more research into the KiwiSDR.
Post by jimlux
I was thinking more about "can you receive it with a SDR implementation
for <$50 and minimal heating of the soldering iron" without worrying too
much about measuring small phase shifts.
Once you've got to that - then you've got a basis for further improvements.
I'll try the RTL-SDR with a non-active antenna on Friday and see what I
can see here in Southern California. I know my old style "atomic" clock
does see the signal sometimes, so I can grab some sample when the clock
says it's live.
If anyone has a suggestion for an off the shelf active antenna that's
orderable and receivable by Friday, I'd love to hear it. There's 3 or 4
of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ
has one)
I have the PixelSat loop (now sold by DX Engineering) and it works great at
60kHz. I hear WWVB 7x24 in San Antonio. MFJ has a cheaper version that I've
heard works OK.

I have my loop driving my KiwiSDR. I haven't made it public (yet). I hear
WWVB with it just peachy all the time.
Post by jimlux
Why available by Friday? I'm going to be really busy starting next week
for a month commissioning a satellite launching next week, so this
weekend is my last opportunity to fool with actual technology.
DX Engineering or MFJ. You might find that HRO has one or the other in
stock. Don't they have a store in Las Vegas, not too far from you? UPS
ground should get to you in a day.
--
Brian Lloyd
706 Flightline
Spring Branch, TX 78070
***@lloyd.aero
+1.210.802-8FLY (1.210.802-8359)
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Bob kb8tq
2018-12-05 16:19:04 UTC
Permalink
Hi

One of the most common things to do for an antenna is to come up with a resonant
loop. That gives you *some* rejection of the massive 60 KHz switcher noise you have
to deal with. By fiddling a bit with the turns and pickoff, you can come up with a
high Z output (if you like JFET front ends) or a low Z (if you like common base setups).
Interesting features like balanced feed to reduce pickup are also fairly simple.

An E-Field probe is another way to get the signal in and it can have some advantages in
the right setting. If you are after broadband coverage, they certainly are a better bet than
a resonant loop.

A while back a list member was making 60KHz antennas and selling them on eBay. It’s
been a while since I went looking for them. They may still be out there.

With loops (provided your home isn’t the source of the 60KHz trash) a fairly good signal
can be had with an indoor antenna. With the probe antennas, you really need to get out
and away from “stuff” to get a reasonable signal. Having a resonant loop in a heated
space helps reduce the phase issues of a high(ish) Q device and day/night swings.

I have seen a lot of radios over the years that claim sub-500KHz coverage. Many of them
have been so deaf down there as to be completely useless. The signals are fairly strong,
but indeed the radios have been very deaf …. It’s not just about the antenna.

Bob
Post by Bob kb8tq
Hi
Post by jimlux
Post by Poul-Henning Kamp
--------
Post by jimlux
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.
With stable signals like this, it is a bad idea to chop them up,
in particular if your ADC runs from a good stable frequency.
True enough - this was just to get started.
Post by Poul-Henning Kamp
Instead continuously average the square of the signal into a 1
second long circular buffer.
Then multiply/sum that buffer with a 120kHz sine and cosine to find
the phase angle.
yes.. assuming your ADC is running off a sufficiently stable source. I was thinking about a very low cost implementation where the ADC is running off a not very wonderful microcontroller clock.
A stable clock probably is a pretty good bet on a “Time Nut” grade design. Indeed one objective might be to ultimately
read out the phase directly WRT that reference . Some sort of PPS tick likely would get into all this as well.
I was thinking more about "can you receive it with a SDR implementation for <$50 and minimal heating of the soldering iron" without worrying too much about measuring small phase shifts.
Once you've got to that - then you've got a basis for further improvements.
I'll try the RTL-SDR with a non-active antenna on Friday and see what I can see here in Southern California. I know my old style "atomic" clock does see the signal sometimes, so I can grab some sample when the clock says it's live.
If anyone has a suggestion for an off the shelf active antenna that's orderable and receivable by Friday, I'd love to hear it. There's 3 or 4 of them I've seen (Clifford labs, DX Engineering has one, I'm sure MFJ has one)
Why available by Friday? I'm going to be really busy starting next week for a month commissioning a satellite launching next week, so this weekend is my last opportunity to fool with actual technology.
_______________________________________________
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructio
Poul-Henning Kamp
2018-12-05 18:15:28 UTC
Permalink
--------
Post by jimlux
All manner of PLLs don't work as well when the input signal is of
varying amplitude. Maybe it works well enough here.
The PLL needs a phase offset input, if you do the circular buffer you
can stick three tracking points into it and use them to feed the PLL.

I did this with my "AducLoran" SDR receiver, and it worked great.

You can see a real life run here:

Loading Image...

I saved this one, because it shows beautifully how the Loran-C
signal was designed to be night-wave resistant.

The receiver ran of a free-running OCXO here, which is why you see
the three sample-points 'phase-slip' periodically. In closed loop
mode, the OCXO was disciplined by the AducLoran and the middle point
haunted the 3rd zero-crossing.

The AducLoran ran om a Analog Devices "Aduc" ARM chip and used the
internal ADC for direct sampling of the antenna signal (from the
aforementioned $20 loop antenna)

Full details here:

http://phk.freebsd.dk/AducLoran/
Post by jimlux
The real intent was to show that you can do the processing with a very
simple implementation - no need to fire up SDR# or gnuradio.
100% agree, those are not useful for any timenut purpose involving phase.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@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.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
D***@gmx.de
2018-12-05 23:11:30 UTC
Permalink
Hi,

if you need the frequency, amplitude and phase of a sampled sine wave
there is a solution without correlation, nonlinear fit or interpolation
in the frequency domain. It works with damped sine waves as well.

You just have to solve a linear system of equations.

See https://www.dsprelated.com/showarticle/795.php
with links to Matlab code.

Cheers
Detlef
Post by jimlux
Here's some python code that I use to find the frequency, amplitude and
phase of a discrete sine in noise for 100MHz samples. It's basically a
sequential sliding correlator.
If I were decoding WWVB to start, I'd break my samples up into 0.1
second or 0.5 second chunks and process them to see what the carrier
phase is.  If I did 0.1 second chunks, I can probably identify the bit
transitions every second, because in 1/10th chunks, the phase will not
be one of two values.
This routine is not computationally efficient, it's pretty brute force -
a better approach would use a narrow band transform and do a correlation.
This routine also might get fouled up by the amplitude modulation (at
least in the "peak search" part of operation.
Another approach would be to implement a classical Costas Loop.  I think
though, a sliding correlator of some sort might be a better solution -
for one thing, it "look forward and back in time"
fs = sample rate
M = number of samples
ftestmin, ftestmax is the range to search over in MHz
adc is a numpy array with the samples
    # build an array of sample times
    t = np.arange(0,M)
    t = t/fs
    # iteratively search a small range around the peak to find the best
fit for a sine wave.
    # the resolution bandwidth for 32768 points is about 3 kHz, so
looking over
    # to make life nicer, we'll round the start and stop frequency to a
    # multiple of 100 Hz, then go in 10 Hz steps
    ftestmin = 0.0001 * math.floor(ftestmin * 10000)
    ftestmax = 0.0001 * math.ceil(ftestmax * 10000)
    resid = adc - np.mean(adc)
    ftest = np.arange(ftestmin,ftestmax,0.000010)
    test1   = 0
    testmax = 0
    pi = np.pi
        try1 = (np.cos(t * 2 * pi * ftest[i]) - 1.0j*np.sin(t * 2 * pi
* ftest[i]))
        try1 = np.reshape(try1, (adc.size,1))
        test1 = np.sum(resid * try1,axis=0) / M
            testmax = test1
            ftestmax = ftest[i]
#
    c = np.cos(t * 2 * pi * ftestmax)
    s = np.sin(t * 2 * pi * ftestmax)
    f1db = 20 * np.log10(np.sqrt(2) * abs(testmax))
    freqreturn  = ftestmax
    ampreturn   = f1db[0]
    phasereturn = np.angle(testmax[0]) * 180 / pi
_______________________________________________
To unsubscribe, go to
http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the ins
Gregory Maxwell
2018-12-05 23:22:22 UTC
Permalink
Post by D***@gmx.de
if you need the frequency, amplitude and phase of a sampled sine wave
there is a solution without correlation, nonlinear fit or interpolation
in the frequency domain. It works with damped sine waves as well.
You just have to solve a linear system of equations.
A similar linerization can be used in an iterative manner to also
solve for first and higher order amplitude modulation as well as
frequency modulation:

https://people.xiph.org/~xiphmont/demo/ghost/demo3.xhtml

Also relevant is
https://github.com/stevengj/harminv/blob/master/README.md though
generally less flexible than the ghost chirp code.

What I've never known is how to characterize the statistics of these
kinds of matchers.

_______________________________________________
time-nuts mailing list -- time-***@lists.febo.com
To unsubscribe, go to http://lists.febo.com/mailman/listinfo/time-nuts_lists.febo.com
and follow the instructions there.
Loading...