June 2015
Beginner
348 pages
8h 44m
English
In the previous Time for action section, we created a simple filter for detrended data. Now, let's use a more restrictive filter that will leave us only with the main frequency component. We will fit a sinusoidal pattern to it and plot our results. This model has four parameters—amplitude, frequency, phase, and vertical offset.
def residuals(p, y, x): A,k,theta,b = p err = y-A * np.sin(2* np.pi* k * x + theta) + b return err
filtered = -fftpack.irfft(fftpack.ifftshift(amps))
Read now
Unlock full access