# Using DSP for precise zero crossing measurement?

**URL:** <https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091>\
**Category:** GNU Radio\
**Created:** [September 18, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091 "2006-09-18T17:16:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Ackermann\_N8UR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cdc98d/32.png) [@John\_Ackermann\_N8UR](https://www.ruby-forum.com/u/John_Ackermann_N8UR)\
**Post date:** [September 18, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091/1 "2006-09-18T17:16:20Z")

</div>

I wonder if there is someone on the list who’d be willing to let me call  
them on the phone to talk about the feasibility of using DSP techniques  
(i.e., GnuRadio) to very precisely measure the zero crossing point of a  
slowly changing waveform with some noise on it.

More precisely, the goal is to measure the zero crossings of a pair of 1  
Hertz sine waves, having an amplitude of perhaps 1 volt peak to peak,  
with a precision of ideally 100 nanoseconds. We want to determine the  
true zero crossing point, somehow eliminating the effect of any noise on  
the signal.

The zero crossings are then used to calculate the time interval (or  
phase) between the two waves. I need to capture each pair of zero  
crossings, and can’t average over multiple intervals.

The challenge of doing this with conventional techniques like a time  
interval counter is that trigger jitter becomes a huge problem with a 2  
volt/second slew rate. I’m hoping that DSP techniques might provide a  
way around this problem.

It might be easier to explain further details over the phone, so if  
someone is interested in guiding me through this problem, please let me  
know and I can get your number off-list.

Thanks!

John

---

<div class="post-metadata">

**Author:** ![John\_Ackermann\_N8UR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cdc98d/32.png) [@John\_Ackermann\_N8UR](https://www.ruby-forum.com/u/John_Ackermann_N8UR)\
**Post date:** [September 18, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091/2 "2006-09-18T17:58:26Z")

</div>

John Ackermann N8UR wrote:

> The zero crossings are then used to calculate the time interval (or  
> phase) between the two waves. I need to capture each pair of zero  
> crossings, and can’t average over multiple intervals.

If it is the phase difference that you are ultimately looking for, there  
are alternatives to measuring the zero crossing difference in the time  
domain.

How precisely are the two sine waves matched in frequency? How hard  
would it be to come up with reference waveform representing “zero”  
phase? How often do you need to measure the difference?

-Johnathan

---

<div class="post-metadata">

**Author:** ![John\_Ackermann\_N8UR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cdc98d/32.png) [@John\_Ackermann\_N8UR](https://www.ruby-forum.com/u/John_Ackermann_N8UR)\
**Post date:** [September 18, 2006, 6:42pm UTC](https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091/3 "2006-09-18T18:42:35Z")

</div>

Johnathan C. wrote:

> How precisely are the two sine waves matched in frequency? How hard  
> would it be to come up with reference waveform representing “zero”  
> phase? How often do you need to measure the difference?

Good questions, and adding a bit more background may help.

What I am trying to do is measure the short term frequency stability  
(Allan Deviation) of a device under test compared to a reference. The  
two signals are at nominally the same frequency, though in actuality  
they will be a small fraction of a Hz off from each other.

The signals start out at HF – typically 10MHz – but are each mixed in  
the analog domain with a common local oscillator that’s offset by about  
1Hz (ie, LO is 10.000 001Hz) to yield a pair of 1 Hz difference  
frequencies. Using a common local oscillator signal makes any noise on  
the LO common mode to the other two signals, and thereby reduces its  
impact.

The result is that those 1Hz signals carry the same noise components as  
the 10MHz signals did. This improves the measurement resolution ) by  
the ratio of original to output frequency – as much as seven decades  
(using a divider would divide the noise, too, so that wouldn’t gain  
anything).

The goal is to measure the stability in terms of the time difference  
between the two 1Hz outputs; more correctly, we measure the delta of the  
time difference second-to-second to determine the stability. It’s  
possible to measure stability to parts in 10e-13 for one second using  
this method.

This “dual mixer time difference” technique is the standard one used for  
frequency stability measurement over short (0.1 to perhaps 1000 second)  
intervals. The problem is that the trigger jitter in a normal time  
interval counter masks most of the resolution that’s gained by the  
process; finding the zero crossing to 100ns accuracy against a 1Hz, 1  
volt p-p signal means the trigger jitter must be down in the nanovolts,  
and that’s hard to accomplish.

Most systems currently use a series of limiting amplifiers to increase  
the slew rate and reduce the trigger jitter, but those amplifiers  
contribute their own noise and other complications like thermal  
instability. My hope is that DSP might yield a better way to accurately  
determine the zerio crossing of a very slow slew rate signal.

Thanks!

John

---

<div class="post-metadata">

**Author:** ![John\_Ackermann\_N8UR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cdc98d/32.png) [@John\_Ackermann\_N8UR](https://www.ruby-forum.com/u/John_Ackermann_N8UR)\
**Post date:** [September 18, 2006, 6:48pm UTC](https://www.ruby-forum.com/t/using-dsp-for-precise-zero-crossing-measurement/69091/4 "2006-09-18T18:48:36Z")

</div>

John Ackermann N8UR wrote:

> The signals start out at HF – typically 10MHz – but are each mixed in  
> the analog domain with a common local oscillator that’s offset by about  
> 1Hz (ie, LO is 10.000 001Hz) to yield a pair of 1 Hz difference

The LO is at 10.000 001 MHz, not Hz. Sorry.
