MATLAB Answers

Finding RRI fluctuations (ECG) in 1s windows

3 ビュー (過去 30 日間)
Shamus Sim
Shamus Sim 2020 年 8 月 10 日
コメント済み: Shamus Sim 2020 年 8 月 11 日
This is the code I am running.
%ECG data
load('Dog_1_interictal_segment_0001.mat')
sf = 399.0698; %sampling frequency (Hz), samples per second
T = 1/sf;
timeSeries = T:T:600.8122;
%filtering
%y filtered data
d = designfilt('lowpassfir', ...
'PassbandFrequency',0.15,'StopbandFrequency',0.2, ...
'PassbandRipple',1,'StopbandAttenuation',60, ...
'DesignMethod','equiripple');
y = filtfilt(d,interictal_segment_1.data(1,:));
%findpeak for y signal in row 1
[pks,locs] = findpeaks(y(1,:),'MinPeakDistance',0.3);
I have found the local max for my signal y(1,:). However i would like to find fluctuations in the signal for successive 1 second, non-overlapping windows. Supposed that peaks 1,2,3,4 are successive local max.
Such that:
fluctuation1=peak2-peak1
fluctuation2=peak3-peak2
fluctuations are counted for a total length of 1 second and data is kept in window.1. Repeat for another 1s and keep data in window.2.
I am new to Matlab so any help is appreciated. Thank you.

  0 件のコメント

サインインしてコメントする。

回答 (1 件)

Peng Li
Peng Li 2020 年 8 月 10 日
Your question isn't quite clear. If you want to get fluctuations of subsequent points in a time series as you described above, you can use diff function to do the first order difference, or simply using locs(2:end) - locs(1:end-1) (locs in the variable you defined in your program).
The thing that is confusing is that you are trying to get RRI within a 1-s window. That doesn't make a lot of sense as usually the heart beats about once, or a bit more than twice per second when people exercise. You are not able to get any fluctuations from a single heart beat.

  2 件のコメント

Shamus Sim
Shamus Sim 2020 年 8 月 11 日
Thanks for your feedback!
Its actually ECG for the brain. Thats why T of waves are much shorter.
These sound like good suggestions:
diff function to do the first order difference, or simply using locs(2:end) - locs(1:end-1)
However, could it also include these characteristics?
fluctuations are counted for a total length of 1 second and data is kept in window.1. Repeat for another 1s and keep data in window.2.
Shamus Sim
Shamus Sim 2020 年 8 月 11 日
I mean EEG signal not ECG. Sorry

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by