tf.signal.stft() 短时傅里叶变换的示例

import tensorflow as tf
import numpy as np
a1 = np.arange(5)
print(a1)
[0 1 2 3 4]
a2 = a1.astype(np.float32)  # int 转 float
print(a2)
[0. 1. 2. 3. 4.]
a3 = tf.signal.stft(  # 短时傅里叶变换
    a2,  # 音频序列
    frame_length=2,  # 窗口长度
    frame_step=1  # 步长
)
print(a3.shape)

在这里插入图片描述

(4, 2)

猜你喜欢

转载自blog.csdn.net/weixin_44493841/article/details/121468775