title: Detecting Phase and Amplitude of a sine having known frequency
body: <p>I receive a sinusoidal data from a sensor, which is in the form <strong>(A + B(sin(n/N+a)))</strong>, where N is the Total Number of Samples, plus some small noises. I know that in N samples (1000 samples), the sine wave will complete one revolution. The signal looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Iotg6.jpg" alt="sinusoidal"></p>
  
  <p>I want to extract the variable amplitude "B" and phase "a", using as little data as possible. In other word, I want to predict the sensor's signal as soon as possible using DSP. I have already tried "correlation" but it didn't work. </p>
  
  <p>Using TMS320C000 with FPU, TMU unit.</p>