How we can calculate Power spectrum of EEG signal?

조회 수: 28 (최근 30일)
siddhartha chandel
siddhartha chandel 2012년 9월 6일
댓글: Keerthivasan M 2022년 11월 14일
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
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');
shivani puranik
shivani puranik 2016년 6월 27일
but the error remains the same

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

답변 (2개)

Krishnapriya V B
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
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
Keerthivasan M
Keerthivasan M 2022년 11월 14일
which date to be load

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


Ashish Tiwari
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

카테고리

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