__init__.py 文件源码

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

项目:GRIPy 作者: giruenf 项目源码 文件源码
def frequency_phase_rotation(values, angle, deg=False):
    window_size = 64
    noverlap = 32
    window = signal.hann(window_size, sym=False)
    if not signal.check_COLA(window, len(window), noverlap):
        raise Exception('check_COLA failed.')
    f, t, Zxx = signal.stft(values, window=window, nperseg=window_size, 
                       noverlap=noverlap
    )
    Zxx_rotated = np.zeros(Zxx.shape, dtype=np.complex)
    for freq_idx in range(Zxx.shape[0]): # Loop over all frequencies
        Zxx_rotated[freq_idx] = phase_rotation(Zxx[freq_idx], angle, deg)
    t, x = signal.istft(Zxx_rotated, window=window, nperseg=window_size, 
                        noverlap=noverlap
    )
    return t, x
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号