Detection

ECG

Cardio.detectRPeaksFunction
detectRPeaks(ecg::Vector{<:Real}, samplerate::Real; minPeakDist::Real = 0.360)

Find R peaks in ECG signals as specified by Benitez et al. See http://dx.doi.org/10.1016/S0010-4825(01)00009-9 for more information.

Args:

  • ecg: ECG data
  • samplerate: Sampling rate [Hz]
  • minPeakDist: minimum distance between consecutive peaks [s]

Return:

  • 'res::Vector{Int64}': Vector containing the position of the R peaks in ecg, divide by samplerate to get values in a time base
source
plot(ecg, lab = "")
peaks = detectRPeaks(ecg, 250) # signal was sampled at 250 Hz
scatter!(peaks, ecg[peaks], lab = "R peaks")
Cardio.getECGBaselineFunction
getECGBaseline(ecg::Vector{<:Real}, samplerate::Real)

Get the baseline of an ECG signal for baseline correction. Source: Advances in Cardiac Signal Processing - Acharya, U.R. and Suri, J. and Spaan, J.A.E. and Krishnan, S.M. and Technologies, B. - ISBN: 9783540366751 page: 58f. adaption by Jan F. Kraemer

Args:

  • ecg: ECG signal
  • samplerate: Sampling rate
source
plot(ecg, lab = "")
baseline = getECGBaseline(ecg, 250) # signal was sampled at 250 Hz
plot!(baseline, lab = "baseline", linewidth = 2)

Blood Pressure

Cardio.detectPWPeaksFunction
detectPWPeaks(signal::Vector{<:Real}, fs::Real; windowLength::Int = 300, tuning::Real = 0.7)

Find Peaks in a pulsewave signal with an algorithm proposed by Nenova, B., & Iliev, I. (2010). An automated algorithm for fast pulse wave detection. International Journal Bioautomation, 14(3), 203.

Args:

  • signal: Pulswave data
  • fs: Sampling Frequency [Hz]
  • windowLenght: Optional length of the window in ms. (standard: 300ms)
  • tuning: fine tuning to filter Peaks below a certain height

Return:

Returns a Vector containing the Peak indices. Use signal[indices] to access the Peak values.

source
plot(bp, lab = "")
peaks = detectPWPeaks(bp, 1000) # signal was sampled at 1000 Hz
scatter!(peaks, bp[peaks], lab = "Systolic pressure")