You are of course correct again: I was looking at the wrong .py file not 
generated by GRC but archived earlier. Now the positions of the 1PPS rising 
edge are always at the same location within each record, making me confident 
the IQ acquisition and streaming is properly aligned on the PPS rising edge. I 
can now confidently analyze the Linux kernel synchronisation to PTP, trusting 
the timestamp of the end of acquisition is representative of the 
PPS+acquisition duration+Linux timer offset.
Thanks.

----- Mail original -----
De: "Marcus D. Leech" <[email protected]>
À: "friedtj" <[email protected]>
Cc: "usrp-users" <[email protected]>
Envoyé: Jeudi 20 Juillet 2023 17:30:45
Objet: Re: [USRP-users] Re: X310 1-PPS synchronization

On 20/07/2023 10:41, [email protected] wrote:
>> I don't see a streaming time specified in the generated code that you
>> supplied.
> I used
>          self.blocks_head_0 = blocks.head(gr.sizeof_gr_complex*1, 
> (int(6*samp_rate)))
> and
>          self.connect((self.blocks_head_0, 0), (self.blocks_file_sink_0, 0))
>          self.connect((self.blocks_interleave_0, 0), (self.blocks_head_0, 0))
> and since I interleave 2 complex streams I expect 6*samp_rate to last 3 
> seconds
>
>> Try setting a "Start Time" in your UHD source block of perhaps "2.0" --
>> this will arrange for streaming to commence 2 seconds
>> after it resets the timestamp clock.  Otherwise, streaming is started
>> at some random time.
> OK will try that. The setting in the Python script is the one provided by GRC.
> Indeed adding at the end of the __init__(self) generated by GRC
>          curr_hw_time = self.uhd_usrp_source_1.get_time_last_pps()
>          self.uhd_usrp_source_1.set_time_next_pps((curr_hw_time+1.0))
>          self.uhd_usrp_source_1.set_start_time((curr_hw_time+1.1))
> seems to do the trick with the 1st PPS edge always aligned to the same sample 
> index.
> Too bad GRC does not generate the appropriate code: I cannot see any impact 
> when
> changing the Start Time (seconds) of the UHD: USRP Source block.
>
Hmmm, using GR 3.10.1.1, setting a "start time" of 1.4 ends up 
generating this code in the .py:

       self.uhd_usrp_source_0.set_center_freq(0, 0)
         self.uhd_usrp_source_0.set_antenna("RX2", 0)
         self.uhd_usrp_source_0.set_gain(0, 0)

         self.uhd_usrp_source_0.set_start_time(uhd.time_spec(1.4))
         self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1)

>> Also, rather than looking for the PPS edge in the data, the "File Meta
>> Sink" includes meta-data, like timestamps-as-seen-by-the-radio.
> The PPS edge was just to check the consistency of the date last access date
> (which seems consistent with my expectation) and the position of the actual
> data (which I cannot figure out by analyzing the IQ stream). I did check that 
> the
> meta data are consistent (with my above example the data start streaming at 
> 1.1 s
> of the internal timer of the SDR source) but my objective is the comparison 
> with
> the system time, which I am now on better tracks to achieve with these inputs.
>
> Thanks.
>
> _______________________________________________
> USRP-users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to