Closed sunshineinsandiego closed 2 years ago
Hello @sunshineinsandiego !
Thank you for reaching out. The function ecg.ecg
returns an array rpeaks
, which corresponds to the indices of the R-peaks location.
This means that you could obtain the actual value or amplitude for each R-peak in your raw_ecg_data
simply by doing:
raw_ecg_data[rpeaks]
Did this answer your question?
Yes, got it! Thanks much!
Hi - I'm trying to recover the indices corresponding to the identified R-peak locations in my
raw_ecg_data
. From the docs, it appearsrpeaks
is an array with the time locations of each R-peak in ms.For example, if my `rpeaks' array looks like this:
Then I assume the detected R-peaks occur 37ms, 142ms, 159ms...18752ms from the start of the signal.
If my
sampling_rate
is 100hz, then locating the R-peaks in my original data should be a simple as dividing therpeaks
array by1/sampling_rate
.For this example, it would be:
And I would be able to locate the actual value or amplitude for each R-peak in my
raw_ecg_data
as follows:Does this seem accurate? Thanks!