   Author Topic: Help with Math on calculating difference between two frequencies  (Read 2459 times)

0 Members and 1 Guest are viewing this topic. Bryan Help with Math on calculating difference between two frequencies
« on: February 13, 2016, 09:00:40 pm »
Ok, I have my GPSDO and  Rubidium standard on my Rigol scope monitoring the races to see how close they are . I know a lot depends on the accuracy of the horizontal sweep and the GPSDO is not great for short term stability, so this is more of a experiment and a lets see.

I have the GPSDO on CH1 and triggered. The Rubidium on Ch2. Ch2 will slowly wander left taking 140 seconds for one phase. The sweep is 20ns. So fi I have it right then the difference between the two traces is 140 seconds/20ns or 1.42e -10. So does this mean that the difference between the two is +/- 0.000000000142 HZ ?? or do I have this all wrong, missing a step, no way can it be this precise?.
« Last Edit: February 13, 2016, 11:19:23 pm by Bryan »
-=Bryan=- awallin

• Frequent Contributor
•  • Posts: 582 Re: Help with Math on calculating difference between two frequencies
« Reply #1 on: February 13, 2016, 09:52:58 pm »

are you looking at 10 MHz output from both devices?

If so, and it takes 140 seconds between the moments where the waveforms line up, then I get a frequency difference of 0.00714 Hz or 7.14e-10 fractional.
This was calculated by assuming one waveform has N cycles during 140s and the other has N+1 - hopefully that's the right way to think about this...  Maxlor

• Frequent Contributor
•  • Posts: 560
• Country:  Re: Help with Math on calculating difference between two frequencies
« Reply #2 on: February 13, 2016, 10:01:20 pm »
If by "phase" you mean one wavelength of the GPSDO signal, then that means that in 140s, the rubidium has one cycle more than the GPSDO. So if the GPSDO were exactly 10Mhz, the rubidium signal would be (140 * 10Mhz + 1Hz) / 140 = 10Mhz + 1/140 Hz or a 0.0071Hz difference. Still pretty good if you ask me  uncle_bob

• Supporter
•    • Posts: 2425
• Country:  Re: Help with Math on calculating difference between two frequencies
« Reply #3 on: February 13, 2016, 10:27:50 pm »
Hi

Given the way a digital scope works, you really want to use a single trace. Trigger on one channel and look at the other channel. It that's possible, you will get more samples on the screen.

So the easy way:

Fire it up so you can see 1 ns per division. If the edge moves 1 division in a second, the frequency is off by 1x10^-9. If you can only see 5 ns, wait 5 seconds (it's easier to time).

As long as you are looking at something in the seconds range, the scope's timebase isn't a big deal. If the timebase is off by 10 ppm, your 1ppb is really 1.00001 ppb. (There is only a small chance I got the number of zeros right, you get the idea). The timebase accuracy *does * matter if you want to know exactly how far off the GPS PPS is from a PPS out of the Rb.

Now, if you are comparing two 10 MHz outputs, the period is 100 ns. Watching them align edges as they drift is waiting for the to accumulate a relative time error of 100 ns. If it took 100 seconds to do this, you would be off by 1 ns /s or 1x10^-9. If it takes 200 seconds you would be off by 5x10^-10.

Hopefully that all makes sense.

Bob Bryan Re: Help with Math on calculating difference between two frequencies
« Reply #4 on: February 15, 2016, 09:07:45 am »
Thanks everyone, much appreciated.

Maxlor: Yes that is exactly what I meant, one wavelength. Thanks for the help on the math<g>

Uncle_Bob: A little stuck on your calculations in example two. If I follow the same using 140 seconds vs your example of 100s or 200s I get 7.14 ^-10 magnitudes less than what Maxlor and Awallin calculated.
-=Bryan=- awallin

• Frequent Contributor
•  • Posts: 582 Re: Help with Math on calculating difference between two frequencies
« Reply #5 on: February 15, 2016, 12:51:20 pm »
Uncle_Bob: A little stuck on your calculations in example two. If I follow the same using 140 seconds vs your example of 100s or 200s I get 7.14 ^-10 magnitudes less than what Maxlor and Awallin calculated.

Numbers without unit are fractional frequency, i.e. f_fractional = f_actual/f_nominal, with f_nominal = 10 MHz. There is thus a factor 1e7 difference between the numbers. 7e-10 fractional, or 7 mHz, same thing. uncle_bob

• Supporter
•    • Posts: 2425
• Country:  Re: Help with Math on calculating difference between two frequencies
« Reply #6 on: February 15, 2016, 01:58:40 pm »
Uncle_Bob: A little stuck on your calculations in example two. If I follow the same using 140 seconds vs your example of 100s or 200s I get 7.14 ^-10 magnitudes less than what Maxlor and Awallin calculated.

Numbers without unit are fractional frequency, i.e. f_fractional = f_actual/f_nominal, with f_nominal = 10 MHz. There is thus a factor 1e7 difference between the numbers. 7e-10 fractional, or 7 mHz, same thing.

Hi

Yup.

It is common in the world of time and frequency to quickly move everything over to fractional numbers. You play with a multitude of frequencies (1 pps, 10 MHz , 5 MHz , 100 Mhz) and doing this makes a comparison *much* easier.

Bob Bryan Re: Help with Math on calculating difference between two frequencies
« Reply #7 on: February 16, 2016, 02:23:30 am »
Uncle_Bob: A little stuck on your calculations in example two. If I follow the same using 140 seconds vs your example of 100s or 200s I get 7.14 ^-10 magnitudes less than what Maxlor and Awallin calculated.

Numbers without unit are fractional frequency, i.e. f_fractional = f_actual/f_nominal, with f_nominal = 10 MHz. There is thus a factor 1e7 difference between the numbers. 7e-10 fractional, or 7 mHz, same thing.

Ok, think I got it. In your original post you mention  0.00714 Hz, but you meant .00714mHZ?. (millihertz)
Quote

If so, and it takes 140 seconds between the moments where the waveforms line up, then I get a frequency difference of 0.00714 Hz or 7.14e-10 fractional.
-=Bryan=- uncle_bob

• Supporter
•    • Posts: 2425
• Country:  Re: Help with Math on calculating difference between two frequencies
« Reply #8 on: February 16, 2016, 12:38:15 pm »
Uncle_Bob: A little stuck on your calculations in example two. If I follow the same using 140 seconds vs your example of 100s or 200s I get 7.14 ^-10 magnitudes less than what Maxlor and Awallin calculated.

Numbers without unit are fractional frequency, i.e. f_fractional = f_actual/f_nominal, with f_nominal = 10 MHz. There is thus a factor 1e7 difference between the numbers. 7e-10 fractional, or 7 mHz, same thing.

Ok, think I got it. In your original post you mention  0.00714 Hz, but you meant .00714mHZ?. (millihertz)
Quote

If so, and it takes 140 seconds between the moments where the waveforms line up, then I get a frequency difference of 0.00714 Hz or 7.14e-10 fractional.

Hi

Ok, if we start from 1x10^7 Hz (10 MHz) and go to 0.00714 Hz (1x10^-3 Hz) you get a 7+3 = 10 or 1x10^10 delta.

The whole mili Hz, micro Hz, nano Hz thing from KHz, MHz, GHz is a perfect example of why you take it to a single fractional number early. You spend way to much time backtracking otherwise.

Bob basinstreetdesign Re: Help with Math on calculating difference between two frequencies
« Reply #9 on: February 16, 2016, 08:40:54 pm »
Maxlor has it correctly.  Your difference between the two 10MHz signals is 1/140 Hz = 0.00714 Hz with the Rubidium being higher than the GPSDO by that amount.
« Last Edit: February 16, 2016, 08:42:54 pm by basinstreetdesign »
STAND BACK!  I'm going to try SCIENCE! Bryan Re: Help with Math on calculating difference between two frequencies
« Reply #10 on: February 20, 2016, 09:46:55 am »
Thanks basinstreetdesign. As well as the Rubidium I have two GPSDO's, one is a Nortel Trimble NTBW50AA  and the other is a Symmetricom GPSDO https://www.eevblog.com/forum/projects/a-look-at-my-symmetricom-gpsdo-(ocxo-furuno-receiver)/ . The Nortel has been disciplining for about a year while the Symmetricom for only about a week. I only have the one antenna. The Nortel doesn't seem to have a very good Holdover feature. You can put it in Holdover/manual mode  but the output will start to vary quite soon after being put in this state. The Symmetricom GPSDO has a feature to enable the oscillator at 10Mhz if it loses the antenna and it appears to do so well and stable. Anyways what is interesting is the two compared side by side on the scope. The trigger was set on the Nortel and the Symmetricom took 4000 seconds to cross one wavelength. I used the tracking feature to make it easy to track a point on the waveform with the crosshair. If the measurements are correct than that's a difference of 0.00025 hz between the two. Wish I had two antennas to really see how far/close apart they are. All fun stuff.
-=Bryan=-

Share me

Smf  