一、小波变换简介

小波变换是从20世纪80年代起逐渐发展成熟的一项数学应用技术,具有对时间—频率的双重分析和多分辨率分析能力,目前已经广泛应用于图像处理、模式识别等多个领域。小波变换的窗口大小固定但形状可改变,因此能够满足时域—频域局部化分析要求[22]。离散小波变换比连续小波变换的去噪效果更好,更适用于实际应用。

小波变换首先通过分解信号,使信号的能量集中在一些大的小波系数中,而噪声的能量分布于整个小波域内;然后通过阈值降噪,选择合适的阈值将有用信号的系数保留,将噪声信号的系数置零,从而去除噪声;最后再对经过阈值降噪后的系数进行重构,得到去除噪声后的信号。

常用的小波基函数有Meyer小波、Coiflet(coif N)小波、Daubechies(db N)小波等[9]。为得到较好的去噪效果,所选取的小波基函数在对心电信号进行分解时,应尽量保留心电信号中的有用分量,同时使噪声分解对应的小波系数差异尽可能大。Coiflet4小波基与心电信号的波形最为相似,同时与输出信号具有良好的相关性,重构后的信号信噪比大、均方误差小,因此本文选用Coiflet4小波基进行小波分解。

二、部分源代码

function varargout = mainGUI(varargin)
% MAINGUI MATLAB code for mainGUI.fig
%      MAINGUI, by itself, creates a new MAINGUI or raises the existing
%      singleton*.
%
%      H = MAINGUI returns the handle to a new MAINGUI or the handle to
%      the existing singleton*.
%
%      MAINGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MAINGUI.M with the given input arguments.
%
%      MAINGUI('Property','Value',...) creates a new MAINGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before mainGUI_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to mainGUI_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 mainGUI% Last Modified by GUIDE v2.5 26-Mar-2021 12:46:25% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @mainGUI_OpeningFcn, ...'gui_OutputFcn',  @mainGUI_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before mainGUI is made visible.
function mainGUI_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 mainGUI (see VARARGIN)% Choose default command line output for mainGUI
handles.output = hObject;% Update handles structure
guidata(hObject, handles);% UIWAIT makes mainGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = mainGUI_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;function edit1_Callback(hObject, eventdata, handles)
% 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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% 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)
global x
[filename,pathname]=uigetfile({'*.xlsx';'*.csv';'*.txt';'*.'},'载入文件');
set( handles.edit1,'String',strcat(pathname,filename));
data=xlsread(strcat(pathname,filename));
x=data';
axes(handles.axes1)
plot(x);
axis tight
grid on
title('原始癫痫脑电信号')
xlabel('采样点');
ylabel('幅值/mV');
msgbox('数据导入已完成!')% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% 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 = cellstr(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
function varargout = jiemian(varargin)
% JIEMIAN MATLAB code for jiemian.fig
%      JIEMIAN, by itself, creates a new JIEMIAN or raises the existing
%      singleton*.
%
%      H = JIEMIAN returns the handle to a new JIEMIAN or the handle to
%      the existing singleton*.
%
%      JIEMIAN('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in JIEMIAN.M with the given input arguments.
%
%      JIEMIAN('Property','Value',...) creates a new JIEMIAN or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before jiemian_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to jiemian_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 jiemian% Last Modified by GUIDE v2.5 29-Jul-2020 18:27:56% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @jiemian_OpeningFcn, ...'gui_OutputFcn',  @jiemian_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before jiemian is made visible.
function jiemian_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 jiemian (see VARARGIN)% Choose default command line output for jiemian
handles.output = hObject;% Update handles structure
guidata(hObject, handles);% UIWAIT makes jiemian wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = jiemian_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;function edit1_Callback(hObject, eventdata, handles)
% 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
ha=axes('units','normalized','pos',[0 0 1 1]);
uistack(ha,'down');
ii=imread('105.jpg');
image(ii);
colormap gray
set(ha,'handlevisibility','off','visible','on');if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');
endfunction edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (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 pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% 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)
userChar = get( handles.edit1, 'string' );
passChar = get( handles.edit2,'string' );
accountNumber = '20171008189'; % 默认账号
keyWord = 'dfgdbfd697';     % 默认密码
n = find( strcmp(accountNumber, {userChar}),1 ); % 判断输入的用户名和默认值是否一致。如果一致,则 n 非空if ~isempty( n ) && strcmp( keyWord,{passChar} )h = msgbox( '欢迎进入脑电信号处理系统!' );uiwait( h );delete( gcf ); % 关闭当前的用户登录界面bishe%调用数据GUIelseerrordlg( '账号或密码错误,请重新输入!' );
end% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% 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)
close% --- Executes during object creation, after setting all properties.
function text3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to text3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

三、运行结果

四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 沈再阳.精通MATLAB信号处理[M].清华大学出版社,2015.
[2]高宝建,彭进业,王琳,潘建寿.信号与系统——使用MATLAB分析与实现[M].清华大学出版社,2020.
[3]王文光,魏少明,任欣.信号处理与系统分析的MATLAB实现[M].电子工业出版社,2018.
[4]徐洁.基于小波分析的脉搏波信号处理[J].电子设计工程. 2013,21(11)

【脑电信号】基于matlab GUI小波变换癫痫脑电信号特征提取及分析【含Matlab源码 1154期】相关推荐

  1. 【数字信号调制】基于matlab GUI PCM编码和QAM调制系统【含Matlab源码 2080期】

    ⛄一.PCM编码+QAM调制简介 1 PCM 数字信号是对连续变化的模拟信号进行抽样.量化和编码产生的,称为PCM(Pulse Code Modulation),即脉冲编码调制. 脉冲编码调制就是把一 ...

  2. 【车辆计数】基于matlab GUI背景差分法道路行驶多车辆检测【含Matlab源码 1911期】

    ⛄一.背景差分法和帧间差分法的车辆运动目标检测简介 1 引言 运动目标检测是从图像序列中检测运动目标.通过运动目标检测可以得到图像中的运动目标,获取图像中的运动信息.运动目标检测在医学辅助诊断.航天航 ...

  3. 【图像加密】基于matlab GUI正交拉丁方置乱+混沌图像加密解密【含Matlab源码 636期】

    ⛄一.正交拉丁方置乱及混沌系统简介 0 引言 随着通讯技术的飞速发展, 越来越多的领域需要传送数字图像信号, 因此信息的传送安全问题显得越来越重要.通常应用于数字图像通信的两种保护技术为:数字水印技术 ...

  4. 【图像加密】基于matlab GUI正交拉丁方置乱算法图像加解密【含Matlab源码 182期】

    ⛄一.正交拉丁方置乱简介 0 引言 随着通讯技术的飞速发展, 越来越多的领域需要传送数字图像信号, 因此信息的传送安全问题显得越来越重要.通常应用于数字图像通信的两种保护技术为:数字水印技术和图像加密 ...

  5. 【时钟识别】基于matlab GUI Hough变换指针式时钟识别【含Matlab源码 2085期】

    ⛄一.简介 1 仪表示数识别流程 基于刻度准确定位的指针式仪表示数识别方法包括预处理.指针检测.刻度定位.油位计表盘中心拟合与仪表读数计算5个部分.该方法无需预先添加任何表盘信息,算法流程如图2所示. ...

  6. 【图像融合】基于matlab GUI高斯金字塔+拉普拉斯金字塔彩色图像融合【含Matlab源码 1506期】

    一.区域分割图像融合简介 图像的分解 对源图像进行融合时,首先对图像进行分解,利用拉普拉斯金字塔分解,先对图像进行高斯金字塔分解,然后再进行拉普拉斯金字塔分解. 1 高斯金字塔分解 记源图像为G0,G ...

  7. 【图像加密】基于matlab GUI Logistic混沌图像加密与解密【含Matlab源码 1216期】

    ⛄一.混沌图像加密与解密简介 混沌系统图像加密解密理论部分参考链接: 基于混沌系统的图像加密算法设计与应用 ⛄二.部分源代码 %加密程序 function b=jiami(a,s,h) [m1,n1] ...

  8. 基于java开发的健身器材电商管理系统.rar(含项目源码前后端项目)

    功能:健身器材信息管理.健身器材分类管理.公告管理.个人中心.订单管理.健身器材入库管理.健身器材出库管理.收获评价管理.系统管理等 前端页面展示 后端管理: 源码下载地址:>>>

  9. 【Matlab脑电信号】小波睡眠监测【含源码 595期】

    一.代码运行视频(哔哩哔哩) [Matlab脑电信号]小波睡眠监测[含源码 595期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1] 沈再阳.精通MATLAB ...

  10. 【Matlab生物电信号】生物电信号仿真【含GUI源码 684期】

    一.代码运行视频(哔哩哔哩) [Matlab生物电信号]生物电信号仿真[含GUI源码 684期] 二.matlab版本及参考文献 1 matlab版本 2014a 2 参考文献 [1]董兵,超于毅,李 ...

最新文章

  1. 深入剖析AQS和CAS,看了都说好
  2. AOP之PostSharp7-解决IOC 不能直接new问题,简化IOC开发和IOC对象LazyLoad
  3. Daily Scrum02 12.04
  4. 《scikit-learn》SVM(三)ROC曲线
  5. MVC框架中的值提供机制(二)
  6. Docker之DockerFile讲解
  7. C++ Programming with TDD之一:GMOCK框架简介
  8. Hadoop HA集群部署
  9. 怎么在mac下运行映像dmg_如何将Apple Mac OS X系统DMG镜像文件转换成ISO镜像文件呢?...
  10. R3LIVE调试记录
  11. 短信网关在短信信息服务中的作用(转)
  12. JPA实体中数据库生成ID的最终指南1
  13. 特斯拉“炸”降,蔚来、小鹏、理想们的路就平坦了么?
  14. C#基于联通短信Sgip协议构建短信网关程序.net
  15. 【RTT】SPI Flash 与文件系统(3):DFS 和 EasyFlash
  16. 大数据·实战个例“宏”分析
  17. EPLAN教程 | EPLAN表格居然还能这么玩
  18. html5 小游戏 404页面,原来404页面可以这样做
  19. Oc 二维码的扫描-ZBar与生成
  20. 多巴胺ELISA试剂盒方案:体外定量,手动操作

热门文章

  1. django.db.utils.OperationalError: 1045错误
  2. 使用spring-boot-maven-plugin插件打包spring boot项目
  3. 802.1q VLAN
  4. 图片垂直居中 和 float
  5. 白话CSS3的新特性
  6. WCF在多个服务中使用事物
  7. 190420每日一句
  8. C/C++学习笔记 指针1
  9. 传智播客黑马 Python学习笔记之python初识
  10. 181116每日一句