Advertisement
Guest User

Untitled

a guest
May 14th, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from librosa import stft
  4. from scipy.signal import windows
  5.  
  6. x = np.cos(2*np.pi * (2048//2 - 4) * np.linspace(0, 1, 2048, 0))
  7. window = windows.dpss(512, 512//2-1)
  8. Sx = stft(x, window=window, n_fft=len(window), hop_length=1)
  9. plt.imshow(np.abs(Sx)[::-1], cmap='turbo', aspect='auto')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement