【肌电信号】脉搏信号分析(去噪+特征提取)matlab源码含GUI
一、簡介
EMG,應(yīng)用電子學(xué)儀器記錄肌肉靜止或收縮時的電活動,及應(yīng)用電刺激檢查神經(jīng)、肌肉興奮及傳導(dǎo)功能的方法。英文簡稱EMG。通過此檢查可以確定周圍神經(jīng)、神經(jīng)元、神經(jīng)肌肉接頭及肌肉本身的功能狀態(tài)。\ 通過測定運動單位電位的時限、波幅,安靜情況下有無自發(fā)的電活動,以及肌肉大力收縮的波型及波幅,可區(qū)別神經(jīng)原性損害和肌原性損害,診斷脊髓前角急、慢性損害(如脊髓前灰質(zhì)炎、運動神經(jīng)元疾病),神經(jīng)根及周圍神經(jīng)病變(例如肌電圖檢查可以協(xié)助確定神經(jīng)損傷的部位、程度、范圍和預(yù)后)。另外對神經(jīng)嵌壓性病變、神經(jīng)炎、遺傳代謝障礙神經(jīng)病、各種肌肉病也有診斷價值。此外,肌電圖還用于在各種疾病的治療過程中追蹤疾病的恢復(fù)過程及療效。\ 利用計算機技術(shù),可作肌電圖的自動分析,如解析肌電圖、單纖維肌電圖以及巨肌電圖等,提高診斷的陽性率。\ 肌電圖檢查多用針電極及應(yīng)用電刺激技術(shù),檢查過程中有一定的痛苦及損傷 ,因此除非必要 ,不可濫用此項檢查。另外,檢查時要求肌肉能完全放松或作不同程度的用力,因而要求受檢者充分合作。對于某些檢查,檢查前要停藥,如新斯地明類藥物應(yīng)于檢查前16小時停用\ 記錄肌肉動作電位的曲線(電描記圖)稱為肌電圖。縮寫為EMG。實際使用的描記方法有兩種:一種是表面導(dǎo)出法,即把電極貼附在皮膚上導(dǎo)出電位的方法;另一種是針電極法,即把針電極刺入肌肉導(dǎo)出局部電位的方法。用后一種方法能分別記錄肌肉每次的動作電位,而根據(jù)從每秒數(shù)次到二、三十次的肌肉動作電位情況,發(fā)現(xiàn)頻率的異常。應(yīng)用肌電圖還可以診斷運動機能失常的原因。平常所用的針電極稱為同心電極,它是把細針狀電極穿過注射針的中心,兩者絕緣固定制成的。
二、源代碼
``` %% Program Start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 名稱:信號處理課程設(shè)計 %% 功能:脈搏檢測系統(tǒng)GUI主界面 %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
function varargout = mainjiemian(varargin) % MAINJIEMIAN MATLAB code for mainjiemian.fig % MAINJIEMIAN, by itself, creates a new MAINJIEMIAN or raises the existing % singleton. % % H = MAINJIEMIAN returns the handle to a new MAINJIEMIAN or the handle to % the existing singleton. % % MAINJIEMIAN('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in MAINJIEMIAN.M with the given input arguments. % % MAINJIEMIAN('Property','Value',...) creates a new MAINJIEMIAN or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before mainjiemianOpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to mainjiemianOpeningFcn 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 mainjiemian
% Last Modified by GUIDE v2.5 29-Apr-2021 12:18:07
% Begin initialization code - DO NOT EDIT guiSingleton = 1; guiState = struct('guiName', mfilename, ... 'guiSingleton', guiSingleton, ... 'guiOpeningFcn', @mainjiemianOpeningFcn, ... 'guiOutputFcn', @mainjiemianOutputFcn, ... 'guiLayoutFcn', [] , ... 'guiCallback', []); if nargin && ischar(varargin{1}) guiState.gui_Callback = str2func(varargin{1}); end
if nargout [varargout{1:nargout}] = guimainfcn(guiState, varargin{:}); else guimainfcn(guiState, varargin{:}); end % End initialization code - DO NOT EDIT
% --- Executes just before mainjiemian is made visible. function mainjiemian_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 mainjiemian (see VARARGIN)
% Choose default command line output for mainjiemian handles.output = hObject; ha=axes('units','normalized','position',[0 0 1 1]); uistack(ha,'down') II=imread('1.jpg'); image(II) colormap gray set(ha,'handlevisibility','off','visible','off'); % Update handles structure
% Update handles structure guidata(hObject, handles);
% UIWAIT makes mainjiemian wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = mainjiemian_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 togglebutton1. function togglebutton1_Callback(hObject, eventdata, handles) untitled; % hObject handle to togglebutton1 (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 togglebutton1
% --- Executes on button press in togglebutton2. function togglebutton2_Callback(hObject, eventdata, handles) yuchuli; % hObject handle to togglebutton2 (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 togglebutton2
% --- Executes on button press in togglebutton3. function togglebutton3_Callback(hObject, eventdata, handles) tezheng; % hObject handle to togglebutton3 (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 togglebutton3
% --- Executes when figure1 is resized. function figure1SizeChangedFcn(hObject, eventdata, handles) % hObject handle to figure1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) if nargout [varargout{1:nargout}] = guimainfcn(guiState, varargin{:}); else guimainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT
% --- Executes just before jidian is made visible. function jidian_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 jidian (see VARARGIN)
% Choose default command line output for jidian handles.output = hObject; ha=axes('units','normalized','position',[0 0 1 1]); uistack(ha,'down') II=imread('666.jpg'); image(II) colormap gray set(ha,'handlevisibility','off','visible','off');
axes(handles.axes1); axes(handles.axes2); axes(handles.axes3); axes(handles.axes4); axes(handles.axes5); axes(handles.axes6); % Update handles structure guidata(hObject, handles);
% UIWAIT makes jidian wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = jidian_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 when figure1 is resized. function figure1_SizeChangedFcn(hObject, eventdata, handles) % hObject handle to figure1 (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 pushbutton1. function pushbutton1Callback(hObject, eventdata, handles) %%%%%把代碼放到這,運行時自動加載 [filename,filepath]=uigetfile('C:\Users\dell\Desktop\信號處理課設(shè)-----楊碩\初始脈搏數(shù)據(jù)\MaiBobefore.txt'); filename=[filepath,filename]; [t,Plusepre]=textread(filename,'%f%f','headerlines',1);%讀入2個浮點值,并跳過文檔的第1行 [m,n]=size(Plusepre); n=3; s3=Plusepre;
%%%%%%%%%%%%—————提取2000個點進行數(shù)據(jù)處理——————%%%%%%%%%%%%%%%%%%%% fs=360;%采樣率 x0=s3(1:2000);%取1到2000共2000個點 t=1:length(x0);%length(x0)指x0數(shù)組元素的個數(shù) axes(handles.axes1); plot(t,x0) xlabel('采樣點'); ylabel('magtitude'); title('標準脈搏信號') box1=msgbox('正在加載請稍候','提示'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%初步去除基線漂移%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%中值濾波%%%%%%%%%%%%%%%%%%%%%%%%%%%% L1=medfilt1(x0,330); %一維中值濾波,x0為數(shù)組,即要處理原始波形,n是中值濾波器的參數(shù),L1是濾波以后的結(jié)果(數(shù)組) L2=x0-L1; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%頻譜%%%%%%%%%%%%%%%%%%%%%%%% N=length(x0);%樣點個數(shù) df=fs/(N-1);%分辨率 f=(0:N-1)df;%其中每點的頻率 Y=fft(L2(1:N))/N2;%真實的幅值 axes(handles.axes2); plot(f(1:N/2),abs(Y(1:N/2)));%傅里葉變換后的頻譜圖是對稱的,這里需要一半就可以了 xlabel('頻率/Hz'); ylabel('振幅'); axis ( [0 100 0 0.4] ); title('中值濾波后脈搏信號頻率譜') drawnow; ```
三、運行結(jié)果
\ \ \ \ \
四、備注
版本:2014a
總結(jié)
以上是生活随笔為你收集整理的【肌电信号】脉搏信号分析(去噪+特征提取)matlab源码含GUI的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何推销自己?
- 下一篇: 叮咚~您有一份GitHub2020年度报