Finding RRI fluctuations (ECG) in 1s windows

2 Ansichten (letzte 30 Tage)
Shamus Sim
Shamus Sim am 10 Aug. 2020
Kommentiert: Shamus Sim am 11 Aug. 2020
This is the code I am running.
%ECG data
sf = 399.0698; %sampling frequency (Hz), samples per second
T = 1/sf;
timeSeries = T:T:600.8122;
%y filtered data
d = designfilt('lowpassfir', ...
'PassbandFrequency',0.15,'StopbandFrequency',0.2, ...
'PassbandRipple',1,'StopbandAttenuation',60, ...
y = filtfilt(d,,:));
%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:
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.

Antworten (1)

Peng Li
Peng Li am 10 Aug. 2020
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 Kommentare
Shamus Sim
Shamus Sim am 11 Aug. 2020
I mean EEG signal not ECG. Sorry

Melden Sie sich an, um zu kommentieren.


Mehr zu ECG / EKG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by