Skip to content

Commit 2a09df7

Browse files
committed
added note
1 parent e261013 commit 2a09df7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mne/io/cnt/cnt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,12 @@ def _get_cnt_info(input_fname, eog, ecg, emg, misc, data_format, date_format, he
328328
lowpass_toggle = bool(np.fromfile(fid, "i1", count=1).item())
329329
highpass_toggle = bool(np.fromfile(fid, "i1", count=1).item())
330330

331+
# Reference: https://paulbourke.net/dataformats/eeg/
331332
# Header has a field for number of samples, but it does not seem to be
332333
# too reliable. That's why we have option for setting n_bytes manually.
334+
# According to link above, the number of samples should be calculated as follows:
335+
# nsamples = SETUP.EventTablePos - (900 + 75 * nchannels) / (2 * nchannels)
336+
# where 2 likely refers to the data format with default 2 bytes.
333337
fid.seek(_NSAMPLES_OFFSET)
334338
n_samples = np.fromfile(fid, dtype="<u4", count=1).astype(int).item()
335339
n_samples_header = n_samples

0 commit comments

Comments
 (0)