Hi Ziang -

I'm not sure I completely follow your system set-up, so I'm not sure how to
answer all of your questions, exactly. There are almost certainly a couple
of things at play here, including the source of your time (is it on the
radio? your PC?), and the data representation of the time tag itself.

The `rx_time` field of the file meta sink block uses UHD's tuple
representation for time, with an integer number of full seconds and then a
fractional second component. See more here:
https://github.com/EttusResearch/uhd/blob/master/host/lib/types/time_spec.cpp

So, concatenating them as `full.frac seconds` is correct, but it's
important to keep in mind the limitations of data representation in terms
of the fractional portion. Having 20 digits of "value" in your float
doesn't mean they are significant - you need to be aware of the limitations
and accuracy of your hardware to whatever degree it matters in your
application.

Does that help?

Cheers,
Ben

On Tue, Apr 30, 2019 at 4:13 PM Ziang Gao <zianggaowirel...@gmail.com>
wrote:

> Hi,
>
> I'm trying to use blocks_file_meta_sink to record data with tags, and then
> use gr_read_file_metadata.py to read .hdr file, and I got this output:
> " " "
> HEADER 30
> Version Number: 0
> Sample Rate: 20000000.00 sps
> Seconds: 1556652948.179670
> Item size: 8
> Data Type: float (5)
> Complex? True
> Header Length: 171 bytes
> Extra Length:  22
> Extra Header?  True
> Size of Data: 8000000 bytes
>               1000000 items
>
> Extra Header:
> rx_freq: 2.4205e+09
> " " "
> It looks like the time in seconds only has 6 floating points, however, it
> supposes to be double.
> I thought it was caused by string formatting so I went to
> parse_file_metadata.py and modified line 94 from "print "Seconds:
> {0:6f}".format(t)" to "print "Seconds: {0:20f}".format(t)", then I got:
> " " "
> Seconds: 1556652948.17966961860656738281
> " " "
> Is this the correct way to solve this problem? Is GNUradio's time tag
> actually precise to nanosecond? I want to use a PC with GPS time module and
> sync a B200mini with it, can I actually get the correct GPS time tag in
> this way?
>
>  Thanks
>
> Best regards,
> Ziang
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to