Advertisement
Guest User

Untitled

a guest
Apr 1st, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. fig, ax = plt.subplots(1, 2, sharex=True, sharey=True)
  2. f, t, Sxx = signal.spectrogram(x, fs=fs, window='hann', nperseg=8192,
  3.                                scaling='spectrum')
  4. mx = np.abs(10 * np.log10(Sxx)).max()
  5. ax[0].pcolormesh(t, f / 1000, 10 * np.log10(Sxx), shading='gouraud',
  6.                  vmin=-mx, vmax=0)
  7.  
  8. f_1, t_1, Sxx_1 = signal.spectrogram(x1, fs=fs, window='hann', nperseg=8192,
  9.                                      scaling='spectrum')
  10. ax[1].pcolormesh(t_1, f_1 / 1000, 10 * np.log10(Sxx_1), shading='gouraud',
  11.                  vmin=-mx, vmax=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement