How to plot MFCC in Python?

前端 未结 4 784
陌清茗
陌清茗 2021-02-02 17:48

I\'m just a beginner here in signal processing. Here is my code so far on extracting MFCC feature from an audio file (.WAV):

from python_speech_features import m         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-02 18:35

    This will plot the MFCC as colors, which is a more popular way

    import matplotlib.pyplot as plt
    import numpy as np
    from matplotlib import cm
    fig, ax = plt.subplots()
    mfcc_data= np.swapaxes(mfcc_data, 0 ,1)
    cax = ax.imshow(mfcc_data, interpolation='nearest', cmap=cm.coolwarm, origin='lower')
    ax.set_title('MFCC')
    
    plt.show()
    

提交回复
热议问题