In this question I coded an extended Kalman filter to estimate the noise-free periodically modulated sinusoid.