<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/10/2014 05:24 PM, Ian Buckley
      wrote:<br>
    </div>
    <blockquote
      cite="mid:8BCAA8D1-0CD9-48E7-89FC-199F967BBC33@ionconcepts.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      time_spec_t is nothing more than a container for a highly accurate
      count of seconds and fractions there of. It measures from no
      reference …that entirely down to you to decide what seconds is
      relative to.
      <div>The USRP doesn't care about calendars, if you set time from a
        UTC coordinated source and then an event like a leap second
        occurs then the USRP will no longer be coordinated with UTC.</div>
    </blockquote>
    Also, in addition:<br>
    <br>
    <a class="moz-txt-link-freetext" href="http://files.ettus.com/manual/page_gpsdo.html">http://files.ettus.com/manual/page_gpsdo.html</a><br>
    <br>
    The "gps_time" sensor will return a format suitable for use as a
    Unix epoch time, and that is what the TOD registers in the USRP will
    be initialized to<br>
      automatically when you have a built-in GPSDO.<br>
    <br>
    But, like Ian says, the TOD registers and logic in the USRP know
    nothing of Gregorian calendars, etc.   A time_spec_t of '0' is
    interpreted however<br>
      you want to interpret it, although the Unix epoch-time is
    certainly convenient, and that's what it gets set to when you have a
    GPSDO, and what<br>
      the "gps_time" sensor returns, and what the
    uhd::time_spec_t::get_system_time() method will return on POSIX
    systems, the hardware really<br>
      doesn't care.  It just takes whatever is stuffed in there
    initially, and just keeps incrementing  it at an appropriate rate. 
    If you call the get_time_now()<br>
      uhd::multi_usrp method it will return a time_spec_t, upon which
    you can call get_ful_secs(), which will be a time_t.  If the USRP
    has been initialized<br>
      with a Unix-epoch type time, then that time_t should correpond to
    Unix-epoch time.<br>
    <br>
    <br>
    <br>
    <br>
    <blockquote
      cite="mid:8BCAA8D1-0CD9-48E7-89FC-199F967BBC33@ionconcepts.com"
      type="cite">
      <div><br>
        <div>
          <div>On Dec 10, 2014, at 1:37 PM, Peter Witkowski via
            USRP-users <<a moz-do-not-send="true"
              href="mailto:usrp-users@lists.ettus.com">usrp-users@lists.ettus.com</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <div dir="ltr">
              <div>
                <div>Hi Marcus,<br>
                  <br>
                </div>
                I've looked at the documentation (prior to sending my
                original mailing list message) and am still lost.  Let
                me rephrase my question.  Since time_spec_t just holds a
                seconds count, when did the count start (assuming the
                USRP is synched to UTC via the GPSDO)?  Restated once
                more, if I get back 0, what time is it?<br>
                <br>
              </div>
              I'm assuming that once synched, the USRP is just using
              seconds after Unix epoch (this would be logical), but
              would like to confirm this.<br>
              <div>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Wed, Dec 10, 2014 at 4:11
                    PM, Marcus D. Leech via USRP-users <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:usrp-users@lists.ettus.com"
                        target="_blank">usrp-users@lists.ettus.com</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div bgcolor="#FFFFFF" text="#000000"><span
                          class="">
                          <div>On 12/10/2014 04:02 PM, Peter Witkowski
                            via USRP-users wrote:<br>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">
                              <div>
                                <div>Thanks for the info thus far.  That
                                  explains a lot and at least I know I
                                  don't have to worry about conversions
                                  from UTC to GPS time.<br>
                                  <br>
                                </div>
                                So now that it looks like the USRP is
                                using UTC, when I get a time_spec_t
                                structure back from it (or pass it one
                                as a start time in issue_stream_cmd()),
                                what does the time_spec_t structure
                                hold?  UTC seconds after Unix epoch or
                                something else entirely?<br>
                                <br>
                              </div>
                              Note all this assumes that the GPSDO is
                              working properly and locked.<br>
                              <div>
                                <div>
                                  <div class="gmail_extra"><br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                        </span><a moz-do-not-send="true"
href="http://files.ettus.com/manual/classuhd_1_1time__spec__t.html#a2bd6c4c8ad7209d219c3ca5ae238fb6e"
                          target="_blank">http://files.ettus.com/manual/classuhd_1_1time__spec__t.html#a2bd6c4c8ad7209d219c3ca5ae238fb6e</a>
                        <div>
                          <div class="h5"><br>
                            <br>
                            <br>
                            <blockquote type="cite">
                              <div dir="ltr">
                                <div>
                                  <div>
                                    <div class="gmail_extra">
                                      <div class="gmail_quote">On Wed,
                                        Dec 10, 2014 at 3:32 PM,
                                        Perelman, Nathan via USRP-users
                                        <span dir="ltr"><<a
                                            moz-do-not-send="true"
                                            href="mailto:usrp-users@lists.ettus.com"
                                            target="_blank">usrp-users@lists.ettus.com</a>></span>
                                        wrote:<br>
                                        <blockquote class="gmail_quote"
                                          style="margin:0 0 0
                                          .8ex;border-left:1px #ccc
                                          solid;padding-left:1ex">
                                          <div bgcolor="white"
                                            link="blue" vlink="purple"
                                            lang="EN-US">
                                            <div>
                                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The

                                                  time returned via
                                                  get_mboard_sensor(“gps_time”)
                                                  will be UTC already
                                                  (assuming the GPSDO is
                                                  locked). The GPSDO
                                                  corrects for leap
                                                  seconds. If you look
                                                  up the GPRMC string,
                                                  you can see that the
                                                  time/date given are
                                                  UTC.</span></p>
                                              <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-Nathan</span></p>
                                              <p class="MsoNormal"><a
                                                  moz-do-not-send="true"
name="14a360b06b44bec8_14a35f4435933d7c_14a35e7fb9b6b53b__MailEndCompose"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></a></p>
                                              <div>
                                                <div
                                                  style="border:none;border-top:solid
                                                  #b5c4df
                                                  1.0pt;padding:3.0pt
                                                  0in 0in 0in">
                                                  <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
                                                      USRP-users
                                                      [mailto:<a
                                                        moz-do-not-send="true"
href="mailto:usrp-users-bounces@lists.ettus.com" target="_blank">usrp-users-bounces@lists.ettus.com</a>]
                                                      <b>On Behalf Of </b>Marcus
                                                      D. Leech via
                                                      USRP-users<br>
                                                      <b>Sent:</b>
                                                      Wednesday,
                                                      December 10, 2014
                                                      3:18 PM<br>
                                                      <b>To:</b> <a
                                                        moz-do-not-send="true"
href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a><br>
                                                      <b>Subject:</b>
                                                      Re: [USRP-users]
                                                      time_spec_t GPS
                                                      Time or UTC?</span></p>
                                                </div>
                                              </div>
                                              <div>
                                                <div>
                                                  <div> <br
                                                      class="webkit-block-placeholder">
                                                  </div>
                                                  <p class="MsoNormal">On
                                                    12/10/2014 03:10 PM,
                                                    Peter Witkowski via
                                                    USRP-users wrote: </p>
                                                  <div>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"
style="margin-bottom:12.0pt">Hello,</p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal"
style="margin-bottom:12.0pt">I have a question regarding the time
                                                          reference used
                                                          by the USRP
                                                          (namely the
                                                          x300).</p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal"
style="margin-bottom:12.0pt">If I call the following UHD API functions
                                                          (see list
                                                          below), what
                                                          time reference
                                                          is used (GPS
                                                          or UTC)?  Does
                                                          the USRP
                                                          itself handle
                                                          leap seconds
                                                          and the delta
                                                          between Unix
                                                          time and the
                                                          time it's
                                                          getting from
                                                          it's GPS
                                                          receiver
                                                          (assuming a
                                                          GPSDO is
                                                          installed and
                                                          locked)?</p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal">1. 
                                                          When I specify
                                                          the
                                                          time_spec_t
                                                          value in
                                                          issue_stream_cmd(),
                                                          what time
                                                          reference is
                                                          the USRP
                                                          expecting? 
                                                          For example,
                                                          do I pass it
                                                          seconds after
                                                          epoch (Unix
                                                          time) or
                                                          something
                                                          else?</p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal">2.
                                                          When I get
                                                          time via
                                                          get_time_last_pps(),
                                                          what is the
                                                          time
                                                          reference?</p>
                                                          </div>
                                                          <p
                                                          class="MsoNormal">3.
                                                          Same question
                                                          as above
                                                          except for
                                                          retrieving
                                                          time via
                                                          get_mboard_sensor("gps_time").</p>
                                                        </div>
                                                        <p
                                                          class="MsoNormal"
style="margin-bottom:12.0pt">4.  When I get samples from the sensor
                                                          using recv(),
                                                          what time
                                                          reference is
                                                          used for the
                                                          time_spec_t
                                                          timestamp in
                                                          the
                                                          rx_metadata_t
                                                          structure?  I
                                                          understand
                                                          that is the
                                                          timestamp of
                                                          the first
                                                          sample, but is
                                                          the timestamp
                                                          seconds after
                                                          epoch (i.e.
                                                          Unix time) or
                                                          based on
                                                          something
                                                          else?</p>
                                                      </div>
                                                      <p
                                                        class="MsoNormal"
style="margin-bottom:12.0pt">Just wondering if I need to worry about
                                                        translating
                                                        between GPS
                                                        seconds and Unix
                                                        seconds or
                                                        something
                                                        similar.</p>
                                                    </div>
                                                    <p class="MsoNormal">Thanks
                                                      in advance for the
                                                      help.<br
                                                        clear="all">
                                                    </p>
                                                    <div>
                                                      <div>
                                                        <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <div>
                                                          <p
                                                          class="MsoNormal"><br>
                                                          -- </p>
                                                          <div>
                                                          <p
                                                          class="MsoNormal">Peter

                                                          Witkowski<br>
                                                          <a
                                                          moz-do-not-send="true"
href="mailto:pwitkowski@gmail.com" target="_blank">pwitkowski@gmail.com</a></p>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                  <pre> </pre>
                                                  <pre> </pre>
                                                  <pre>_______________________________________________</pre>
                                                  <pre>USRP-users mailing list</pre>
                                                  <pre><a moz-do-not-send="true" href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a></pre>
                                                  <pre><a moz-do-not-send="true" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a></pre>
                                                  <p class="MsoNormal">The
                                                    USRP doesn't
                                                    actually care, or
                                                    know, about
                                                    epoch-based time
                                                    systems.   The TOD
                                                    clock in USRPs is
                                                    just a wide counter
                                                    that increments at<br>
                                                      the master clock
                                                    rate.<br>
                                                    <br>
                                                    The only requirement
                                                    in most cases is
                                                    that everybody in a
                                                    collection of USRPs
                                                    agrees on the
                                                    interpretation of
                                                    time.  The gps_time
                                                    returned in the<br>
                                                      sensor is just
                                                    parsed from the NMEA
                                                    data, as far as I
                                                    know, without any
                                                    further manipulation
                                                    to make it
                                                    consistent with (for
                                                    example) Unix epoch<br>
                                                      time or any other
                                                    time system.<br>
                                                    <br>
                                                    In many cases,
                                                    applications that
                                                    don't care about
                                                    time-as-it-relates-to-the-rest-of-the-world,
                                                    they load the TOD
                                                    registers in a
                                                    cluster of USRPs<br>
                                                      with 0, so that
                                                    the TOD clock
                                                    becomes kind of a
                                                    "mission elapsed
                                                    timer".<br>
                                                    <br>
                                                    <br>
                                                    <br>
                                                    <br>
                                                  </p>
                                                  <pre>-- </pre>
                                                  <pre>Marcus Leech</pre>
                                                  <pre>Principal Investigator</pre>
                                                  <pre>Shirleys Bay Radio Astronomy Consortium</pre>
                                                  <pre><a moz-do-not-send="true" href="http://www.sbrac.org/" target="_blank">http://www.sbrac.org</a></pre>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <br>
_______________________________________________<br>
                                          USRP-users mailing list<br>
                                          <a moz-do-not-send="true"
                                            href="mailto:USRP-users@lists.ettus.com"
                                            target="_blank">USRP-users@lists.ettus.com</a><br>
                                          <a moz-do-not-send="true"
href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com"
                                            target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
                                          <br>
                                        </blockquote>
                                      </div>
                                      <br>
                                      <br clear="all">
                                      <br>
                                      -- <br>
                                      <div>Peter Witkowski<br>
                                        <a moz-do-not-send="true"
                                          href="mailto:pwitkowski@gmail.com"
                                          target="_blank">pwitkowski@gmail.com</a></div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <br>
                              <fieldset></fieldset>
                              <br>
                              <pre>_______________________________________________
USRP-users mailing list
<a moz-do-not-send="true" href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a>
<a moz-do-not-send="true" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                        </div>
                      </div>
                      <br>
                      _______________________________________________<br>
                      USRP-users mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:USRP-users@lists.ettus.com">USRP-users@lists.ettus.com</a><br>
                      <a moz-do-not-send="true"
href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com"
                        target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <br>
                  -- <br>
                  <div class="gmail_signature">Peter Witkowski<br>
                    <a moz-do-not-send="true"
                      href="mailto:pwitkowski@gmail.com">pwitkowski@gmail.com</a></div>
                </div>
              </div>
            </div>
            _______________________________________________<br>
            USRP-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:USRP-users@lists.ettus.com">USRP-users@lists.ettus.com</a><br>
<a class="moz-txt-link-freetext" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>