语音信号处理实验报告Word文档格式.docx

上传人:b****4 文档编号:14408570 上传时间:2022-10-22 格式:DOCX 页数:27 大小:246KB
下载 相关 举报
语音信号处理实验报告Word文档格式.docx_第1页
第1页 / 共27页
语音信号处理实验报告Word文档格式.docx_第2页
第2页 / 共27页
语音信号处理实验报告Word文档格式.docx_第3页
第3页 / 共27页
语音信号处理实验报告Word文档格式.docx_第4页
第4页 / 共27页
语音信号处理实验报告Word文档格式.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

语音信号处理实验报告Word文档格式.docx

《语音信号处理实验报告Word文档格式.docx》由会员分享,可在线阅读,更多相关《语音信号处理实验报告Word文档格式.docx(27页珍藏版)》请在冰豆网上搜索。

语音信号处理实验报告Word文档格式.docx

N=32'

elseif(i==3),legend('

N=64'

elseif(i==4),legend('

N=128'

elseif(i==5),legend('

N=256'

elseif(i==6),legend('

N=512'

end

(2)加汉明窗

a=a(:

h=hanning(2.^(i-2)*N);

%形成一个汉明窗,长度为2.^(i-2)*N

if(i==2),legend('

2)短时平均过零率

a=wavread('

n=length(a);

N=320;

subplot(3,1,1),plot(a);

h=linspace(1,1,N);

%求卷积得其短时能量函数En

subplot(3,1,2),plot(En);

fori=1:

n-1

ifa(i)>

=0

b(i)=1;

else

b(i)=-1;

end

ifa(i+1)>

b(i+1)=1;

b(i+1)=-1;

w(i)=abs(b(i+1)-b(i));

%求出每相邻两点符号的差值的绝对值

end

k=1;

j=0;

while(k+N-1)<

n

Zm(k)=0;

fori=0:

N-1;

Zm(k)=Zm(k)+w(k+i);

j=j+1;

k=k+N/2;

%每次移动半个窗

forw=1:

j

Q(w)=Zm(160*(w-1)+1)/(2*N);

%短时平均过零率

subplot(3,1,3),plot(Q),grid;

3)自相关函数

N=240

y=wavread('

y=y(:

x=y(13271:

13510);

x=x.*rectwin(240);

R=zeros(1,240);

fork=1:

240

forn=1:

240-k

R(k)=R(k)+x(n)*x(n+k);

j=1:

240;

plot(j,R);

grid;

实验二基于MATLAB分析语音信号频域特征

1)短时谱

clear

subplot(2,1,1),

plot(a);

title('

originalsignal'

grid

N=256;

h=hamming(N);

form=1:

N

b(m)=a(m)*h(m)

end

y=20*log(abs(fft(b)))

subplot(2,1,2)

plot(y);

短时谱'

2)语谱图

[x,fs,nbits]=wavread('

x=x(:

specgram(x,512,fs,100);

xlabel('

时间(s)'

ylabel('

频率(Hz)'

语谱图'

3)倒谱和复倒谱

(1)加矩形窗时的倒谱和复倒谱

clear

[4000,4350]);

N=300;

b(m)=a(m)*h(m);

c=cceps(b);

c=fftshift(c);

d=rceps(b);

d=fftshift(d);

subplot(2,1,1)

plot(d);

加矩形窗时的倒谱'

plot(c);

加矩形窗时的复倒谱'

(2)加汉明窗时的倒谱和复倒谱

a=a(;

加汉明窗时的倒谱'

加汉明窗时的复倒谱'

实验三基于MATLAB的LPC分析

MusicSource=wavread('

MusicSource=MusicSource(:

Music_source=MusicSource'

;

N=256;

%windowlength,N=100--1000;

Hamm=hamming(N);

%createHammingwindow

frame=input('

请键入想要处理的帧位置='

%originiscurrentframe

origin=Music_source(((frame-1)*(N/2)+1):

((frame-1)*(N/2)+N));

Frame=origin.*Hamm'

%

%ShortTimeFourierTransform

[s1,f1,t1]=specgram(MusicSource,N,N/2,N);

[Xs1,Ys1]=size(s1);

fori=1:

Xs1

FTframe1(i)=s1(i,frame);

N1=input('

请键入预测器阶数='

%N1ispredictor'

sorder

[coef,gain]=lpc(Frame,N1);

%LPCanalysisusingLevinson-Durbinrecursion

est_Frame=filter([0-coef(2:

end)],1,Frame);

%estimateframe(LP)

FFT_est=fft(est_Frame);

err=Frame-est_Frame;

%error

%FFT_err=fft(err);

subplot(2,1,1),plot(1:

N,Frame,1:

N,est_Frame,'

-r'

原始语音帧vs.预测后语音帧'

subplot(2,1,2),plot(err);

误差'

pause

%subplot(2,1,2),plot(f'

20*log(abs(FTframe2)));

%GainsolutionusingG^2=Rn(0)-sum(ai*Rn(i)),i=1,2,...,P

fLength(1:

2*N)=[origin,zeros(1,N)];

Xm=fft(fLength,2*N);

X=Xm.*conj(Xm);

Y=fft(X,2*N);

Rk=Y(1:

N);

PART=sum(coef(2:

N1+1).*Rk(1:

N1));

G=sqrt(sum(Frame.^2)-PART);

A=(FTframe1-FFT_est(1:

length(f1'

)))./FTframe1;

%inversefilterA(Z)

subplot(2,1,1),plot(f1'

20*log(abs(FTframe1)),f1'

(20*log(abs(1./A))),'

subplot(2,1,2),plot(f1'

(20*log(abs(G./A))));

LPC谱'

%plot(abs(ifft(FTframe1./(G./A))));

excited'

%plot(f1'

20*log(abs(FFT_est(1:

)).*A/G)));

%pause

%find_pitch

temp=FTframe1-FFT_est(1:

));

%notmovehigherfrequnce

pitch1=log(abs(temp));

pLength=length(pitch1);

result1=ifft(pitch1,N);

%movehigherfrequnce

pitch1((pLength-32):

pLength)=0;

result2=ifft(pitch1,N);

%directdorealcepstrumwitherr

pitch=fftshift(rceps(err));

origin_pitch=fftshift(rceps(Frame));

subplot(211),plot(origin_pitch);

原始语音帧倒谱(直接调用函数)'

subplot(212),plot(pitch);

预测误差倒谱(直接调用函数)'

subplot(211),plot(1:

length(result1),fftshift(real(result1)));

预测误差倒谱(根据定义编写,没有去除高频分量)'

subplot(212),plot(1:

length(result2),fftshift(real(result2)));

预测误差倒谱(根据定义编写,去除高频分量)'

实验四基于VQ的特定人孤立词语音识别研究

1、mfcc.m

functionccc=mfcc(

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 合同协议

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1