def make_spectrum_phase(y, FRAMESIZE, OVERLAP, FFTSIZE):
D=librosa.stft(y,n_fft=FRAMESIZE,hop_length=OVERLAP,win_length=FFTSIZE,window=scipy.signal.hamming)
Sxx = np.log10(abs(D)**2)
phase = np.exp(1j * np.angle(D))
mean = np.mean(Sxx, axis=1).reshape((257,1))
std = np.std(Sxx, axis=1).reshape((257,1))+1e-12
Sxx = (Sxx-mean)/std
return Sxx, phase, mean, std
评论列表
文章目录