Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. from mpl_toolkits.mplot3d import Axes3D
  2. def gm(input,title):
  3. f, t, Zxx = signal.stft(input, 8000)
  4. fig = plt.figure(figsize = (10,10))
  5. ax = fig.gca(projection='3d')
  6.  
  7. x = t
  8. y = f
  9. X, Y = np.meshgrid(x, y)
  10. Z = np.abs(Zxx*100)
  11.  
  12. ax.plot_surface(Y, X, Z, rstride = 1, cstride = 1,cmap=cm.plasma)
  13. ax.set_xlabel('Częstotliwość[Hz]')
  14. ax.set_ylabel('Czas[s]')
  15. ax.set_zlabel('PSD[dB]')
  16. ax.set_title(title)
  17.  
  18. gm(y1,"Sygnał sinusoidalny stały - gęstość mocy")
  19. gm(y2,"Szum gaussowski - gęstość mocy")
  20. gm(y3,"Sygnał sinusoidalny zmienny - gęstość mocy")
  21. gm(audio,"Sygnał mowy - gęstość mocy")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement