Hi everyone,
I have 2 small questions concerning timestamps in raw objects in MNE - can anyone help me?
I have an xdf file containing a stream with EEG data from 128 channels, one with data from an Arduino that’s measuring grip strength (1 channel), and one with triggers from my PsychoPy experiment.
I’d like to turn my xdf file into a raw object. As I’m new to Python MNE & not familiar with the structure of raw objects, I tried building one from scratch so I can see how everything works.
Now my questions:
My xdf files contain timestamps for all recorded values in my different streams, but I don’t know how to include them in my Raw object. I looked at some examples of Raw objects and they don’t seem to contain timestamps but rather seem to work with sample numbers instead - is that correct?
If so: My timestamps don’t really match (even if I round them a bit). I added snippets from my data below so you know what I mean. I think using sample numbers won’t make sense in this case. Is there a workaround for that?
Thanks in advance for your help / ideas!
~ Merle
# Example timestamp values (values measured in seconds)
`You can see that I cut the snippets from different parts of the streams.
The EEG recording started earlier than the rest & has a higher sampling rate,
so the indices are way higher.
I tried getting timestamps from the same range
so you can see they do not match.`
# stream 1: timestamps for EEG data with sample freq = 500 Hz
streams[1]["time_stamps"][20900:21000]
# output:
array([6999.93109028, 6999.93309023, 6999.93509019, 6999.93709014,
6999.93909009, 6999.94109004, 6999.94309 , 6999.94508995,
6999.9470899 , 6999.94908986, 6999.95108981, 6999.95308976,
6999.95508972, 6999.95708967, 6999.95908962, 6999.96108958,
6999.96308953, 6999.96508948, 6999.96708944, 6999.96908939,
6999.97108934, 6999.9730893 , 6999.97508925, 6999.9770892 ,
6999.97908915, 6999.98108911, 6999.98308906, 6999.98508901,
6999.98708897, 6999.98908892, 6999.99108887, 6999.99308883,
6999.99508878, 6999.99708873, 6999.99908869, 7000.00108864,
7000.00308859, 7000.00508855, 7000.0070885, 7000.00908845,
7000.01108841, 7000.01308836, 7000.01508831, 7000.01708827,
7000.01908822, 7000.02108817, 7000.02308812, 7000.02508808,
7000.02708803, 7000.02908798, 7000.03108794, 7000.03308789,
7000.03508784, 7000.0370878, 7000.03908775, 7000.0410877,
7000.04308766, 7000.04508761, 7000.04708756, 7000.04908752,
7000.05108747, 7000.05308742, 7000.05508738, 7000.05708733,
7000.05908728, 7000.06108724, 7000.06308719, 7000.06508714,
7000.06708709, 7000.06908705, 7000.071087, 7000.07308695,
7000.07508691, 7000.07708686, 7000.07908681, 7000.08108677,
7000.08308672, 7000.08508667, 7000.08708663, 7000.08908658,
7000.09108653, 7000.09308649, 7000.09508644, 7000.09708639,
7000.09908635, 7000.1010863 , 7000.10308625, 7000.1050862 ,
7000.10708616, 7000.10908611, 7000.11108606, 7000.11308602,
7000.11508597, 7000.11708592, 7000.11908588, 7000.12108583,
7000.12308578, 7000.12508574, 7000.12708569, 7000.12908564])
# stream 2: timestamps for experiment triggers
streams[2]["time_stamps"][0:10]
# output:
array([6963.5034906 , 6964.75858024, 6991.82214163, 6992.82910679,
6994.33896652, 6995.53916588, 7001.53491572, 7001.53492682,
7002.53810648, 7004.04580771])
# stream 3: timestamps for Arduino data with sample freq = 45 Hz
streams[3]["time_stamps"][350:400]
# output:
array([6999.93935424, 6999.95185334, 6999.96437993, 6999.97685173,
6999.98938732, 7000.00185342, 7000.01435351, 7000.02685491,
7000.0393514, 7000.05185349, 7000.06436069, 7000.07685378,
7000.08937208, 7000.10185407, 7000.11435287, 7000.12685416,
7000.13935495, 7000.15185235, 7000.16435454, 7000.17685314,
7000.18935483, 7000.20185523, 7000.21435302, 7000.22685212,
7000.23935521, 7000.2518539 , 7000.2643561, 7000.27685459,
7000.28935469, 7000.30185588, 7000.31436148, 7000.32685387,
7000.33935346, 7000.35185446, 7000.36435425, 7000.37685245,
7000.38935254, 7000.40185414, 7000.41435253, 7000.42685332,
7000.43935442, 7000.45185551, 7000.46435401, 7000.476852,
7000.489355, 7000.50185619, 7000.51435259, 7000.52685678,
7000.53935587, 7000.55186167])