Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mpl_toolkits.mplot3d import Axes3D
- def gm(input,title):
- f, t, Zxx = signal.stft(input, 8000)
- fig = plt.figure(figsize = (10,10))
- ax = fig.gca(projection='3d')
- x = t
- y = f
- X, Y = np.meshgrid(x, y)
- Z = np.abs(Zxx*100)
- ax.plot_surface(Y, X, Z, rstride = 1, cstride = 1,cmap=cm.plasma)
- ax.set_xlabel('Częstotliwość[Hz]')
- ax.set_ylabel('Czas[s]')
- ax.set_zlabel('PSD[dB]')
- ax.set_title(title)
- gm(y1,"Sygnał sinusoidalny stały - gęstość mocy")
- gm(y2,"Szum gaussowski - gęstość mocy")
- gm(y3,"Sygnał sinusoidalny zmienny - gęstość mocy")
- gm(audio,"Sygnał mowy - gęstość mocy")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement