USRP Software Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do accuracy time synchronization with USRP and labview?

Dear friends,

   

          I want to do some accuracy time synchronization work with USRP N210 and labview.  In my application, there is a timer, e.g. a 64 bit counter which increases every 1 microsecond. When the value of the counter modules 65536 equals to 0, my application inverts boolean value.

          My question is that: the labview platform only milisecond level timing accuracy. I can use the API provided by windows instead. But with that function, I can not get my boolean inverted, because I can not increase the counter at microsecond accuracy. 

          Then I tried to find whether there is a timer in the USRP. I found that the USRP has a internal clock. How can I use the counter to do the job?  Thanks in advanced!

0 Kudos
Message 1 of 7
(8,175 Views)
Every fetch waveform has a time stamp t0 that gives the exact time the first sample was acquired. dt is the time between samples. Using both of those you can do very precise timing with USRP. The USRP 2930 and 2932 include a GPS Clock which provides UTC time to ns accuracy in the waveform's t0 with a GPS lock.
0 Kudos
Message 2 of 7
(8,171 Views)

Hi ErikL, thanks for your reply. I checked the stamp t0 in the received waveform, and I found the field. But how to use this field to count a special time interval(e.g. 65536us) to schedule an soft interrupt? For example I want to change the central frequency of USRP every 65536us. Thanks again!

0 Kudos
Message 3 of 7
(8,159 Views)
In that case I would do finite acquisition and change the frequency after each finite acquisition.
0 Kudos
Message 4 of 7
(8,146 Views)
number of samples / Sample rate = 65 536 microseconds =
0.0655 seconds
0 Kudos
Message 5 of 7
(8,142 Views)

Hi Erik,

 

I have a similar question: let's say that we know the exact time first sample was acquired (t0). Now I would like to transmit exactly t seconds after t0. Basically I am trying to implement a tranceiver that receives a packet and exactly after t seconds of the packet's first sample, in transmits a response. How can I do that?

 

Thanks,

Hanif

0 Kudos
Message 6 of 7
(7,862 Views)

Great question.  Use timed commands in the niUSRP driver.  Both the RX and TX channels use the same time base in the device.  Once a feature is detected you can send a transmit trigger time with a TX command.  The example is a bit more complicated than just this piece but you'll find a rough implementation here: https://decibel.ni.com/content/docs/DOC-29883  Note the bottom loop where the specified time is added to the TX command and then data is passed to the niUSRP Transmit function.

 

Note that you do have some latency's that you can not exceed.  It takes time for the RX signal to get back to the computer and time for you to detect the feature you are looking for.  I estimate you could recieve a signal and then TX again within about 10ms.  If you need lower latency we have FPGA based SDR using our FlexRIO SDR product.  vist http://www.ni.com/sdr to learn more.

0 Kudos
Message 7 of 7
(7,856 Views)