Borrar filtros
Borrar filtros

How to do eeg preprocessing

6 visualizaciones (últimos 30 días)
sukam
sukam el 23 de Nov. de 2020
Comentada: Abdullah Abdullah el 18 de Feb. de 2023
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 comentario
Abdullah Abdullah
Abdullah Abdullah el 18 de Feb. de 2023
Replace the line X=nan(size(EEG,2),300,nTrials); by X=nan(size(EEG,2),3000,nTrials);
3000 not 300.

Iniciar sesión para comentar.

Respuestas (1)

Jonas
Jonas el 23 de Nov. de 2020
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.

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by