Last active
July 2, 2020 03:21
-
-
Save Jezzamonn/bc07d01f952dec327e7a84617ae0fb96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
points = pd.read_csv('hand500.csv', header=None) | |
points_complex = points[0] + 1j * points[1] | |
z = np.fft.fft(points_complex) | |
amp = np.abs(z) | |
phase = np.angle(z) | |
freq = np.fft.fftfreq(len(z)) | |
# zero out base amplitude to center it around zero | |
amp[0] = 0 | |
circle_data = pd.DataFrame({'amp': amp, 'phase': phase, 'freq': freq})\ | |
.sort_values('amp', ascending=False) | |
circle_data.to_csv('hand500_freq.csv', header=None, index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment