资源简介
matlab 基于双门限的端点检测
小波分解,提取高频系数,计算能量,然后设定双阈值实现检测
代码片段和文件信息
clc;close all;clear all;
signal=wavread(‘G:\abonrmalsounddetect\VOICE003.wav‘);
%signal1=flipud(signal);
framelen=2048;framewap=1024;
temp=enframe(signalframelenframewap); %信号分帧
framelen1=512;framewap1=8;
point=size(temp);
for i=1:point(1)
[cl]=wavedec(temp(i1:2048)3‘db6‘); %小波变换
coefficent=c(1051:2079); %高频系数提取
energywav(i)=sum(abs(coefficent)2); %直接由小波系数计算能量--1
temp1=enframe(coefficentframelen1framewap1);%二次分帧求取平均能量--2
for j=1:size(temp1)
energy(j)=sum(abs(temp1(j))2); %2的分能量,3的能量
% energy(j)=abs(temp1(j));
end
energycoe(i)=mean(energy);
temp2=enframe(coefficentframelen164); %二次分帧求取平均能量--3
for j=1:size(temp2)
energy(j)=sum(abs(temp2(j))2); %3的能量
% energy(j)=abs(temp2(j));
end
energyfra(i)=mean(energy);
for n=1:size(temp2) %3--异常检测
if energy(n)-energyfra(i)>energy(n)*0.7
resultfra(i)=1;
else resultfra(i)=0;
end
end
end
% energymean=medfilt1(energymean3);
for i=1:point(1)-1
throsholdcoe(i)=0;throsholdwav(i)=0;
if i>2
throsholdwav(i)=1.15*(energywav
- 上一篇:hopfield网络解决TSP问题
- 下一篇:Simuli
nk FFT模块
评论
共有 条评论