【信号分析】基于matlab的信号分析附GUI界面

简介: 【信号分析】基于matlab的信号分析附GUI界面

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

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

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

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

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

⛄ 内容介绍

本文主要介绍基于MATLAB GUI的信号分析仪的设计,使用MATLAB图形用户界面中的各种控件来实现对参数的设定并最终显示信号波形曲线图.此分析仪能够输出的曲线图有时域曲线,复域曲线,频域曲线以及时域曲线与频域曲线的对比,使得能够准确的观察时域曲线与频域曲线的同步变化情况.

⛄ 部分代码

function varargout = juli(varargin)

% JULI M-file for juli.fig

%      JULI, by itself, creates a new JULI or raises the existing

%      singleton*.

%

%      H = JULI returns the handle to a new JULI or the handle to

%      the existing singleton*.

%

%      JULI('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in JULI.M with the given input arguments.

%

%      JULI('Property','Value',...) creates a new JULI or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before juli_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to juli_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 juli


% Last Modified by GUIDE v2.5 28-May-2008 19:12:14


% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

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

                  'gui_Singleton',  gui_Singleton, ...

                  'gui_OpeningFcn', @juli_OpeningFcn, ...

                  'gui_OutputFcn',  @juli_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 juli is made visible.

function juli_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 juli (see VARARGIN)


% Choose default command line output for juli

handles.output = hObject;


% Update handles structure

guidata(hObject, handles);


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

% uiwait(handles.figure1);



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

function varargout = juli_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 selection change in listbox1.

function listbox1_Callback(hObject, eventdata, handles)

val=get(handles.listbox1 ,'Value');

switch val

case 1

 t=-1:0.01:10;

 y1=sin(2*pi*t);

 axes(handles.axes1);

plot(t,y);


case 2

    t=-1:0.01:10;

 y1=cos(2*pi*t);

 axes(handles.axes1);

plot(t,y);


case 3

   t=-1:0.01:10;

   y1=square(2*pi*t);

   axes(handles.axes1);

plot(t,y);

case 4

       t=-1:0.01:10;

 axes(handles.axes1);


y1=sawtooth(2*pi*t);

plot(t,y);

case 5

   t=-3:0.001:5;

   axes(handles.axes1);


y1=tripuls(t,4,0.5);

plot(t,y);


 

end

% hObject    handle to listbox1 (see GCBO)

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

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


% Hints: contents = get(hObject,'String') returns listbox1 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from listbox1



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

function listbox1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to listbox1 (see GCBO)

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

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


% Hint: listbox 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 pushbutton1.

function pushbutton1_Callback(hObject, eventdata, handles)

 t=-3:0.1:10;

hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

axes(handles.axes2);


y=sin(w*t);

plot(t,y);


% 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)

val=get(handles.popupmenu1 ,'Value');

switch val

case 1

 t=0:0.1:10;

 hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

y=sin(w*t);


 

 y1=sin(2*pi*t);

 y2=y.*y1

 axes(handles.axes3);

plot(t,y2);


case 2

    t=0:0.01:10;

 y1=cos(2*pi*t);

  hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

y=sin(w*t);


    y2=y.*y1

 axes(handles.axes3);

plot(t,y);


case 3

   t=0:0.01:10;

   y1=square(2*pi*t);

  hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

y=sin(w*t);


      y2=y.*y1

   axes(handles.axes3);

plot(t,y);

case 4

       t=0:0.01:10;

 


y1=sawtooth(2*pi*t);

hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

y=sin(w*t);


 y2=y.*y1

axes(handles.axes3);

plot(t,y);

case 5

   t=-3:0.001:5;

 

hfstext=findobj('tag','edit1');

h=get(hfstext,'string');

w=str2num(h);

y=sin(w*t);



y1=tripuls(t,4,0.5);

 y2=y.*y1

 axes(handles.axes3);

 

plot(t,y);

xlabel('时间(t)');


title('正弦信号');


 

end

% 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 selection change in popupmenu1.

function popupmenu1_Callback(hObject, eventdata, handles)

val=get(handles.popupmenu1 ,'Value');

switch val

case 1

 t=0:0.01:10;

 y=sin(2*pi*t);

 axes(handles.axes1);

plot(t,y);

xlabel('时间(t)');


title('正弦信号');


case 2

    t=0:0.01:10;

 y=cos(2*pi*t);

 axes(handles.axes1);

plot(t,y);

xlabel('时间(t)');


title('余弦信号');


case 3

   t=0:0.01:10;

   y=square(2*pi*t);

   axes(handles.axes1);

plot(t,y);

xlabel('时间(t)');


title('周期方波信号');

case 4

       t=0:0.01:10;

 axes(handles.axes1);


y=sawtooth(2*pi*t);

plot(t,y);

xlabel('时间(t)');


title('周期锯齿波信号');

case 5

   t=-3:0.001:5;

   axes(handles.axes1);


y=tripuls(t,4,0.5);

plot(t,y);

xlabel('时间(t)');


title('三角波信号');


 

end

% hObject    handle to popupmenu1 (see GCBO)

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

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


% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array

%        contents{get(hObject,'Value')} returns selected item from popupmenu1



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

function popupmenu1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to popupmenu1 (see GCBO)

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

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


% Hint: popupmenu 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 slider movement.

function slider1_Callback(hObject, eventdata, handles)

fs=get(hObject,'value');

hfstext=findobj('tag','edit1');

set(hfstext,'string',num2str(fs));

% hObject    handle to slider1 (see GCBO)

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

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


% Hints: get(hObject,'Value') returns position of slider

%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider



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

function slider1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to slider1 (see GCBO)

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

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


% Hint: slider controls usually have a light gray background.

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

   set(hObject,'BackgroundColor',[.9 .9 .9]);

end




function edit1_Callback(hObject, eventdata, handles)

fs=get(hObject,'value');

hfs=findobj('tag','slider1');

set(hfs,'string',num2str(fs));

% hObject    handle to edit1 (see GCBO)

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

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


% Hints: get(hObject,'String') returns contents of edit1 as text

%        str2double(get(hObject,'String')) returns contents of edit1 as a double



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

function edit1_CreateFcn(hObject, eventdata, handles)

% hObject    handle to edit1 (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 pushbutton3.

function pushbutton3_Callback(hObject, eventdata, handles)

close;

main

% 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 checkbox1.

function checkbox1_Callback(hObject, eventdata, handles)

r=get(hObject,'value');

if r==1

   

   grid on

else

   grid off

end

% hObject    handle to checkbox1 (see GCBO)

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

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


% Hint: get(hObject,'Value') returns toggle state of checkbox1



% --- Executes on button press in checkbox2.

function checkbox2_Callback(hObject, eventdata, handles)

r=get(hObject,'value');

if r==1

   

zoom on

else

  zoom off

end

% hObject    handle to checkbox2 (see GCBO)

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

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


% Hint: get(hObject,'Value') returns toggle state of checkbox2


⛄ 运行结果

⛄ 参考文献

[1] 陈瑞峰, 左曙光, 郭伟. 基于MATLAB GUI的信号分析系统[J]. 佳木斯大学学报:自然科学版, 2009, 27(5):4.

[2] 赵秋英, 吴玲, 徐秀丽. 基于MATLAB GUI的信号分析仪设计[J]. 中国科技博览, 2015(004):000.

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
4天前
|
存储 算法 数据可视化
基于 MATLAB的GUI信号处理界面设计 源码+运行截图
基于 MATLAB的GUI信号处理界面设计 源码+运行截图
18 2
|
3月前
|
算法 数据可视化 图形学
网络通信系统的voronoi图显示与能耗分析matlab仿真
在MATLAB2022a中,该程序模拟了两层基站网络,使用泊松分布随机生成Macro和Micro基站,并构建Voronoi图。它计算每个用户的信号强度,选择最强连接,并分析SINR和数据速率。程序还涉及能耗计算,包括传输、接收、处理和空闲能耗的分析。Voronoi图帮助可视化网络连接和优化能源效率。
|
16天前
|
算法 决策智能
基于禁忌搜索算法的VRP问题求解matlab仿真,带GUI界面,可设置参数
该程序基于禁忌搜索算法求解车辆路径问题(VRP),使用MATLAB2022a版本实现,并带有GUI界面。用户可通过界面设置参数并查看结果。禁忌搜索算法通过迭代改进当前解,并利用记忆机制避免陷入局部最优。程序包含初始化、定义邻域结构、设置禁忌列表等步骤,最终输出最优路径和相关数据图表。
|
1月前
|
算法 数据可视化
基于SSA奇异谱分析算法的时间序列趋势线提取matlab仿真
奇异谱分析(SSA)是一种基于奇异值分解(SVD)和轨迹矩阵的非线性、非参数时间序列分析方法,适用于提取趋势、周期性和噪声成分。本项目使用MATLAB 2022a版本实现从强干扰序列中提取趋势线,并通过可视化展示了原时间序列与提取的趋势分量。代码实现了滑动窗口下的奇异值分解和分组重构,适用于非线性和非平稳时间序列分析。此方法在气候变化、金融市场和生物医学信号处理等领域有广泛应用。
|
2月前
|
算法 Perl
【光波电子学】基于MATLAB的多模光纤模场分布的仿真分析
本文介绍了基于MATLAB的多模光纤模场分布仿真分析,详细阐述了多模光纤的概念、实现方法、仿真技术,并利用模式耦合方程分析方法,通过理论和仿真模型设计,展示了不同模式下的光场分布及其受光纤参数影响的分析结果。
61 4
【光波电子学】基于MATLAB的多模光纤模场分布的仿真分析
|
1月前
|
算法 数据挖掘 vr&ar
基于ESTAR指数平滑转换自回归模型的CPI数据统计分析matlab仿真
该程序基于ESTAR指数平滑转换自回归模型,对CPI数据进行统计分析与MATLAB仿真,主要利用M-ESTAR模型计算WNL值、P值、Q值及12阶ARCH值。ESTAR模型结合指数平滑与状态转换自回归,适用于处理经济数据中的非线性趋势变化。在MATLAB 2022a版本中运行并通过ADF检验验证模型的平稳性,适用于复杂的高阶自回归模型。
|
1月前
|
机器学习/深度学习 算法
基于心电信号时空特征的QRS波检测算法matlab仿真
本课题旨在通过提取ECG信号的时空特征并应用QRS波检测算法识别心电信号中的峰值。使用MATLAB 2022a版本实现系统仿真,涵盖信号预处理、特征提取、特征选择、阈值设定及QRS波检测等关键步骤,以提高心脏疾病诊断准确性。预处理阶段采用滤波技术去除噪声,检测算法则结合了一阶导数和二阶导数计算确定QRS波峰值。
|
2月前
|
算法 测试技术 SoC
基于直流潮流的IEEE30电力系统停电分布及自组织临界性分析matlab仿真
本研究提出一种基于直流潮流的算法来分析电力系统的停电分布及自组织临界性。算法迭代更新参数并模拟线路随机断开,运用粒子群优化计算关键值,并评估线路接近容量极限的概率。通过改变参数β和μ,分析不同线路可靠性和容量增加方式下的停电分布,并探索系统趋向临界状态的过程及停电概率分布。该方法基于IEEE30测试系统,利用MATLAB2022a实现,简化处理有功功率流动,适用于评估电力系统稳定性及预防大规模停电事故。
|
2月前
|
存储 算法 Serverless
【matlab】matlab基于DTW和HMM方法数字语音识别系统(源码+音频文件+GUI界面)【独一无二】
【matlab】matlab基于DTW和HMM方法数字语音识别系统(源码+音频文件+GUI界面)【独一无二】
|
2月前
|
机器学习/深度学习 监控 算法
基于深度学习网络的人员行为视频检测系统matlab仿真,带GUI界面
本仿真展示了基于GoogLeNet的人员行为检测系统在Matlab 2022a上的实现效果,无水印。GoogLeNet采用创新的Inception模块,高效地提取视频中人员行为特征并进行分类。核心程序循环读取视频帧,每十帧执行一次分类,最终输出最频繁的行为类别如“乐队”、“乒乓球”等。此技术适用于智能监控等多个领域。
61 4

热门文章

最新文章