sccn / xdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

editing xdf manually

rschmaelzle opened this issue · comments

Hi,
i have an xdf file that has a number of different streams. Unfortunately, due to some hickups with manufaturer's naming, certain streams and types are identically names (eg. name ='android' and type='EEG' for 3 times), hence the xdf-reader just goes through the loop and reads in only the first one. My hacky solution was to edit the files manually, but this dramatically messes up the xdf (note: I am using HexFiend - but it seems that this interferes with encoding).
Another issues is that several substreams also don't have the field "effective_srate", whcih seems to be mandatory for reading (using the eeglab plugin, but not using the load_xdf), but isn't present.
I know, going forward it will be best to record clean new data with a proper setup, but for debugging and code development, I would really like to read in this file and check the timings, alignment, and the merging of differently sampled streams.
So my three questions are:
how can i edit the xdf manually? are there other ways to read it in without editing? does the msissing effective_srate always cause trouble?
thank you very much, r

effective_srate isn't in the xdf file. It is calculated from the timestamps. This is different from nominal_srate, which is meant to represent the hardware-controlled sampling rate and should be stored in the header. If your data sources are generating data points at a regular rate then you definitely want your stream header to have a nominal_srate.

I don't use the Matlab importer much, but from what I can tell the effective_srate is always calculated as long as the HandleJitterRemoval option is set. And then it's possible to tell the EEGLAB importer to use effective_srate as the raw_srate so that it may proceed with importing the stream. Note that this is not recommended in general because the effective_srate could be meaningless in streams that were in fact irregular, and using that rate (e.g. in designing a filter) will be incorrect in most circumstances.

About editing XDF files, there's XDF Browser which I believe can edit xdf headers. I've never used it so I don't know for sure. BTW, I think XDF Browser might move from its current home in labstreaminglayer org to a new home in the xdf-modules org.

thanks a lot - it is too soon to tell if that worked, but I was able to use an old exe of xdf browser from the ftp repository to read and edit the file!
Thank you very much, r