{"id":556,"date":"2020-07-24T16:50:58","date_gmt":"2020-07-24T16:50:58","guid":{"rendered":"https:\/\/oshablue.com\/bsides\/?p=556"},"modified":"2020-07-24T17:14:06","modified_gmt":"2020-07-24T17:14:06","slug":"hdl-0108-rscpt-batch-capture-and-sample-rate","status":"publish","type":"post","link":"https:\/\/oshablue.com\/doc\/hdl-0108-rscpt-batch-capture-and-sample-rate\/","title":{"rendered":"HDL-0108-RSCPT: Batch Capture and Sample Rate"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_68 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ea4b4ac5325\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ea4b4ac5325\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/oshablue.com\/doc\/hdl-0108-rscpt-batch-capture-and-sample-rate\/#References\" title=\"References\">References<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/oshablue.com\/doc\/hdl-0108-rscpt-batch-capture-and-sample-rate\/#Summary_of_the_Rationale_and_Resolution\" title=\"Summary of the Rationale and Resolution\">Summary of the Rationale and Resolution<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/oshablue.com\/doc\/hdl-0108-rscpt-batch-capture-and-sample-rate\/#How_to_Change_the_Code\" title=\"How to Change the Code\">How to Change the Code<\/a><\/li><\/ul><\/nav><\/div>\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"References\"><\/span>References<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the DacqMan code repository please see the README file for the Custom User Batch Output and search for the paragraphs regarding sample rate.  See also: capture-options.json, as well as relevant code in the source.  <\/p>\n\n\n\n<p>The comments in this post are a summary of the details in the source code and configuration files in the repository.<\/p>\n\n\n\n<p>Remember, you can use the DacqMan tool to copy configuration files to a local directory on your host PC and change values in there as well.  And running the source with your experimental modifications is quite easy.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary_of_the_Rationale_and_Resolution\"><\/span>Summary of the Rationale and Resolution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The HDL-x series, as of this writing, ships with a sample rate of 40Mhz.<\/p>\n\n\n\n<p>However, the end-customer software used to validate the integrity of the batch output data file format was an older version and broke when the correct 40MHz sample rate was assigned in the batch (UTR) file, due to an issue in converting 40,000,000 from a single to a double float in that legacy code.  Perhaps that conversion issue has been changed, perhaps that update has not been a requirement.<\/p>\n\n\n\n<p>So, to validate the UTR file format, and guarantee a known working output for import into the end-customer toolchain, a &#8220;fake&#8221; sample rate of 25MHz (or maybe 35MHz &#8211; depending on the version used and settings used) is written to the file, even though the true sample rate is still 40MHz.  This allows the import of the batch to proceed without error, and the calculated thickness can be adjusted temporarily via the SOSsteel setting for example, if desired.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Change_the_Code\"><\/span>How to Change the Code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After verifying, or in order to correct\/update\/verify, your toolchain software updates for UTR file processing, you may wish to update the DacqMan source and\/or configuration.<\/p>\n\n\n\n<p>Please note, that more caveats are given in the two README files in the DacqMan source regarding how the software tries to maintain legacy compatibility with the end-customer batch UTR file processing, but the inefficiencies, duplication and gotchas required in doing so.  <\/p>\n\n\n\n<p>Therefore, there are several duplicate sample rate values used or not used, depending on your UTR processing toolchain and any updates of your legacy software.<\/p>\n\n\n\n<p>The primary setting for the sample rate, in DacqMan v0.0.9, is in mainWindow.html line 561 in the const defaultHardwareWaveformSampleFrequencyHz.  Here, it is set to 25MHz (25000000) so that the end-customer toolchain doesn&#8217;t break trying to use the real sample rate of 40MHz.  That is where you can change the value back to the real world value of 40000000 when your toolchain is updated or verified to work properly for the new sample rate.<\/p>\n\n\n\n<p>In sprenderer.js you can see on line 1606 where the CaptureDataFileOutput object instance named captureDataFileOutputBatch is instantiated with the parameter waveformSampleFrequencyHz set to the defaultHardwareWaveformSampleFrequencyHz value, and as such, overrides the default value.<\/p>\n\n\n\n<p>A hardware configuration module is planned that will abstract these values into a configuration file in the future.  This was however not suitable at the current stage, given the questions about legacy compatibility cleanup.<\/p>\n\n\n\n<p>Other sample frequency related values are present in capture-options.json where comments and notes provide some description about their values and selection.<\/p>\n\n\n\n<p>There is provision for including cal files in the code and batch output, but it is not required for some processing.  So a lot of this is user work flow dependent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>References In the DacqMan code repository please see the README file for the Custom User Batch Output and search for the paragraphs regarding sample rate. See also: capture-options.json, as well as relevant code in the source. The comments in this post are a summary of the details in the source code and configuration files in &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/oshablue.com\/doc\/hdl-0108-rscpt-batch-capture-and-sample-rate\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;HDL-0108-RSCPT: Batch Capture and Sample Rate&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[15,49,9,32,13,14,38,12],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-hdlite-family","category-dacqman","category-hardware","category-hdl-0108-rscpt-8-chan-mod-rapid-scan","category-ndt","category-new-prototypes","category-software","category-ultrasonics","entry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/posts\/556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":1,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/posts\/556\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oshablue.com\/doc\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}