I have a folder containing multiple wav files (currently say 4). I want to plot the wav, its mfcc and mel spectrogram in a row , so finally a figure with 12 plots(each row with three figure, and hence four rows). I am not able to plot the graph, only extracted the features. Can some one help with this for loop please. I mean how to use subplot command and how to store each figure in loop.
Regards
path=glob.glob('the path having four wav files/*.wav')
for p in path:
y, sr = librosa.load(p, sr=16000)
mfcc=librosa.feature.mfcc(y)
S = librosa.feature.melspectrogram(y, sr)
fig, ax = plt.subplot(4,3,.....)
librosa.display.waveplot(y, sr=sr)
librosa.display.specshow(librosa.power_to_db(S, ref=np.max))
librosa.display.specshow(mfcc, x_axis="time",y_axis="mel")
plt.show()