clear
clc
%在噪声环境下语音信号的增强
%语音信号为读入的声音文件
%噪声为正态随机噪声
sound=wavread('c12345.wav');
count1=length(sound);
noise=0.05*randn(1,count1);
for i=1:count1
signal(i)=sound(i);
end
for i=1:count1
y(i)=signal(i)+noise(i);
end
%在小波基'db3'下进行一维离散小波变换
[coefs1,coefs2]=dwt(y,'db3'); %[低频 高频]
count2=length(coefs1);
count3=length(coefs2);
energy1=sum((abs(coefs1)).^2);
energy2=sum((abs(coefs2)).^2);
energy3=energy1+energy2;
for i=1:count2
recoefs1(i)=coefs1(i)/energy3;
end
for i=1:count3
recoefs2(i)=coefs2(i)/energy3;
end
%低频系数进行语音信号清浊音的判别
zhen=160;
count4=fix(count2/zhen);