Skip to content

Error in ppg_sqi.use_template(wave, annotation: list, fs: int) #220

Open
@HotDog702

Description

@HotDog702
94:    locs = find_peaks(y[i:])[0]
95:    pks = y[locs]

find_peaks returns peak indexes relative to the beginning of input array, in your case y[i:], so to get peak indexes of the original array, you have to add the index of starting point, namely i. So, correct line must be:
94: locs = find_peaks(y[i:])[0] + i
otherwise the next line returns incorrect pks values
OR:
95: pks = y[i:][locs]

By the way, you can get peak values directly from find_peaks by transferring to it height= parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions