Advertisement
szabozoltan69

pythonscript_nufft

Sep 19th, 2018
213
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement