|
From: | Skyvalakis Konstantinos |
Subject: | Re: Phase Synchronize 2 USRP N200 w/ SBX cards |
Date: | Tue, 15 Jun 2021 13:34:22 +0000 |
I just thought, that the time difference I observed might be because of the time difference in the execution of my python commands.
So, is there a way to validate my time synchronization between the 2 devices?
Thanks. From: Discuss-gnuradio <discuss-gnuradio-bounces+kskyvalakis=isc.tuc.gr@gnu.org> on behalf of Skyvalakis Konstantinos <kskyvalakis@isc.tuc.gr>
Sent: Tuesday, June 15, 2021 4:19 PM To: Marcus D Leech Cc: Discuss-gnuradio@gnu.org Subject: Re: Phase Synchronize 2 USRP N200 w/ SBX cards Hi again
I would like to ask you the following and I am also attaching the code for clarity:
self.sink = uhd.usrp_sink(
",".join(("addr0=192.168.10.2,addr1=192.168.10.3", "")),
uhd.stream_args(
cpu_format="fc32",
channels=range(2),
),
)
self.source = uhd.usrp_source(
",".join(("addr0=192.168.10.2,addr1=192.168.10.3", "")),
uhd.stream_args(
cpu_format="fc32",
channels=range(2),
),
)
self.source.set_clock_source('external', 0)
self.source.set_time_source('external', 0)
self.source.set_clock_source('external', 1)
self.source.set_time_source('external', 1)
self.sink.set_clock_source('external',0)
self.sink.set_time_source('external',0)
# self.sink.set_clock_source('external',1)
# self.sink.set_time_source('external',1)
self.source.set_time_unknown_pps(uhd.time_spec(0.0))
self.sink.set_time_unknown_pps(uhd.time_spec(0.0))
self.source.set_samp_rate(self.adc_rate)
self.source.set_gain(self.rx_gain0,0)
self.source.set_gain(self.rx_gain1,1)
self.source.set_antenna("RX2")
self.sink.set_samp_rate(self.dac_rate)
self.sink.set_gain(self.tx_gain0, 0)
self.sink.set_gain(self.tx_gain1, 1)
self.sink.set_antenna("TX/RX")
t1 = self.sink.get_time_now(0)
t2 = self.sink.get_time_now(1)
t3 = self.source.get_time_now(0)
t4 = self.source.get_time_now(1)
print(uhd.time_spec_t.get_real_secs(t1))
print(uhd.time_spec_t.get_real_secs(t2))
print(uhd.time_spec_t.get_real_secs(t3))
print(uhd.time_spec_t.get_real_secs(t4))
Shouldn't t1 be equal with t2 and t3 equal with t4?
In my application they are never equal.
As an example of a single run of my code the output of the above print commands is the following:
0.00439223
0.00546809
0.00621017
0.00697208
Thank you for your help.
K.
From: Skyvalakis Konstantinos
Sent: Sunday, June 13, 2021 11:02 PM To: Marcus D Leech Cc: Discuss-gnuradio@gnu.org Subject: Re: Phase Synchronize 2 USRP N200 w/ SBX cards Agreed. The compensation part is not the one I worry about. What worries me the most is the angle-in-radians part.
Let's say that from the time sink plot I observe that I have pi/2 radians phase offset between channel 1 and channel 2. How do I know it's pi/2 radians and not -3pi/2?
To be precise, I am also dumping the 2 channels complex data to 2 file sinks, which I then import on matlab for easier and faster experimentation.
In other words, how can I precisely calculate the 4 discrete phase shifts I am observing in my application?
Should I use cross correlation?
Should I use Hilbert transform?
I don't have a very noisy application, in case that plays a very crucial role.
Thanks.
On Jun 13, 2021 22:06, Marcus D Leech <patchvonbraun@gmail.com> wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |