%原始信号
[y,fs,nbits]=wavread ('C:\Users\Administrator.WIN7U-20150423O\Desktop\1.wav');
%把语音信号进行加载入Matlab 仿真软件平台中
sound(y,fs,nbits); %回放语音信号
n = length (y) %求出语音信号的长度
Y=fft(y,n); %快速傅里叶变换
figure(1)
subplot(2,1,1);plot(y);title('原始信号波形');
grid;
subplot(2,1,2);plot(abs(Y));title('原始信号频谱');
grid;
%经滤波后波形
N=240
y=WAVREAD('C:\Users\Administrator.WIN7U-20150423O\Desktop\1.wav'),
[1 18000];
L=length(y)%30秒,每秒8000个点,一共240000个点
LL=length(y)/N %一共 1000帧 %短时能量
figure(2)
F1 = enframe(y,200);
eng = sum(F1.^2);
plot(eng);xlabel('帧');ylabel('短时平均能量');title('短时能量')
%短时平均幅度Mn=sum(abs(Y))/N
figure(3)
F2 = enframe(y,200);
eng = sum(abs(F2));
plot(eng);xlabel('帧');ylabel('短时平均幅度');title('短时平均幅度');
%分帧函数
function f=enframe(x,win,inc)
nx=length(x(:));
len = win;
if (nargin < 3)
inc = len;
end
nf = fix((nx-len+inc)/inc);
f=zeros(nf,len);
indf= inc*(0:(nf-1)).';
inds = (1:len);
f(:) = x(indf(:,ones(1,len))+inds(ones(nf,1),:));
f = f';
%短时自相关函数
[y,fs,N]=wavread ('C:\Users\Administrator.WIN7U-20150423O\Desktop\1.wav');
F = enframe(y,200);
figure(4)
f5 = F(:,5);
out8=autocorr(f5);
subplot(2,1,1);plot(f5);xlabel('样点');title('浊音帧波形图');
subplot(2,1,2);plot(out8);xlabel('延时');title('浊音帧短时');