onsets.py 文件源码

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

项目:untwist 作者: IoSR-Surrey 项目源码 文件源码
def process(self, X):
        onset_func = zscore(self.func(X))
        onset_func = signal.filtfilt(self.moving_avg_filter, 1, onset_func)
        onset_func = onset_func - signal.medfilt(
            onset_func[:,np.newaxis], self.median_kernel
        )[:,0]
        peaks = signal.argrelmax(onset_func)
        onsets = peaks[0][np.where(onset_func[peaks[0]] >
            self.threshold)]
        return onsets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号