I'm trying to supply to Movesense Simulator (2.0.0 - VS2017) ECG data from a CSV file that looks like the following:
LoopingTimestamp:8000
Timestamp,/Meas/ECG/{RequiredSampleRate}
0,0
8,1000
16,2000
24,3000
32,4000
40,5000
48,6000
56,7000
64,8000
72,9000
...
8000,1000000
But it looks like a random(but constant during the simulation) offset is added to data every time I run the simulator.
These are some examples of the first chunk of data I got for each simulation:
41750 42750 43750 44750 45750 46750 47750 48750 49750 50750 51750 52750 53750 54750 55750 56750 (+750)
43125 44125 45125 46125 47125 48125 49125 50125 51125 52125 53125 54125 55125 56125 57125 58125 (+125)
42250 43250 44250 45250 46250 47250 48250 49250 50250 51250 52250 53250 54250 55250 56250 57250 (+250)
The offset is always a multiple of 125, that is the ECG frequency requested by my code.
What am I doing wrong? I'm expecting to get the same exact data I have in the CSV, like I do for HR.
You are seeing the linear interpolation between data points. If the current timestamp is between the timestamps in CSV file the data is a weighted average of the two nearest values. Since your data increments 1000 units per sample and your timestamps are 8 ms apart, the increment in value is 1000/8 = 125.
Full Disclosure: I work for the Movesense team