# Signal Source Coherence

**URL:** <https://www.ruby-forum.com/t/signal-source-coherence/233016>\
**Category:** GNU Radio\
**Created:** [November 11, 2014, 6:36pm UTC](https://www.ruby-forum.com/t/signal-source-coherence/233016 "2014-11-11T18:36:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 11, 2014, 6:36pm UTC](https://www.ruby-forum.com/t/signal-source-coherence/233016/1 "2014-11-11T18:36:34Z")

</div>

Hello list,  
Please refer to the attached flowgraph. In it I use two methods to  
generate 3 tones of equal amplitude.  
The first method simply uses 3 signal sources to generate the  
required tones directly and sums them together. The second method  
multiplies two signal sources to generate the upper and lower tones,  
and sums that result with the higher signal source. Both methods  
generate the same result in the magnitude spectrum.  
However, using an external Matlab script (not written by me, so I  
can’t share) to up-convert the lower tone and down-convert the upper  
tone to the same frequency as the middle tone (so all three tones end  
up being the same frequency, using the middle tone as reference), and  
measuring the phase difference between all tones, I get unexpected  
results.  
With the second method, the phase relationships are constant, as  
expected. However, with the first method, the phase relationships  
drift (linearly I think) over seconds.  
I did some equation manipulation, but it does seem like, for the  
first method, even with arbitrary phase offsets in each signal source,  
the final phase relationships between the 3 tones should still be  
constant, and not change over time.  
A quick search did not come up with relevant answers, and maybe  
this is a purely academic error on my part, but the remaining  
possibility that I can think of is that the signal sources in GNU  
Radio are somehow not coherent?

Regards,  
Liwei

---

<div class="post-metadata">

**Author:** ![liwei](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ccd318/32.png) [@liwei](https://www.ruby-forum.com/u/liwei)\
**Post date:** [November 11, 2014, 6:45pm UTC](https://www.ruby-forum.com/t/signal-source-coherence/233016/2 "2014-11-11T18:45:32Z")

</div>

Hi Liwei,

they _should_ be coherent, because GNU Radio has no relationship to  
“real wall-clock time” and just outputs mathematically calculated  
numbers, just like matlab does.  
Depending on the number of samples we talk about when you say “over  
seconds”, this might simply be a matter of numerical accuracy – GNU  
Radio internally uses (single precision) floating point numbers, and  
thus the accuracy of the generated frequency might be limited, and so is  
the accuracy of the phase comparison.

Having a few numbers would be nice here – how large is your drift in  
2pi/sample?

Greetings,  
Marcus
