discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] UHD recv timestamp differs from stream command ti


From: Matt Ettus
Subject: Re: [Discuss-gnuradio] UHD recv timestamp differs from stream command time spec
Date: Thu, 02 Sep 2010 11:02:14 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100720 Fedora/3.0.6-1.fc12 Thunderbird/3.0.6

On 09/02/2010 10:39 AM, Marc Epard wrote:
I'm using a USRP2 with UHD and starting a receive a short time in the
future. I have an external reference and PPS. Below is the pertinent
code, slightly simplified.

The timestamp returned in the metadata by recv is always off a little
from the time I requested in the stream command. The amount it is off
seems to be consistent and related to the sampling rate. For 25 Msps,
it's always off by 230 nanoseconds, for 12.5 Msps, it's off by 270
nanoseconds, for 6.25 Msps, it's off by 350 nanoseconds. If I receive
one packet at a time using RECV_MODE_ONE_PACKET, the first packet's
metadata is off by the same amount.

I'm using the latest gnuradio and uhd (the one with USRP1 support).

Should I expect the timestamp in the received metadata to match the
requested time in the stream command?


The timestamp that you request is used as the time to turn on the receiver. The timestamp returned with the data is the time of those samples at the output of the receive DSP chain. Since there is decimation in the receive chain, there will be some delay between when you enable the receiver and when the DSP spits out its first sample. When using our standard DSP units that we provide in the code, this delay is a function of the decimation rate.

If you really need your first sample to be at time X, you will need to send a command which starts the receive chain a little early.

There are two related issues. First, if you are using the standard ATR settings, the receiver is turned off when you are not receiving. Nothing powers up instantly, so if you want to have useful reception at a particular time, you will also need to turn it on early.

The second issue is group delay through the RF, ADC, and DSP. We demarcate time at the output (decimated) side of the DSP. That data came in over the air some time earlier, but that time delta is a function of the daughterboard design and settings (particularly the filters), the ADC design, and the DSP design and settings. The DSP delays can be calculated. In any application where you need to know to the nanosecond the time a particular sample represents at the antenna port you will need to calibrate the delays.

All of this applies to the TX side as well, in reverse.

Matt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]