How to do eeg preprocessing

16 ビュー (過去 30 日間)
sukam
sukam 2020 年 11 月 23 日
コメント済み: Abdullah Abdullah 2023 年 2 月 18 日
Hi all ,
i am trying to implement a code for the sake of preprocessig an eeg signals, however i coudnt understand without comments added
Could anyone explain a bit if should add any toolbox and if i should create any folder . please add comments if possible
dataFolder='D:\Data\BCICIV_1\';
files=dir([dataFolder 'BCICIV_ca*.mat']);
ref=[];
for s=1:length(files)
s
load([dataFolder files(s).name]); fs=nfo.fs;
EEG=.1*double(cnt);
b=fir1(50,2*[8 30]/nfo.fs);%FIRfiltDesign(nfo.fs,8,30,[],[],1)
EEG=filter(b,1,EEG);
y=mrk.y'; %(-1 for class one or 1 for class two)
nTrials=length(y);
X=nan(size(EEG,2),300,nTrials);
for i=1:nTrials
X(:,:,i)=EEG(mrk.pos(i)+0.5*nfo.fs:mrk.pos(i)+3.5*nfo.fs-1,:)'; % [0.5-3.5] seconds epoch, channels*Times
end
save(['./Data1/A' num2str(s) '.mat'],'X','y','fs');
end
thans all in advance
  1 件のコメント
Abdullah Abdullah
Abdullah Abdullah 2023 年 2 月 18 日
Replace the line X=nan(size(EEG,2),300,nTrials); by X=nan(size(EEG,2),3000,nTrials);
3000 not 300.

サインインしてコメントする。

回答 (1 件)

Jonas
Jonas 2020 年 11 月 23 日
You should use breakpoints to step by step understand the code. Seems to use fairly basic MATLAB commands.
Regarding toolboxes, if you want to run this code, you will need the Signal Processing Toolbox to be able to use the 'fir1' function. This function is used to create a bandpass filter with a window passband as input parameter.

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by