根据matlab的肌电信号管理组织程序
- 格式:doc
- 大小:123.54 KB
- 文档页数:28
使用Matlab进行信号处理的基本步骤引言:信号处理是一种处理和分析信号的技术,广泛应用于通信、音频、图像和视频等领域。
在信号处理过程中,Matlab是一种强大的工具,在处理和分析各种信号时提供了丰富的函数和工具包。
本文将介绍信号处理的基本步骤和Matlab 的应用。
一、信号处理概述信号是一种随时间变化的信息,可以是声音、图像、视频等。
信号处理就是对信号进行采集、变换、调整和分析的过程。
信号处理的目的是从原始信号中提取出有用的信息,去除噪声和干扰,以及改善信号的质量。
二、信号处理的基本步骤1. 信号采集信号采集是信号处理的第一步,通过传感器或设备,将信号从现实世界中转化为数字信号。
在Matlab中,我们可以使用内置函数如`audioread`、`imread`等读取音频和图像信号。
2. 信号预处理信号采集后,通常需要进行一些预处理操作,例如去除噪声、校正偏移量等。
Matlab提供了一系列的数字滤波器函数,如`designfilt`、`filter`等,可以帮助我们实现信号预处理。
3. 信号分析与转换在信号处理过程中,我们通常需要对信号进行分析和转换。
Matlab提供了许多函数和工具箱来进行信号分析,例如傅里叶变换、小波变换、自相关函数等。
这些工具可以帮助我们理解信号的频谱特性、能量分布等。
4. 特征提取信号的特征提取是信号处理的重要环节,通过提取信号的特征,可以用于分类、识别和检测等任务。
Matlab提供了许多特征提取函数,如`melSpectrogram`、`mfcc`等,可以用于提取音频信号的频谱特征。
5. 信号重构与恢复在信号处理过程中,有时需要对信号进行重构和恢复。
这可以通过滤波、插值和拟合等技术来实现。
Matlab提供了一系列的函数和工具箱,如`interp1`、`polyfit`等,可以用于信号重构和恢复。
6. 结果展示信号处理最终的结果需要通过数据可视化的方式进行展示,以便更好地理解和分析。
如何使用Matlab进行神经电信号处理与分析引言神经电信号是用于在神经系统中进行信息传递的电信号。
对于神经科学研究人员来说,了解和分析神经电信号对于揭示大脑的功能和机制至关重要。
Matlab作为一种功能强大的编程语言和开发环境,提供了丰富的工具和函数,可用于处理和分析神经电信号。
本文将介绍如何使用Matlab进行神经电信号处理和分析的基本方法和技巧。
1. 数据导入与预处理首先,我们需要将神经电信号数据导入Matlab环境中进行处理和分析。
常见的神经电信号数据包括脑电图(EEG)、脑磁图(MEG)和神经肌电图(EMG)。
Matlab提供了一系列函数和工具箱来读取不同格式的神经电信号数据文件,如EEGLAB和FieldTrip等。
在导入数据之后,我们还需要对数据进行预处理,以去除噪声和伪装信号。
常见的预处理步骤包括滤波、伪迹去除和去除运动伪迹等。
Matlab提供了诸多滤波函数和技术,如带通滤波、低通滤波和高通滤波等。
通过合理运用这些工具,我们可以对神经电信号数据进行有效的预处理。
2. 特征提取与分析在预处理之后,我们可以开始对神经电信号数据进行特征提取和分析。
特征提取是神经电信号处理中的重要步骤,可以从原始信号中提取出有用的信息。
在Matlab中,我们可以使用一系列函数和算法来提取信号的频域特征、时域特征和空域特征。
频域特征可以用于分析信号的频率成分和频率特征,如功率谱密度和频谱特性等。
Matlab提供了FFT和Periodogram等函数,可用于计算信号的频谱与谱密度。
时域特征包括信号的能量、振幅、时延和相位等。
可以使用Matlab的瞬时特征函数来计算信号的瞬时属性。
空域特征用于分析信号在空间上的分布和变化,如空间滤波和空间相关性等。
Matlab提供了一些函数和工具箱,如EEGLAB和FieldTrip,可用于实现这些分析。
3. 数据可视化与结果展示在特征提取和分析之后,我们通常需要将结果进行可视化展示,以便更好地理解和传达。
Matlab技术在人体生理信号处理中的应用案例解析引言:在当今数字化的时代,人体生理信号的处理越来越重要。
准确地捕捉和分析这些信号有助于我们深入了解人体的生理状况和健康状况。
而Matlab作为一款强大的工具,被广泛应用于人体生理信号的处理。
本文将通过几个应用案例,来展示Matlab技术在人体生理信号处理中的重要作用。
一、脑电图(EEG)处理脑电图是记录大脑电活动的一种生理信号。
它反映了大脑在不同状态下的电活动,被广泛用于研究睡眠、意识状态和神经疾病等。
在脑电图处理中,Matlab提供了丰富的工具和函数来处理和分析原始数据,例如滤波、频域分析和时间域分析等。
通过Matlab的工具箱,可以方便地对脑电图进行去除噪声、频谱分析、时频分析等,进而提取出感兴趣的特征。
这些特征可以用于研究不同的脑电图模式,并为医生提供诊断依据。
二、心电图(ECG)处理心电图是记录心脏电活动的一种生理信号。
它被广泛用于心脏疾病的诊断和监测。
Matlab提供了一套丰富的工具箱,例如信号处理工具箱和心电图工具箱,用于对心电图进行处理和分析。
通过Matlab的滤波技术和傅里叶变换等算法,可以去除心电图中的噪声和干扰,同时还可以提取心电图中的特征,例如心率、ST段变异和QRS波形等。
这些特征对于心脏疾病的早期诊断和监测非常重要。
三、肌电图(EMG)处理肌电图是记录肌肉电活动的一种生理信号。
它可以反映肌肉的收缩和放松状况,被广泛用于研究肌肉活动和肌肉疾病。
在肌电图处理中,Matlab提供了一系列用于去除噪声和分析肌电图的函数和工具箱。
通过Matlab的滤波算法和傅里叶变换等技术,可以准确地提取肌电图中的肌肉活动特征,并用于研究肌肉疾病和运动控制等领域。
四、血氧饱和度(SpO2)处理血氧饱和度是衡量氧气输送至组织的重要指标,通常通过红外线光源和传感器来测量。
Matlab提供了一些工具箱用于对血氧饱和度进行监测和处理。
通过Matlab的数据处理和曲线拟合技术,可以对原始的SpO2数据进行滤波和校正,提高数据的准确性和可信度。
燕山大学课程设计(论文)任务书院(系):电气工程学院基层教学单位:说明:此表一式四份,学生、指导教师、基层教学单位、系部各一份。
年月日二、摘要1)MATLAB的简单介绍MATLAB是美国Mathworks公司开发的新一代科学计算软件:MATLAB是英文MATtrix LABoratory(矩阵实验室)的缩写;MATLAB是一个专门为科学计算而设计的可视化计算器。
利用这个计算器中的简单命令,能快速完成其他高级语言只有通过复杂此案出才能实现的数值计算和图形显示。
MATLAB是一种既可交互使用又能解释执行的计算机编程语言。
所谓交互使用,是指用户输入一条语句后立即就能得到该语句的计算结果,而无需像C语言那样首先编写源程序,然后对之进行编译,连接,才能最终形成可执行文件。
MATLAB语言可以用直观的数学表达式来描述问题,从而避开繁琐的底层编程,因此可大大提高工作效率。
MATLAB是解决工程技术问题的技术平台。
利用它能够轻松完成复杂的数值计算,数据分析,符号计算和数据可视化等任务。
MATLAB软件由主包和各类工具箱构成。
其中,主包基本是一个用C/C++等语言编写成的函数库。
该函数库提供矩阵(或数组)的各种算法以及建立在此基础上的各种应用函数和一些相关的用户有好操作界面。
而工具箱从深度和广度上大大扩展了MATLAB主包的功能和应用领域。
随着自身的不断完善和发展,MATLAB功能越来越强大,应用也越来越广泛。
2)信号测试技术与分析随着机械工业不断向自动化、高精度、智能化等方向的发展,在机械设备运行及生产过程中进行参量测试、分析与诊断等处理过程已成为必要环节,许多信号处理方法如时域统计分析、相关分析、相干分析、频谱分析等已经被广泛被应用与机械工程测试领域。
测试信号通常指的是被测对象的运动或状态信息。
测试信号可以用数学表达式描述,也可以用图形、图表等进行描述。
在工程测试中,有的信号可以用数学公式精确描述,而大量的测试信号却只能用数学公式来近似描述。
燕山大学数字信号处理课程设计肌电信号Matlab程序汇总a=load('C:\Users\Administrator\Desktop\***\60\3\3.txt' b=a(1,:);c=a(2,:);figuresubplot(2,1,1);plot(b);xlabel('时间 ');ylabel('被测变量');title('60度第三组原始信号(通道一)');grid on;subplot(2,1,2);plot(c);xlabel('时间 ');ylabel('被测变量');title('60度第三组原始信号(通道二)');grid on;fprintf('\n60度第二组n通道一时域参数:\n')fprintf(' 均值 = %7.5f\n',mean(b));fprintf(' 标准差 = %7.5f \n',sqrt(var(b)));fprintf(' 方差 = %7.5f \n',var(b));fprintf(' 积分肌电值 = %7.5f \n',mean(abs(b)));fprintf(' 均方根有效值 = %7.5f \n',sqrt(mean(b.^2)) );fprintf('\n60度第二组通道二时域参数:\n')fprintf(' 均值 = %7.5f\n',mean(c));fprintf(' 标准差 = %7.5f \n',sqrt(var(c)));fprintf(' 方差 = %7.5f \n',var(c));fprintf(' 积分肌电值 = %7.5f \n',mean(abs(c)));fprintf(' 均方根有效值= %7.5f \n',sqrt(mean(c.^2)) );a=load('C:\Users\***_\Desktop\Qu180.txt'); %b=a(1,:);b=a(2,:);N=16384;fs=1000;y=fft(b,N);%做16384点傅立叶变换L=length(y);mag=abs(y);f=(0:L-1)/L*fs;figure;plot(f,mag);%幅频谱axis([0 1000 0 1000]);xlabel('频率\HZ');ylabel('幅值');%title('Qu180幅频(通道一) N=2^1^4=16384'); title('Qu180幅频(通道二) N=2^1^4=16384'); grid on;figure;plot(f,angle(y));%相频谱xlabel('频率\HZ');ylabel('相位');%title('Qu180相频(通道一)');title('Qu180相频(通道二)');axis([0 1000 -4 4]);grid on;a=load('C:\Users\***\Desktop\Qu180.txt'); %b=a(1,:);b=a(2,:);N=16384;%设计带阻滤波器(椭圆数字滤波器)wp1=45;wp2=55;%通带截止频率ws1=49.9;ws2=50.1;%阻带起始频率rp=0.3;%通带波纹(db)rs=40;%阻带最小衰减量(db)fs=1000;wp=[wp1,wp2]/(0.5*fs);ws=[ws1,ws2]/(0.5*fs);[n, wc]=ellipord(wp,ws,rp,rs,'z');%[num,den]=ellip(n,rp,rs,wc,'stop');%分子分母向量[H,W]=freqz(num,den);c=filter(num,den,b);%对b进行滤波y1=fft(b,N);%做16384点傅立叶变换L1=length(y1);mag1=abs(y1);f1=(0:L1-1)/L1*fs;figure;plot(f1,mag1);%幅频谱axis([0 1000 0 1000]);xlabel('频率\HZ');ylabel('幅值');%title('Qu180幅频(通道一)滤波前');title('Qu180幅频(通道二)滤波前'); grid on;y2=fft(c,N);%做16384点傅立叶变换L2=length(y2);mag2=abs(y2);f2=(0:L2-1)/L2*fs;figure;plot(f2,mag2);%幅频谱axis([0 1000 0 1000]);xlabel('频率\HZ');ylabel('幅值');%title('Qu180幅频(通道一)滤波后'); title('Qu180幅频(通道二)滤波后');。
燕山大学课程设计说明书题目:基于matlab的肌电信号工频干扰的消除学院(系):电气工程学院年级专业: 09级测控仪表学号学生姓名:指导教师:教师职称:燕山大学课程设计(论文)任务书院(系):电气工程学院基层教学单位:自动化仪表系2012年 6 月 29日燕山大学课程设计评审意见表摘要肌电信号是产生肌肉力的电信号根源,它是肌肉中很多运动单元动作电位在时间和空间上的叠加,反映了神经,肌肉的功能状态,在基础医学研究、临床诊断和康复工程中有广泛的应用。
梳状滤波器它是由许多按一定频率间隔相同排列的通带和阻带,只让某些特定频率范围的信号通过。
梳状滤波器其特性曲线象梳子一样,故称为梳状滤波器。
本文主要介绍使用梳状滤波器消除在检测和记录肌电信号时噪声和干扰的影响,如50HZ的工频及其谐波,并使用MATLAB软件对原信号、滤波器、处理信号进行频谱分析,观察其频谱特性。
关键词:梳状滤波器;MATLAB;频谱分析目录第一章设计过程 (6)1.1滤波器设计结构图 (6)1.2设计滤波器步骤 (6)第二章 MATLAB的应用 (6)2.1MATLAB语言简介 (6)2.2一些函数及指令简介 (7)第三章程序和仿真图 (9)3.1滤波器设计程序及仿真图 (9)3.2原始信号的频谱分析 (11)3.3信号滤波的程序设计及频谱分析 (12)第4章学习心得 (16)参考文献 (17)第一章设计过程1.1滤波器设计结构图椭圆滤波器设计结构图如图所示:连续混合信号图4.1结构框图1.2设计数字滤波器的步骤1.确定数字滤波器的性能指标:Wp、Ws、Rp、Rs、N、Wc。
2. 将数字滤波器的性能指标转化成相应模拟滤波器的性能指标。
3.设计满足指标要求的模拟滤波器Ha(s)。
4.通过变换将模拟滤波器转换成数字滤波器4.数字滤波器的MATLAB实现和频谱分析第二章 MATLAB的应用2.1 MATLAB语言简介MATlAB是在20世纪80年代初期,由美国的MathWorks软件开发公司正式推出的一种数学工具软件。
积分肌电 matlab积分肌电(Surface Electromyography,简称sEMG)是一种测量肌肉活动的方法,通过记录肌肉表面电位信号来研究肌肉的功能和运动控制。
在医学、生物力学和运动科学等领域中,积分肌电被广泛应用于肌肉功能评估、姿势控制、运动分析和康复训练等方面。
Matlab作为一种强大的科学计算软件,为积分肌电的研究提供了丰富的工具和功能。
在Matlab中,可以使用不同的函数和工具箱来处理和分析积分肌电数据,从而获得对肌肉活动的深入理解。
积分肌电数据采集是积分肌电研究的第一步。
通过将电极贴附在肌肉表面,可以记录到肌肉收缩引起的电位变化。
Matlab提供了一些函数和工具箱,可以帮助研究人员快速、准确地采集积分肌电数据。
例如,使用MATLAB的Data Acquisition Toolbox,可以方便地与数据采集设备进行通信,并实时获取肌电信号。
接下来,积分肌电数据预处理是对原始数据进行滤波、去噪和特征提取的过程。
Matlab提供了丰富的信号处理函数和工具箱,可以帮助研究人员对积分肌电信号进行预处理。
例如,使用MATLAB的Signal Processing Toolbox,可以对积分肌电信号进行滤波处理,去除噪声和干扰。
另外,使用MATLAB的Wavelet Toolbox,可以对积分肌电信号进行小波变换,提取出有用的频域特征。
然后,积分肌电数据分析是对预处理后的数据进行进一步分析和解释的过程。
Matlab提供了丰富的数据分析函数和工具箱,可以帮助研究人员对积分肌电数据进行统计分析、图像处理和机器学习等。
例如,使用MATLAB的Statistics and Machine Learning Toolbox,可以对积分肌电数据进行统计分析,比如计算均值、方差和相关系数等。
另外,使用MATLAB的Image Processing Toolbox,可以对积分肌电数据进行图像处理和分割,提取出肌肉活动的关键特征。
matlab中ecg用法-回复Matlab中的ECG用法Matlab是一种功能强大的数学计算和数据可视化软件,广泛应用于各个领域,包括生物医学工程。
在生物医学领域中,心电图(ECG)是一种重要的检测和诊断工具。
本文将介绍Matlab中的一些ECG用法,并逐步回答与之相关的问题。
一、什么是心电图(ECG)?心电图是反映人体心肌电活动的一种生理学信号图形记录,通常通过电极贴在人体胸部获取。
ECG记录了心脏在一定时间内的一系列电信号,可以用来检测和诊断心脏疾病。
二、如何在Matlab中读取和显示ECG数据?在Matlab中,可以使用`load`函数或`csvread`函数加载以文本格式存储的ECG数据。
读取ECG数据后,可以使用`plot`函数将ECG信号绘制成图形进行显示。
以下是一个示例代码:matlabdata = load('ecg_data.txt');time = 1:length(data); 创建时间轴figure;plot(time, data);xlabel('时间(ms)');ylabel('电压(mV)');title('ECG信号');上述代码读取名为`ecg_data.txt`的文本文件,并将其绘制成ECG信号曲线。
`xlabel`和`ylabel`函数用于设置坐标轴的标签,`title`用于设置图形的标题。
三、如何进行ECG数据的滤波处理?ECG信号中常常存在各种噪声,包括基线漂移和高频干扰等。
为了提取出ECG信号的有效信息,需要对数据进行滤波处理。
Matlab中提供了多种滤波函数,如`medfilt1`、`filtfilt`和`butter`等。
以下是一个使用巴特沃斯滤波器对ECG数据进行滤波的示例代码:matlabfs = 1000; 采样率(Hz)fc = 50; 截止频率(Hz)[b, a] = butter(2, fc/(fs/2), 'high'); 创建二阶高通巴特沃斯滤波器系数filtered_data = filtfilt(b, a, data); 使用滤波器对数据进行滤波plot(time, filtered_data);xlabel('时间(ms)');ylabel('电压(mV)');title('滤波后的ECG信号');上述代码创建了一个二阶高通巴特沃斯滤波器,截止频率为50Hz,并使用`filtfilt`函数将ECG数据进行滤波处理。
肌电信号采集流程和注意事项下载温馨提示:该文档是我店铺精心编制而成,希望大家下载以后,能够帮助大家解决实际的问题。
文档下载后可定制随意修改,请根据实际需要进行相应的调整和使用,谢谢!并且,本店铺为大家提供各种各样类型的实用资料,如教育随笔、日记赏析、句子摘抄、古诗大全、经典美文、话题作文、工作总结、词语解析、文案摘录、其他资料等等,如想了解不同资料格式和写法,敬请关注!Download tips: This document is carefully compiled by theeditor. I hope that after you download them,they can help yousolve practical problems. The document can be customized andmodified after downloading,please adjust and use it according toactual needs, thank you!In addition, our shop provides you with various types ofpractical materials,such as educational essays, diaryappreciation,sentence excerpts,ancient poems,classic articles,topic composition,work summary,word parsing,copy excerpts,other materials and so on,want to know different data formats andwriting methods,please pay attention!一、肌电信号采集流程1. 准备工作选择合适的肌电采集设备,如肌电图仪、表面电极等。
基于matlab的肌电信号处理程序:function varargout = untitled(varargin)% UNTITLED M-file for untitled.fig% UNTITLED, by itself, creates a new UNTITLED or raises the existing% singleton*.%% H = UNTITLED returns the handle to a new UNTITLED or the handle to% the existing singleton*.%% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in UNTITLED.M with the given input arguments. %% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before untitled_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application % stop. All inputs are passed to untitled_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 untitled % Last Modified by GUIDE v2.5 08-Nov-2014 12:45:18% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @untitled_OpeningFcn, ...'gui_OutputFcn', @untitled_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 untitled is made visible.function untitled_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 untitled (see VARARGIN)% Choose default command line output for untitledhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes untitled wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = untitled_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)% 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 s;global a;global t;global count;% count=1;[filename,filepath]=uigetfile('*.txt','Ñ¡ÔñÎļþ');%Ñ¡ÔñÊý¾ÝÎļþstr=[filepath filename];s=load(str);a=s(:,7);t=s(:,1);axes(handles.axes1);plot(t,a);xlabel('ʱ¼ä');ylabel('±äÁ¿');title('ÔʼÐźÅ');if count==2global s2;global a2;global t2;[filename,filepath]=uigetfile('*.txt','Ñ¡ÔñÎļþ'); str=[filepath filename];s2=load(str);a2=s2(:,7);t2=s2(:,1);plot(handles.axes2,t2,a2);endcount=1;% --- 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) global a;global t;global s;global y;% global IR;% global SORH;y=fft(a,20000);M =length (a) ;N=length(y);p=size(a);% s1=a(1:20000);[C L]=wavedec(a,3,'db5');cA3=appcoef(C,L,'db5',3);cD1=detcoef(C,L,1);cD2=detcoef(C,L,2);cD3=detcoef(C,L,3);thr1=thselect(cD1,'rigrsure');thr2=thselect(cD2,'rigrsure');thr3=thselect(cD3,'rigrsure');TR=[thr1,thr2,thr3];SORH='s';[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,...'db5',3,TR,SORH);L=p(2);x=a;h=XC;F=0;M=0;for ii=1:Lm(ii)=(x(ii)-y(ii))^2;t(ii)=y(ii)^2;f(ii)=t(ii)/m(ii);F=F+f(ii);M=M+m(ii);end;SNR=10*log10(F);MSE=M/N;SM=SNR/MSE;axes(handles.axes2);plot(XC(1:10000));xlabel('ʱ¼ä');ylabel('±äÁ¿');title('È¥ÔëºóÐźÅ');% plot(handles.axes2,XC(1:20000));% --- 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) global a;global t;global y;global count;%a=EMG3(1:points,2);y=fft(a,20000); %¶ÔÐźŽøÐпìËÙFourier±ä»»fs=2000;N=length(y);mag=abs(y);%ÇóµÃFourier±ä»»ºóµÄÕñ·ùf=(0:N-1)/N*fs; %ƵÂÊÐòÁÐaxes(handles.axes1);plot(f,mag);% plot(handles.axes1,f,mag);%»æÖÆÍ¼ÐÎxlabel('ƵÂÊ');ylabel('·ùÖµ');title('Ô¼¡µç·ùƵN=20000');if count==2global a2;global t2;global y2;%a=EMG3(1:points,2);y2=fft(a2,20000); %¶ÔÐźŽøÐпìËÙFourier±ä»»fs=2000;N=length(y2);mag=abs(y2);%ÇóµÃFourier±ä»»ºóµÄÕñ·ùf=(0:N-1)/N*fs; %ƵÂÊÐòÁÐaxes(handles.axes2);plot(f,mag);endcount=1;% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% 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) global a;global t;% global IR;% global SORH;[C L]=wavedec(a,3,'db5');cA3=appcoef(C,L,'db5',3);cD1=detcoef(C,L,1);cD2=detcoef(C,L,2);cD3=detcoef(C,L,3);thr1=thselect(cD1,'rigrsure');thr2=thselect(cD2,'rigrsure');thr3=thselect(cD3,'rigrsure');TR=[thr1,thr2,thr3];SORH='s';[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,...'db5',3,TR,SORH);y1=fft(XC,20000);fs=2000;N=length(y1);mag1=abs(y1);f=(0:N-1)/N*fs;axes(handles.axes2);plot(f,mag1);xlabel('ƵÂÊ');ylabel('·ùÖµ');title('È¥Ôëºó·ùƵN=20000');% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% 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) global a;global t;global y;global count;N=length(y);f=(0:N-1)/N*fs;%ƵÂÊÐòÁÐaxes(handles.axes1);plot(f,angle(y));xlabel('ƵÂÊ');ylabel('Ïàλ');title('Ô¼¡µçÏàÆµ');% plot(handles.axes1,f,angle(y));%»æÖÆÏàÆµÌØÐÔͼif count==2global a2;global t2;global y2;fs=2000;N=length(y2);f=(0:N-1)/N*fs;%ƵÂÊÐòÁÐaxes(handles.axes2);plot(f,angle(y2));xlabel('ƵÂÊ');ylabel('Ïàλ');title('Ô¼¡µçÏàÆµ');end% plot(handles.axes1,f,angle(y));%»æÖÆÏàÆµÌØÐÔͼ% --- Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% 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) global a;global t;[C L]=wavedec(a,3,'db5');cA3=appcoef(C,L,'db5',3);cD1=detcoef(C,L,1);cD2=detcoef(C,L,2);cD3=detcoef(C,L,3);thr1=thselect(cD1,'rigrsure');thr2=thselect(cD2,'rigrsure');thr3=thselect(cD3,'rigrsure');TR=[thr1,thr2,thr3];SORH='s';[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,...'db5',3,TR,SORH);y1=fft(XC,20000);fs=2000;N=length(y1);f=(0:N-1)/N*fs;axes(handles.axes2);plot(f,angle(y1));xlabel('ƵÂÊ');ylabel('Ïàλ');title('È¥Ôëºó¼¡µçÏàÆµ');% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% 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) trydelete(allchild(handles.axes1));delete(allchild(handles.axes2));set(handles.edit1,'string','');set(handles.edit1,'string','');set(handles.edit3,'string','');set(handles.edit4,'string','');set(handles.edit5,'string','');set(handles.edit6,'string','');end% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% 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) global a;global t;global s;y=fft(a,20000);fs=2000;N=length(y);mag=abs(y);f=(0:N-1)/N*fs;power1=(mag.^2)/20000; axes(handles.axes1);plot(f,power1);xlabel('ƵÂÊ');ylabel('¹¦ÂÊÆ×');title('Ô¼¡µç¹¦ÂÊÆ×'); global count;global a2;global t2;global s2;if count==2y2=fft(a2,20000);fs=2000;N=length(y2);mag=abs(y2);f=(0:N-1)/N*fs;power1=(mag.^2)/20000; axes(handles.axes2);plot(f,power1);xlabel('ƵÂÊ');ylabel('¹¦ÂÊÆ×');title('Ô¼¡µç¹¦ÂÊÆ×');endcount=1;% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% 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) global a;global t;global s;s=fft(a,2000);[C L]=wavedec(a,3,'db5');cA3=appcoef(C,L,'db5',3);cD1=detcoef(C,L,1);cD2=detcoef(C,L,2);cD3=detcoef(C,L,3);thr1=thselect(cD1,'rigrsure');thr2=thselect(cD2,'rigrsure');thr3=thselect(cD3,'rigrsure');TR=[thr1,thr2,thr3];[XC,CXC,LXC,PERFO,PERF2]=wdencmp('lvd',a,...'db5',3,TR,SORH);y1=fft(XC,20000);fs=2000;N=length(y1);mag=abs(y1);f=(0:N-1)/N*fs;power1=(mag.^2)/20000;%axes(handles.axes2);plot(f,power1);xlabel('ƵÂÊ');ylabel('¹¦ÂÊÆ×');title('È¥Ôëºó¼¡µç¹¦ÂÊÆ×');% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% 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) %Çó¾ùÖµset(handles.edit1,'string',mean(a));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 pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% 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) global a;set(handles.edit3,'string',sqrt(var(a)));function edit3_Callback(hObject, eventdata, handles)% hObject handle to edit3 (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 edit3 as text% str2double(get(hObject,'String')) returns contents of edit3 as a double% --- Executes during object creation, after setting all properties.function edit3_CreateFcn(hObject, eventdata, handles)% hObject handle to edit3 (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 pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles)% 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)global a;set(handles.edit4,'string',var(a));function edit4_Callback(hObject, eventdata, handles)% hObject handle to edit4 (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 edit4 as text% str2double(get(hObject,'String')) returns contents of edit4 as a double% --- Executes during object creation, after setting all properties.function edit4_CreateFcn(hObject, eventdata, handles)% hObject handle to edit4 (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 pushbutton13.function pushbutton13_Callback(hObject, eventdata, handles)% hObject handle to pushbutton13 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Çó»ý·Ö¼¡µçÖµIEMGglobal a;set(handles.edit5,'string',mean(abs(a)));function edit5_Callback(hObject, eventdata, handles)% hObject handle to edit5 (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 edit5 as text% str2double(get(hObject,'String')) returns contents of edit5 as a double% --- Executes during object creation, after setting all properties.function edit5_CreateFcn(hObject, eventdata, handles)% hObject handle to edit5 (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 pushbutton14.function pushbutton14_Callback(hObject, eventdata, handles)% hObject handle to pushbutton14 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%Çó¾ù·½¸ùÓÐЧֵRMSglobal a;set(handles.edit6,'string',sqrt(mean(a.^2)));function edit6_Callback(hObject, eventdata, handles)% hObject handle to edit6 (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 edit6 as text% str2double(get(hObject,'String')) returns contents of edit6 as a double% --- Executes during object creation, after setting all properties.function edit6_CreateFcn(hObject, eventdata, handles)% hObject handle to edit6 (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 pushbutton15.function pushbutton15_Callback(hObject, eventdata, handles)% hObject handle to pushbutton15 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) global a;global t;global s;y=fft(a,20000);fs=2000;N=length(y);mag=abs(y);f=(0:N-1)/N*fs;power1=(mag.^2)/20000;ss=sum(power1);m2=0.5*ss;df=fs/N;m1=0.5*df*(sum(power1(1:N-1))+sum(power1(2:N)));MPF=m1/m2;set(handles.edit7,'string',MPF);function edit7_Callback(hObject, eventdata, handles)function edit7_Callback(hObject, eventdata, handles)% hObject handle to edit7 (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 edit7 as text% str2double(get(hObject,'String')) returns contents of edit7 as a double% --- Executes during object creation, after setting all properties.function edit7_CreateFcn(hObject, eventdata, handles)% hObject handle to edit7 (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。