segmentation.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:DTW_physionet2016 作者: JJGO 项目源码 文件源码
def get_intervals(pcg, transitions=None, interval='RR', resize=None):
    """
    Given array transitions and a interval type
    computes an array of starting indices and ending indices for that
    given type of interval.

    Args:
        pcg : numpy array
        transitions : tuple( numpy array begin, numpy array end)
            begin - indices where the intervals start
            end   - indices where the intervals end
        interval : string
            Type of interval [RR, S1, Sys, S2, Dia]. Defaults to RR
        resize : int
            resample the interval to a specified length
    Returns:
        intervals : list<numpy array>
            list of intervals of the specified type
    """

    intervals = [pcg[i:j] for i, j in zip(*boundaries(transitions, interval))]
    if resize:
        intervals = [resample(i, resize) for i in intervals]
    return intervals
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号