<div dir="ltr">Hello,<br><br>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. <br>
<br>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.<br>
<br>Following the FAQ for importing a generic data format, I have successfully created the following structure:<br><br>data.label = subjectData.Labels;<br>data.fsample = subjectData.Fs;<br>data.trial = subjectData.TrialData;<br>
data.time = subjectData.Ref;<br><br>I have fed this data into the ft_preprocessing.m function with the configuration shown below. <br><br>cfg = [];<br>cfg.channel = 'C*';<br>cfg.lpfilter = 'yes'; <br>
cfg.hpfilter = 'yes'; <br>cfg.bsfilter = 'yes'; <br>cfg.lpfreq = 100/data.fsample; <br>cfg.hpfreq = 10/data.fsample; <br>cfg.bsfreq = [59 61]/data.fsample; <br>
cfg.lpfiltord = 4; <br>cfg.hpfiltord = 4; <br>cfg.bpfiltord = 4; <br>cfg.lpfilttype = 'but'; <br>cfg.hpfilttype = 'but';<br>ecog = ft_preprocessing(cfg,data);<br>
<br>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. <br>
<br>cfg.padding = 200; <br>cfg.padtype = 'data'; <br> <br><br>Error using butter (line 83)<br>butter: critical frequencies must be in (0 1)<br><br>Error in ft_preproc_lowpassfilter (line 93)<br>
[B, A] = butter(N, max(Flp)/Fn);<br><br>Error in preproc (line 297)<br>if strcmp(cfg.lpfilter, 'yes'), dat = ft_preproc_lowpassfilter(dat, fsample, cfg.lpfreq, cfg.lpfiltord, cfg.lpfilttype,<br>cfg.lpfiltdir, cfg.lpinstabilityfix); end<br>
<br>Error in ft_preprocessing (line 323)<br> [dataout.trial{i}, dataout.label, dataout.time{i}, cfg] = preproc(data.trial{i}(rawindx,:), data.label(rawindx), data.time{i},<br> cfg, begpadding, endpadding);<br><br>I would appreciate some help as to why the padding does not work for my data set.<br>
<br>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: <br><br>cfg = [];<br>cfg.method = 'mtmfft'; <br>cfg.output = 'pow';<br>
cfg.foi = [1:30];<br>cfg.taper = 'hanning';<br>cfg.t_ftimwin = 4./cfg.foi; <br>cfg.toi = 0:0.5:30; <br>cfg.tapsmofrq = 4;<br>freq = ft_freqanalysis (cfg,ecog);<br> <br>But I get the following error:<br><br>
Error using ft_specest_mtmfft (line 75)<br>the padding that you specified is shorter than the data<br><br>Error in ft_freqanalysis (line 503)<br> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper', cfg.taper, options{:}, 'feedback', fbopt);<br>
<br>I was wondering if I could get some help decrypting this error message.<br><br>Thank you in advance.<br><br>Alex.<br><br><br></div>