0
我试图在原始音频上应用机器学习算法。我的训练将是音频信号的傅立叶系数。 我试图让那些和应用IFFT得到我的声音回,但它不与我的实现,这是工作:scipy.io fft和ifft的问题
fs, data = wavfile.read('dataset piano/wav/music (1).wav')
Te = 0.25
T = 40
a = data.T[0] #retrieve first channel
#put the information in a matrix, one row will contain the fourier coefficients of 0.25s of music.
#The whole matrix, which has 40 rows will contain information of 10s of the wav file.
X = np.array([fft(a[int(i*fs*Te):int((i+1)*fs*Te)]) for i in range(T)])
Z = ifft(X.flatten())
Z = Z.astype(data.dtype)
wavfile.write('test3.wav',fs,Z)
通常它应该发挥的WAV文件的前10秒,但它不”我真的不明白为什么。我所得到的只是一个高调的声音。我从scipy使用fft和ifft。
非常感谢!它现在完美运行!也谢谢你的解释! – Tiffany