# Signal Source Coherence

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

Regards,
Liwei

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