Nov-29-2020, 01:42 PM
I'm not familiar with spectrogram so the below DOES NOT WORK, but it shows how you may assign. The problem I appear to have here is not having the data.
import numpy as np ht = np.array([1,2,3,4,5,6,7,8,9]) fs = np.array([3,1,5,2,6]) from scipy.signal import spectrogram spec_f, spec_t, spec = spectrogram(ht,fs) plt.pcolormesh(spec_t, spec_f, spec, shading='gouraud') plt.ylabel('Frequency [Hz]') plt.xlabel('Time [sec]') plt.show()