I have a list of about 100 numbers. I know that the data reasonably fits some sine function. I'd like to create some kind of curve. Ideally, I'd like to extract the amplitude, phase, and frequency. Any suggestions or ideas?
for example: inputList = [x1,...,x100]
and I'm trying to figure out some function that does this
def fitCurve(inputList):
A = amplitude(inputList)
#calculate frequency
#calculate phase
def amplitude(data):
return (max(data) - min(data))/2
def frequency(data):
#my first intuition is to find the first peak, but I'm not sure how to find the second one
def phase(data):
#not sure what to do here at all...