Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Open Ephys data format (version 0.4)

...

  hdr = fread(fid, 1024, 'char*1');
eval(char(hdr'));
info.header = header;



This is actually pretty handy, since any changes to the header format (which will probably happen often) won't affect the code for reading data files. However, note that reading files using this method also creates a security risk if there is any doubt as to the origin of the file, since reading the header involves executing a portion of the file as MATLAB code. Therefore, be careful if you are working with files in one of these formats that you did not create yourself.

...

  • One little-endian int64 timestamp (actually a sample number; this can be converted to seconds using the sampleRate variable in the header)
  • One little-endian uint16 number (N) indicating the samples per record (always 1024, at least for now)
  • One little-endian uint16 recording number (version 0.2 and higher)
  • 1024 big-endian int16 samples
  • 10-byte record marker (0 1 2 3 4 5 6 7 8 255)

This makes up a record of 2070 bytes (= 8 + 2 + 2 + 2048 + 10).

If a file is opened or closed in the middle of a record, the leading or trailing samples are set to zero.

...