05-27-2025 04:54 AM
I'm currently using a USRP-2945 to measure the phase difference between RX1 and RX2.
A 2.45 GHz continuous wave signal generated by a signal generator is split using a power splitter and fed into RX1 and RX2 with equal cable lengths.
The signals are in-phase and of equal amplitude. I'm using LabVIEW 2021 to implement a VI that measures the phase difference between the two channels.
▼ Phase difference calculation method
1. Acquire 1000 IQ samples per channel
2. Calculate the phase difference from the IQ signals at each sample
3. Compute the average phase difference
▼ Expected result
・The average phase difference φ ≈ 0°, since both inputs are in-phase
▼ Actual result
・Every time I run the program, φ randomly takes one of the following 4 values : 0°, ±90°, 180°
If anyone knows why ±90° or 180° phase jumps occur and how to suppress or correct them, I would appreciate it if you could share your information and experiences.
▼Setup
Device : USRP-2945
Software : LabVIEW 2021 (64-bit)
Cables : Equal-length coax cables used for both channels
05-27-2025 12:09 PM - edited 05-27-2025 01:27 PM
Can you reduce the problem to a simple Example VI that contains some typical data and just the phase detection?
(Create an array indicator after "fetch data", run the VI until the indicator contains data, then stop the VI. Now rIght-click that new indicator and "create constant. Save the VI under a new name using "save for previous", e.g. 2020 or below, and attach it here.)
There is a lot of "code smell", for example why would you need to index the same two rows twice in parallel? Are you aware that index array is resizable and you don't need to wire indices if you want them in order?
I am sure that the function "Complex to polar" would be much more useful when dealing with phases. Have you tried?
05-27-2025 01:40 PM
See if this can give you some ideas. (note that you can avoid potential division by zero if you just use the sign of the numerator, because the denominator cannot be negative).
(Still, I think there are simpler ways to do that)