Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # <nbformat>3.0</nbformat>
  3.  
  4. # <codecell>
  5.  
  6. %matplotlib inline
  7.  
  8. # <codecell>
  9.  
  10. import pylab as pl
  11. import numpy as np
  12.  
  13. # <codecell>
  14.  
  15. a = np.arange(1000)
  16. a = a/1000.0*(np.pi*2*60)
  17. a = np.sin(a)
  18.  
  19. # <codecell>
  20.  
  21. pl.plot(a)
  22.  
  23. # <codecell>
  24.  
  25. f = np.fft.fft(a)
  26. f = np.abs(f)
  27. #f = np.fft.fftshift(f)
  28.  
  29. # <codecell>
  30.  
  31. pl.plot(f)
  32.  
  33. # <codecell>
  34.  
  35. for i in range(len(f)):
  36. print str(i) + " " + str(int(f[i]))
  37.  
  38. # <codecell>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement