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

📄 gui.m

📁 基于MATLAB的DTMF拨号演示文件
💻 M
📖 第 1 页 / 共 2 页
字号:
function varargout = gui(varargin)
% GUI M-file for gui.fig
%      GUI, by itself, creates a new GUI or raises the existing
%      singleton*.
%
%      H = GUI returns the handle to a new GUI or the handle to
%      the existing singleton*.
%
%      GUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI.M with the given input arguments.
%
%      GUI('Property','Value',...) creates a new GUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before gui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to gui_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 gui

% Last Modified by GUIDE v2.5 28-Aug-2005 19:03:15

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @gui_OpeningFcn, ...
                   'gui_OutputFcn',  @gui_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 gui is made visible.
function gui_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 gui (see VARARGIN)

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



% Make the My notch Radio Button Active...
set(handles.rbmynotch,'Value',1);
set(handles.rbsptoolnotch,'Value',0);




% Update handles structure
guidata(hObject, handles);

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


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



%================================================================
%================================================================
%      Update the y1 Figures...
%================================================================
%================================================================
if ~exist('filt1') || ~exist('filt2') || ~exist('filt3') || ~exist('filt4') || ~exist('filt5') || ~exist('filt6') || ~exist('filt7') ,
    disp('No Filters load them...')
    load filter_bank.mat
end

fs=8192;
% Frequency

axes(handles.y1);
[H,w] = freqz(filt1.tf.num,filt1.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');


axes(handles.y2);
[H,w] = freqz(filt2.tf.num,filt2.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');

axes(handles.y3);
[H,w] = freqz(filt3.tf.num,filt3.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');

axes(handles.y4);
[H,w] = freqz(filt4.tf.num,filt4.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');

axes(handles.y5);
[H,w] = freqz(filt5.tf.num,filt5.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');

axes(handles.y6);
[H,w] = freqz(filt6.tf.num,filt6.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');

axes(handles.y7);
[H,w] = freqz(filt7.tf.num,filt7.tf.den,512);
plot(w*fs/(2*pi),abs(H));grid;
xlabel('Frequence');ylabel('Amplitude');






% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in b1.
function b1_Callback(hObject, eventdata, handles)
% hObject    handle to b1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(1);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in b2.
function b2_Callback(hObject, eventdata, handles)
% hObject    handle to b2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(2);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in b3.
function b3_Callback(hObject, eventdata, handles)
% hObject    handle to b3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(3);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank
% --- Executes on button press in b4.
function b4_Callback(hObject, eventdata, handles)
% hObject    handle to b4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(4);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank
% --- Executes on button press in b5.
function b5_Callback(hObject, eventdata, handles)
% hObject    handle to b5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(5);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank
% --- Executes on button press in b6.
function b6_Callback(hObject, eventdata, handles)
% hObject    handle to b6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(6);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank
%--- Executes on button press in b7.
function b7_Callback(hObject, eventdata, handles)
% hObject    handle to b7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(7);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in b8.
function b8_Callback(hObject, eventdata, handles)
% hObject    handle to b8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(8);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in b9.
function b9_Callback(hObject, eventdata, handles)
% hObject    handle to b9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(9);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in ba.
function bstar_Callback(hObject, eventdata, handles)
% hObject    handle to bstar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad('*');
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in b0.
function b0_Callback(hObject, eventdata, handles)
% hObject    handle to b0 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(0);
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in bn.
function bcell_Callback(hObject, eventdata, handles)
% hObject    handle to bcell (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad('#');
myfilter=get(handles.rbmynotch,'Value');
update_gui_bank

% --- Executes on button press in info.
function info_Callback(hObject, eventdata, handles)
% hObject    handle to info (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB

⌨️ 快捷键说明

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