语音信号处理实验报告集锦_第1页
语音信号处理实验报告集锦_第2页
语音信号处理实验报告集锦_第3页
语音信号处理实验报告集锦_第4页
语音信号处理实验报告集锦_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

语音信号处理实验报告集锦【实验一】实验题目Shorttimeanalysis(短时间分析)实验要求WriteaMATLABprogramtoanalyzeaspeechandsimultaneously,onasinglepage,plotthefollowingmeasurements:1.theentirespeechwaveform2.theshort-timeenergy,En3.theshort-timemagnitude,Mn4.theshort-timezero-crossing,Zn5.thenarrowbandspectrogram6.thewidebandspectrogramUseboththespeechwaveformsinthewznjdx_normal.wav.Chooseappropriatewindowsizes,windowshifts,andwindowfortheanalysis.Explainyourchoiceoftheseparameters.写一个程序来分析语音的同时,在一个单页,情节如下措施:1。整个语音波形2。短时间能量3。短时幅度,锰4。短时过零,锌5。窄带语谱图6。宽带语谱图在wznjdx_normal.wav使用语音波形。选择合适的窗口大小,窗口移动和窗口进行分析。解释你对这些参数的选择。实验程序clear[x,fs]=wavread('wznjdx_normal.wav');n=length(x);N=320;subplot(4,1,1);plot(x);h=linspace(1,1,N);En=conv(h,x.*x);subplot(4,1,2);plot(En);Mn=conv(h,abs(x));subplot(4,1,3);plot(Mn);fori=1:n-1ifx(i)>=0y(i)=1;elsey(i)=-1;endifx(i+1)>=0y(i+1)=1;elsey(i+1)=-1;endw(i)=abs(y(i+1)-y(i));endk=1;j=0;while(k+N-1)<nZm(k)=0;fori=0:N-1Zm(k)=Zm(k)+w(k+i);endj=j+1;k=k+N/2;endforw=1:jQ(w)=Zm(160*(w-1)+1)/(2*N);endsubplot(4,1,4);plot(Q);grid;figure(2);subplot(2,1,1);spectrogram(x,h,256,200,0.0424*fs);subplot(2,1,2);spectrogram(x,h,256,200,0.0064*fs);实验结果语谱图:(Matlab7.0用不了spectrogram)【实验二】实验题目Homomorphicanalysis同态分析实验要求WriteaMATLABprogramtocomputetherealcepstrumsofasectionofvoicedspeechandunvoicedspeech.Plotthesignal,thelogmagnitudespectrum,therealcepstrum,andthelowpasslifteredlogmagnitudespectrum.写一个程序来计算实际倒谱一段浊音和清音。小区的信号,对数幅度谱,真正的倒谱,和低通liftered对数幅度谱。三、实验程序nfft=256;[x,fs]=wavread('wznjdx_normal.wav');fx=x;Xvm=log(abs(fft(fx,nfft)));xhv=real(ifft(Xvm,nfft));lifter=zeros(1,nfft);lifter(1:30)=1;lifter(nfft-28:nfft)=1;fnlen=0.02*fs;%20mswin=hamming(fnlen);%加窗n=fnlen;%窗宽度赋给循环自变量nnoverlap=0.5*fnlen;while(n<=length(x)-1)fx=x(n-fnlen+1:n).*win;n=n+noverlap;endxhvp=xhv.*lifter';figure;subplot(4,1,1)plot(lifter);title('倒谱滤波器');subplot(4,1,2)plot(x);title('语音信号波形');subplot(4,1,3)plot(Xvm);title('Xvm');subplot(4,1,4)plot(xhv);title('xhv');四、实验结果【实验三】一、实验题目LPanalysis线性分析二、实验要求WriteaMATLABprogramtoconvertfromaframeofspeechtoasetoflinearpredictioncoefficients.PlottheLPCspectrumsuperimposedonthecorrespondingSTFT.写一个程序将从语音到一组线性预测系数的框架。情节的LPC谱叠加在相应的变换。三、实验程序clear;[x,fs]=wavread('wznjdx_normal.wav');fx=x(4000:4160-1);p=10;[a,e,k]=aryule(fx,p);G=sqrt(e*length(fx));f=log(abs(fft(fx)));h0=zeros(1,160);h=log(G)-log(abs(fft(a,160)));figure(1);subplot(211);plot(fx);subplot(212);plot(f);holdon;plot((0:160-1),h,'r');四、实验结果【实验四】一、实验题目Pitchestimation二、实验内容Writeaprogramtoimplementthepitchestimationandthevoiced/unvoiceddecisionusingtheLPC-basedmethod.三、实验程序clear[x,fs]=wavread('wznjdx_normal.wav');n=length(x);Q=x';NFFT=512;N=256;Hamm=hamming(N);frame=30;M=Q(((frame-1)*(N/2)+1):((frame-1)*(N/2)+N));Frame=M.*Hamm';%lowpassfilter[b2,a2]=butter(2,900/4000);speech2=filter(b2,a2,Frame);%filter%residual[a,e]=lpc(speech2,20);errorlp=filter(a,1,speech2);%residual%Short-termautocorrelation.re=xcorr(errorlp);%Findmaxautocorrelationforlagsintheintervalminlagtomaxlag.minlag=17;%F0:450Hzmaxlag=160;%F0:50Hzfnlen=256;[remax,idx]=max(re(fnlen+minlag:fnlen+maxlag));figuresubplot(3,1,1);plot(Frame);subplot(3,1,2);plot(speech2);subplot(3,1,3);plot(re);text(500,0,'idx');idx=idx-1+minlagremax四、实验结果【实验五】一、实验题目Speechsynthesis语音合成二、实验内容WriteaprogramtoanalyzeaspeechandsynthesizeitusingtheLPC-basedmethod.写一个程序来分析语音和综合使用LPC法。三、实验程序主程序clear;[x,sr]=wavread('wznjdx_normal.wav');p=[1-0.9];x=filter(p,1,x);N=256;inc=128;y=lpcsyn(x,N,inc);wavplay(y,sr);子程序lpcsynfunctiony=lpcsyn(x,N,inc)%[x,sr]=wavread('wznjdx_normal.wav');%pre=[1-0.97];%x=filter(pre,1,x);%N=256;%inc=128;fn=floor(length(x)/inc);y=zeros(1,50000);for(i=1:fn)order=16;x(1:N,i)=x((i-1)*inc+1:(i+1)*inc);[A(i,:),G(i),P(i),fnlen,fnshift]=lpcana(x(1:N,i),order);if(P(i))%Voicedframe.e=zeros(N,1);e(1:P(i):N)=1;%Impulse-trainexcitation.else%Unvoicedframe.e=randn(N,1);%Whitenoiseexcitation.endyt=filter(G(i),A(i,:),e);j=(i-1)*inc+[1:N];y(j)=y(j)+yt';end;end子程序lpcanafunction[A,G,P,fnlen,fnshift]=lpcana(x,order)fnlen=256;fnshift=fnlen/2;n=length(x);[b2,a2]=butter(2,900/4000);speech2=filter(b2,a2,x);[A,e]=lpc(speech2,order);errorlp=filter(A,1,speech2);re=xcorr(errorlp);G=sqrt(e*length(speech2));minlag=17;maxlag=160;[remax,idx]=max(re(n+minlag:n+maxlag));P=idx-1+minlag;end四、实验结果【实验六】一、实验题目Speechenhancement语音增强二、实验内容Writeaprogramtoimplementthebasicspectralmagnitudesubtraction.编写一个程序,实现基本的谱幅度减法。三、实验程序clear[speech,fs,nbits]=wavread('wznjdx_normal.wav');%读入数据alpha=0.04;%噪声水平winsize=256;%窗长size=length(speech);%语音长度numofwin=floor(size/winsize);%帧数hamwin=zeros(1,size);%定义汉明窗长度enhanced=zeros(1,size);%定义增强语音的长度ham=hamming(winsize)';%%产生汉明窗x=speech'+alpha*randn(1,size);%信号加噪声noisy=alpha*randn(1,winsize);%噪声估计N=fft(noisy);nmag=abs(N);%噪声功率谱%分帧forq=1:2*numofwin-1frame=x(1+(q-1)*winsize/2:winsize+(q-1)*winsize/2);%对带噪语音帧间重叠一半取值hamwin(1+(q-1)*winsize/2:winsize+(q-1)*winsize/2)=...hamwin(1+(q-1)*winsize/2:winsize+(q-1)*winsize/2)+ham;%加窗y=fft(frame.*ham);

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论