I have a 9 minutes files which the sampling rate of that is 16000. My signal has totally 9*60*16000= 8640000 samples. I am doing a stft in python (librosa package) and plotting spectrogram. I know the frequency resolution of spectrogram is equal to Fs(Sampling frequency)/N (Number of FFT point).
If I plot the spectrogram with N-fft= 2048, then my spectrogram has a shape of (1025, 16876) and the x_axis shows 9 minutes for time. If plot it with N-fft= 16384, then my spectrogram has a shape of (8193, 2110) and the x_axis shows 1 minutes and 10 seconds for time. I do not understand the relationship between the shape of the spectrogram and the time which we see in the time axis. Also I want to know the relationship between the time in spectrogram axis and actual time in the signal.
file = ('mm.wav')
k=1
v, sr = librosa.load( file, sr=16000)
t, phase = librosa.magphase(librosa.stft(v, n_fft= 2048))
librosa.display.specshow(librosa.power_to_db(t,ref=np.max),y_axis='linear',x_axis='time',sr=sr)
t.shape
fig.savefig ('2048.png')