This article will provide an overview of the raw binary channel data file (.chn) and provide an example of how to compare that data to exported data in a CSV/TSV file.
Binary Data Overview
Following data download in SLICEWare, a channel data file is created for each channel configured in the Prepare tab in the default DTS SLICEWare Data folder. The files can be viewed using a hex editor.
This file consists of a header and sample data in raw binary form. The header length of the file varies in length dependent upon several factors; the format of which can be viewed here:
Sample data begins on the byte immediately following the last header byte.
Each sample consists of a signed 32-bit integer in little-endian format (least significant byte first), where the value represents the ADC count value of the signal at that given sample point/time. The following figure provides a snapshot of a raw binary channel file (.chn) where the blue-highlighted values denote the first sample data.
SLICEWare provides several export formats for use with various programs. For the purposes of this article, we will focus on the CSV format (similar to TSV). There are two different data modes for use when exporting data: Don’t filter channels and Use channel filter settings.
The default export mode will be Use channel filter settings. Selecting this mode applies the software filter designated in the sensor database to the raw data before saving the filtered data to the export file. As this data has been subjected to filtering, values in the exported file will not match the values presented in the binary channel file.
To directly compare export file values to the channel data file values (.chn files), the Don’t filter channels setting must be selected when exporting data to the designated file.
When a file is exported, a folder will be created in the DTS Data folder denoting the export file type. Inside this folder, two subfolders named FILTERED and UNFILTERED will be created. Dependent upon the export format and filter settings selected, the default location will be one of these subfolders. The filename of the exported data will denote filter setting (_FILTERED or _UNFILTERED).
Why Filtering Matters
Signal filtering allows for the suppression or elimination of undesirable frequency content in the input signal. This provides a way to make the system response comply with filtering requirements inherent in many dynamic test procedures, and generally delivers a cleaner signal.
The software filters available in DTS software comply with the SAE J211/1 and ISO 6487 standards. Utilizing the SAE and ISO standards is a two-phase process. The first phase consists of passing the raw channel data through a 2-pole Butterworth filter at the desired frequency from time t0 to tn. The second phase consists of passing the filtered data generated in the first phase through a second, identical 2-pole Butterworth filter from time tn to t0. The reverse filtering allows for reduction of the phase shift introduced by the initial forward filtering.
The following figure provides a snapshot of the filtered and unfiltered CSV files from the accelerometer test that will be examined later.
As can be seen, application of a CFC 180 software filter to the data results in a noticeable adjustment to the sample results as compared to the raw data.
This section will provide an example of comparing data between the channel file and exported CSV files. The following figure depicts an accelerometer test with a snapshot of the first few data points from the channel file. Note the CFC 180 software filter applied to the data in the Filter drop down menu.
Exported CSV file snapshots:
Converting Binary Channel Data to EU Units
Sensor channel data in the raw binary channel file (.chn) is a signed 32-bit integer in little-endian format (least significant byte first).
For the first data point on channel 0, the channel file reads "2E 00". Since the data is little-endian, the actual value would be 0x00 2E. This is the number of ADC counts representing the signal value at this sample number/time.
To calculate the EU unit value of this particular data point, the following steps must be followed:
- Convert signed 32-bit hex value to decimal value
ADC count value = 0x00 2E (base 16) --> 46 (base 10) = 46
- Adjust the decimal ADC count value by the Data Zero value
Data Zero = 49 counts
Adjusted Count Value = ADC Count Value - Data Zero = 46 - 49 = -3
- Multiply the Adjusted Count Value by the Scale Factor (EU/CNT) value
Scale Factor (EU/CNT) = 0.022148
EU = Adjusted Count Value * Scale Factor = -3 * 0.022148 = -0.066444
As can be seen in the above data snapshot, this value matches that presented in the unfiltered data CSV file but does not match the value shown in the filtered data CSV. The reason behind this can be seen by attempting to reverse the calculation process listed above for the filtered data value:
- Determine Adjusted Count Value
Adjusted Count Value = EU / Scale Factor = -0.146 / 0.022148 = -6.59202
This calculation shows that the EU value shown in the filtered CSV file requires the use of a fractional ADC count value. Since the raw channel data is in the form of a signed 32-bit integer, there is no way for the raw channel file to account for the fractional ADC count value. Continuing to reverse calculate would result in the following:
- Convert fractional Adjusted Count Value to an integer value
Adjusted Count Value = -6.59202 --> -7
- Convert Adjusted Count Value to EU units
EU = Adjusted Count Value * Scale Factor = -7 * 0.022148 = -0.155036
This value does not match the filtered data value! (normal and expected)
- Calculate ADC Count Value
ADC Count Value = Adjusted Count Value + Data Zero = -7 + 49 = 42
- Convert signed ADC decimal value to signed 32-bit hex value
ADC Count Value = 42 (base 10) --> 0x00 2A
This value does not match the raw channel data! (normal and expected)