{"id":264,"date":"2020-07-22T12:13:24","date_gmt":"2020-07-22T19:13:24","guid":{"rendered":"https:\/\/boom-tracker.com\/tracker\/?p=264"},"modified":"2020-07-26T10:37:33","modified_gmt":"2020-07-26T17:37:33","slug":"mind-the-gap","status":"publish","type":"post","link":"https:\/\/boom-tracker.com\/tracker\/blog\/mind-the-gap\/","title":{"rendered":"Mind the gap"},"content":{"rendered":"\n<p>The downside to increasing the sample rate is that I also increased the timing error that accumulates during a sampling buffer.  Look at these sequential data buffers:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap.png\" alt=\"\" class=\"wp-image-263\" width=\"813\" height=\"589\" srcset=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap.png 994w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-300x217.png 300w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-768x556.png 768w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-250x181.png 250w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-550x398.png 550w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-800x579.png 800w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-249x180.png 249w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-414x300.png 414w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/001-1595437347_round_off_gap-690x500.png 690w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><figcaption>I&#8217;ve got a gap<\/figcaption><\/figure>\n\n\n\n<p>There&#8217;s a gap of more than 400 microseconds between the last measurement of the first packet and the first measuement of the second.  That gap isn&#8217;t real though.  There&#8217;s actually about a 42-43 microsecond gap in real time, but because I send the measurement interval as a whole number of microseconds between messages, there&#8217;s a fraction of a microsecond that gets lost to truncation.  In this case, the actual interval of 42.72 microseconds gets truncated to 42 microseconds when sent to the server, and that means that there&#8217;s about a 370 microsecond error by the end of the packet (0.72 microseconds * 512 measurements in the packet).<\/p>\n\n\n\n<p>Currently the measurement packet has a 22 bytes of header, including both the timestamp of the beginning of the packet (8 bytes) and the number of microseconds between measurements (2 bytes).  I could redesign the measurement packet so that the same two bytes pass 100ths of microseconds rather than whole microseconds, and that would allow up to 655.35 microseconds as a measurement interval without changing the overhead of the packet. (I&#8217;ve only got about 1450 bytes to work with in a UDP packet that&#8217;s going to travel over WiFi and Ethernet, so I&#8217;m trying to be frugal with headers and leave as much space as possible for actual measurements.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The downside to increasing the sample rate is that I also increased the timing error that accumulates during a sampling buffer. Look at these sequential data buffers: There&#8217;s a gap of more than 400 microseconds between the last measurement of the first packet and the first measuement of the second. That gap isn&#8217;t real though.&hellip; <a class=\"more-link\" href=\"https:\/\/boom-tracker.com\/tracker\/blog\/mind-the-gap\/\">Continue reading <span class=\"screen-reader-text\">Mind the gap<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[3,7,9],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-blog","category-design","category-experimentation"],"_links":{"self":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":2,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":296,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/264\/revisions\/296"}],"wp:attachment":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}