Advertisement
szabozoltan69

pythonscript_nufft

Sep 19th, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import matplotlib.gridspec as gridspec
  4. import nufft
  5.  
  6. x = np.linspace(-500,500,100000)
  7. y = np.sin(x)
  8.  
  9. f=np.linspace(0.95,0.95,1000)
  10.  
  11. ft=nufft.nufft.nufft1d3(x, y, f)
  12.  
  13. max_value = max(np.abs(ft[1:]))
  14. max_index = np.abs(ft[1:]).tolist().index(max_value)
  15. freqlist=f.tolist()
  16. FREQ=freqlist[max_index]
  17. print(FREQ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement