How to load a specific channel from EEG into MATLAB

조회 수: 19 (최근 30일)
David Lee
David Lee 2018년 11월 28일
댓글: David Lee 2018년 11월 29일
Hi. I am just new to EEG and also MATLAB. Currently, I am having a 14 channels EEG data, however I need only signal from 2 specific channel for analysis. How can I load the only 2 channels into MATLAB using edfread? Then, I am able to convert the data into frequency domain with the following codes but it is converting all 14 channels. Therefore, what should I modify from the existing code to get only 2 channel of signal being converted?
[header,data] = edfread("data.edf");
S = data;
y=fft(S);
PS=abs(y);
N=length(S);
fs=128;
freq=(1:N)*fs/N;
plot(freq,PS)
Your help will be highly appreciated. Thanks

채택된 답변

dpb
dpb 2018년 11월 28일
편집: dpb 2018년 11월 28일
Often unless data files are simply humongous, it's just simpler to read it all in and then selectively keep what you're interested in...
nKeep=[3 11]; % arbitary selection; write some user input code to set the desired channel(s)
[header,S] = edfread("data.edf");
S = S(:,nKeep); % keep only the desired channels..
...
Carry on from there as before...
  댓글 수: 1
David Lee
David Lee 2018년 11월 29일
Thanks for your answer. Is it meaning that if I want to select only channel (e.g: channel 7), the code will be like below: ?
nKeep = 7;
[header,S] = edfread("data.edf");
S = S(:,nKeep);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by