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

📄 gui.m

📁 Goertzel算法是DTMF信号检测的核心
💻 M
📖 第 1 页 / 共 2 页
字号:
f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton9_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator('B',N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton10_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator(8,N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton11_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator(9,N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton12_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator('C',N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton13_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator('*',N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton14_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator('D',N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton15_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator('#',N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = pushbutton16_Callback(h, eventdata, handles, varargin)% To check for Nif handles.chk == 0    N = 205;else    N = handles.data;           %  Number of samplesendNP = handles.data1;         % Noise Powerhandles.data3 = handles.data3 + 1;  % to keep track of number of times push buttons are used% Generator[x,v,snr] = generator(0,N,NP);size(x);% Display SNRset(handles.edit3,'String',snr)% To plot on GUIf = 1:N;axes(handles.Out_dtmf) % Select the proper axesplot(f,x(1:N))set(handles.Out_dtmf,'XMinorTick','on')grid on% Decoder[D,m] = decoder(x,N);size(m);% To append each dialled digit into an array (max 8 numbers)[handles.data4,handles.data3] = StringNum(handles.data4,D,handles.data3);% After 8th digit the next number is put into first digit placeif handles.data4 == ' '     handles.data4(handles.data3) = D;end% To display the dialled numbers set(handles.edit2,'String',handles.data4);         % The dialled number as decoded by the decoder                                       % is displayed on the edit text% To plot the output                                       f = 1 : length(m);axes(handles.G_output) % Select the proper axesplot(f,m)set(handles.G_output,'XMinorTick','on')grid onguidata(h,handles);% --------------------------------------------------------------------function varargout = popupmenu1_Callback(h, eventdata, handles, varargin)handles.chk = 1;val = get(h,'Value')    % gets the number of the array element selectedif val == 1    handles.data = 205;  %  saving the required data into HANDLESelseif val == 2    handles.data = 128;else    handles.data = 1024;endguidata(h,handles);      % saving the HANDLE structure% --------------------------------------------------------------------function varargout = slider2_Callback(h, eventdata, handles, varargin)va = get(h,'Value');% Display value on EDIT TEXTset(handles.edit1,'String',num2str(va));handles.data1 = va;guidata(h,handles);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

⌨️ 快捷键说明

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