0
点赞
收藏
分享

微信扫一扫

【信号处理】脉搏信号处理系统含Matlab源码

1 简介

脉搏信号是人体最重要的生理信号之一,它包含大量生理病理信息.体内各种状态变化都会反映在脉搏信号中.而脉搏信号的改变或杂音的出现,往往是人体各器官病症的最早表征.脉搏信号的研究可以清楚地了解身体的生理特性,为疾病诊断提供重要依据.

2 部分代码

%% Program Start
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 
%% 功能:脉搏信号处理系统GUI预处理对比界面
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
function varargout = COPM(varargin)
% COPM MATLAB code for COPM.fig
% COPM, by itself, creates a new COPM or raises the existing
% singleton*.
%
% H = COPM returns the handle to a new COPM or the handle to
% the existing singleton*.
%
% COPM('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in COPM.M with the given input arguments.
%
% COPM('Property','Value',...) creates a new COPM or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before COPM_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to COPM_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 COPM
% Last Modified by GUIDE v2.5 15-Dec-2019 20:03:34
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @COPM_OpeningFcn, ...
'gui_OutputFcn', @COPM_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 COPM is made visible.
function COPM_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 COPM (see VARARGIN)
% Choose default command line output for COPM
handles.output = hObject;
ha=axes('units','normalized','position',[0 0 1 1]);
uistack(ha,'down')
II=imread('888.jpg');
image(II)
colormap gray
set(ha,'handlevisibility','off','visible','off');
% Update handles structure
axes(handles.axes1);
axes(handles.axes2);
axes(handles.axes3);
axes(handles.axes4);
axes(handles.axes5);
axes(handles.axes6);
axes(handles.axes7);
axes(handles.axes8);
axes(handles.axes9);
axes(handles.axes10);
axes(handles.axes11);
axes(handles.axes12);
% Update handles structure
guidata(hObject, handles);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%前面的代码不用管
% UIWAIT makes COPM wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = COPM_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)
%%%%%把代码放到这,运行时自动加载
[filename,filepath]=uigetfile('C:\Users\dell\Desktop\信号处理课设-----杨硕\初始脉搏数据\MaiBobefore.txt');
filename=[filepath,filename];
[t,Pluse_pre]=textread(filename,'%f%f','headerlines',1);%读入2个浮点值,并跳过文档的第1行
[m,n]=size(Pluse_pre);
n=3;
s3=Pluse_pre;
%%%%%%%%%%%%—————提取2000个点进行数据处理——————%%%%%%%%%%%%%%%%%%%%
fs=360;%采样率
x0=s3(1:2000);%取1到2000共2000个点
t=1:length(x0);%length(x0)指x0数组元素的个数
axes(handles.axes1);
plot(t,x0)
xlabel('采样点');
ylabel('magtitude');
title('标准脉搏信号')
box1=msgbox('正在加载请稍候','提示');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%初步去除基线漂移%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%中值滤波%%%%%%%%%%%%%%%%%%%%%%%%%%%%
L1=medfilt1(x0,330); %一维中值滤波,x0为数组,即要处理原始波形,n是中值滤波器的参数,L1是滤波以后的结果(数组)
L2=x0-L1;
axes(handles.axes2);
plot(t,L2)
xlabel('采样点');
ylabel('magtitude');
title('中值滤波后的脉搏信号')
drawnow;%刷新屏幕,实时显示
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%频谱%%%%%%%%%%%%%%%%%%%%%%%%
N=length(x0);%样点个数
df=fs/(N-1);%分辨率
f=(0:N-1)*df;%其中每点的频率
Y=fft(L2(1:N))/N*2;%真实的幅值
axes(handles.axes3);
plot(f(1:N/2),abs(Y(1:N/2)));%傅里叶变换后的频谱图是对称的,这里需要一半就可以了
xlabel('频率/Hz');
ylabel('振幅');
axis ( [0 100 0 0.4] );
title('中值滤波后脉搏信号频率谱')
drawnow;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%去除工频干扰%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%利用双线性变换法设计butterworth带阻滤波器
f0=90;%工频干扰频率90Hz
B1=0.3;
N=2;
fs=360;%采样率
T=1/fs;
rp=3;%通带衰减
rs=N/2*10;%阻带衰减
w

3 仿真结果

【信号处理】脉搏信号处理系统含Matlab源码_ide

【信号处理】脉搏信号处理系统含Matlab源码_中值滤波_02

【信号处理】脉搏信号处理系统含Matlab源码_ide_03

【信号处理】脉搏信号处理系统含Matlab源码_中值滤波_04

4 参考文献

[1]陈晓彤. 脉搏信号预处理与特征提取[D]. 西安科技大学, 2015.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

【信号处理】脉搏信号处理系统含Matlab源码_信号处理_05

举报

相关推荐

0 条评论