【滤波器】基于Matlab设计巴斯 切比雪夫 椭圆 低通高通带通带阻数字滤波器附GUI界面
创始人
2024-04-17 12:31:24
0

 ✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法  神经网络预测 雷达通信  无线传感器

信号处理 图像处理 路径规划 元胞自动机 无人机  电力系统

⛄ 内容介绍

介绍了基于Matlab的IIR数字滤波器设计方法.先确定数字滤波器的性能指标,再按照一定的映射规则(冲激响应不变法或双线性变换法)变换成模拟滤波器的性能指标,然后采用一定的逼近方法(巴特沃斯型或切比雪夫型)设计模拟滤波器,最后将模拟滤波器按照同样的映射规则转变成数字滤波器.同时介绍了设计IIR数字滤波器常用的Matlab函数.通过Matlab实验仿真,利用介绍的数字滤波器的设计方法,成功地设计出了满足预定指标的各型IIR数字滤波器.

⛄ 部分代码

function varargout = Butterworth_bandpass(varargin)

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

                   'gui_Singleton',  gui_Singleton, ...

                   'gui_OpeningFcn', @Butterworth_bandpass_OpeningFcn, ...

                   'gui_OutputFcn',  @Butterworth_bandpass_OutputFcn, ...

                   'gui_LayoutFcn',  [] , ...

                   'gui_Callback',   []);

if nargin && ischar(varargin{1})

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

end

if nargout

    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

else

    gui_mainfcn(gui_State, varargin{:});

end

% End initialization code - DO NOT EDIT

% --- Executes just before Butterworth_bandpass is made visible.

function Butterworth_bandpass_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 Butterworth_bandpass (see VARARGIN)

% Choose default command line output for Butterworth_bandpass

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes Butterworth_bandpass wait for user response (see UIRESUME)

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = Butterworth_bandpass_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 structure

varargout{1} = handles.output;

% --- Executes during object creation, after setting all properties.

function muestreo_CreateFcn(hObject, eventdata, handles)

% hObject    handle to muestreo (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.

%       See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

    set(hObject,'BackgroundColor','white');

end

% --- Executes on button press in menu.

function menu_Callback(hObject, eventdata, handles)

% hObject    handle to menu (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

FILTER

close Butterworth_bandpass

% --- Executes on button press in calcular.

function calcular_Callback(hObject, eventdata, handles)

% hObject    handle to calcular (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

Fs=str2double(get(handles.muestreo,'String'));

Fpb=str2double(get(handles.b_pb,'String'));

Fpb1=str2double(get(handles.dos0,'String'));

Fsb=str2double(get(handles.b_rb,'String'));

Fsb1=str2double(get(handles.dos1,'String'));

Rpb=str2double(get(handles.edit4,'String'));

Rsb=str2double(get(handles.edit5,'String'));

if (Fs<0 | isnan(Fs))

   errordlg('El valor debe ser num閞ico positivo ',' ERROR ');

   set(handles.muestreo,'String',10);

   handles.muestreo=10;

end

if (Fpb<0 | isnan(Fpb))

   errordlg('El valor debe ser num閞ico positivo ',' ERROR ');

   set(handles.b_pb,'String',1);

   handles.muestreo=1;

end

if (Fsb<0 | isnan(Fsb))

   errordlg('El valor debe ser num閞ico positivo ',' ERROR ');

   set(handles.b_rb,'String',4);

   handles.b_rb=4;

end

if (Rpb<0 | isnan(Rpb))

   errordlg('El valor debe ser num閞ico positivo ',' ERROR ');

   set(handles.edit4,'String',10);

   handles.edit4=10;

end

if (Rsb<0 | isnan(Rsb))

   errordlg('El valor debe ser num閞ico positivo ',' ERROR ');

   set(handles.edit5,'String',30);

   handles.edit5=30;

end

fs=Fs/2;    %Frec. de muestreo

fpb=[Fpb Fpb1]/fs;  %Frec. de borde pasa banda

fpb

fsb=[Fsb Fsb1]/fs; % Frec. de borde rechaza banda

fsb

%------------------------------------------------------------

[n,wn]=buttord(fpb, fsb, Rpb, Rsb);

[b,a] =butter(n,wn,'bandpass');

[H,w]=freqz(b,a,512,1);

%Trazado de la respuesta en Magnitud

axes(handles.axes1)

plot(w,20*log10(abs(H)));

grid on;

title (['Filtro pasa-bajos, Respuesta en magnitud, orden=', num2str(n)]);

xlabel('frecuencia');

ylabel('H(f) db')

axis([0 0.5 -Rsb-10 0])

axes(handles.axes2)

plot(w,angle(H));

grid on;

title (['Filtro pasa-bajos, Respuesta en magnitud, orden=', num2str(n)]);

xlabel('frecuencia')

ylabel('醤gulo de H rad')

%Resp al impulso

axes(handles.axes3)

[y,t]= impz(b,a,60);

stem(t,y);

title (['Filtro pasa-bajos, Respuesta al impulso, orden=', num2str(n)]);

%Ploteo de los polos y ceros

z= roots(b);  %Zeros

p = roots(a);  % Polos

axes(handles.axes4)

zplane(z,p)

title(['Trazade polos y ceros para Butter'])

⛄ 运行结果

⛄ 参考文献

[1]王艳文, 史先红. 基于MATLAB的切比雪夫Ⅱ型数字低通滤波器设计[J]. 科技视界, 2013(17):1.

[2]贾建科, 韩团军, 朱宁洲. 基于MatlabGUI的模拟带通滤波器的设计[J]. 现代电子技术, 2010, 33(10):5.

⛄ Matlab代码关注

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

相关内容

热门资讯

银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
AWSECS:访问外部网络时出... 如果您在AWS ECS中部署了应用程序,并且该应用程序需要访问外部网络,但是无法正常访问,可能是因为...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
AWSElasticBeans... 在Dockerfile中手动配置nginx反向代理。例如,在Dockerfile中添加以下代码:FR...
Android|无法访问或保存... 这个问题可能是由于权限设置不正确导致的。您需要在应用程序清单文件中添加以下代码来请求适当的权限:此外...
月入8000+的steam搬砖... 大家好,我是阿阳 今天要给大家介绍的是 steam 游戏搬砖项目,目前...
​ToDesk 远程工具安装及... 目录 前言 ToDesk 优势 ToDesk 下载安装 ToDesk 功能展示 文件传输 设备链接 ...
北信源内网安全管理卸载 北信源内网安全管理是一款网络安全管理软件,主要用于保护内网安全。在日常使用过程中,卸载该软件是一种常...
AWS管理控制台菜单和权限 要在AWS管理控制台中创建菜单和权限,您可以使用AWS Identity and Access Ma...