Weird sequence of USRP rx_timestamps when connecting a GPSDO.

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.

2 Comments

The only one reason I can think that is GPSDO timestamps is more complex, and may use different data structures from the normal one.
To get a quick Timestamp Tagging of that complex data structure (double) ,the happening of weird timestamps may be due to using Shift Operation, since the interval is Power of 2.
However, this is just my guess. I hope to get other answers.

Sign in to comment.

 Accepted Answer

天意
天意 on 18 Jan 2023
Edited: 天意 on 18 Jan 2023
It's because of the overflow of double64.

More Answers (1)

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

Products

Release

R2022a

Asked:

on 6 Jan 2023

Edited:

on 13 Feb 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!