Page 1 of 1

identical timestamp with different data

Posted: Wed Jan 11, 2023 10:31 am
by safrizal
Hi James,
When I record the EEG data with python
I get identical timestamps with different raw data.
is it okay?

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 10:45 am
by James
Yes. The Muse hardware unfortunatly does not have an RTC, so timestamps are generated on the device once Bluetooth data is received. This means that data can be bunched up in the Bluetooth packet buffer and processed together.
But, also, check you're logging the milliseconds, not just seconds.

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 10:53 am
by safrizal
I used the number of seconds as timestamps, and I get this on my record. Sometimes I get 10 rows of data with identical timestamps like this, sometimes it is just two rows with identical timestamps.

1673289749.0507035,799.8168334960938,773.6264038085938,887.2527465820312,817.5457763671875,817.5457763671875
1673289749.0507035,782.4908447265625,772.8204956054688,890.879150390625,797.3992919921875,825.2014770507812
1673289749.0507035,792.967041015625,780.879150390625,884.029296875,811.098876953125,769.1941528320312
1673289749.0507035,758.3150024414062,771.2088012695312,887.6557006835938,799.010986328125,857.8388061523438
1673289749.0507035,759.5238037109375,774.4322509765625,888.05859375,790.5494384765625,771.6116943359375

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 10:55 am
by James
Can you show me the code you're using to get the timestamp from the bundle.

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 10:58 am
by safrizal
here it is :

def eeg_handler(self, address, *args):
self.data=[]
eegRecord.tp9, eegRecord.af7, eegRecord.af8, eegRecord.tp10, eegRecord.au = args
self.timeStamps=time.time()
self.labelValueTP9.config(text=":"+str(eegRecord.tp9))
self.labelValueTP10.config(text=":"+str(eegRecord.tp10))
self.labelValueAF7.config(text=":"+str(eegRecord.af7))
self.labelValueAF8.config(text=":"+str(eegRecord.af8))
self.data=list(args)
self.data.insert(0,self.timeStamps)
self.listJoin.append(self.data)

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 11:01 am
by James
"time.time()" just your local computer time, this is not the timestamp from the OSC data bundle.
You're seeing the same time because your computer is processing a bunch of data at once. Nothing wrong there, just some network buffering on your computer. :-)

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 11:06 am
by safrizal
is there a way I got timestamps from MindMonitor apps?

Re: identical timestamp with different data

Posted: Wed Jan 11, 2023 11:12 am
by James
Yes, you can read it from the OSC Bundle. In there it's called a "TimeTag".
I'm not sure how you can read it in Python though.

For Reference the structure of OSC is that there is an OSC Bundle with a TimeTag then in that are multiple OSC Packets with the data.
https://opensoundcontrol.stanford.edu/spec-1_0.html

All the Python libraries I've seen only deal with reading Packets, not the Bundle, so the way you're doing it is probably the best one unless you switch up to a more powerful language like C#.