300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 【滤波器】基于matlab GUI IIR+FIR数字滤波器设计【含Matlab源码 698期】

【滤波器】基于matlab GUI IIR+FIR数字滤波器设计【含Matlab源码 698期】

时间:2022-09-26 15:46:17

相关推荐

【滤波器】基于matlab GUI IIR+FIR数字滤波器设计【含Matlab源码 698期】

一、获取代码方式

获取代码方式1:

完整代码已上传我的资源: 【滤波器】基于matlab GUI IIR+FIR数字滤波器设计【含Matlab源码 698期】

获取代码方式2:

通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、数字滤波器设计简介

1 设计原理

1.1 滤波器概念

1.2 数字滤波器的系统函数和差分方程

1.3 数字滤波器结构的表示

1.4 数字滤波器的分类

2.1 IIR滤波器与FIR滤波器的分析比较

2.2 FIR滤波器的原理

3 FIR滤波器的仿真步骤

三、部分源代码

function varargout = filter_2(varargin)% FILTER_2 MATLAB code for filter_2.fig%FILTER_2, by itself, creates a new FILTER_2 or raises the existing%singleton*.%%H = FILTER_2 returns the handle to a new FILTER_2 or the handle to%the existing singleton*.%%FILTER_2('CALLBACK',hObject,eventData,handles,...) calls the local%function named CALLBACK in FILTER_2.M with the given input arguments.%%FILTER_2('Property','Value',...) creates a new FILTER_2 or raises the%existing singleton*. Starting from the left, property value pairs are%applied to the GUI before filter_2_OpeningFcn gets called. An%unrecognized property name or invalid value makes property application%stop. All inputs are passed to filter_2_OpeningFcn via varargin.%%*See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one%instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help filter_2% Last Modified by GUIDE v2.5 16-May- 12:02:23% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @filter_2_OpeningFcn, ...'gui_OutputFcn', @filter_2_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});elsegui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before filter_2 is made visible.function filter_2_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to filter_2 (see VARARGIN)global response;global analog;global window1;global digital;global analog_choose;response=1;analog=1;analog_choose=1;window1=1;digital=1;%set(handles.function_value,'String','Butterworth');%set(handles.method_value,'String','direct form');set(handles.order,'Enable','off');% Choose default command line output for filter_2handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes filter_2 wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = filter_2_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes on button press in IIR_button.function IIR_button_Callback(hObject, eventdata, handles)% hObject handle to IIR_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global analog_choose;global response;global analog;if(get(hObject,'Value')==1) %当选中IIR时屏蔽FIR模块set(handles.order_information,'String','order');set(handles.FIR_button,'Value',0);set(handles.filter_information,'String','IIR');set(handles.window_function,'Enable','off');set(handles.order,'Enable','off');set(handles.view_window,'Enable','off');set(handles.analog_filter,'Enable','on');set(handles.Apass,'Enable','on');set(handles.Astop,'Enable','on');set(handles.order,'Enable','off');set(handles.specify_order,'Enable','on'); set(handles.specify_order,'Value',0);%对阶数的处理set(handles.custom_order,'Enable','on');set(handles.custom_order,'String','');set(handles.min_order,'Enable','on');set(handles.min_order,'Value',0);%get(handles.analog_method,'Value');if( analog_choose==1)set(handles.method_value,'String','direct form');elseset(handles.method_value,'String','bilinear');endswitch(analog)case 1set(handles.function_value,'String','Butterworth');case 2set(handles.function_value,'String','chebyshev1');case 3set(handles.function_value,'String','chebyshev2');endswitch(response)case 1set(handles.type_information,'String','Lowpass');case 2set(handles.type_information,'String','Highpass');case 3set(handles.type_information,'String','Bandpass');case 4set(handles.type_information,'String','Bandstop');endelseset(handles.window_function,'Enable','on');set(handles.order,'Enable','on');set(handles.view_window,'Enable','on');set(handles.order,'Enable','on');end% Hint: get(hObject,'Value') returns toggle state of IIR_button% --- Executes on button press in FIR_button.function FIR_button_Callback(hObject, eventdata, handles)% hObject handle to FIR_button (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global digital;global response;global window1;if(get(hObject,'Value')==1) %当选中FIR时屏蔽IIR模块set(handles.IIR_button,'Value',0);set(handles.filter_information,'String','FIR');set(handles.window_function,'Enable','on');% set(handles.order,'Enable','on');set(handles.view_window,'Enable','on');set(handles.analog_filter,'Enable','off');set(handles.Apass,'Enable','off');set(handles.Astop,'Enable','off');%set(handles.order,'Enable','on');if(digital==2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%处理阶数set(handles.specify_order,'Enable','off');set(handles.custom_order,'Enable','off');set(handles.min_order,'Enable','off');set(handles.window_function,'Enable','off');set(handles.view_window,'Enable','off');set(handles.order_information,'String','sample')set(handles.order,'Enable','on');end switch(response)case 1set(handles.type_information,'String','Lowpass');case 2set(handles.type_information,'String','Highpass');case 3set(handles.type_information,'String','Bandpass');case 4set(handles.type_information,'String','Bandstop');endif(digital==1)set(handles.method_value,'String','window');elseset(handles.method_value,'String','FSI');endswitch(window1)case 1set(handles.function_value,'String','Hamming');case 2set(handles.function_value,'String','Blackman');case 3set(handles.function_value,'String','Hann');case 4set(handles.function_value,'String','Rectangular');endelseset(handles.analog_filter,'Enable','on');set(handles.Apass,'Enable','on');set(handles.Astop,'Enable','on');set(handles.order,'Enable','off');end% Hint: get(hObject,'Value') returns toggle state of FIR_button% --- If Enable == 'on', executes on mouse press in 5 pixel border.% --- Otherwise, executes on mouse press in 5 pixel border or over filter_information.function filter_information_ButtonDownFcn(hObject, eventdata, handles)% hObject handle to filter_information (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

四、运行结果

五、matlab版本及参考文献

1 matlab版本

a

2 参考文献

[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,.

[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,.

[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。