I calculated the spectogram of an image using the piece of code show below.
spec,freq,t,im = plt.specgram(raw[18],Fs=100,NFFT=100,noverlap=50).
spec,freq,t,im = plt.specgram(raw[18],Fs=100,NFFT=100,noverlap=50)