Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # compute DFT
  2. fft_x = fft(window)
  3. l = len(fft_x)
  4. freq = fftfreq(l, 1.0/20) # matching vector of frequencies
  5. fft_x_shifted = fftshift(fft_x) # shift DC component
  6. half_l = ceil(l/2.0)
  7. # fold negative frequencies and scale
  8. fft_x_half = abs((2.0 / 256) * fft_x[:half_l]) # ===> Normal decisione tree, good precision.
  9. #fft_x_half = abs((2.0 / 256) * fft_x_shifted[:half_l]) # ===> BIG decisione tree, low precision.
  10. freq_half = freq[:half_l]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement