{"id":2233,"date":"2015-11-19T07:47:52","date_gmt":"2015-11-19T10:47:52","guid":{"rendered":"http:\/\/tangopardo.com.ar\/2cf7\/?p=2233"},"modified":"2015-11-19T20:02:40","modified_gmt":"2015-11-19T23:02:40","slug":"a-statistical-insight","status":"publish","type":"post","link":"https:\/\/tangopardo.com.ar\/2cf7\/2015\/11\/19\/a-statistical-insight","title":{"rendered":"A statistical insight"},"content":{"rendered":"<p>I&#8217;ve been working during the weekends on an instrumentation frontend to precisely measure the resistance of an RTD sensor using a ratiometric approach.<\/p>\n<p>After building it and waiting a prudential time to let it warm I saved an hour of samples (3600) and fired Octave.<\/p>\n<p>The mean and standard deviation looked ok and while a plot showed a bit of noise it was well within reasonable limits.<\/p>\n<p>Just for the sake of it I did a histogram and, oh the horror:<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div data-carousel-extra='{\"blog_id\":1,\"permalink\":\"https:\\\/\\\/tangopardo.com.ar\\\/2cf7\\\/2015\\\/11\\\/19\\\/a-statistical-insight\"}' id='gallery-1' class='gallery galleryid-2233 gallery-columns-1 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min.png'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min-300x225.png\" class=\"attachment-medium size-medium\" alt=\"Histogram of readings.\" aria-describedby=\"gallery-1-2235\" srcset=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min-300x225.png 300w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min-1024x768.png 1024w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min.png 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" data-attachment-id=\"2235\" data-permalink=\"https:\/\/tangopardo.com.ar\/2cf7\/2015\/11\/19\/a-statistical-insight\/histograma_lecturas_rref_60_min\" data-orig-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min.png\" data-orig-size=\"1200,900\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"histograma_lecturas_rref_60_min\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Histogram of readings.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min-300x225.png\" data-large-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_rref_60_min-1024x768.png\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-2235'>\n\t\t\t\tHistogram of readings.\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<p>This is clearly not OK. It should be more like a Gaussian (the real formula is quite daunting but still retains symmetry) and that looks a lot like a bimodal distribution. Changing the number of bins does not help.<\/p>\n<p>The ADC I used does not have a reference input so I make two differential reads and then take the quotient (I know&#8230; but it was the only one available when started).<\/p>\n<p>Perhaps the input multiplexer is at fault? (the unused channels are grounded, so I discarded that as a cause). I repeated the experiment but this time doing a full run on each channel instead of switching them and this is the result:<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-2 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-2 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t#gallery-2 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-2 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div data-carousel-extra='{\"blog_id\":1,\"permalink\":\"https:\\\/\\\/tangopardo.com.ar\\\/2cf7\\\/2015\\\/11\\\/19\\\/a-statistical-insight\"}' id='gallery-2' class='gallery galleryid-2233 gallery-columns-1 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min.png'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min-300x225.png\" class=\"attachment-medium size-medium\" alt=\"Histogram of raw samples taken at different times to avoid using the multiplexer.\" aria-describedby=\"gallery-2-2234\" srcset=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min-300x225.png 300w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min-1024x768.png 1024w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min.png 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" data-attachment-id=\"2234\" data-permalink=\"https:\/\/tangopardo.com.ar\/2cf7\/2015\/11\/19\/a-statistical-insight\/histograma_lecturas_crudas_60min\" data-orig-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min.png\" data-orig-size=\"1200,900\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"histograma_lecturas_crudas_60min\" data-image-description=\"&lt;p&gt;Histogram of raw samples taken at different times to avoid using the multiplexer.&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Histogram of raw samples taken at different times to avoid using the multiplexer.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min-300x225.png\" data-large-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/histograma_lecturas_crudas_60min-1024x768.png\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-2-2234'>\n\t\t\t\tHistogram of raw samples taken at different times to avoid using the multiplexer.\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<p>Well, both are skewed so there&#8217;s something else going on.<\/p>\n<p>Scoping at the inputs shows what seems to be AM at around 70MHz even without power applied (that&#8217;s on the tv broadcast band here) and it kind of makes sense because I didn&#8217;t use a shield. Head bangs on the desk.<\/p>\n<p>Anyways, using a quick digital filter makes everything look nicer but I&#8217;ll still have to shield this:<\/p>\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-3 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-3 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t#gallery-3 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-3 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div data-carousel-extra='{\"blog_id\":1,\"permalink\":\"https:\\\/\\\/tangopardo.com.ar\\\/2cf7\\\/2015\\\/11\\\/19\\\/a-statistical-insight\"}' id='gallery-3' class='gallery galleryid-2233 gallery-columns-1 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min.png'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min-300x225.png\" class=\"attachment-medium size-medium\" alt=\"Measured resistance with and without filtering.\" aria-describedby=\"gallery-3-2236\" srcset=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min-300x225.png 300w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min-1024x768.png 1024w, https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min.png 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" data-attachment-id=\"2236\" data-permalink=\"https:\/\/tangopardo.com.ar\/2cf7\/2015\/11\/19\/a-statistical-insight\/medida_rx_filtrado_60min\" data-orig-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min.png\" data-orig-size=\"1200,900\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"medida_rx_filtrado_60min\" data-image-description=\"&lt;p&gt;Measured resistance with and without filtering.&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Measured resistance with and without filtering.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min-300x225.png\" data-large-file=\"https:\/\/tangopardo.com.ar\/2cf7\/wp-content\/uploads\/2015\/11\/medida_rx_filtrado_60min-1024x768.png\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-3-2236'>\n\t\t\t\tMeasured resistance with and without filtering.\n\t\t\t\t<\/dd><\/dl><br style=\"clear: both\" \/>\n\t\t<\/div>\n\n<p>The transient at the beginning is not going to be an issue, as in real life I don&#8217;t expect such a step change (from 0 to ~3k) and in any case the antialias filter will get rid of it.<\/p>\n<p>On a second thought, those chunks skewed up are really interesting and I should spotted that as a failure symptom earlier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working during the weekends on an instrumentation frontend to precisely measure the resistance of an RTD sensor using a ratiometric approach. After building it and waiting a prudential time to let it warm I saved an hour of samples (3600) and fired Octave. The mean and standard deviation looked ok and while a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13,37,24,3,22,62],"tags":[],"class_list":["post-2233","post","type-post","status-publish","format-standard","hentry","category-electronica","category-facultad","category-hacks","category-software","category-software-libre","category-tf"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pmnbC-A1","_links":{"self":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/2233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/comments?post=2233"}],"version-history":[{"count":8,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/2233\/revisions"}],"predecessor-version":[{"id":2244,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/posts\/2233\/revisions\/2244"}],"wp:attachment":[{"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/media?parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/categories?post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tangopardo.com.ar\/2cf7\/wp-json\/wp\/v2\/tags?post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}