wavelete_energy_decompose.m
上传用户:xhrjvip
上传日期:2020-11-07
资源大小:2k
文件大小:1k
- function [x_delta,x_theta,x_apha,x_beta]=wavelete_energy_decompose(x)
- %小波分解
- [c,l]=wavedec(x,8,'db3');
- %下面的程序是对信号用小波进行分解。
- ca8=wrcoef('a',c,l,'db3',8);%心电、眼电干扰
- cd8=wrcoef('d',c,l,'db3',8);%0.41~0.82 delta波
- cd7=wrcoef('d',c,l,'db3',7);%0.82~1.64 delta波
- cd6=wrcoef('d',c,l,'db3',6);%1.64~3.28 delta波
- cd5=wrcoef('d',c,l,'db3',5);%3.28~6.56 theta波
- cd4=wrcoef('d',c,l,'db3',4);%6.56~13.13 apha波
- cd3=wrcoef('d',c,l,'db3',3);%13.13~26.25 beta波
- cd2=wrcoef('d',c,l,'db3',2);%26.25~52.25 高频噪声
- cd1=wrcoef('d',c,l,'db3',1);%52.25~105 高频噪声
- %下面的程序时对小波分解的近似信号的系数提取
- %N=[1,2,3,4,5,6,7,8];
- %[D1,D2,D3,D4,D5,D6,D7,D8]=detcoef(c,l,[N(1),N(2),N(3),N(4),N(5),N(6),N(7),N(8)]);
- %%%对delta系数求绝对和
- %x_delta=sum(abs(D8)^2)+sum(abs(D7)^2)+sum(abs(D6)^2);
- x_delta=sum(abs((cd8)).^2)+sum(abs((cd7)).^2)+sum(abs((cd6)).^2);
- %%%theta系数
- %x_theta=sum(abs(D5)^2);
- x_theta=sum(abs((cd5)).^2);
- %%%apha系数
- %x_apha=sum(abs(D4)^2);
- x_apha=sum(abs((cd4)).^2);
- %%%beta系数
- %x_beta=sum(abs(D3)^2);
- x_beta=sum(abs((cd3)).^2);
- %%%能量归一化
- energy_sum=x_delta+x_theta+x_apha+x_beta;
- x_delta=x_delta/energy_sum;
- x_theta=x_theta/energy_sum;
- x_apha=x_apha/energy_sum;
- x_beta=x_beta/energy_sum;