MATLAB-GUI-声音图像处理20个模块的程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

%---Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')axes(handles.axes1);plot(y);grid;title('原始声音信号的波形');y1=y(100:199);axes(handles.axes2);plot(y1);grid;title('截取声音信号的波形');%---Executesonbuttonpressinpushbutton18.functionpushbutton18_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton18(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(100:199);axes(handles.axes1);plot(y1);grid;title('截取声音信号的波形');t=0:0.01:2;y2=abs(fft(y1,512));f=100*(0:256)/512;%进行对应的频率转换axes(handles.axes2);plot(f,y2(1:257));grid;title('FFT变换后波形');%---Executesonbuttonpressinpushbutton2.functionpushbutton2_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')axes(handles.axes1);plot(y);grid;title('原始声音信号的波形');y1=fft(y,100);f=0:Fs/99:Fs;axes(handles.axes2);plot(f,abs(y1));grid;title('原始声音信号的频谱');%---Executesonbuttonpressinpushbutton3.functionpushbutton3_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')axes(handles.axes1);plot(y);grid;title('原始声音信号的波形');y1=fft(y,1000);y2=abs(y1);axes(handles.axes2);plot(y2);grid;title('原始声音信号的幅值');xlabel('Hz');ylabel('FuZhi');%---Executesonbuttonpressinpushbutton4.functionpushbutton4_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton4(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')axes(handles.axes1);plot(y);grid;title('原始声音信号的波形');y1=fft(y,1000);y2=angle(y1);axes(handles.axes2);plot(y2);grid;title('原始声音信号的相位');%---Executesonbuttonpressinpushbutton5.functionpushbutton5_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton5(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')axes(handles.axes1);plot(y);grid;title('原始声音信号的波形');t=0:0.001:1;y=randn(size(t));axes(handles.axes2);plot(y),axis([01000-55]),gridon;title('加高斯白噪声的波形')%---Executesonbuttonpressinpushbutton6.functionpushbutton6_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton6(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(1:1000);axes(handles.axes1);plot(y1);grid;title('原始声音信号的波形');axes(handles.axes2);hist(y1);axis();title('直方图');%---Executesonbuttonpressinpushbutton7.functionpushbutton7_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton7(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(1:1000);axes(handles.axes1);plot(y1);grid;title('截取声音信号的波形');N=length(y1);i=1:N;[f,i]=ksdensity(y1);axes(handles.axes2);plot(i,f);grid;xlabel('x');ylabel('f(x)');axis();title('概率密度');%---Executesonbuttonpressinpushbutton8.functionpushbutton8_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton8(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(1:1000);axes(handles.axes1);plot(y1);grid;title('截取声音信号的波形');R=xcorr(y1);axes(handles.axes2);plot(R);grid;title('自相关函数');%---Executesonbuttonpressinpushbutton9.functionpushbutton9_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton9(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(1:1000);axes(handles.axes1);plot(y1);grid;title('截取声音信号的波形');t=0:1/Fs:1;axes(handles.axes2);y2=periodogram(y1,[],1000,Fs);plot(y2);axis();gridontitle('功率谱');%---Executesonbuttonpressinpushbutton10.functionpushbutton10_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton10(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)y=wavread('H:\cw\cw.wav');[y,Fs,bits]=wavread('H:\cw\cw.wav')y1=y(1:1000);axes(handles.axes1);plot(y1);grid;title('截取声音信号的波形');n=length(y1);x=randn(50,n);average=zeros(1,50);fori=1:50forj=1:1000average(i)=average(i)+x(i,j);endaverage(i)=average(i)/1000;endEX=sum(average)/50;axes(handles.axes2);plot(average);grid;title

1 / 12
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功