Open leoggoes opened 6 years ago
@leoggoes signal.unitsOffset[i] will always be 0 with this expression since
signal.unitsInDigit[i] = (header.maxInUnits[i] - header.minInUnits[i]) / (header.digitalMax[i] - header.digitalMin[i]);
so it's surely not the good expression
Hi. Came to my attention that when converting digital values to values in units you multiplied the gain but forgot the offset for signal calibration. I don't think it deserves a git pull, so I'll paste the files here and you give it a look. Just added a "Doubles[] unitOffset" on EDFSignal.java , "signal.unitsOffset[i] = (header.maxInUnits[i] - header.minInUnits[i]) - signal.unitsInDigit[i] (header.digitalMax[i] - header.digitalMin[i]);" on unitsInDigit for loop and "signal.valuesInUnits[j][s] = signal.digitalValues[j][s] signal.unitsInDigit[j] + signal.unitsOffset[j];" on header.numberOfChannels loop inside EDFParser.java. EDFParser.txt EDFSignal.txt