lylea
Newbie level 1
Bandpower calculation
Hi,
I'm trying to calculate the bandpower of two frequency range,F on EEG signal as in the matlab programme below.This is not my programme,so I'm not fully understand how this program works.especially on "bp = [bp,log(filter(ones(W*fs,1),W*fs,filter(B,1,tmp).^2 ))];".
Is there anyone understand;
1)why log is used in this bandpower calculation?
2)Why there is two 'filter' is used in that line?
3)where exactly the bandpower calculation is done?why there is no 'trapz' to calculate the bandpower?
Thanx in advance.
s=load(data); %data name
fs=256;
W=1; %window size=1sec
F = [1,4;5,8]; %filter cutoff freq
bp = [];
tmp = s;
tmp(isnan(tmp))=0;
for k=1:size(F,1),
B = fir1(fs,F(k, / fs*2); %filter coefficient
bp = [bp,log(filter(ones(W*fs,1),W*fs,filter(B,1,tmp).^2 ))];
end;
Hi,
I'm trying to calculate the bandpower of two frequency range,F on EEG signal as in the matlab programme below.This is not my programme,so I'm not fully understand how this program works.especially on "bp = [bp,log(filter(ones(W*fs,1),W*fs,filter(B,1,tmp).^2 ))];".
Is there anyone understand;
1)why log is used in this bandpower calculation?
2)Why there is two 'filter' is used in that line?
3)where exactly the bandpower calculation is done?why there is no 'trapz' to calculate the bandpower?
Thanx in advance.
s=load(data); %data name
fs=256;
W=1; %window size=1sec
F = [1,4;5,8]; %filter cutoff freq
bp = [];
tmp = s;
tmp(isnan(tmp))=0;
for k=1:size(F,1),
B = fir1(fs,F(k, / fs*2); %filter coefficient
bp = [bp,log(filter(ones(W*fs,1),W*fs,filter(B,1,tmp).^2 ))];
end;