Dear Members
I get the SPWVD result by using funciton tfrspwv. Now I want to get energy in different frequency bands. So i used the function margtfr. Unfortunately, i meet some problems.
I define four frequency bands as VLF(0-0.04Hz), LF(0.04-0.15Hz),HF(0.15-0.4Hz) and AF(0-0.4Hz). In my opinion, they must satisfy the equation of energy: E_AF=E_VLF+E_LF+E_HF
When I use margtfr to get energy of these band, the result can't satisfy the equation.
The commands I used to get energy:
f_VLF_1=0;f_VLF_2=0.04;
p_VLF=find(f_tfr>=f_VLF_1 & f_tfr<=f_VLF_2);
f_VLF=f_tfr(p_VLF);
t_VLF=t_tfr;
tfr_VLF=tfr(p_VLF,:);
[margt_VLF,margf_VLF,E_VLF]=margtfr(tfr_VLF,t_VLF,f_VLF);
I want to know where wrong is in my program.
Thank you !!