【语音处理】基于GUI双音多频(DTMF)信号检测【Matlab 488期】

一、简介

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

二、源代码

function varargout = mygui(varargin)
% MYGUI MATLAB code for mygui.fig
%      MYGUI, by itself, creates a new MYGUI or raises the existing
%      singleton*.
%
%      H = MYGUI returns the handle to a new MYGUI or the handle to
%      the existing singleton*.
%
%      MYGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MYGUI.M with the given input arguments.
%
%      MYGUI('Property','Value',...) creates a new MYGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before mygui_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to mygui_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 mygui

% Last Modified by GUIDE v2.5 09-Nov-2019 22:01:11

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @mygui_OpeningFcn, ...
                   'gui_OutputFcn',  @mygui_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
global SNR;



% --- Executes just before mygui is made visible.
function mygui_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 mygui (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = mygui_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 on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global SNR;%设置全局变量SNR
SNR=str2double(get(handles.edit2,'String'));%由信噪比输入框得到SNR
s='4';%此按钮对应的输入符号为'4'
y1=mysound(s);%得到加噪声后得dtft信号
y2=mygeortzel(y1);%戈泽尔算法解码
y3=georeceive(y2);
y4=myfft(y1);%FFT算法解码
set(handles.text17,'String',y3);%输出戈泽尔算法解码的值
set(handles.text12,'String',y4);%输出FFT算法解码得值
set(handles.text13,'string','4');%输出输入的原始键值

% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='1';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','1');

% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='7';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','7');

% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='*';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','*');

% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='3';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','3');

% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='8';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','8');

% hObject    handle to pushbutton6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='6';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','6');

% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='0';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','0');

% hObject    handle to pushbutton8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='2';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','2');

% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='5';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','5');

% hObject    handle to pushbutton10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='9';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','9');

% hObject    handle to pushbutton11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton12.
function pushbutton12_Callback(hObject, eventdata, handles)
global SNR;
SNR=str2double(get(handles.edit2,'String'));
s='D';
y1=mysound(s);
y2=mygeortzel(y1);
y3=georeceive(y2);
y4=myfft(y1);
set(handles.text17,'String',y3);
set(handles.text12,'String',y4);
set(handles.text13,'string','D');

% hObject    handle to pushbutton12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
global SNR;

三、运行结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、备注

完整代码或者代写添加QQ912100926
往期回顾>>>>>>
【信号处理】基于GUI界面之处理录音与音频【Matlab 123期】
【信号处理】CDR噪声和混响抑制【含Matlab源码 198期】
【信号处理】最小二乘法解决稀疏信号恢复问题【Matlab 199期】
【信号处理】遗传算法的VST混响【Matlab 200期】
【信号处理】HMM的睡眠状态检测【Matlab 201期】
【信号处理】小波变换的音频水印嵌入提取【Matlab 202期】
【信号处理】ICA算法信号分离【Matlab 203期】
【信号处理】基于GUI界面的脉搏信号之脉率存档【Matlab 204期】
【信号处理】基于GUI界面的虚拟信号发生器(各种波形)【Matlab 205期】
【信号处理】基于GUI界面信号发生器之电子琴【Matlab 206期】
【信号处理】数字电子琴设计与实现【Matlab 207期】
【雷达通信】雷达数字信号处理【Matlab 214期】
【雷达通信】线性调频(LFM)脉冲压缩雷达仿真【Matlab 215期】
【雷达通信】距离多普勒(RD)、CS、RM算法的机载雷达成像【Matlab 216期】
【雷达通信】《现代雷达系统分析与设计》【Matlab 217期】
【语音处理】基于matlab GUI语音信号处理平台【含Matlab源码 218期】
【语音采集】基于GUI语音信号采集【Matlab 219期】
【语音调制】基于GUI语音幅度调制【Matlab 220期】
【语音合成】基于GUI语音合成【Matlab 221期】
【语音识别】基于GUI语音基频识别【Matlab 222期】
【语音加密】基于GUI语音信号加密解密【Matlab 223期】
【信号处理】小波变换的语音增强【Matlab 224期】
【信号处理】基于GUI语音去噪【Matlab 225期】
【语音增强】基于GUI维纳滤波之语音增强【Matlab 226期】
【音频处理】基于GUI语音信号处理【含Matlab 227期】
【雷达通信】基于GUI雷达定位【Matlab 244期】
【雷达通信】基于GUI雷达脉冲压缩【Matlab 245期】
【雷达通信】基于GUI雷达定位模拟【Matlab 246期】
【雷达通信】SVM识别雷达数据【Matlab 247期】
【信息处理】GUI数字波束的算法库【Matlab 249期】
【通信】OFDM-MIMO通信建模与仿真【Matlab 250期】
【通信】OFDM仿真【Matlab 251期】
【信号处理】窗函数法的FIR数字滤波器设计【Matlab 252期】
【通信】FIR低通数字滤波器设计【Matlab 253期】
【通信】FIR IIR数字滤波器设计【Matlab 254期】
【调制信号】基于GUI数字调制信号仿真【Matlab 255期】
【通信】扩频通信系统设计【Matlab 256期】
【通信】多径衰落信道的仿真【Matlab 257期】
【语音识别】基于BP神经网络的语音情感识别【Matlab 258期】
【信号处理】音频水印嵌入与提取【Matlab 259期】
【音频水印】小波变换的量化音频数字水印【Matlab 260期】
【语音去噪】低通和自适应滤波去噪【Matlab 261期】
【信号处理】8级m序列【Matlab 262期】
【情感识别】基于GUI语音情感分类识别【Matlab 263期】
【信号处理】FIR与IIR滤波器低通、高通、带通设计【Matlab 273期】
【语音处理】语音信号的预处理【Matlab 274期】
【语音识别】傅立叶变换0-9的数字语音识别【含Matlab 333期】
【语音识别】基于GUI DTW的0-9数字语音识别【Matlab 334期】
【语音播放】基于GUI MP3设计【Matlab 335期】
【语音处理】人耳掩蔽效应的语音增强算法信噪比计算【Matlab 336期】
【语音去噪】谱减法去噪【Matlab 337期】
【语音识别】带动量项的BP神经网络语音识别【Matlab 338期】
【语音隐写】LSB语音隐藏【Matlab 339期】
【语音识别】男女声识别【Matlab 365期】
【信号处理】基于GUI的PCM调制【Matlab 366期】
【语音处理】语音加噪和降噪处理【Matlab 367期】
【语音去噪】最小二乘法(LMS)自适应滤波器【Matlab 368期】
【语音增强】谱减法、最小均方和维纳滤波语音增强【Matlab 369期】
【通信】基于GUI数字频带(ASK、PSK、QAM)调制仿真 【Matlab 422期】
【信号处理】心电信号ECG滤波处理【Matlab 423期】
【语音播报】语音播报【Matlab 487期】

猜你喜欢

转载自blog.csdn.net/m0_54742769/article/details/115008126