single vs double precsion in GSR preprocessing?

Post Reply
dmedine
Posts: 7
Joined: Sat Jan 16, 2016 12:22 am

single vs double precsion in GSR preprocessing?

Post by dmedine »

I am trying to implement a C++ routine to do online GSR processing that will produce identical output as does ActiveView. I noticed a numerical issue and I am not sure the right thing to do. The preprocessing pipeline, among other things, downsamples the raw data from the GSR Aux channels. This means the data must be filtered in order to avoid anti-aliasing. However, the filter is a Chebyshev filter and the data are int32 values. So, the data must be converted to floating point values (in the labview filter node) in order to do the operation.

The problem is that I don't know whether or not to convert the values to single or double precision. Because the raw data values are quite large the difference in output is on the order of 1e^6 (!!!). Doubles are certainly more accurate, but I want to match ActiveView.

Can anyone give me some insight as to what LabView does internally? Attached is a plot of the difference between GSR_pos - GSR_neg filtered using the 4th order Chebyshev filter. The blue is the (noisier) single precision version, and the red is the double. If one notes the scale of the ordinate, you can see that they are quite significantly different in scale. This will lead to vastly different GSR values after the rest of the pipeline is applied.
single_vs_double.png
single_vs_double.png (25.71 KiB) Viewed 29718 times

Post Reply