analyticsClass.py 文件源码

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

项目:seelab-jr 作者: jithinbp 项目源码 文件源码
def fft(self,ya, si):
        '''
        Returns positive half of the Fourier transform of the signal ya. 
        Sampling interval 'si', in milliseconds
        '''
        ns = len(ya)
        if ns %2 == 1:  # odd values of np give exceptions
            ns=ns-1 # make it even
            ya=ya[:-1]
        v = np.array(ya)
        tr = abs(np.fft.fft(v))/ns
        frq = np.fft.fftfreq(ns, si)
        x = frq.reshape(2,ns/2)
        y = tr.reshape(2,ns/2)
        return x[0], y[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号