心率变异性 matlab,求大神给matlab写个注释!!!(心率变异性的频域FFT算法)...

%---------------------------------------------spectral analysis

%use resampling RR interval

clear all;close all;

dat=load('D:\toolbox\matlab\hc03-01.txt');fs=2;

dat=1000*dat;% convert to ms

figure(1); plot(dat);

%select data segment

%----------------------

p_num=2;

figure(2);plot(dat);hold on;

for j=1:p_num

[x_j,y_j]=ginput(1);plot(x_j,y_j,'r+','linewidth',2);hold on;x(j)=x_j;y(j)=y_j;

end;

x=round(x);

d=dat(x(1):x(2));

%-------------- removeartifacts

thr=150; % choose thresholdremove artifact

num_mean=60*2; % number of data points for calculating local mean

conti_num=10*2;

[ind_remove,d1]=remove_artifact_BF(d,num_mean,conti_num,thr);

close all; figure(1);subplot(2,1,1);plot(d);holdon;plot(ind_remove,d(ind_remove),'or');

subplot(2,1,2);plot(d1);

%-------------------------------- psd

fs=2;nfft=256;window=hanning(256);[p,f]=psd(d1,nfft,fs,window,128,'linear');

figure(2)

plot(log2(f),p,'+-');f_bound=[0.04,0.15,0.4];f_y=[0,0,0];

holdon;plot(log2(f_bound),f_y,'or');hold on;

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值