⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chevyshev_i_low.m

📁 数字滤波仿真程序
💻 M
字号:
function varargout = CHEVYSHEV_I_low(varargin)

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @CHEVYSHEV_I_low_OpeningFcn, ...
                   'gui_OutputFcn',  @CHEVYSHEV_I_low_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 CHEVYSHEV_I_low is made visible.
function CHEVYSHEV_I_low_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 CHEVYSHEV_I_low (see VARARGIN)

% Choose default command line output for CHEVYSHEV_I_low
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes CHEVYSHEV_I_low wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = CHEVYSHEV_I_low_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 CHEVYSHEV_I_low


% --- 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'));
Fsb=str2double(get(handles.b_rb,'String'));
Rpb=str2double(get(handles.edit4,'String'));
Rsb=str2double(get(handles.edit5,'String'));

%Fs=10;  
fs=Fs/2;    %Frec. de muestreo

%Fpb=2;  
fpb=Fpb/fs;  %Frec. de borde pasa banda

%Fsb=2.4; 
fsb=Fsb/fs; % Frec. de borde rechaza banda

%Rpb=0.1;
%Rsb=30;

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

[n,fn]=cheb1ord(fpb, fsb, Rpb, Rsb);
[b,a] =cheby1(n,Rpb,fn,'low');
[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'])



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -