[FieldTrip] generic data format

Alexander Reyes reyesale at usc.edu
Thu Sep 12 17:54:38 CEST 2013


I am having some difficulty getting my data into a format that can be read
by FieldTrip correctly. I apologize in advance for the length of this e
mail. This is actually a two part question.

1. The data I am trying to analyze consists of electrocorticography (ECoG)
data rather than EEG or MEG and was collected with a system not supported
by FieldTrip. My raw data are segmented into 30 second trials (22 in total)
and arranged into columns representing 76 ECoG and 8 EMG channels and
sampled at 500 Hz. There are no markers or triggers in my data as of now
since this is preliminary data. Additionally, I have not removed any
artifacts from the data nor have I redefined any trials.

Following the FAQ for importing a generic data format, I have successfully
created the following structure:

data.label =          subjectData.Labels;
data.fsample =     subjectData.Fs;
data.trial =         subjectData.TrialData;
data.time =          subjectData.Ref;

I have fed this data into the ft_preprocessing.m function with the
configuration shown below.

cfg = [];
cfg.channel       = 'C*';
cfg.lpfilter      = 'yes';
cfg.hpfilter      = 'yes';
cfg.bsfilter      = 'yes';
cfg.lpfreq        = 100/data.fsample;
cfg.hpfreq        = 10/data.fsample;
cfg.bsfreq        = [59 61]/data.fsample;
cfg.lpfiltord     = 4;
cfg.hpfiltord     = 4;
cfg.bpfiltord     = 4;
cfg.lpfilttype    = 'but';
cfg.hpfilttype    = 'but';
ecog = ft_preprocessing(cfg,data);

The generated file filters the data correctly, but there are edge effects
so I would like to pad the data. However, when I insert the two extra lines
shown below and then run ft_preprocessing, I get the error that follows.

cfg.padding       = 200;
cfg.padtype       = 'data';

Error using butter (line 83)
butter: critical frequencies must be in (0 1)

Error in ft_preproc_lowpassfilter (line 93)
    [B, A] = butter(N, max(Flp)/Fn);

Error in preproc (line 297)
if strcmp(cfg.lpfilter, 'yes'),     dat = ft_preproc_lowpassfilter(dat,
fsample, cfg.lpfreq, cfg.lpfiltord, cfg.lpfilttype,
cfg.lpfiltdir, cfg.lpinstabilityfix); end

Error in ft_preprocessing (line 323)
    [dataout.trial{i}, dataout.label, dataout.time{i}, cfg] =
preproc(data.trial{i}(rawindx,:), data.label(rawindx),  data.time{i},
    cfg, begpadding, endpadding);

I would appreciate some help as to why the padding does not work for my
data set.

2. In an attempt to keep moving forward, I have bypassed the padding and
tried to do a simple frequency analysis using the following configuration:

cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'pow';
cfg.foi = [1:30];
cfg.taper = 'hanning';
cfg.t_ftimwin = 4./cfg.foi;
cfg.toi = 0:0.5:30;
cfg.tapsmofrq = 4;
freq = ft_freqanalysis (cfg,ecog);

But I get the following error:

Error using ft_specest_mtmfft (line 75)
the padding that you specified is shorter than the data

Error in ft_freqanalysis (line 503)
      [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper',
cfg.taper, options{:}, 'feedback', fbopt);

I was wondering if I could get some help decrypting this error message.

Thank you in advance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130912/710ddf03/attachment-0001.html>

More information about the fieldtrip mailing list