MATLAB: How to change time to amplitude in a spectrogram

digital signal processingfftMATLABsignal processingspectrogram

Hi experts,
I have created an 11k wav file and am reading it into MATLAB. From here I am using the data given from the wav file and using a spectrogram to view it.
When I run the code, the spectrogram returned is given in time and frequency. The frequency returned is correct. Is it possible to change the time to amplitude? this would be very useful for my results.
Here is my code :
clear; [y, fs] = audioread('11k_wav.wav'); figure(1); spectrogram(y,256,224,512,fs,'xaxis');
Thank you in advance.

Best Answer

Amplitude in a spectrogram is the z-axis value. The pectrogram is actually a surf plot, so you can use the interactive image rotation in the plot GUI or the view function to make the amplitude correspond to the y-axis.