# Measuring phase between channels

**URL:** <https://www.ruby-forum.com/t/measuring-phase-between-channels/230425>\
**Category:** GNU Radio\
**Created:** [June 17, 2014, 7:07pm UTC](https://www.ruby-forum.com/t/measuring-phase-between-channels/230425 "2014-06-17T19:07:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 17, 2014, 7:07pm UTC](https://www.ruby-forum.com/t/measuring-phase-between-channels/230425/1 "2014-06-17T19:07:58Z")

</div>

Hello,  
I want to measure the phase difference between three synchronised USRP  
channels (Common Ref & PPS), does software exist to do this, and to what  
accuracy, please?  
Sorry, this is a bit of a newbie question, and probably already covered!  
Dave

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 17, 2014, 8:30pm UTC](https://www.ruby-forum.com/t/measuring-phase-between-channels/230425/2 "2014-06-17T20:30:33Z")

</div>

On 17.06.2014 19:06, David M. wrote:

> Hello,  
> I want to measure the phase difference between three synchronised USRP  
> channels (Common Ref & PPS), does software exist to do this, and to what  
> accuracy, please?  
> Sorry, this is a bit of a newbie question, and probably already covered!

Sure, the easiest way would simply be to put in a scope, and check by  
looking – of course, that’s not very accurate.

There’s enough math operators in GNU Radio to see the actual phase  
difference, such as conjugate and multiply, then convert to phase.

Cheers,  
Martin

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 17, 2014, 9:36pm UTC](https://www.ruby-forum.com/t/measuring-phase-between-channels/230425/3 "2014-06-17T21:36:29Z")

</div>

Hi David,

for starters, you could just divide one channel by the other and  
calculate the result’s argument. There are blocks for both operations 🙂

Short explanation:  
Just consider the complex signals $s\_1, s\_2$ in polar coordinates  
(instead of the usual real/imag representation)  
$s\_1(t) = a\_1(t) \* e^{j \phi\_1(t)}$.  
Dividing that by $s\_2(t) = a\_2(t) \* e^{j \phi\_2(t)}$ gives you  
$p(t) = a\_1(t)/a\_2(t) \* e^{j \phi\_1 - \phi\_2(t)}$, of which you can take  
the argument to get the phase difference.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![dgm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df788c/32.png) [@dgm](https://www.ruby-forum.com/u/dgm)\
**Post date:** [June 18, 2014, 1:48am UTC](https://www.ruby-forum.com/t/measuring-phase-between-channels/230425/4 "2014-06-18T01:48:51Z")

</div>

I did an experiment similar to this a year or so ago. I synced all the  
USRPs to the same 10MHz and PPS. I had pretty good results using libgps  
to  
get the GPS time and then using UHD to start streaming on a particular  
PPS  
edge on all units. With LFRX boards this will ensure that the DDCs start  
at  
the same time and start from zero degrees. I seem to remember there was  
some small random variation from run to run. If you are just looking for  
relative changes in phase difference I found this approach works fairly  
well.

On Tue, Jun 17, 2014 at 10:36 AM, Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
