<div dir="ltr">Dear all,<div><br></div><div>I am new to FieldTrip and trying to process offline Emotive Epoc EEG data. The file I am trying to process is a single trial.</div><div><br></div><div>The code I tried is:</div><div><br></div><div>
<p>%% import data from testbench emotiv edf file </p>
<p>[hdr, data_eeg] = edfread(<span>'emotive.edf'</span>);</p>
<p> </p>
<p>%% Rearrange data to match FieldTrip Format</p>
<p>% Remove unnecessary columns</p>
<p>data.trial = data_eeg([3:16,39], : );</p>
<p> </p>
<p> </p>
<p>% Cell-array containing strings, Nchan X 1</p>
<p>% Based on <a href="https://emotiv.com/forum/forum14/topic1817/messages/" target="_blank">https://emotiv.com/forum/forum14/topic1817/messages/</a></p>
<p><span>data.label = {</span>'AF3'<span> </span>'F7'<span> </span>'F3'<span> </span>'FC5'<span> </span>'T7'<span> </span>'P7'<span> </span>'O1'<span> </span>'O2'<span> </span>'P8'<span> </span>'T8'<span> </span>'FC6'<span> </span>'F4'<span> </span>'F8'<span> </span>'AF4'<span> </span>'MARKER'<span>};</span></p>
<p> </p>
<p>% Sampling frequency in Hz, single number</p>
<p>data.fsample = 128;</p>
<p> </p>
<p>% Setting time</p>
<p>[x, filelength] = size(data.trial);</p>
<p>data.time{1} = [1:filelength]./data.fsample;</p>
<p>%% Using the rearranged data</p>
<p> </p>
<p> </p>
<p>% Set the trial column name and event value (what you enter to the last column. </p>
<p>% here enter number 1 as the marker) </p>
<p>cfg.trialdef.eventtype = 'MARKER';</p>
<p>cfg.trialdef.eventvalue = 1;</p>
<p>cfg.trialdef.eventtype = '?';</p>
<p>ft_definetrial(cfg);</p>
<p><br></p><p>%% Preprocessing<br></p>
<p> cfg = [];</p>
<p> cfg.channel = <span>'AF3'</span>;</p>
<p> cfg.lpfilter = <span>'yes'</span>;</p>
<p> cfg.hpfilter = <span>'yes'</span>;</p>
<p> cfg.bsfilter = <span>'yes'</span>;</p>
<p> cfg.lpfreq = 100;</p>
<p> cfg.hpfreq = 10;</p>
<p> cfg.bsfreq = [59 61];</p>
<p> cfg.lpfiltord = 4;</p>
<p> cfg.hpfiltord = 4;</p>
<p> cfg.bpfiltord = 4;</p>
<p> cfg.lpfilttype = <span>'but'</span>;</p>
<p> cfg.hpfilttype = <span>'but'</span>;</p>
<p> ecog = ft_preprocessing(cfg,data);</p><div><br></div><div><br></div><div>When I run the script. I am getting the following error. </div><div><br></div><div><div>Error in ft_trialfun_general (line 78)</div><div>hdr = ft_read_header(cfg.headerfile, 'headerformat',</div><div>cfg.headerformat);</div></div><div><br></div><div>Do I need to set the header structure as well? Can somebody help me to get this fixed. I am reading the documentation but it seems start is bit hard!</div><div><br></div><div>Appreciate your support</div><div><br></div>
</div></div>