title: Using Fourier Transform to get frequency and phase
body: <p>Suppose I have samples of a periodic function, what is a good way to get frequency and phase information out of it?</p>
  
  <p>In particular, I'd like to get a form like</p>
  
  <pre><code>a+b Cos[c x + d]
  </code></pre>
  
  <p>Here's a part of the sample</p>
  
  <pre><code>{255,255,255,249,64,0,0,0,0,0,0,0,0,0,0,0,0,233,255,255,255,255,255,255,255,255,255,209,0,0,0,0,0,0,0,0,0,0,0,0,118,255,255,255,255,255,255,255,255,255,255,132,0,0,0,0,0,0,0,0,0,0,0,0,200,255,255,255,255,255,255,255,255,255,239,19,0,0,0,0,0,0,0,0,0,0,0,46,245,255,255,255,255,255,255,255,255,255,186,0}
  </code></pre>