How do I save a spectrogram as an image in Python?
Convert the power spectrogram (amplitude squared) to decibel (dB) units, using power_to_db() method.. Display the spectrogram as img (we can save it here). Save the img using savefig(). Display the image using plt.