[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Using PPS to trigger received data storage in Pyt
Re: [Discuss-gnuradio] Using PPS to trigger received data storage in Python
Fri, 25 Nov 2011 18:25:38 -0500
Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
On 11/25/2011 05:51 PM, Yan Nie wrote:
> I really appreciate your reply, Josh.
> I am using a GPS as the input for PPS of my receiver based on USRP
> N200 in order to synchronize with a transmitter which uses GPS pulse
> to synchronize with other devices. This transmitter detects the NEG
> edge of GPS pulse, then 2ms later, starts to transmit signal for
> 1ms,then it suspends for the remainder of this second. When next GPS
> pulse coming at the beginning of next second, this transmitter
> repeats the transmission process again for every second.
> Therefore, this PPS signal is used as a synchronization signal in my
> receiver to synchronously receive the signal sent by this transmitter
> needed to collaborate with. The PPS signal need to trigger the signal
> reception every second, as the precision of the clock of USRP and GPS
> cannot be exactly the same. If only use PPS to trigger the latching
> of the time registers the first second of signal reception,
> eventually, the receiver and transmitter cannot be precisely
Ah, so you are not sharing a reference, therefore PPS is not "pulse per
second", its "pulse per approximately a second" because of clock drift,
in other words, just a generic event trigger.
Well, there isnt a way to cause streaming to start on a pulse unless you
perform some FPGA mods, but I will tell you one creative way to solve this:
Continually read get_time_last_pps(). Every time this function returns a
different value, you know the exact time (relative to USRP) that a pulse
So you know:
1) the exact time for every sample thanks to stream tags
2) the exact time of every pulse thanks to get_time_last_pps
Now you just have make some code that combines both pieces of
information to store the samples.