脑电信号基于matlab小波变换+样本熵的癫痫脑电信号特征提取含matlab源码1154期(代码片段)

紫极神光 紫极神光     2022-12-11     520

关键词:

一、简介

1974年,法国工程师J.Morlet首先提出小波变换的概念,1986年著名数学家Y.Meyer偶然构造出一个真正的小波基,并与S.Mallat合作建立了构造小波基的多尺度分析之后,小波分析才开始蓬勃发展起来。小波分析的应用领域十分广泛,在数学方面,它已用于数值分析、构造快速数值方法、曲线曲面构造、微分方程求解、控制论等。在信号分析方面的滤波、去噪声、压缩、传递等。在图像处理方面的图像压缩、分类、识别与诊断,去噪声等。本章将着重阐述小波在图像中的应用分析。
1 小波变换原理
小波分析是一个比较难的分支,用户采用小波变换,可以实现图像压缩,振动信号的分解与重构等,因此在实际工程上应用较广泛。小波分析与Fourier变换相比,小波变换是空间域和频率域的局部变换,因而能有效地从信号中提取信息。小波变换通过伸缩和平移等基本运算,实现对信号的多尺度分解与重构,从而很大程度上解决了Fourier变换带来的很多难题。
小波分析作一个新的数学分支,它是泛函分析、Fourier分析、数值分析的完美结晶;小波分析也是一种“时间—尺度”分析和多分辨分析的新技术,它在信号分析、语音合成、图像压缩与识别、大气与海洋波分析等方面的研究,都有广泛的应用。
(1)小波分析用于信号与图像压缩。小波压缩的特点是压缩比高,压缩速度快,压缩后能保持信号与图像的特征不变,且在传递中能够抗干扰。基于小波分析的压缩方法很多,具体有小波压缩,小波包压缩,小波变换向量压缩等。
(2)小波也可以用于信号的滤波去噪、信号的时频分析、信噪分离与提取弱信号、求分形指数、信号的识别与诊断以及多尺度边缘检测等。
(3)小波分析在工程技术等方面的应用概括的包括计算机视觉、曲线设计、湍流、远程宇宙的研究与生物医学方面。
2 多尺度分析

3 图像的分解和量化

4 图像压缩编码

5 图像编码评价

二、源代码

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(varargin1)
    gui_State.gui_Callback = str2func(varargin1);
end

if nargout
    [varargout1:nargout] = gui_mainfcn(gui_State, varargin:);
else
    gui_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
varargout1 = 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
%        contentsget(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(varargin1)
    gui_State.gui_Callback = str2func(varargin1);
end

if nargout
    [varargout1:nargout] = gui_mainfcn(gui_State, varargin:);
else
    gui_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
varargout1 = 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');
end



function 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%调用数据GUI
   

else
    errordlg( '账号或密码错误,请重新输入!' );
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

三、运行结果

四、备注

版本:2014a

脑电信号基于matlab小波睡眠监测含matlab源码595期(代码片段)

一、简介基于matlab的脑电波睡眠监测二、源代码data0=rand(1,9999);%脑电信号原始数据tm=0.02;%采样时间间隔td=1:tm:30;%取时间1-30秒data=data0(1:(30-1)/tm+1);%1-30秒的数据figure(1)subplot(211);plot(td,data);xlabel(\'时间(秒)\'),ylabel(\'脑波电压\'),title( 查看详情

脑电信号基于matlab小波睡眠监测含matlab源码595期(代码片段)

一、简介基于matlab的脑电波睡眠监测二、源代码data0=rand(1,9999);%脑电信号原始数据tm=0.02;%采样时间间隔td=1:tm:30;%取时间1-30秒data=data0(1:(30-1)/tm+1);%1-30秒的数据figure(1)subplot(211);plot(td,data);xlabel(\'时间(秒)\'),ylabel(\'脑波电压\'),title( 查看详情

一种基于脑电图情感识别的新型深度学习模型

...到了快速的发展。其中一部分机器学习技术中是通过分析脑电图(EEG)信号来工作的,这些信号本质上是对从一个人的头皮上收集的脑电活动的记录。过去十多年来,大多数基于脑电图的情绪分类方法都采用了传统的机器学习方法... 查看详情

大脑结构及脑电信号基础知识

文章目录大脑结构大脑大脑皮层神经元脑电信号生理机制脑电概念信号采集信号分析脑机交互(BCI)节律与心理活动诱发电位大脑结构大脑大脑皮层神经元脑电信号生理机制脑电概念信号采集信号分析脑机交互(BCI)附录节律与心理... 查看详情

matlab中的脑电图带通滤波器

】matlab中的脑电图带通滤波器【英文标题】:EEGbandpassfilterinmatlab【发布时间】:2014-05-1420:36:03【问题描述】:我正在尝试从采样率为500Hz的10分钟长的EEG信号中过滤theta范围(3-8Hz)。这是我的代码。请帮助我了解问题所在。现在... 查看详情

脑电波头环与arduino如何造物?(内附详细步骤)

参考技术A近段时间,我创作大量关于“脑电波头环+Arduino”的相关作品,在DFROBOT平台发布,引发许多创客朋友的关注和留言,希望我能给出详细具体的案例。现在,我将以脑电波控制RGB灯的为例,并附上详细具体的操作步骤:01... 查看详情

数字信号分析基于matlab小波变换气象数据分析(小波系数小波方差小波模小波模平方)含matlab源码2409期

...分析数学理论基础多尺度分析,就是在不同分辨率下显示信号的特征。其实质是把信号在一系列不同层次的空间进行分解。多尺度分析在信号分析中的应用可以用通常可以采用小波变换进行去噪。常用的正交小波基有Haar小波、Meye... 查看详情

基于小波变换的信号分离

一、实验目的:使用小波变换将信号进行分离。验证小波变换在信号处理中的有效性。二、实验原理:小波变换是一种非常重要的信号处理方法,可以将信号分解成不同频率的小波成分,从而进行信号的分析和处... 查看详情

基于小波变换的emg信号病人数据matlab仿真分析(代码片段)

...背景三、matlab程序四、仿真结论一、理论基础    肌电信号(EMG)是一种非常微弱的生物电信号,它与神经肌肉活动密切相关,其中蕴涵着很多与肢体运动相关联的信息。肌电信号可通过表面肌电拾取电极或针式肌电拾取... 查看详情

图像融合基于matlab低频融合策略小波图像融合含matlab源码2319期

...像融合1.1小波的分解和重构小波变换是一种能够用来检测信号局部特征的数学工具。当然也可以将二维信号分解成不同分辨率的子带信号。由于图像为二维信号,可以作以下小波分解:其中,f(x,y)为源图像,C0,H,G为一维小波滤波器,h,v,... 查看详情

基于支持向量机svm的脑部肿瘤识别,脑电波样本熵提取

目录支持向量机SVM的详细原理SVM的定义SVM理论Libsvm工具箱详解简介参数说明易错及常见问题SVM应用实例,基于SVM的的脑部肿瘤识别分类预测代码结果分析展望支持向量机SVM的详细原理SVM的定义支持向量机(supportvectormachines,SVM)... 查看详情

心电信号基于matlab逻辑算法rst波检测含matlab源码2386期

⛄一、小波阈值法去噪概述电能质量扰动信号的噪声大多以高斯白噪声的形式存在,利用小波变换对信号进行多分辨率分解,由于小波变换具有去除数据相关性的特点,故可以将有用信号与噪声的能量分离开来。信号... 查看详情

数字信号去噪基于matlab硬阈值软阈值半软阈值maxmin阈值garrote阈值小波变换心音去噪含matlab源码2064期

一、小波阈值法去噪概述电能质量扰动信号的噪声大多以高斯白噪声的形式存在,利用小波变换对信号进行多分辨率分解,由于小波变换具有去除数据相关性的特点,故可以将有用信号与噪声的能量分离开来。信号中... 查看详情

数字信号去噪基于matlab硬阈值软阈值半软阈值maxmin阈值garrote阈值小波变换心音去噪含matlab源码2064期

一、小波阈值法去噪概述电能质量扰动信号的噪声大多以高斯白噪声的形式存在,利用小波变换对信号进行多分辨率分解,由于小波变换具有去除数据相关性的特点,故可以将有用信号与噪声的能量分离开来。信号中... 查看详情

心电信号基于matlab小波阙值心电信号去噪含matlab源码2188期

一、小波阈值法去噪概述电能质量扰动信号的噪声大多以高斯白噪声的形式存在,利用小波变换对信号进行多分辨率分解,由于小波变换具有去除数据相关性的特点,故可以将有用信号与噪声的能量分离开来。信号中... 查看详情

语音隐藏基于matlab小波变换dwt结合离散余弦变换dct音频数字水印嵌入提取含matlab源码2131期

一、离散小波变换的音频信号数字水印技术简介0引言近年来,数字水印技术的作用越来越重要。数字水印技术是将一些标识信息直接嵌入数字载体当中,或间接表示在信号载体中,且不影响原载体的使用价值。通过隐藏在载体中的... 查看详情

语音隐藏基于matlab小波变换dwt结合离散余弦变换dct音频数字水印嵌入提取含matlab源码2131期

一、离散小波变换的音频信号数字水印技术简介0引言近年来,数字水印技术的作用越来越重要。数字水印技术是将一些标识信息直接嵌入数字载体当中,或间接表示在信号载体中,且不影响原载体的使用价值。通过隐藏在载体中的... 查看详情

图像融合基于matlab双树复小波变换像素级图像融合含matlab源码2024期

...算法,这一算法的提出,使得双树复小波变换能够应用于信号分析和图像处理等领域。与小波变换不同,双树复小波变换具有近似位移不变性、数据冗余有限及方向选择性良好等特点,可以反映图像在六个方向上的分辨率变化。... 查看详情