hello i want to calculate fft of a sinusoid that i get from a csv file, i tried the fft function, but the specter that i found is not the one that i expect, the sinusoid that i used was recuperated from other program, the idea is to find frequencies and harmonics to test my program and use it to analyse other unknown signals; here is the code
import numpy import matplotlib.pyplot as plt from matplotlib.pyplot import * from scipy.fftpack import fft x=numpy.genfromtxt(r'C:\Users\souag\Desktop\pywav\sinus.csv', delimiter=',') time=x[:,][:,0] sine=x[:,][:,1:5] print (sine[0:30]) time=time-time[0] plt.subplot(2,1,1) plt.plot(time,sine,'r') axis([0,2,-2,4]) grid() T=200.0 fe=10.0 Te=1/fe N=int(T*fe) tfd=numpy.fft.fft(sine) f=numpy.arange(0,N) figure(figsize=(10,4)) vlines(f,[0],numpy.absolute(tfd),'b') xlabel('f') ylabel('C') axis([0,20,0,10]) grid()