Searching \ for '[EE] WWVB CMAX Chip?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=wwvb+cmax+chip
Search entire site for: 'WWVB CMAX Chip?'.

Exact match. Not showing close matches.
PICList Thread
'[EE] WWVB CMAX Chip?'
2009\04\19@210254 by Bob Axtell

face picon face
I had a very bad day this weekend with WWVB,
I am using the CMAX module (

According to the NIST-WWVB specs, the way I
interpreted them must be faulty. According to what I
expected to get, I should have seen pulses 800mS
long, 500mS long, or 200mS long, each occurring
every 1 second. Two 800mS pulses start the sequence
followed by minutes, hours, day, etc etc. 200mS
pulses are a ZERO, 500mS pulses are a ONE.

Instead, I got a bunch of 5mS to 100mS arbitrary
pulses, which flopped around for about an hour
then stopped.Not a peep thereafter.

Did I get interference or what?

2009\04\20@001137 by davidcou

picon face
You do seem to understand the Output Pulse stream from WWVB but you may be receiving marginal or interference levels on the 60KHz transmission from Colorado.

Where are you located (within the USA)?

Are you in a room that has a Window that is not in a basement and not near metal walls?

Try facing the Antenna perpendicular toward Colorado from your location.

You may want to look at Weather.Com and see what the weather is between you and Colorado.

Keep us posted with your results.? I have developed many WWVB devices and can compare notes with you if you like.

David


{Original Message removed}

2009\04\20@002719 by Bob Axtell

face picon face
I think you are right. The signal made no sense; it seemed intelligent
but more like a
much faster signal stream, possibly military....

I am going to populate another CMAX module onto the PCB and try again.

more below...

On Sun, Apr 19, 2009 at 9:11 PM,  <spam_OUTdavidcouTakeThisOuTspamaol.com> wrote:
> You do seem to understand the Output Pulse stream from WWVB but you may be receiving marginal or interference levels on the 60KHz transmission from Colorado.
>
> Where are you located (within the USA)? Tucson, AZ USA
>
> Are you in a room that has a Window that is not in a basement and not near metal walls?
actually, I was in a metal trailer, I forgot.... I'll bet I was
getting nothing.....
>
> Try facing the Antenna perpendicular toward Colorado from your location.
I'll try it.

>
> You may want to look at Weather.Com and see what the weather is between you and Colorado.

They have a freak winter storm there right now...
>
> Keep us posted with your results.? I have developed many WWVB devices and can compare notes with you if you like.
Now that I think about it, I am only a few miles from Ft Huachuca, the
US Army listening /
communication station for signals world-wide. I'll bet I heard a
powerful ULF signal from
there.

Can I email you privately? ..>
> David
>
>
> {Original Message removed}

2009\04\20@011954 by Sean Breheny

face picon face
Hi Bob,

WWVB can be very easy or very difficult to receive depending on, mainly:

1) Your location relative to Colorado
2) Ionosphere conditions and time of day
3) local sources of VLF noise

I once built a simple receiver for WWVB and I never got it to work in
Ithaca, NY but it worked fine in Scranton, PA. I never figured out
why. Both, of course, are about the same distance from WWVB. It could
be that one was in just the right or just the wrong position relative
to mountains or skip zones to receive nothing or a strong signal.

I think that many WWVB-synced devices only work when far away from
TVs, switching power supplies, computers, etc., and even then, there
may only be a hour or so per day when they get a usable signal, and
that is when they sync up.

The signal is indeed very slow (about 1 or 2 bits per second, if I
recall correctly). Note that it is amplitude shift keying (i.e., it is
never off completely - rather it shifts between high power and lower
power)

I would encourage you to follow the advice you received from others
here. Basically, move your setup far away from any possible
interference sources, get it out in the open where it is not shielded
by metal, try orienting the antenna different ways and try at various
times of day. Check, also, with the WWVB web site - there are
occasional outages. You might even get another WWVB-enabled device and
put them side by side to see if one gets a signal and the other
doesn't.

Also, have you seen:

http://www.embeddedrelated.com/usenet/embedded/show/62642-1.php

http://www.prc68.com/I/Loop.shtml

It seems that others have had some problems with this module, too.

Sean


On Mon, Apr 20, 2009 at 12:27 AM, Bob Axtell <.....bob.axtellKILLspamspam@spam@gmail.com> wrote:
{Quote hidden}

>> {Original Message removed}

2009\04\20@081552 by olin piclist

face picon face
Sean Breheny wrote:
> I think that many WWVB-synced devices only work when far away from
> TVs, switching power supplies, computers, etc., and even then, there
> may only be a hour or so per day when they get a usable signal, and
> that is when they sync up.

Here in New England about 2000 miles from the transmitter the WWVB clocks
only seem to sync up overnight.  I have one in my office.  Whenever I change
the battery it just sits there the rest of the day.  Next morning it's
magically showing the correct time again.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@121115 by Bob Axtell

face picon face
Well, I am only a few hundred miles away. I think I will make the WWVB
receiver an
"outside" peripheral and make it peripheral to a larger PIC.and put it
on the roof away
from anythinf..Just put the CMax module into a weatherproof box, and
feed out +12V, the signal, and GND in a shielded cable. I'll just
capture the value of the pulse widths inb a
60-byte circular buffer, and extract and use it only if the synch
pulses are in place and the
data looks plausible......

I was already going to put it on the roof and read it only at night as
it was....

I have decided I received interference of some kind...

Thanks for the tips, Olin.

--Bob

On Mon, Apr 20, 2009 at 5:16 AM, Olin Lathrop <.....olin_piclistKILLspamspam.....embedinc.com> wrote:
{Quote hidden}

>

2009\04\20@124706 by Joseph Bento

face
flavicon
face

On Apr 20, 2009, at 6:16 AM, Olin Lathrop wrote:

> Sean Breheny wrote:
>> I think that many WWVB-synced devices only work when far away from
>> TVs, switching power supplies, computers, etc., and even then, there
>> may only be a hour or so per day when they get a usable signal, and
>> that is when they sync up.
>
> Here in New England about 2000 miles from the transmitter the WWVB  
> clocks
> only seem to sync up overnight.  I have one in my office.  Whenever  
> I change
> the battery it just sits there the rest of the day.  Next morning it's
> magically showing the correct time again.
>

What is the groundwave propagation of 60KHz?  I live in Salt Lake  
City, 400 miles or so from Ft Collins.  I can sync to WWVB 24/7 even  
in a basement bedroom.

Joe

2009\04\20@125228 by Brooke Clarke

flavicon
face
Hi Bob:

The s/n you will get depends on how far you are from the transmitter.  If on
either coast then your only hope is to try around midnight local time.  Way too
noisy during the day.

The other thing is getting the loop pointing to the transmitter.  I recently
got a projection clock and the first night it did not lock up at all.  I turned
it 90 degrees and it's been working fine ever since.  See:
www.prc68.com/I/Shadow-Clock.shtml#WT5360U
Remember that loops have two deep nulls so if the loop is pointing the wrong
direction you don't have a chance.

I tried connecting a LED and resistor to the positive output of the CMMR-6P-60
(you didn't mention which one you have) but didn't see anything but noise.  But
switching to the inverting output the LED now follows the signal (as best it
can in the noise).

Remember that these are very high impedance circuits and you need to use some
kind of buffer amp with a high input impedance so you don't load them down.
(or run a low voltage LED at low current)

I've looked at many patents for LF time receivers and there's all kinds of
tricks used to overcome the noise.  Key ones being:
* only try once a day near midnight local time
* disable the receiver when you advance a mechanical clock
* generate a local time code to compare with the incoming code
* change the ACG during the long pulses so it's correct then the actual data is
present
* search for known data i.e. manually set the clock & calendar and search for
things that are constant

Some info at:
http://www.prc68.com/I/Loop.shtml#CMMR6P60
Have Fun,

Brooke Clarke
http://www.prc68.com

2009\04\20@131446 by Peter Restall

flavicon
face

Evening Bob,

I've been playing about with MSF in the UK (also 60KHz and a similar encoding
method) - my own receiver not a monolithic solution though.  I've found my
laptop pretty much kills the signal from about 6 feet away and closer,
depending on the orientation of the screen; that usually confuses me for a few
minutes while I try to figure out what I've changed :)

I've also noticed that supply/chip decoupling has to be very good, since the
50Hz line ripple gets amplified pretty effectively otherwise - this is pretty
evident on my breadboard as noise when I look through my 'scope.  Since you
guys run mains at 60Hz, is it possible you may be getting a harmonic amplified
sufficiently to swamp the signal ?

I've noticed that the signal gets slightly stronger in the evening/night,
but overall it's fairly constant amplitude - I'm about 60 miles away from the
transmitter, so pretty close really.  But then again, WWVB is a much higher
powered transmitter.  If anything, evening time reduces the noise more than
increases the amplitude.

Also, when I constructed my boards, I found that the ground plane I thought
would help didn't - the antenna had to be about an inch above the board for
reception (obviously my bad layout...oops).  Obviously your ferrite rod also
has to be broad-side to the WWVB transmitter too, otherwise you'll get
attenuation.

I put a page together detailing my (rather poor, as it turns out) efforts;
maybe some of the ramblings can help you diagnose your issues:

http://custard.restall.net/msf_receiver/index.php

I've since got a better (experimental) setup - better front-end, AGC, and
fewer chips - and I'm going to pipe everything into a PIC, using its PWM as a
BFO and comparators as threshold detectors (and ADC inputs to monitor the
level and control the AGC), but that's a story for another thread :)

Hope this helps.

Regards,

Pete Restall

2009\04\20@131656 by M. Adam Davis

face picon face
I keep on thinking about making my own WWVB transmitter with a GPS
receiver as the timebase, and having it just powerful enough to take
care of all the wwvb clocks in my house, mounted on my roof with a
solar panel.

Will probably never get around to it, but it's a fun project to think
about.  Still haven't looked into the FCC implications...

-Adam

On Mon, Apr 20, 2009 at 12:52 PM, Brooke Clarke <EraseMEbrookespam_OUTspamTakeThisOuTpacific.net> wrote:
{Quote hidden}

>

2009\04\20@132717 by Sean Breheny

face picon face
Hi Joe,

I was trying to find a good discussion of 60kHz propagation via Google
and couldn't find much more than the WWVB wiki article. Basically they
say it is primarily groundwave but there is some ionospheric
reflection, too. Not a very rigorous discussion.

If you look at the coverage maps on the WWVB web site, you can see
that at certain times of the day, the coverage area expands and there
appear to be skip zones at the edges. However, most of the time the
entire continental US is within the coverage area and that area is
contiguous (no skip zones, i.e., periodic regions of high signal
strength followed by ones of low signal strength).

It appears to me that at 60kHz, the wavelength is so long that the
ground-ionosphere "tunnel" actually forms a high-order waveguide
(i.e., several wavelengths high, the lowest layers of the ionosphere
are about 100km high and the wavelength of 60kHz is about 3km). There
is considerable refraction by the Earth's curvature and terrain
(mountains), but also reflection from the ionosphere during times when
the ionization levels are in the correct range to reflect rather than
absorb 60kHz.

Sean


On Mon, Apr 20, 2009 at 12:46 PM, Joseph Bento <josephspamspam_OUTkirtland.com> wrote:
{Quote hidden}

>

2009\04\20@133458 by olin piclist

face picon face
Joseph Bento wrote:
> What is the groundwave propagation of 60KHz?  I live in Salt Lake
> City, 400 miles or so from Ft Collins.  I can sync to WWVB 24/7 even
> in a basement bedroom.

The wavelength at 60KHz is 3.1 miles, so the multiple ranges of mountains
between Fort Collins and Salt Lake City should break up the ground wave, at
least somewhat.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@134956 by olin piclist

face picon face
Peter Restall wrote:
> I've since got a better (experimental) setup - better front-end, AGC,
> and fewer chips - and I'm going to pipe everything into a PIC, using
> its PWM as a BFO and comparators as threshold detectors (and ADC
> inputs to monitor the level and control the AGC), but that's a story
> for another thread :)

With a dsPIC you should be able to go another step.  After suitable
amplification and at least some frequency filtering, run the antenna signal
into the dsPIC A/D.  The rest is all software.  You can multiply the signal
by both a sine and cosine at 60KHz, low pass filter each of these
independently, then square them and add them to get the squared carrier
amplitude.  Sampling at 4x the carrier frequency still leaves you over 120
instructions per sample.

The low pass filter after the sine and cosine multiplies will make this
software tuner highly selective.  You only need to pass enough to account
for the crystal error and modulation bandwidth.  60KHz derived from a 50ppm
crystal only has a error of +-3Hz, so you can easily set your LPF rolloff
frequency to 10Hz.  You could even detect and long term null out the beat
frequency.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@141454 by Mark E. Skeels

flavicon
face
Olin Lathrop wrote:
> [SNIP]
> With a dsPIC you should be able to go another step.  After suitable
> amplification and at least some frequency filtering, run the antenna signal
> into the dsPIC A/D.  The rest is all software.  You can multiply the signal
> by both a sine and cosine at 60KHz, low pass filter each of these
> independently, then square them and add them to get the squared carrier
> amplitude.  Sampling at 4x the carrier frequency still leaves you over 120
> instructions per sample.
>
> The low pass filter after the sine and cosine multiplies will make this
> software tuner highly selective.  You only need to pass enough to account
> for the crystal error and modulation bandwidth.  60KHz derived from a 50ppm
> crystal only has a error of +-3Hz, so you can easily set your LPF rolloff
> frequency to 10Hz.  You could even detect and long term null out the beat
> frequency.
>
>  
Can you please explain this in a bit more detail, Olin? I don't
understand what the math is doing.

Mark Skeels
Engineer
Competition Electronics, Inc.
TEL: 815-874-8001
FAX: 815-874-8181
http://www.competitionelectronics.com

2009\04\20@142746 by Marcel Duchamp

picon face
Olin Lathrop wrote:
>
> With a dsPIC you should be able to go another step.  After suitable
> amplification and at least some frequency filtering, run the antenna signal
> into the dsPIC A/D.  The rest is all software.  You can multiply the signal
> by both a sine and cosine at 60KHz, low pass filter each of these
> independently, then square them and add them to get the squared carrier
> amplitude.  Sampling at 4x the carrier frequency still leaves you over 120
> instructions per sample.
>
> The low pass filter after the sine and cosine multiplies will make this
> software tuner highly selective.  You only need to pass enough to account
> for the crystal error and modulation bandwidth.  60KHz derived from a 50ppm
> crystal only has a error of +-3Hz, so you can easily set your LPF rolloff
> frequency to 10Hz.  You could even detect and long term null out the beat
> frequency.

Olin, can you (or anyone else) explain the idea behind this?  I'm
referring to the mixing of the carrier by the sine and cosine.

I have seen plenty of hardware ICs that do this (I/Q mixing) but I do
not know what the purpose is.

Thanks!

2009\04\20@144512 by Sean Breheny

face picon face
Oops, after seeing Olin's email about the wavelength being 3.1 miles,
I went back and checked and it is indeed 5 km or 3.1 miles.


On Mon, Apr 20, 2009 at 1:27 PM, Sean Breheny <@spam@shb7KILLspamspamcornell.edu> wrote:
{Quote hidden}

>> -

2009\04\20@145336 by Sean Breheny

face picon face
I believe in this case that the purpose is to make a direct conversion
detector which ignores phase.

A basic direct conversion receiver just multiplies the incoming RF by
a sinusoid. This produces the sum and difference frequencies. At
60kHz, for example, if you mix it with a 59kHz sinusoid, you will get
119kHz and 1kHz. It is easy then to low-pass-filter it to get the 1kHz
out.

However, if you want to measure changes in the amplitude, and you want
to use a very low bandwidth low-pass-filter, it would be advantageous
to actually zero-beat the carrier with the local oscillator (which
should produce, in this case, 120kHz and DC). However, it is very
difficult to exactly synchronize the LO with the carrier. So, instead,
you can make two mixers and feed them both with  the carrier AND with
the LO, but on one the LO is 90 deg out of phase with the other.

When the carrier is 90 deg out of phase with one of the LO inputs,
that mixer will produce 0 volts DC out, but the carrier will then be
exactly in phase with the LO input to the other mixer, which will
output 1x the magnitude of the carrier in DC volts. If you
low-pass-filter each of these, square them, then add them (according
to the Pythagorean theorem), the result will be the square of the
magnitude of the carrier signal, regardless of how it drifts in phase
or even slightly in frequency.

The modulating waveform can then be obtained directly from this
squared magnitude (either by square root if needed or just
thresholding and comparing for a digital waveform).

Sean


On Mon, Apr 20, 2009 at 2:27 PM, Marcel Duchamp
<RemoveMEmarcel.duchampTakeThisOuTspamsbcglobal.net> wrote:
> Olin, can you (or anyone else) explain the idea behind this?  I'm
> referring to the mixing of the carrier by the sine and cosine.
>
> I have seen plenty of hardware ICs that do this (I/Q mixing) but I do
> not know what the purpose is.
>
> Thanks!
>

2009\04\20@152752 by olin piclist

face picon face
Mark E. Skeels wrote:
> Can you please explain this in a bit more detail, Olin? I don't
> understand what the math is doing.

In general, look up something called "product modulation".  That's what AM
is usually called in signal processing lingo.

The basic problem is to detect the amplitude of a fixed carrier signal.
There are many ways to do this, and different ways to think about each of
the methods.

Let's say you have a signal of known frequency that you want to determine
the amplitude of, and you can generate your own signal of that same
frequency.  But there is a wrinkle in that the incoming signal contains
other frequencies that are noise.  Your job is to detect just the signal of
the specific frequency and determine its amplitude, while ignoring all the
other frequencies added to it.

Let's say the signal you generate youreself (we'll call this the "local
oscillator", or LO) was known to be in phase with the signal of interest.
In that case you could multiply the two signals and integrate the result
over some suitable time.  This rejects the unwanted parts of the input
signal nicely since the integral of any two sine waves of different
frequency is zero if the integration window is wide enough (the suitable
time is long enough).  Since your LO sine signal is fixed, the resulting
integral is directly proportional to the amplitude of just the desired
carrier of the input signal.

However, think about what to do when you don't know the phase of the
incoming carrier.  If you get them 90deg out of phase, the integral will be
zero regardless of how strong the carrier is.  One way to get around this is
to create two LO signals 90deg out of phase.  If the carrier is exactly in
phase with one of them, then that integral will yield the carrier amplitude
and the other will be zero.  Vice versa if the carrier happens to be in
phase with the other LO signal.  If its phase happens to be between the two
LO signals, then each will pick up some of the amplitude.

One way to look at this is with a phazer diagram.  One LO signal is the unit
vector in the +X direction, the other in the +Y direction.  The carrier is a
unknown vector whose angle you don't care about and magnitude you are trying
to find.  The integral with each of the LO signals is basically the
projection of the carrier vector onto that axis.  Note that therefore the
magnitude of the carrier vector is the square root of the sum of the squares
of the two projections, or the square root of the sum of the squares of the
two LO integrals.  This is why I originally said to multiply by a sine and
cosine.  These are just the two LO signals 90deg apart.

Now consider what happens when the LO frequency is a little off from the
carrier frequency.  Again we can look at this as a phazer diagram at the
frequency of the LO signals.  The two LO signals are therefore always the +X
and +Y unit vectors as before.  However, the carrier vector now rotates
since its frequency isn't the same as the LO frequency.  The frequency of
rotation will be the difference between the LO and carrier frequencies.

So how do you decode the amplitude of this rotating vector?  The same way as
before.  The square root of the sum of the squares of the products between
the carrier and the two LO signals still gives the carrier amplitude since
this math is independent of the carrier phase.  However, now the integration
*for a suitable time* that a I waved my hands at before becomes important.
What we're really doing is low pass filtering the two LO with carrier
products, which acts like a integral up to some time.  You don't want to cut
into the frequency at which the carrier is rotating around the phazer
diagram, but you want to cut out as much noise mixed with the carrier as you
can.  You also need to leave whatever bandwidth the carrier is being
modulated with, else you won't see the modulations.

In the example of WWVB, the carrier is derived from a highly accurate atomic
clock, and your LO signals are derived from the PIC crystal.  Even cheap
crystals are good to 50ppm, which is 3Hz out of 60KHz.  The atomic clock is
essentially exact for our purposes when compared to a crystal.  That means
the carrier phazer will rotate around at up to 3Hz in either direction.  You
need to let this 3Hz pass else you loose the ability to detect the carrier
at that crystal error.  The carrier modulation bandwidth is also about a Hz
or two, so I suggested setting the low pass filter rolloffs to about 10Hz.
That will attenuate the noise components in the incoming signal outside the
very narrow band of 59990Hz to 60010Hz while not getting in the way of
tolerating 50ppm frequency error in the LO and of detecting the expected
changes in the carrier amplitude.

The carrier amplitude is therefore the square root of the sum of the squares
of the two LO and carrier products.  I skipped the final square root because
it would take cycles in the dsPIC and isn't necessary if all you want to do
is slice between a carrier high and carrier low level.

There is a lot more that could be said, but I've got to get back to work.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@152802 by olin piclist

face picon face
Marcel Duchamp wrote:
> Olin, can you (or anyone else) explain the idea behind this?  I'm
> referring to the mixing of the carrier by the sine and cosine.
>
> I have seen plenty of hardware ICs that do this (I/Q mixing) but I do
> not know what the purpose is.

Look up "product modulation".

********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@153131 by olin piclist

face picon face
Sean Breheny wrote:
{Quote hidden}

Exactly.  If I'd seen this post before writing my own explanation I could
have saved myself the trouble.  This would be a lot easier to explain on a
whiteboard than just with words.  Somehow you managed use half the words I
did but say the same thing.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\20@154257 by Mark E. Skeels

flavicon
face
Thanks, Sean and Olin.

Mark Skeels
Engineer
Competition Electronics, Inc.
TEL: 815-874-8001
FAX: 815-874-8181
http://www.competitionelectronics.com


2009\04\20@154413 by Bob Ammerman

picon face
> In general, look up something called "product modulation".  That's what AM
> is usually called in signal processing lingo.
>
> The basic problem is to detect the amplitude of a fixed carrier signal.
> There are many ways to do this, and different ways to think about each of
> the methods.
>
> Let's say you have a signal of known frequency that you want to determine
> the amplitude of, and you can generate your own signal of that same
> frequency.  But there is a wrinkle in that the incoming signal contains
> other frequencies that are noise.  Your job is to detect just the signal
> of
> the specific frequency and determine its amplitude, while ignoring all the
> other frequencies added to it.
<snip>

Wow, beautiful explanation, Olin.

-- Bob Ammerman
RAm Systems

2009\04\20@161037 by Marcel Duchamp

picon face
Olin Lathrop wrote:

Thanks Olin and Sean!

I used a similar circuit technique for a related function but I did not
know all the things both of you posted.

My application was using ultrasonic doppler to measure water velocity.
Mixing the receive signal with the carrier gives the sum and the
difference where the difference is the doppler signal.  This does not
give the information of whether the receive signal is above or below the
carrier frequency. Knowing this can tell you the direction - towards the
sensor or away from it, thus upstream or downstream velocity.

To get the direction, the receive signal is mixed with I and Q versions
of the carrier.  These are then fed to a flip flop; one is clock and the
other is the data.  The flip flop then gives high for one direction and
low for the other.  Later on, seeing I and Q demod circuits for various
comm methods, this circuit came up over and over but I knew they were
not for velocity direction so I was curious just how it works for
communications.

2009\04\20@182921 by Bob Axtell

face picon face
indeed!

--Bob

On Mon, Apr 20, 2009 at 12:43 PM, Bob Ammerman <spamBeGonerammermanspamBeGonespamverizon.net> wrote:
{Quote hidden}

>

2009\04\20@230408 by Sean Breheny

face picon face
Thanks, Olin. Yes, a picture is really helpful in explaining this.

Sean


On Mon, Apr 20, 2009 at 3:32 PM, Olin Lathrop <TakeThisOuTolin_piclistEraseMEspamspam_OUTembedinc.com> wrote:
> Exactly.  If I'd seen this post before writing my own explanation I could
> have saved myself the trouble.  This would be a lot easier to explain on a
> whiteboard than just with words.  Somehow you managed use half the words I
> did but say the same thing.
>
>
> ********************************************************************
> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
> (978) 742-9014.  Gold level PIC consultants since 2000.
>

2009\04\21@044845 by Alan B. Pearce

face picon face
>Thanks, Olin. Yes, a picture is really helpful in explaining this.

I had a basic understanding of what happens (my background being radio) but
as I understand what would go on inside the pic, the program would be using
the relationship cos^2(theta)+sin^2(theta) = 1, where cos(theta) and
sin(theta) are the outputs from the quadrature mixers. Am I correct in this?

2009\04\21@085210 by olin piclist

face picon face
Alan B. Pearce wrote:
> I had a basic understanding of what happens (my background being
> radio) but as I understand what would go on inside the pic, the
> program would be using the relationship cos^2(theta)+sin^2(theta) =
> 1, where cos(theta) and sin(theta) are the outputs from the
> quadrature mixers. Am I correct in this?

Yes, that's exactly right.  The carrier amplitude is sqrt(C^2 + S^2) where C
and S are the results of multiplying the incoming signal by the cosine and
sine LO signals, respectively.  This finds the carrier amplitude independent
of its phase with respect to the LO.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\21@125154 by Brooke Clarke

flavicon
face
Hi Olin:

A crystal that's 3 Hz off at 60 kHz has a stability of 5E-5.  I have a table of
some different oscillator stabilities at:
http://www.prc68.com/I/PClock.shtml#ST
these range from 1E-2 to 1E-15 and includes columns for:
time for 1 sec error,
error in 24 hours,
time for 400 ns error (PIC related), and
time for 100 ns error (10 MHz period).

If a LO with a stability of say 1E-7 was used the frequency error becomes 0.006
Hz, much lower than the modulation bandwidth.  So is there a way using DSP to
recover both the amplitude and phase (note WWVB has a phase modulation as well
as AM) using a method that's matched to the modulation rather than use low pass
filtering?  The idea being to greatly reduce the effective bandwidth hence
improving the s/n ratio.

--
Have Fun,

Brooke Clarke
http://www.prc68.com

2009\04\21@133938 by Peter Restall

flavicon
face

On Mon, 20 Apr 2009 13:50:47 -0400, Olin Lathrop wrote:

> With a dsPIC you should be able to go another step.  After suitable
> amplification and at least some frequency filtering, run the antenna signal
> into the dsPIC A/D.  The rest is all software.  You can multiply the signal
> by both a sine and cosine at 60KHz, low pass filter each of these
> independently, then square them and add them to get the squared carrier
> amplitude.  Sampling at 4x the carrier frequency still leaves you over 120
> instructions per sample.
>
> [snip]

Olin,

That is fantastically beautiful - thanks for the ideas/explanation; much
appreciated (not forgetting Sean also).  I'm very new to radio (and PICs and
electronics and...) and an SDR wasn't something I was considering.  But it
sounds like you've done this sort of application before...

I'm now torn between going the same route as I was (I already bought the
hardware for it, and already have the programmer), or giving the software
receiver a shot; I've just taken a quick look at some dsPICs and they're not a
great deal more expensive then the PIC16F685s I was going to use - in fact, if
you take out the cost of the NE602 mixer I'm using currently, it'd work out
cheaper (but I already have the mixers too...)

By eliminating the mixer, I'd need op-amps with better GBW products for the
pre-filters/amps before the signal gets to the PIC (currently my IF of
filtering - an LM324 in a handy quad package).  Gah - Decisions, Decisions !

Judging by my past attempts though, perhaps your software approach is a good
plan for a Mk IV design - when Mk III doesn't go as planned...:(

Cheers,

Pete Restall

2009\04\21@134534 by olin piclist

face picon face
Brooke Clarke wrote:
> A crystal that's 3 Hz off at 60 kHz has a stability of 5E-5.

Or 50ppm like I said.

> If a LO with a stability of say 1E-7 was used

Then you'd have a rather expensive oscillator since that's 0.1ppm.  You can
get crystals down to 20ppm or 15ppm before things start getting more
complicated and expensive.

> So is
> there a way using DSP to recover both the amplitude and phase (note
> WWVB has a phase modulation as well as AM) using a method that's
> matched to the modulation rather than use low pass filtering?

As I said in my original post, you could monitor the LO frequency error and
slowly null it out.  With a 20ppm crystal you're only 1.2Hz off worst case
anyway and the frequency drift will be slow, so you can set the time
constant of the frequency adjustment algorithm much slower than the
deliberate phase jumps of the carrier, making detection of them possible.

Keep in mind that if you're receiving WWVB via a skip, then there will be
phase shifts as the ionosphere moves up and down and different parts of it
reflect into your receiver.

> The
> idea being to greatly reduce the effective bandwidth hence improving
> the s/n ratio.

How much "greatly" are you going to reduce it beyond the 20Hz I originally
suggested?  With a 20ppm crystal you only need 2.4Hz bandwidth to account
for the LO error.  You probably need a bit more than that for the modulation
bandwidth.  If you want to be able to measure the ASK shifts within 100mS or
so, you probably can't low pass filter tighter than 5Hz, leaving a 10Hz
bandwidth.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\21@140336 by olin piclist

face picon face
Peter Restall wrote:
> That is fantastically beautiful - thanks for the ideas/explanation;
> much appreciated (not forgetting Sean also).  I'm very new to radio
> (and PICs and electronics and...) and an SDR wasn't something I was
> considering.  But it sounds like you've done this sort of application
> before...

Actually I haven't, but I've thought about it for a while.  One of the fun
projects I've thought up but probably won't get to any time soon is a WWVB
receiver using a dsPIC to get the time as described, then present a NTP
server over ethernet.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\04\21@194121 by Sean Breheny

face picon face
On Tue, Apr 21, 2009 at 1:46 PM, Olin Lathrop <RemoveMEolin_piclistspamTakeThisOuTembedinc.com> wrote:
>> So is
>> there a way using DSP to recover both the amplitude and phase (note
>> WWVB has a phase modulation as well as AM) using a method that's
>> matched to the modulation rather than use low pass filtering?
>
> As I said in my original post, you could monitor the LO frequency error and
> slowly null it out.  With a 20ppm crystal you're only 1.2Hz off worst case
> anyway and the frequency drift will be slow, so you can set the time
> constant of the frequency adjustment algorithm much slower than the
> deliberate phase jumps of the carrier, making detection of them possible.
>

I recently did a project where I phase locked a TXCO-based DDS (direct
digital synthesizer) to the carrier of an AM radio station. I found
that the resulting phase error signal did indeed have rather sudden
changes in slope (indicating that the frequency could change up and
down by around 0.5 Hz within seconds). Since I am local to the AM
station, this should not have been jumps in the incoming signal, so I
think it was probably due to phase noise in the TXCO. All of this is
to say that strange things can happen when you are trying to
synchronize to a carrier within less than 1 Hz. It is doable, but
there can be significant frequency drift (+/- 0.5 Hz or so) within a
rather short time interval (seconds). even for fairly expensive
oscillators (the TXCO was about $10).

Sean

2009\04\22@111743 by Bob Axtell

face picon face
Gee, I thought WWVB was a piece of  cake since there are detector
modules all over the place. Didn't want to get caught up in the math
of reception...

I am cutting the PCB in half and placing the CMAX detector module up
in the air and running
a shielded lead for 5V, GND, and signal into the office to try to decode it.

--Bob

On Tue, Apr 21, 2009 at 4:41 PM, Sean Breheny <shb7EraseMEspam.....cornell.edu> wrote:
{Quote hidden}

>

2009\04\22@114530 by A K

flavicon
face

About 6 years ago I wrote an assembler interrupt driven WWVB reception
routine for a 16f872 that can handle some noise and is phase-locking.
The best time to do reception here in Cleveland is at night, and I have
to freeze the PWM display of the clock to get rid of extra noise, but at
2:00 AM it gets a lock almost every night.  Send me an email if you're
interested.
 Andrew

Bob Axtell wrote:
{Quote hidden}

>> --

2009\04\24@024925 by Vis Naicker

flavicon
face
Sean Breheny wrote:
...
> A basic direct conversion receiver just multiplies the incoming RF by
> a sinusoid. This produces the sum and difference frequencies. At
> 60kHz, for example, if you mix it with a 59kHz sinusoid, you will get
> 119kHz and 1kHz. It is easy then to low-pass-filter it to get the 1kHz
> out.
>

Olin Lathrop wrote:
>
> With a dsPIC you should be able to go another step.  After suitable
> amplification and at least some frequency filtering, run the antenna
signal
> into the dsPIC A/D.  The rest is all software.  You can multiply the
signal
> by both a sine and cosine at 60KHz, low pass filter each of these
> independently, then square them and add them to get the squared carrier
> amplitude.  Sampling at 4x the carrier frequency still leaves you over 120
> instructions per sample.
...
{ A reference software radio }
Circuit Cellar 222 ( Jan 2009 ) had an article (Digital Radio Reception:
Build a Longwave AM Radio Receiver). As above, amplification & filtering
using common components, then the Luminary micro running at 50mips that
sampled the incoming signal using 500Khz ADC ( 250Khz max RF input).
He mentioned that he had about 100 instructions cycles available for the
decoding algorithms.

2009\04\27@161131 by Martin McCormick

flavicon
face
       I have had a receiver capable of tuning down to 30 KHZ
here in North-Central Oklahoma for a little over a year. My HF
antenna is the guy wires on a 50-foot tower so it is not really
well suited for reception at 60 KHZ, but even so, WWVB is
normally very audible at any time during the day with a little
better reception at night.

       The modulation is an inverted modulation in that full
carrier means no pulses. Pulses are -10 DB drops in the carrier.
Listening with the BFO on as for Morse Code, one hears a strong tone which
almost, but not quite, disappears during the pulses which
are varying lengths depending upon whether they
denote a 0 bit, a 1 bit or a sync.

       Other than being able to say that it is there, listening
to it isn't terribly productive.

       What I have noticed is that there isn't nearly as much
man-made interference on 60 KHZ as I expected there to be but I
am sure that is highly local.

       There is a lot of natural static from
lightning over hundreds of miles so that is a problem especially
this time of year.

       There have also been times in which the signal is
unusually weak for periods of time. I am not sure why this is
but it would probably make a marginal system stop receiving
altogether.

       The fades are probably due to electromagnetic activity
although we have had extremely calm and boring ionospheric
conditions for a couple of years now.

       Do the WWVB modules just give you  a logic level output
that you feed in to a CPU like those little IR modules that can
be used to receive IR remote controls? I have thought about
trying to build some self-setting accurate clocks for
automatically setting our VCR as the auto clock setting function
never worked properly for some reason.

Martin McCormick WB5AGZ  Stillwater, OK
Systems Engineer
OSU Information Technology Department Telecommunications Services Group

2009\04\28@041318 by Alan B. Pearce

face picon face
>The fades are probably due to electromagnetic activity
>although we have had extremely calm and boring ionospheric
>conditions for a couple of years now.

Depending on conditions, you could be marginal in between the ground wave
limit, and sky wave, you could be getting fading due to both interfering
with each other.

2009\04\28@085542 by Martin McCormick

flavicon
face
"Alan B. Pearce" writes:
> Depending on conditions, you could be marginal in between the ground wave
> limit, and sky wave, you could be getting fading due to both interfering
> with each other.

       I live about  700 or 800 miles Southeast of the
transmitter so true groundwave propagation is not likely but
that wave guide effect mentioned between the ionosphere and
ground might vary at times. Interestingly enough, one of the
times I noticed the weaker signals was one evening in mid
November last Fall about 3 or 4 hours after local Sundown which
normally is very good receiving conditions. At the same time, we
were having a faint Sporadic E opening which favored the
Northern United States.

       Several nights later, we had another similar Sporadic E
event and WWVB's signal was normal. What can I say?

       I am hoping we get more Solar activity eventually to see
how much it effects VLF signals.

Martin McCormick WB5AGZ  Stillwater, OK
Systems Engineer
OSU Information Technology Department Telecommunications Services Group


'[EE] WWVB CMAX Chip?'
2009\05\12@185533 by Bob Axtell
face picon face
You know, what would help is to have an audio hard-copy of the WWVB
signal (a tone, maybe?) so I can simply write the code easily, THEN
fix the module and antenna issues.
I'd pay a reasonable fee for that...

--Bob

On Tue, Apr 28, 2009 at 5:55 AM, Martin McCormick
<RemoveMEmartinTakeThisOuTspamspamdc.cis.okstate.edu> wrote:
{Quote hidden}

>

2009\05\12@192013 by Nate Duehr

face
flavicon
face

On Tue, 12 May 2009 15:55:32 -0700, "Bob Axtell" <EraseMEbob.axtellspamspamspamBeGonegmail.com>
said:
> You know, what would help is to have an audio hard-copy of the WWVB
> signal (a tone, maybe?) so I can simply write the code easily, THEN
> fix the module and antenna issues.
> I'd pay a reasonable fee for that...
>
> --Bob

Seen any ham radio towers anywhere near your neighborhood?  Should be
brain-dead simple from there...

NIST also offers an information packet they'll mail to anyone for free
that has charts that show the entire process.  I got mine about ten
years ago, so I'll assume they still do it, but it was easy to call or
e-mail and get it, if I remember correctly...

Maybe by now they've put it on their website.

Nate
--
 Nate Duehr
 RemoveMEnateKILLspamspamnatetech.com

2009\05\12@200852 by Chris Smolinski

flavicon
face
>On Tue, 12 May 2009 15:55:32 -0700, "Bob Axtell" <bob.axtellSTOPspamspamspam_OUTgmail.com>
>said:
>>  You know, what would help is to have an audio hard-copy of the WWVB
>>  signal (a tone, maybe?) so I can simply write the code easily, THEN
>>  fix the module and antenna issues.
>>  I'd pay a reasonable fee for that...
>>
>  > --Bob

I can send you one - what exactly do you need?

--

---
Chris Smolinski
Black Cat Systems
http://www.blackcatsystems.com

2009\05\13@080209 by olin piclist

face picon face
Bob Axtell wrote:
> You know, what would help is to have an audio hard-copy of the WWVB
> signal (a tone, maybe?) so I can simply write the code easily, THEN
> fix the module and antenna issues.
> I'd pay a reasonable fee for that...

Getting 60KHz thru a normal audio system is unpredictable at best.  Most low
pass filter well below that.

On the other hand, a WWVB simulator should be pretty easy to make.  Have a
PIC PWM module produce 60KHz, low pass filter that to make is mostly a sine
wave, then amplify and buffer that a little.  Modulating the amplitude to
one of two levels can be done various ways.  You can change the duty cycle
to get lower amplitude.  You could add a transistor that partially clamps
the signal when turned on, etc.

The real problem with this approach is making sure you did the modulation
correctly.  I remember looking at the NIST site and it seemed well enough
described, but if you have a misconception it will end up in both the
simulator and the receiver.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\13@085313 by Chris Smolinski

flavicon
face
>Bob Axtell wrote:
>>  You know, what would help is to have an audio hard-copy of the WWVB
>>  signal (a tone, maybe?) so I can simply write the code easily, THEN
>>  fix the module and antenna issues.
>  > I'd pay a reasonable fee for that...
>

Here's about 4 minutes of WWVB, starting at 12:22:50 UTC this morning:
http://www.spynumbers.com/whyp/Rec-05-13-2009-122250.WAV

--

---
Chris Smolinski
Black Cat Systems
http://www.blackcatsystems.com

2009\05\13@113921 by Bob Axtell

face picon face
Chris, this is exactly what I needed.

THANKS!!

--Bob

On Wed, May 13, 2009 at 5:53 AM, Chris Smolinski
<spamBeGonecsmolinskiSTOPspamspamEraseMEblackcatsystems.com> wrote:
{Quote hidden}

>

2009\05\13@115340 by Bob Axtell

face picon face
Chris S gave me what I needed. I will extract ON/off from the audio. I
can then write the simple algorithm. THEN I can get the front-end
working (antenna, receiver, etc) leisurely.

Now for something completely different:
Elektor is looking for English-language authors. I think you have a
decent technical book in your treatise on uses of the PIC10Fxxx,
and/or your PIC programming concepts. Look 'em up on their website.
They'll pay a royalty.

--Bob A

On Wed, May 13, 2009 at 5:03 AM, Olin Lathrop <KILLspamolin_piclistspamBeGonespamembedinc.com> wrote:
{Quote hidden}

>

2009\05\13@121805 by Chris Smolinski

flavicon
face
part 1 1093 bytes content-type:text/plain; charset="x-mac-cyrillic" ; format="flowed" (decoded quoted-printable)

No problem.... btw I wrote a WWVB decoder some time ago (using sound from a radio connected to the computer's sound input), let me know if you want a copy of the source (if I can find it, and not sure if it is 100% correct)

{Quote hidden}

2009\05\13@152652 by olin piclist

face picon face
Bob Axtell wrote:
> Chris S gave me what I needed.

That's not clear.  I took a look at his file and there are some basic
problems.  For one thing, his sample rate is only 44.1KHz, which is a
problem when you want to capture a 60KHz signal.  At best you are going to
get some beat frequency.  Then taking a look at the individual cycles you
can see it is mostly 800Hz.  I'm not sure where that came from, but your
60KHz reception circuit is going to ignore 800Hz (at least it should).

The large scale amplitude modulations were caught.  If you only use his file
to derive the envlope from and low pass filter that a bit, then you can feed
that signal into your system as if it came from the demodulator output.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\13@155907 by Chris Smolinski

flavicon
face
>Bob Axtell wrote:
>>  Chris S gave me what I needed.
>
>That's not clear.  I took a look at his file and there are some basic
>problems.  For one thing, his sample rate is only 44.1KHz, which is a
>problem when you want to capture a 60KHz signal.  At best you are going to
>get some beat frequency.  Then taking a look at the individual cycles you
>can see it is mostly 800Hz.  I'm not sure where that came from, but your
>60KHz reception circuit is going to ignore 800Hz (at least it should).

Bob asked for:

>  > You know, what would help is to have an audio hard-copy of the WWVB
>>  signal (a tone, maybe?) so I can simply write the code easily, THEN
>>  fix the module and antenna issues.
>>  I'd pay a reasonable fee for that...
>>
>  > --Bob

The file is the demodulated output of a receiver tuned to 60 kHz. The
receiver was in CW mode, hence the 800 Hz audio.


>The large scale amplitude modulations were caught.  If you only use his file
>to derive the envlope from and low pass filter that a bit, then you can feed
>that signal into your system as if it came from the demodulator output.
>

Exactly.

If Bob really wants it, I can run my SDR-14 (software defined radio
with a 67 MHz sampling rate) and get him a file of WWVB sampled at
190 kHz in quadrature. But I think the audio file will be sufficient.

--

---
Chris Smolinski
Black Cat Systems
http://www.blackcatsystems.com

2009\05\13@201052 by Bob Axtell

face picon face
It'll be fine, because the size of the pulse is so huge.

On Wed, May 13, 2009 at 12:58 PM, Chris Smolinski
<@spam@csmolinski@spam@spamspam_OUTblackcatsystems.com> wrote:
{Quote hidden}

>

2009\05\21@122719 by Alan B. Pearce

face picon face
While browsing the Microchip app notes, I found one that looks relevant to
making a 60kHz receiver from a dsPic ...

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en532447

(watch for line wrap, AN1115 if you cannot reassemble the line).

2009\05\22@132016 by Peter Restall

flavicon
face

On Thu, 21 May 2009 17:27:43 +0100, Alan B. Pearce wrote:

> While browsing the Microchip app notes, I found one that looks relevant to
> making a 60kHz receiver from a dsPic ...

Very nice...

I've just purchased myself some dsPICs and a PICKit2 (and a nice DSP book) so
I could play about with such things for my MSF receiver.  I tried looking at
Olin's suggested method but when trying to get some Octave simulations running
it struck me as very computationally expensive.  However, on first skim, that
appnote looks very similar to Mr. Lathrop's solution and it gives some tricks
for speeding it all up significantly - my lack of DSP/mathematical knowledge
rather hindered my own initial attempts in this regard, so I decided on a
different approach.

I've now decided to bandpass the 60KHz signal and then sample at 26.7KHz
and run it through Goertzel's algorithm - seems to work alright in the
Octave simulations, and gives oodles of spare cycles for updating my LCD,
spitting out the time over RS232, monitoring for push-buttons, etc.  The
circuit is basically a 3-pole LC bandpass, two quad op-amps to provide
incremental gain (one of which is wired as a VGA), and all that feeds into
the dsPIC.  Still need to write the firmware though.  Or perhaps I should just
look at the appnote as it looks far more sensitive and I could probably
remove yet more external components...

Regards,

Pete Restall

2009\05\28@111401 by M.L.

flavicon
face
On Fri, May 22, 2009 at 1:14 PM, Peter Restall <spamBeGonepetespamKILLspamrestall.net> wrote:

>
>
> I've now decided to bandpass the 60KHz signal and then sample at 26.7KHz
> and run it through Goertzel's algorithm - seems to work alright in the
> Octave simulations, and gives oodles of spare cycles for updating my LCD,
> spitting out the time over RS232, monitoring for push-buttons, etc.  The
> circuit is basically a 3-pole LC bandpass, two quad op-amps to provide
> incremental gain (one of which is wired as a VGA), and all that feeds into
> the dsPIC.  Still need to write the firmware though.  Or perhaps I should
> just
> look at the appnote as it looks far more sensitive and I could probably
> remove yet more external components...
>
> Regards,
>
> Pete Restall
> -

2009\05\28@131703 by Peter Restall

flavicon
face

On Thu, 28 May 2009 11:13:40 -0400, M.L. wrote:

> Pete,
> You can't detect a 60kHz signal with a 26.7kHz sample rate. I just ran an
> Octave simulation of the Goertzel algorithm and I was able to get good
> results with something like this:
>
> [snip]
>
> --
> Martin K.

Thanks for the input Martin - I'll have a play about with your script a little
later.  For the time being though, I've stuck my own octave script at

       http://custard.restall.net/piclist/goertzel.m

It seems to work alright (down to about -15dB SNR) but then again I'm new to
this so could be missing something (or lots of things).  The script is just a
testbed so that I can plug in lots of different parameters and throw a few
graphs, etc. together to get an idea of what's happening.  Suggestions for
improvement/further discussion/further reading are obviously welcome.

I also tried implementing a version of the AN1115 tricks to obtain a phase
sensitive detector in octave, but didn't have much luck.  With a pure signal
it works spot on - whenever I start adding any significant noise (ie. by
using awng(), wng() or randn()) it fails miserably.  Adding sine waves of
discrete frequencies doesn't seem to hurt too badly though.  It also takes
lots more CPU cycles to perform a few low-pass filters than it does a humble
Goertzel detector, which seems to perform better under noise in my octave
simulation (although I'm sure this is rubbish - the noise figures I've seen
for PSDs suggest they should be outstanding).  Problem between chair and
keyboard methinks.

Regards,

Pete Restall

2009\05\28@134129 by M.L.

flavicon
face
On Thu, May 28, 2009 at 1:10 PM, Peter Restall <.....petespam_OUTspamrestall.net> wrote:

>
> On Thu, 28 May 2009 11:13:40 -0400, M.L. wrote:
>
> > Pete,
> > You can't detect a 60kHz signal with a 26.7kHz sample rate. I just ran an
> > Octave simulation of the Goertzel algorithm and I was able to get good
> > results with something like this:
> >
> > [snip]
> >
> > --
> > Martin K.
>
> Thanks for the input Martin - I'll have a play about with your script a
> little
> later.  For the time being though, I've stuck my own octave script at
>


Very simply, sampling theory says that you need to sample at least twice as
fast as the maximum frequency you want to look at. So if you sampled at
10kHz the maximum frequency you can see is 5kHz (with much distortion). You
will get numbers if your Goertzel code is trying to detect a frequency >
sample speed, but they won't be correct.
-
Martin

2009\05\28@144452 by Dave Tweed

face
flavicon
face
"M.L." wrote:
> On Thu, May 28, 2009 at 1:10 PM, Peter Restall <TakeThisOuTpete.....spamTakeThisOuTrestall.net> wrote:
> > On Thu, 28 May 2009 11:13:40 -0400, M.L. wrote:
> > > You can't detect a 60kHz signal with a 26.7kHz sample rate. I just
> > > ran an Octave simulation of the Goertzel algorithm and I was able
> > > to get good results with something like this:
> >
> > Thanks for the input Martin - I'll have a play about with your script a
> > little later.
>
> Very simply, sampling theory says that you need to sample at least twice
> as fast as the maximum frequency you want to look at. So if you sampled
> at 10kHz the maximum frequency you can see is 5kHz (with much distortion).
> You will get numbers if your Goertzel code is trying to detect a frequency
> > sample speed, but they won't be correct.

Too simple. Technically, you need to sample at greater than twice the
*bandwidth* you're interested in, and that bandwidth doesn't need to start
at zero frequency.

Subsampling a narrow-bandwidth signal (relative to its carrier frequency)
is a perfectly respectable technique, as long as you understand how the
aliasing is affecting the signal you're interested in (and any interfering
signals or noise).

Also, your analog front end and the sampler itself need to be able to
correctly handle the frequency of the carrier. And obvioulsy, you use
a bandpass filter, rather than a lowpass filter, to eliminate unwanted
aliases.

In a way, it's the discrete-time version of what a superheterodyne
receiver does in continuous time.

-- Dave Tweed

2009\05\28@151010 by Michael Rigby-Jones

flavicon
face


> -----Original Message-----
> From: TakeThisOuTpiclist-bouncesKILLspamspamspammit.edu [.....piclist-bouncesspamRemoveMEmit.edu] On
Behalf
> Of M.L.
> Sent: 28 May 2009 18:41
> To: Microcontroller discussion list - Public.
> Subject: Re: [EE] WWVB CMAX Chip?
>
> On Thu, May 28, 2009 at 1:10 PM, Peter Restall <RemoveMEpetespamspamBeGonerestall.net>
wrote:
>
> >
> > On Thu, 28 May 2009 11:13:40 -0400, M.L. wrote:
> >
> > > Pete,
> > > You can't detect a 60kHz signal with a 26.7kHz sample rate. I just
ran
> an
> > > Octave simulation of the Goertzel algorithm and I was able to get
good
> > > results with something like this:
> > >
> > > [snip]
> > >
> > > --
> > > Martin K.
> >
> > Thanks for the input Martin - I'll have a play about with your
script a
> > little
> > later.  For the time being though, I've stuck my own octave script
at
> >
>
>
> Very simply, sampling theory says that you need to sample at least
twice
> as
> fast as the maximum frequency you want to look at.

Only if you wish to completely re-construct the original signal without
loss of information!

> So if you sampled at
> 10kHz the maximum frequency you can see is 5kHz (with much
distortion).
> You
> will get numbers if your Goertzel code is trying to detect a frequency
>
> sample speed, but they won't be correct.

Undersampling aliases frequencies above the Nyquist rate, and folds them
back into the first Nyquist region.  Shannon understood this and told us
we need to sample at a rate of at least twice the signal bandwidth, not
the highest frequency component.  Providing you don't wish to
re-construct the carrier, then undersampling is a very useful way of
extracting information from a high frequency carrier using a low cost
ADC and DSP.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2009\05\28@161411 by Richard Prosser

picon face
2009/5/29 M.L. <spamBeGonem@spam@spamspam_OUTlkeng.net>:
{Quote hidden}

Actually, sampling theory relates to the bandwidth of the sampled
signal, not the maximum frequency, So, provided that the bandwidth of
the 60kHz carrier is less than 13.35kH, there isn't a "theoretical"
problem.

This is a typical case of undersampling, where you are using a band
limited signal and utilising the information in what would otherwise
be described as an alias.

RP

2009\05\28@164225 by M.L.

flavicon
face
On Thu, May 28, 2009 at 2:44 PM, Dave Tweed <picEraseMEspamdtweed.com> wrote:

>
> In a way, it's the discrete-time version of what a superheterodyne
> receiver does in continuous time.
>
> -- Dave Tweed
>

D'oh
I knew this in RF terms. I had never thought it worked like that in the Z
domain. I learn something new every day.

-
Martin

2009\05\28@164806 by M.L.

flavicon
face
On Thu, May 28, 2009 at 4:42 PM, M.L. <RemoveMEmEraseMEspamspam_OUTlkeng.net> wrote:

> On Thu, May 28, 2009 at 2:44 PM, Dave Tweed <@spam@picRemoveMEspamEraseMEdtweed.com> wrote:
>
>>
>> In a way, it's the discrete-time version of what a superheterodyne
>> receiver does in continuous time.
>>
>> -- Dave Tweed
>>
>
> D'oh
> I knew this in RF terms. I had never thought it worked like that in the Z
> domain. I learn something new every day.
>
> -
> Martin
>

Rephrase: I knew it worked like that but I always thought the sample rate
had to be above 2x the maximum to encompass the slower convoluted signals.

-
Martin

2009\05\29@040844 by Alan B. Pearce

face picon face
>Problem between chair and keyboard methinks.

Ah, as a computer tech once put it, it is a PICNIC problem - Problem In
Chair, Not In Computer ... ;)))

2009\05\29@041212 by Alan B. Pearce

face picon face
>Too simple. Technically, you need to sample at greater than
>twice the *bandwidth* you're interested in, and that bandwidth
>doesn't need to start at zero frequency.

Ah, so that is why the Microchip App Note was able to make the sampling rate
so low.

>In a way, it's the discrete-time version of what a superheterodyne
>receiver does in continuous time.

<Ding> Lights on ... ;)))

2009\05\29@133241 by Peter Restall

flavicon
face

On Thu, 28 May 2009 13:41:08 -0400, M.L. wrote:

> Very simply, sampling theory says that you need to sample at least twice as
> fast as the maximum frequency you want to look at. So if you sampled at
> 10kHz the maximum frequency you can see is 5kHz (with much distortion). You
> will get numbers if your Goertzel code is trying to detect a frequency >
> sample speed, but they won't be correct.
> -
> Martin

Evening Martin.

You may have missed that I am using a bandpass filter rather than a lowpass
filter before the ADC input (3-pole Chebyshev LC).  I believe this should
allow me to sample at a lower rate by using the aliases to my advantage - as
long as the aliased images are more than the signal's bandwidth apart (ie. not
overlapping) then it should be fine.

If you're not familiar with that, do a google on 'bandpass sampling' and
'undersampling' to see what I've tried to accomplish - Wikipedia at
http://en.wikipedia.org/wiki/Sampling_(signal_processing) is the
first link it comes up with.

I actually got the idea from Understanding Digital Signal Processing (2nd Ed)
by Richard G Lyons, which devotes a significant portion of text to its
explanation.

If I've missed something and this technique is not applicable, let me know the
reasons and I'll revisit the theory.  Seems to work to some degree in the
Octave simulation though.

Cheers,

Pete Restall

2009\05\29@145808 by Peter Restall

flavicon
face

On Fri, 29 May 2009 09:09:13 +0100, Alan B. Pearce wrote:

> Ah, as a computer tech once put it, it is a PICNIC problem - Problem In
> Chair, Not In Computer ... ;)))

Ah yes, PICNIC - heard that one before :)

>From the various posts on this topic, it sounds like the undersampling
approach isn't a bad one - especially in this application where all that is
needed is to determine the relative amplitude of the carrier, and where the
bandwidth is basically limited by the sharpness of the LC filter.  Lower
sampling rates also free up a lot more processor time for other tasks
(updating the LCD, responding to serial port commands, adjusting/monitoring
AGC level, etc.)

The only reservation I have is that all the amplification introduces a fair
amount of noise of its own - probably not great for weak signals already
buried in noise (I live about 75 miles/120km from the transmitter, so the
signal is toward the stronger end, so it's not much of an issue - but one I'd
like to cater for, just in case I ever move house !)  My LC filter also rings
a bit, so the amplitude never reaches zero (MSF is an OOK signal, not an ASK
one like WWVB).  I need to sit down and try and figure these problems out, but
if somebody could point me at some good resources for noise reduction and
passive filter troubleshooting that would be great.  I've done the usual things
like make feedback resistors smaller to reduce Johnson noise, and spread the
gain across several stages (higher gain first - noisy variable gain amplifier
(with what should be less gain) last).

I would also like to try implementing something such as a phase sensitive
detector (Olin's suggestion, and detailed a bit in AN1115), which can
supposedly operate down to -100dB SNR - although that's seriously high-end
and a fraction of that SNR would suit me.  I'd like to compare the results
with the simpler Goertzel test - anybody got any insight into the performance
and tradeoffs of either solution from a project that they might have worked
on before ?

My PSD Octave simulations have not been very encouraging so far though - and
the horsepower needed looks like it would severely restrict the auxilliary
operations I could do; seems a shame to dedicate a dsPIC to the signal
detection alone and waste the other 20-odd pins.

I've stuck my scratchpad Octave simulation for a PSD here:

       http://custard.restall.net/piclist/lockin.m

I used my Goertzel simulation as a template and ended up removing variables
(such as noise) until it worked - I was hoping that it would be more reliable
and have better noise characteristics.  I haven't really had time to delve
into this as thoroughly as I'd have liked though.  Any pointers/suggestions/
references on how to best implement such a PSD are much appreciated.  And as
usual, thanks for your time - I dare say there are busier folks than myself on
this list at the moment !

Regards,

Pete Restall

2009\05\29@154157 by olin piclist

face picon face
Peter Restall wrote:
> From the various posts on this topic, it sounds like the
> undersampling
> approach isn't a bad one - especially in this application where all
> that is needed is to determine the relative amplitude of the carrier,
> and where the bandwidth is basically limited by the sharpness of the
> LC filter.

The bandwidth is really determined by the signal the transmitter sends.  If
it's anything like WWVB it is very low though.  10-20Hz is probably good
enough.

> Lower sampling rates also free up a lot more processor
> time for other tasks (updating the LCD, responding to serial port
> commands, adjusting/monitoring AGC level, etc.)

Yes they do, but they aren't free.  The lower the sample rate, the closer
the spacing between frequencies at the original input that will be
interpreted as real signal later.  This means you need a ever tighter analog
filter before sampling as the sample frequency gets lower.

That's why I originally suggested sampling the carrier directly at something
like 240KHz.  If the firmware does narrow band 60KHz detection from those
samples, then the first alias input frequency will be 180KHz.  That gives
the analog filter 3x headroom between the pass and stop bands.  A L-C
antenna should be able to do that with off the shelf parts and low Q to
compensate for error in the resonant frequency.  Then subsequent gain stages
only need basic R-C low and high pass filters, and aliasing shouldn't be a
problem.

If you undersample, some aliases will be a lot closer than 3x from the
carrier.  That might be OK if you're willing to hand tune a high Q L-C
antenna circuit.

It seems to me that there should be sufficient processor resources left
after processing samples at 240KHz.  At 30MHz instruction rate you get 125
instruction cycles per sample, which sounds like more than enough to do the
amplitude detection and the other processing.  Even if only 42 cycles are
left per sample (83 get used to process the sample), you still have a 10
MIPS 16 bit machine to do all the rest of the stuff.  Think about it.
That's more than a whole 18F at 40MHz clock.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\30@052936 by Peter Restall

flavicon
face

On May 29, 2009; 08:42pm, Olin Lathrop wrote:

> The bandwidth is really determined by the signal the transmitter sends.  If
> it's anything like WWVB it is very low though.  10-20Hz is probably good
> enough.

I agree; however, there's no way I am going to get an LC filter with a 10-20Hz
bandwidth, so surely the LC would be the limiting factor in this case ?  If my
LC filter has, say, a 10KHz bandwidth and the signal has only a 10Hz bandwidth,
then to stop the aliased images overlapping, they should be sampled so that
the images are >= 10KHz apart ?


> That's why I originally suggested sampling the carrier directly at something
> like 240KHz.

Ah, I thought it was to allow the sin/cos multiplications to be +/-1 and 0,
and also to ensure that there was sufficient attenuation from the RC filter.
I didn't think about the proximity of aliases.  According to AN1115, the other
nice thing about sampling at 4x frequency is that because of the simplified
sin/cos multiplications, you can halve the number of samples and use a FIR
filter designed for half the sampling frequency.


> It seems to me that there should be sufficient processor resources left
> after processing samples at 240KHz.  At 30MHz instruction rate you get 125
> instruction cycles per sample, which sounds like more than enough to do the
> amplitude detection and the other processing.

This is what I'm struggling to get my head around; it's obvious that if the
processing only takes 83 cycles like you said, then there are more than enough
left over for auxilliaries (more than an 18F @ 40MHz as you say).  But when
I've been playing around with the FIR filters to get the necessary 20Hz pass
band, even with decimation, they take a lot of taps.

I haven't looked into the dsPIC implementation too much as I've been trying
to get my simulations working first, but I'm thinking that each coefficient
in the FIR could be done in one cycle unless I'm missing something (using the
dsPIC MAC instructions).  So a FIR filter with 10 taps would take 10 cycles,
plus a couple for any required pre-/post-amble.

With 125 instructions available per sample, you could have a maximum of about
60 taps per filter (don't forget we need to filter both the I and Q channels).
That doesn't seem a lot to me, especially when trying to filter from a 240KHz
sample rate down to a 20Hz bandwidth.  Obviously I need to do more reading and
get my simulations working properly (hopefully I'll do some of that over the
weekend), but what were your initial thoughts on how many taps the filters
would require ?  Am I missing any tricks that can significantly reduce the
required operations (over and above the quick sin/cos trick that allows us to
halve the samples, plus further decimation) ?

Also, looking at the dsPIC specs, I noticed that at 16x PLL (required to get
the full 30MIPS), there is a jitter of almost 1% - I'm thinking that means
that the bandwidth of the filters needs to be more like 600Hz rather than
20Hz, but in reality I don't really know what the implication of PLL jitter
would be.

This would have made a nice article topic for you Olin - a good excuse to do
that project you were toying with :)

Cheers,

Pete Restall

2009\05\30@140540 by Sean Breheny

face picon face
On Sat, May 30, 2009 at 5:23 AM, Peter Restall <EraseMEpetespam@spam@restall.net> wrote:
> I agree; however, there's no way I am going to get an LC filter with a 10-20Hz
> bandwidth, so surely the LC would be the limiting factor in this case ?  If my
> LC filter has, say, a 10KHz bandwidth and the signal has only a 10Hz bandwidth,
> then to stop the aliased images overlapping, they should be sampled so that
> the images are >= 10KHz apart ?
>

You should be able to do much better than 10kHz BW at 60kHz center
frequency with an LC filter.

In fact, since your signal is so very narrow in bandwidth (a few
hertz), a simple very high Q LC resonant circuit could do very well.

With good care for details, an LC "tank" circuit with a Q of 200,
maybe even 300, is doable. This would get you down to something like
300 to 200Hz BW at 60kHz.

A multi-element ladder filter with a Butterworth or Chebychev or
Elliptical design could probably do even a bit better.

Also, with op-amps getting better all the time with regard to
gain-bandwidth product, I am sure it is possible to build a 60kHz
active band-pass filter which could give you even better performance
than the LC filters.

I suspect that your limiting factor may be the effect of pulsed noise
on your high-Q filter. You might actually want to use a noise
blanker-type circuit (detects spikes and prevents them from passing
through into your narrowest filter, to prevent ringing).

Sean

2009\05\30@171930 by olin piclist

face picon face
Peter Restall wrote:
> I agree; however, there's no way I am going to get an LC filter with
> a 10-20Hz bandwidth, so surely the LC would be the limiting factor in
> this case ?  If my LC filter has, say, a 10KHz bandwidth and the
> signal has only a 10Hz bandwidth, then to stop the aliased images
> overlapping, they should be sampled so that the images are >= 10KHz
> apart ?

You're off by a factor of two and you're oversimplifying.  You make it sound
like a L-C filter passband suddenly cuts off at a particular frequency.  In
practise it has fairly steep sides, but the "width" of the passband depends
on how much attenuation you need.

If the width of the passband is 10KHz, meaning everything outside the 10KHz
passband is sufficiently attenuated so that signals of those frequencies
become irrelevant, and the passband is centered on the carrier, then you
have 5KHz on either side of the carrier where signals must not alias to the
same frequency as the carrier.

>> That's why I originally suggested sampling the carrier directly at
>> something like 240KHz.
>
> Ah, I thought it was to allow the sin/cos multiplications to be +/-1
> and 0, and also to ensure that there was sufficient attenuation from
> the RC filter.

I was planning on getting the the sin/cos values out of a table anyway.
That allows for slight frequency tweaking and maybe even phase locking once
the signal has been captured.  The reason that would be useful is that it
would provide the correction to the local oscillator frequency when the WWVB
signal is not present.  The carrier itself is a highly accurate frequency
standard to quite a few digits (way better than your 20ppm crystal) since
it's derived from one of NIST's atomic clocks.  There can be phase noise on
the received carrier due to ionospheric bounce and changing pathlengths, but
the average frequency is dead on for any purpose you'll likely have.

> I didn't think about the proximity of aliases.  According to AN1115,

I've never read AN1115 nor do I plan to.  This is basic signal processing
folks, with pretty simple math.  You'd be a lot better off understanding it
than treating it like black magic describe in a sacred scroll.  There's no
need to wave dead fish here.

> This is what I'm struggling to get my head around; it's obvious that
> if the processing only takes 83 cycles like you said,

I haven't written the code and don't claim it takes 83 cycles.  I was only
using that to make the point that you've got a whole 18F left even if it
were to take 83 cycles.  In actuality, I expect it to take less.  83 cycles
sounds like a lot, but that's just a knee jerk reaction since I haven't
written any code.

> But when I've been playing around with the FIR filters
> to get the necessary 20Hz pass band, even with decimation, they take
> a lot of taps.

They would, but then using a FIR is silly in the first place.  How did you
get FIR filter in your head?  I certainly never said anything about using
one.  I was envisioning a simple one or two pole low pass filter with each
pole realized by:

 FILT <-- FILT + FF(NEW - FILT)

That takes two adds and a multiply, each of which the dsPIC can do in one
instruction cycle.  There will be a few more instructions for getting the
input values, storing the output, etc, but no way is this a lot of cycles
compared the budget of 83 to still have a 18F left over to do all the other
stuff.

> Also, looking at the dsPIC specs, I noticed that at 16x PLL (required
> to get the full 30MIPS), there is a jitter of almost 1% - I'm
> thinking that means that the bandwidth of the filters needs to be
> more like 600Hz rather than 20Hz, but in reality I don't really know
> what the implication of PLL jitter would be.

I hadn't noticed the PLL jitter.  Depending on what time scale the 1%
deviations persist over that could be a problem and you'd have to widen the
passband as you said.  However, due to how a PLL works, the total phase
error can't get too far and can't accumulate.  The instantaneous frequency
might be off by 1%, but this can't persist long else the PLL would lose
lock.  Think about how much it can be off in one cycle of 240KHz.  That
would be 500 cycles of the 120MHz PLL output.  Let's say the worst case
phase error is +-90deg at any one time.  In reality, I'd expect the PLL to
require better than that anyway to maintain lock.  But to be pessimistic,
that's 1/2 cycle in 500, or one part in 1000, or 60Hz out of 60KHz.  So
unless we can get a more definative and tighter spec from Microchip, it
would probably be a good idea to roll off the LPFs at 75-100Hz to guarantee
at least 10Hz demodulated signal bandwidth at all times.

> This would have made a nice article topic for you Olin - a good
> excuse to do that project you were toying with :)

Actually it looks like Martin is doing just that.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\30@172819 by olin piclist

face picon face
Sean Breheny wrote:
> You should be able to do much better than 10kHz BW at 60kHz center
> frequency with an LC filter.
>
> In fact, since your signal is so very narrow in bandwidth (a few
> hertz), a simple very high Q LC resonant circuit could do very well.
>
> With good care for details, an LC "tank" circuit with a Q of 200,
> maybe even 300, is doable. This would get you down to something like
> 300 to 200Hz BW at 60kHz.

I agree, but such a filter will need careful tuning.  Even then you have to
think about drift over time and temperature.  That may be perfectly fine for
a one-off hobby project if you're willing to tune it once a year and keep it
at a constant temperature.

My plan is to sample at 240KHz so that there is a lot of room to the first
alias.  That allows you to use off the shelf parts, let the center frequency
be off a bit, and deliberately make Q lower to compensate.  Even with a low
enough Q to account for center frequency error, 3x the center frequency
should still be attenuated to oblivion, especially when you consider the
gain stages will have at least one LPF and HPF each.

In other words, keep the hardware simple, reliably working with off the
shelf parts, and make up for it with clever firmware.  It looks like a dsPIC
has enough horsepower to let you get away with it.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\30@203832 by Bob Ammerman

picon face
I am no expert on any of this, but wouldn't  a really tight (ie:
very-high-Q) LC filter have issues tracking over temperature changes?

-- Bob Ammerman
RAm Systems

2009\05\30@211758 by Sean Breheny

face picon face
Hi Bob,

Yes, it probably would. I thought that this discussion was about a
one-off project (where one could include a trimmer cap for occasional
adjustment). For a commercial product, I agree with Olin that other
methods would be better.

Sean


On Sat, May 30, 2009 at 8:38 PM, Bob Ammerman <@spam@rammermanspam_OUTspam.....verizon.net> wrote:
> I am no expert on any of this, but wouldn't  a really tight (ie:
> very-high-Q) LC filter have issues tracking over temperature changes?
>
> -- Bob Ammerman
> RAm Systems
>
>

2009\05\31@082300 by olin piclist

face picon face
Bob Ammerman wrote:
> I am no expert on any of this, but wouldn't  a really tight (ie:
> very-high-Q) LC filter have issues tracking over temperature changes?

Yes.  The resonant frequency of a LC filter is 1 / sqrt(2Pi L C).  A 1%
drift in either component therefore causes about 1/2% change in the center
frequency, or 300Hz drift out of 60KHz.  If your Q is so high that a 300Hz
error will significantly detune the filter, then you've got a problem.


On a separate note, I want to correct something I said yesterday.  I was
thinking about the PLL jitter issue this morning and realized what I said
last night was all wrong.  First, the PLL phase comparator works on the
input frequency of 7.5MHz, not the output frequency of 120MHz.  Second,
while there can be some error in measuring the period of the 240KHz sample
rate, this doesn't really matter.  A PLL that stays in lock may have some
instantaneous phase jitter on its input signal, but this can not be
accumulating error.  Specifying the jitter in terms of frequency error, as
Microchip has apparently done, is misleading.  There can be no long term
frequency error as the ratio of input to output frequency is a integer, in
this case 16.  It is only meaningful to look at the PLL as having
non-accumulating phase jitter.

The net result is that the PLL jitter doesn't matter.  Each sample of the
240KHz sample stream can have a little time jitter on it, but the average
frequency is still as accurate as the crystal.  Even if the time jitter is a
whole 7.5MHz crystal cycle, that is only 3% of a 240KHz cycle.  Since this
error is non-accumulating, it doesn't matter.  Each 240KHz sample will be
within 6deg of the intended phase.  That will result in a little amplitude
noise, but that noise is guaranteed to be high frequency since the phase
error is non-accumulating.  Put another way, the resulting amplitude noise
has a 1/F spectrum.  The amount of that left after passing thru a 20Hz low
pass filter will likely be below our ability to represent it, and certainly
well below the remaining noise floor.

Forgetaboutit.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2009\05\31@130446 by Clint Turner

flavicon
face
It may be worth looking at some of the chips used for the cheap
WWVB-type "Atomic Clock" receivers:  These are just TRF-type receivers
with a very slow AGC, using cheap tuning-fork mode quartz crystals as
the selective element.

The two things learned about these would be:

- KISS principle.  The TRF receiver simply has a comparator-type scheme
that outputs a serial bitstream that the clock controller (which could
be a PIC.)  No A/D sampling required, etc. The AGC is slower than the
serial code so that the amplitude modulation can be easily detected with
a simple comparator (with hysteresis) after envelope (or similar)
detection.  I've bought cheap "Atomic" clocks and have always been able
to find a point on the circuit board with a handy logic level that is
carrying demodulated bitstream.  (Not all receivers keep their receivers
turned on all of the time, though...)
- The use of a quartz crystal as the bandpass element.  These crystals
are cheap (available from Digikey and others) and have passband
responses that will easily pass the WWVB signal and its modulated
sidebands while providing an extremely narrow bandwidth that will reject
a great deal of "garbage" signals from adjacent frequencies.

Looking at the datasheets for the chips that use these crystals can be
informative, as it gives one a general idea how to work with these
crystals to deal with their usually-high series resistance as well as
appropriately load them for the bandwidth appropriate for a WWVB
signal.  Even if going to a simple TRF scheme is anathema to one bent on
using DSP-type techniques, the lessons learned (AGC techniques, quartz
bandpass filter, etc.) from these data sheets are still useful.

Clint


'[EE] WWVB CMAX Chip?'
2009\06\04@150350 by Peter Restall
flavicon
face

On Sun, 31 May 2009 11:03:38 -0600, Clint Turner wrote:

> - The use of a quartz crystal as the bandpass element.  These crystals
> are cheap (available from Digikey and others) and have passband
> responses that will easily pass the WWVB signal and its modulated
> sidebands while providing an extremely narrow bandwidth that will reject
> a great deal of "garbage" signals from adjacent frequencies.

Clint, thanks for the input.  I would've acknowledged you sooner, but I've
been looking at what you suggested for the last couple of days - I had no
idea you could use regular crystals (as opposed to specially constructed ones)
in this way.  It raises an interesting possibility - I already have a couple
of 60KHz crystals I bought for an earlier receiver attempt.

I would like to create a single-pole crystal filter, but am having trouble
finding any decent resources - design notes for ladder filters with >= 3 poles
don't seem to be a problem though.  The closest I've come to what I want so
far is Intersil's app note AN9815, but the equations don't seem to work for
me.  Also, the filters people use are always several MHz; nothing on the
nuances of using lower frequency crystals.  Or matching networks for them
(don't want to use transformers like some examples I've seen).


> Looking at the datasheets for the chips that use these crystals can be
> informative, as it gives one a general idea how to work with these
> crystals to deal with their usually-high series resistance as well as
> appropriately load them for the bandwidth appropriate for a WWVB
> signal.  Even if going to a simple TRF scheme is anathema to one bent on
> using DSP-type techniques, the lessons learned (AGC techniques, quartz
> bandpass filter, etc.) from these data sheets are still useful.

Have you got any datasheets in particular in mind ?  I've looked at some
(generally CMAX) and they are drawn as black boxes.  I've noticed that the
ESR is very high as you said (20K according to my datasheet), and the drive
level is very low (1uW).  I dare say that I will need to measure some crystal
parameters rather than rely on the (poor) datasheet - my crystal type is
MC-306 and it basically gives very wide ranges for *groups* of crystals.
Have you any recommendations on such measurement equipment/techniques ?

After Olin pointed out that FIR filters were not the way to go and pointed me
to the simple lowpass recursive filters, it didn't take long to get my DSP
simulation working with less computations, so that's the way I'd still like
to take the project - but 'bent on it' might be a bit strong !  I also shelled
out for some dsPICs and a nice DSP book, so I'd at least like to use the shiny
new techniques I've learned !

I reckon that using a crystal as a bandpass filter will make a nice addition
and should hopefully clean things up for the amplifier and ADC; and they're
small and pretty cheap.

The problem is finding decent information though - 'fish waving' seems quite
the norm.  Design equations are harder to come by; and when you do they tend
to be incomplete (ie. in the Intersil app note I mentioned, is the V_t
used in their equation meant to be the p-p or RMS signal voltage, or can it
mean the maximum voltage of any out-of-band signals too ?)

I've come across various references to Wes Hayward's works in old QST
magazines and some programs (like AADE filter designer) that do the
calculations (but crash on single-pole designs !), but the 'net is rather
scant in this area :(  Any pointers to material to get me going ?

And thanks again for the suggestions Clint - it's raised more questions
than provided answers though !

Cheers,

Pete Restall

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...