对一组连续电信号自动依次提取感兴趣活动段,检测并记录每一个小段的开始点与结束点的坐标值。
如上图所示,有12个感兴趣的活动段,检测出这12个段,并在原数据的位置上依次标出每一个小段的开始与结束坐标值。我用的是8通道的信号,输入数据格式为:行数为数据长度,列数为各个通道。自行设定端检测与结束的阈值,这里用的阈值是能量值和方差值。帧长和帧移都自己设定,这里用的是64和20.
function[p]=point_detection(data)
data=double(data);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%各列数据归一化
data1=data(:,1)/max(abs(data(:,1)));
data2=data(:,2)/max(abs(data(:,2)));
data3=data(:,3)/max(abs(data(:,3)));
data4=data(:,4)/max(abs(data(:,4)));
data5=data(:,5)/max(abs(data(:,5)));
data6=data(:,6)/max(abs(data(:,6)));
data7=data(:,7)/max(abs(data(:,7)));
data8=data(:,8)/max(abs(data(:,8)));
m=size(data,1);%data行数
frame_len=64;%帧长、帧移、能量和方差阈值
frame_inc=20;
energy=4;
sum_s=3;
%分帧
channal1 = enframe(data1,frame_len,frame_inc);
channal2 = enframe(data2,frame_len,frame_inc);
channal3 = enframe(data3,frame_len,frame_inc);
channal4 = enframe(data4,frame_len,frame_inc);
channal5 = enframe(data5,frame_len,frame_inc);
channal6 = enframe(data6,frame_len,frame_inc);
channal7 = enframe(data7,frame_len,frame_inc);
channal8 = enframe(data8,frame_len,frame_inc);
fn=size(channal1,1);
energy_frame=zeros(1,fn);
sum_s_frame=zeros(1,fn);
channal_energy=zeros(1,8);%要与上面的数量一致,这里是3;
channal_sum_s=zeros(1,8);%要与上面的数量一致,这里是3;
for i=1:fn
channal_energy(1)=sum(channal1(i,:).^2);
channal_energy(2)=sum(channal2(i,:).^2);
channal_energy(3)=sum(channal3(i,:).^2);
channal_energy(4)=sum(channal4(i,:).^2);
channal_energy(5)=sum(channal5(i,:).^2);
channal_energy(6)=sum(channal6(i,:).^2);
channal_energy(7)=sum(chan