HDL-0108-RSCPT: Batch Capture and Sample Rate

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 the repository.

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.

Summary of the Rationale and Resolution

The HDL-x series, as of this writing, ships with a sample rate of 40Mhz.

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.

So, to validate the UTR file format, and guarantee a known working output for import into the end-customer toolchain, a “fake” sample rate of 25MHz (or maybe 35MHz – 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.

How to Change the Code

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.

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.

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.

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’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.

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.

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.

Other sample frequency related values are present in capture-options.json where comments and notes provide some description about their values and selection.

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.