def mcep_to_lin_sp_log(mgc_mat, nFFT):
nFrms, n_coeffs = mgc_mat.shape
nFFTHalf = 1 + nFFT/2
mgc_mat = np.concatenate((mgc_mat, np.zeros((nFrms, (nFFT/2 - n_coeffs + 1)))),1)
mgc_mat = np.concatenate((mgc_mat, np.fliplr(mgc_mat[:,1:-1])),1)
sp_log = (np.fft.fft(mgc_mat, nFFT,1)).real
sp_log = sp_log[:,0:nFFTHalf]
return sp_log
#Gets RMS from matrix no matter the number of bins m_data has,
#it figures out according to the FFT length.
# For example, nFFT = 128 , nBins_data= 60 (instead of 65 or 128)
评论列表
文章目录