How we can calculate Power spectrum of EEG signal?
조회 수: 28 (최근 30일)
이전 댓글 표시
Dear all . I want to calculate power spectrum of single channel eeg . I have coded following but it gives error
??? Subscript indices must either be real positive integers or logicals.
Error in ==> modemotion at 17
plot(ff,pp(0:63)); ylabel('power spectrum
density');xlabel('frequency');title('signal power spectrum');
Please give me how i can short out this.
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1); xlabel('sample'); ylabel('magnitude'); plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
댓글 수: 2
Star Strider
2012년 9월 6일
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1);
xlabel('sample');
ylabel('magnitude');
plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;
d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);
title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63));
ylabel('power spectrum density');
xlabel('frequency');
title('signal power spectrum');
답변 (2개)
Krishnapriya V B
2019년 9월 23일
%%%%%Program to calculate the power spectrum of EEG signal%%%%
clear all;
clc;
data=xlsread('C:\Users\SID\Desktop\emotion regulation post2\emotion\shim1.xlsx');
figure(1); xlabel('sample'); ylabel('magnitude'); plot(data);
legend('14 channel plot of subject1 BASELINE');
data= data';
value1=data(1,:);
chan1= value1-mean(value1);
fs=128;d=1/fs;
t=[0:length(chan1)-1]*d;
figure(2);
plot(chan1);title('original signal');
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(0:63)/128/d;
figure(3);
plot(ff,pp(0:63)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
댓글 수: 2
Ashish Tiwari
2019년 12월 17일
plot(ff,pp( :,1:64)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
do the minor change in your code and you will get your result just look at the last line and change that to this--->>"plot(ff,pp( : ,1:64)); .indexing was not done properly in your mentioned code
Ashish Tiwari
2019년 12월 28일
plot(ff,pp( :,1:64)); ylabel('power spectrum density');xlabel('frequency');title('signal power spectrum');
do the minor change in your code and you will get your result just look at the last line and change that to this--->>"plot(ff,pp( : ,1:64)); .indexing was not done properly in your mentioned code
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!