cf_kt.py 文件源码

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

项目:PhasePApy 作者: austinholland 项目源码 文件源码
def _statistics(self):
    data = self.tr.data
    t = np.arange(0, self.delta * self.npts, self.delta)
    m = len(data)
    Nsta = int(self.t_win * self.sampling_rate)

    # compute the short time average (STA)
    kt = np.zeros(m, dtype='float64')
    pad_kt = np.zeros(Nsta)
    # Tricky: Construct a big window of length len(a)-nsta. Now move this
    # window nsta points, i.e. the window "sees" every point in a at least
    # once.
    # Changed xrange to range as it is compatible in both python 2 & 3
    for i in range(m):  # window size to smooth over
        kt[i] = abs(kurtosis(data[i-Nsta:i]))

    kt[0:Nsta] = 0

    return kt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号