util.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:source_separation_ml_jeju 作者: hjkwon0609 项目源码 文件源码
def create_spectrogram_from_audio(data):
    global setting
    spectrogram = librosa.stft(data, n_fft=Config.n_fft, hop_length=Config.hop_length).transpose()

    # divide the real and imaginary components of each element 
    # concatenate the matrix with the real components and the matrix with imaginary components
    # (DataCorruptionError when saving complex numbers in TFRecords)

    # concatenated = np.concatenate([np.real(spectrogram), np.imag(spectrogram)], axis=1)
    return spectrogram # [num_time_frames, num_freq_bins]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号