Weird sequence of USRP rx_timestamps when connecting a GPSDO.
Show older comments
Hello,
I am using an USRP B210+ GPSDO.
Recently, we can get timestamps of each sample from the USRP by using
[Samples,~,~,Timestamps] = Step(radio);
It performs well without a GPSDO. When setting the sample_rate as 20M(20e6) Hz ,the results may like this

According to the UHD WIKI, the timestamp of the first sample will be given in a rx_stream. Then Matlab automatically
calculate timestamps of each sample by Sample_Rate thereafter beautifully.
-----------------------------------------------------------------------------------------------------------------------------------
However, when plugging a GPSDO, timestamps in arrays show like this.

When I fprintf this Sample to see high decimal of them, by
fprintf("%3.30f",all_stamps(1,1) ); (2,1) (3,1) ......
I found something strange that, 4 or 5 sample are put the same timestamps.
The fprintf result looks like below.
1672916780.081696748733520507812500000000 Sample 3
1672916780.081696748733520507812500000000 4
....
1672916780.081696748733520507812500000000
1672916780.081696748733520507812500000000
1672916780.081696748733520507812500000000
--------------------------------------------------------------------- 与包头1差 2384 20M
1672916780.081696987152099609375000000000 8
1672916780.081696987152099609375000000000
1672916780.081696987152099609375000000000
1672916780.081696987152099609375000000000
-------------------------------------------------------------------- 与包头2差 2384
1672916780.081697225570678710937500000000 12
1672916780.081697225570678710937500000000
1672916780.081697225570678710937500000000
1672916780.081697225570678710937500000000
1672916780.081697225570678710937500000000
------------------------------------------------------------------ 与包头3差 2384
1672916780.081697463989257812500000000000 17
And everytime timestamps updates, the difference of the last timestamp is 0.000002384s,
which equals 5/(20*1024*1024).
-------------------------------------------------------------------------------------------------------------------------
To sum up, uncertain probability of occurrence 4/5 samples are put the same timestamps, and the timestamps
in interval equals 5 samples interval in 20Mhz SampleRate.
Howerver!! I look into my program that all I enter for SampleRate is 20e6, not 20*1024*1024.
Why did this happen?
Thanks.
Accepted Answer
More Answers (1)
Karunya Choppara
on 13 Feb 2026
Edited: Karunya Choppara
on 13 Feb 2026
0 votes
This is an issue due to loss of precision, as the integer and fractional part are combined and assigned to double datatype output
This issue is resolved in R2026a, with a provision to choose the timestamp mode using TimestampMode property
By setting the TimestampMode to 'high-precision' we obtain the timestamp output as a struct, with fields 'timestampInt' and 'timestampFrac' representing the integer part in int64 datatype and fractional part in double datatype respectively.
see the properties and outputs for comm.SDRuReceiver system object
Categories
Find more on Communications Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!