Muse generates a lot of data and it's helpful to store that data on disk for later analysis. All applications written by InteraXon for Muse use a data storage format called Protocol Buffers(PB). Protocol buffers store data in binary form, which means it is very compact. For example, a 5 minute session of data with 220Hz 4-channel EEG and 50Hz 3-channel accelerometer is about 1.5MB on disk. Protocol buffers make it easy to read this data from the programming language of your choice. We also have tools available (MusePlayer) which can convert the data into different formats, such as CSV and MAT. Ordering of DataWhen using a preset that enables compression, the data inside of raw files is only guaranteed to be ordered by type. In other words, all EEG are in order in relationship with each other, and all accelerometer data is in order in relation to each other, but EEG packets are not necessarily ordered in relation to accelerometer packet. EEG samples can arrive up to 72ms after an accelerometer packet with the same timestamp. File FormatWhile Protocol Buffers specify the messages themselves, they do not specify how to separate messages from one another. Muse files separate each message with a size(4 byte integer) and a version(2 byte integer). So each message looks like this: SIZE(4 bytes) VERSION(2 bytes) MESSAGE(SIZE bytes) "Version" is version number. Currently there is only one version, version "1". Integrating with Your Own ProgramsProtocol Buffers make it easy to read and write Muse data from your own programs. It's easy because the code to parse and write the files is generated for you. To generate the code, download a copy of Protocol Buffers from here and install it. Then you only need to compile the Muse.proto file (attached) for the language of your choice. This will generate native parser code that you can use in your own applications. C++ protoc --cpp_out=. Muse_v2.proto Java protoc --java_out=. Muse_v2.proto Python protoc --python-out=. Muse_v2.proto |