数字信号处理matlab课程设计Word格式文档下载.docx

上传人:b****1 文档编号:14628600 上传时间:2022-10-23 格式:DOCX 页数:24 大小:281.60KB
下载 相关 举报
数字信号处理matlab课程设计Word格式文档下载.docx_第1页
第1页 / 共24页
数字信号处理matlab课程设计Word格式文档下载.docx_第2页
第2页 / 共24页
数字信号处理matlab课程设计Word格式文档下载.docx_第3页
第3页 / 共24页
数字信号处理matlab课程设计Word格式文档下载.docx_第4页
第4页 / 共24页
数字信号处理matlab课程设计Word格式文档下载.docx_第5页
第5页 / 共24页
点击查看更多>>
下载资源
资源描述

数字信号处理matlab课程设计Word格式文档下载.docx

《数字信号处理matlab课程设计Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《数字信号处理matlab课程设计Word格式文档下载.docx(24页珍藏版)》请在冰豆网上搜索。

数字信号处理matlab课程设计Word格式文档下载.docx

6、用GUI设计一个信号系统的用户界面。

二、实验所要用到的MATLAB函数

1、语音信号的采样与播放

wavread();

[y,fs,bite]=wavread();

%语音信号的采样

sound(y,fs,bite);

%播放语音

2.滤波器:

IIR:

butte();

%巴特沃思滤波器

cheby1();

%切比雪夫I滤波器

elliptical();

%椭圆滤波器

3.频率响应:

[h,f]=freqz(b,a,n,fs)

freqz(b,a,n,fs)

5.快速傅里叶变换

fft(x,n)

6.画曲线

plot(x,y)

stem(x,y)

7.在MATLAB中,设计辅助低通原型巴特沃思和切比雪夫滤波器的阶数和截止频率;

1)利用buttord和cheblord确定阶数;

2)[num,den]=butter(N,Wn),[num,den]=cheby1(N,Wn)

3)lp2hp,lp2bp,lp2bs可以完成低通滤波器到高通,带通,带阻的转换

4)使用biliner对模拟滤波器进行双线性变换,求得数字滤波器的传输函数系数

三、数字滤波器(代码)

1.IIR低通滤波器

fp=1000;

ft=5500;

fs=1200;

wp=2*pi*fp/ft;

ws=2*pi*fs/ft;

Fp=2*ft*tan(wp/2);

Fs=2*ft*tan(ws/2);

[n,Omgc]=buttord(Fp,Fs,1,100,'

s'

);

[z,p,k]=buttap(n);

B=k*real(poly(z));

A=real(poly(p));

[b1,a1]=lp2lp(B,A,Omgc);

[ba1,aa1]=bilinear(b1,a1,ft);

%模拟转数字

[Ha,w]=freqz(ba1,aa1);

%求频率相应

plot(w*ft/(2*pi),20*log10(abs(Ha)));

title('

IIR低通滤波器'

xlabel('

频率/HZ'

ylabel('

幅值'

2.IIR高通滤波器

fp=5000;

ft=25000;

%取抽样频率

fs=4800;

Rp=1;

As=100;

%通带频率

%截止频率

[n,Omgc]=ellipord(Fp,Fs,Rp,As,'

%计算阶数n和截止频率

[z,p,k]=ellipap(n,Rp,As);

B3=k*real(poly(z));

A3=real(poly(p));

[b3,a3]=lp2hp(B3,A3,Omgc);

[ba3,aa3]=bilinear(b3,a3,ft);

[Ha,w]=freqz(ba3,aa3);

IIR高通滤波器'

3.IIR带通滤波器

fp1=1200;

fp2=3000;

fs1=1000;

fs2=3200;

ft=10000;

wp1=2*pi*fp1/ft;

wp2=2*pi*fp2/ft;

ws1=2*pi*fs1/ft;

ws2=2*pi*fs2/ft;

Fp1=2*ft*tan(wp1/2);

Fp2=2*ft*tan(wp2/2);

Fp=[Fp1,Fp2];

Fs1=2*ft*tan(ws1/2);

Fs2=2*ft*tan(ws2/2);

Fs=[Fs1,Fs2];

bw=Fp2-Fp1;

w0=sqrt(Fp1*Fp2);

%通带宽和中心频率

[n,Omgn]=cheb1ord(Fp,Fs,Rp,As,'

[z,p,k]=cheb1ap(n,Rp);

B2=k*real(poly(z));

A2=real(poly(p));

[b2,a2]=lp2bp(B2,A2,w0,bw);

[ba2,aa2]=bilinear(b2,a2,ft);

[Ha,w]=freqz(ba2,aa2);

IIR带通滤波器'

四、总代码

functionvarargout=bzh(varargin)

%BZHM-fileforbzh.fig

%BZH,byitself,createsanewBZHorraisestheexisting

%singleton*.

%

%H=BZHreturnsthehandletoanewBZHorthehandleto

%theexistingsingleton*.

%BZH('

CALLBACK'

hObject,eventData,handles,...)callsthelocal

%functionnamedCALLBACKinBZH.Mwiththegiveninputarguments.

Property'

'

Value'

...)createsanewBZHorraisesthe

%existingsingleton*.Startingfromtheleft,propertyvaluepairsare

%appliedtotheGUIbeforeko_OpeningFunctiongetscalled.An

%unrecognizedpropertynameorinvalidvaluemakespropertyapplication

%stop.Allinputsarepassedtobzh_OpeningFcnviavarargin.

%*SeeGUIOptionsonGUIDE'

sToolsmenu.Choose"

GUIallowsonlyone

%instancetorun(singleton)"

.

%Seealso:

GUIDE,GUIDATA,GUIHANDLES

%Copyright2021-2021TheMathWorks,Inc.

%Edittheabovetexttomodifytheresponsetohelpbzh

%LastModifiedbyGUIDEv2.509-Jan-202108:

54:

22

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('

gui_Name'

mfilename,...

'

gui_Singleton'

gui_Singleton,...

'

gui_OpeningFcn'

@bzh_OpeningFcn,...

gui_OutputFcn'

@bzh_OutputFcn,...

gui_LayoutFcn'

[],...

gui_Callback'

[]);

ifnargin&

&

ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforebzhismadevisible.

functionbzh_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstobzh(seeVARARGIN)

%Choosedefaultcommandlineoutputforbzh

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesbzhwaitforuserresponse(seeUIRESUME)

%uiwait(handles.figure1);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=bzh_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%handlesstructurewithhandlesa

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

当前位置:首页 > 自然科学 > 化学

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

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