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