MATLABGUI声音图像处理20个模块的程序.docx

上传人:b****3 文档编号:11613327 上传时间:2023-06-01 格式:DOCX 页数:16 大小:16.33KB
下载 相关 举报
MATLABGUI声音图像处理20个模块的程序.docx_第1页
第1页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第2页
第2页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第3页
第3页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第4页
第4页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第5页
第5页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第6页
第6页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第7页
第7页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第8页
第8页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第9页
第9页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第10页
第10页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第11页
第11页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第12页
第12页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第13页
第13页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第14页
第14页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第15页
第15页 / 共16页
MATLABGUI声音图像处理20个模块的程序.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

MATLABGUI声音图像处理20个模块的程序.docx

《MATLABGUI声音图像处理20个模块的程序.docx》由会员分享,可在线阅读,更多相关《MATLABGUI声音图像处理20个模块的程序.docx(16页珍藏版)》请在冰点文库上搜索。

MATLABGUI声音图像处理20个模块的程序.docx

MATLABGUI声音图像处理20个模块的程序

%---Executesonbuttonpressinpushbutton1.

functionpushbutton1_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton1(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

Forpersonaluseonlyinstudyandresearch;notforcommercialuse

y=wavread('H:

\cw\cw.wav');

[y,Fs,bits]=wavread('H:

\cw\cw.wav')

axes(handles.axes1);

Forpersonaluseonlyinstudyandresearch;notforcommercialuse

plot(y);

grid;

title('原始声音信号的波形');

Forpersonaluseonlyinstudyandresearch;notforcommercialuse

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();

gridon

title('功率谱');

%---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:

50

forj=1:

1000

average(i)=average(i)+x(i,j);

end

average(i)=average(i)/1000;

end

EX=sum(average)/50;

axes(handles.axes2);

plot(average);

grid;

title('截取声音信号的均值')

%---Executesonbuttonpressinpushbutton11.

functionpushbutton11_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton11(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:

50

forj=1:

1000

average(i)=average(i)+x(i,j);

end

average(i)=average(i)/1000;

end

EX=sum(average)/50;

variance=zeros(1,50);

fori=1:

50

forj=1:

1000

variance(i)=variance(i)+(x(i,j)-average(i)).^2;

end

variance(i)=variance(i)/1000;

end

DX=sum(variance)/50;

axes(handles.axes2);

plot(variance);

grid;

title('截取声音信号的方差');

%---Executesonbuttonpressinpushbutton12.

functionpushbutton12_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton12(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);

square=zeros(1,50);

fori=1:

50

forj=1:

1000

square(i)=square(i)+x(i,j).^2;

end

square(i)=square(i)/1000;

end

RMS=sum(square)/50;

axes(handles.axes2);

plot(square);

grid;

title('截取声音信号的均方值');

%---Executesonbuttonpressinpushbutton13.

functionpushbutton13_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton13(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('截取声音信号的波形');

h=[ones(1,10)zeros(1,10)];

y2=conv(h,y1);

axes(handles.axes2);

stem(y2,'.');

grid;

title('截取声音信号的卷积');

%---Executesonbuttonpressinpushbutton14.

functionpushbutton14_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton14(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('截取声音信号的波形');

A=[1,-1.8237,0.9801];

B=[1/100.49,0,-1/100.49];

Y=filter(B,A,y1);%对声音滤波

axes(handles.axes2);

stem(Y,'.');

grid;

title('截取声音信号的响应');

%---Executesonbuttonpressinpushbutton15.

functionpushbutton15_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton15(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('截取声音信号的波形');

Y=fft(y1,50);

axes(handles.axes2);

stem(Y,'.');

axis();

grid;

title('截取声音信号的DFT波形');

xlabel('w/pi');

ylabel('Fuzhi');

%---Executesonbuttonpressinpushbutton16.

functionpushbutton16_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton16(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('截取声音信号的波形');

n=length(y1);

window=boxcar(n);

[h,w]=freqz(window,1);%求数字滤波器的复频率响应

axes(handles.axes2);

stem(window);

title('加矩形窗后的波形');

figure

(1);

plot(w/pi,20*log(abs(h)/abs(h

(1))));

grid;

title('加矩形窗后的频率分析');

%---Executesonbuttonpressinpushbutton17.

functionpushbutton17_Callbac

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

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2