title: Cepstral Analysis for pitch detection
body: <p>I'm looking to extract pitches from a sound signal.</p>
  
  <p>Someone on IRC just explained to me how taking a double FFT achieves this. Specifically:</p>
  
  <ol>
  <li>take FFT </li>
  <li>take log of square of absolute value (can be done with lookup table) </li>
  <li>take another FFT </li>
  <li>take absolute value</li>
  </ol>
  
  <p>I am attempting this using vDSP</p>
  
  <p>I can't understand how I didn't come across this technique earlier. I did a lot of hunting and asking questions; several weeks worth.  More to the point, I can't understand why I didn't think of it.</p>
  
  <p>I am attempting to achieve this with vDSP library.  It looks as though it has functions to handle all of these tasks.</p>
  
  <p>However, I'm wondering about the accuracy of the final result.</p>
  
  <p>I have previously used a technique which  scours the frequency bins of a single FFT for local maxima.  When it encounters one, it uses a cunning technique (the change in phase since the last FFT) to more accurately place the actual peak within the bin.</p>
  
  <p>I am worried that this precision will be lost with this technique I'm presenting here.</p>
  
  <p>I guess the technique could be used after the second FFT to get the fundamental accurately. But it kind of looks like the information is lost in step 2.</p>
  
  <p>As this is a potentially tricky process, could someone with some experience just look over what I'm doing and check it for sanity?</p>
  
  <p>Also, I've heard there is an alternative technique involving fitting a quadratic over neighbouring bins. Is this of comparable accuracy?  If so, I would favour it, as it doesn't involve remembering bin phases.</p>
  
  <p>So, questions:</p>
  
  <ul>
  <li>does this approach makes sense? Can it be improved?</li>
  <li>I'm a bit worried about  the "log square" component; there seems to be a vDSP function to do exactly that: vDSP_vdbcon.  However, there is no indication it precalculates a log-table --  I assume it doesn't,  as the FFT function requires an explicit pre-calculation function to be called and passed into it.   And this function doesn't.</li>
  <li>Is there some danger of harmonics being picked up?  </li>
  <li>is there any cunning way of making vDSP  pull out the maxima,  biggest first?</li>
  <li><p>Can anyone point me towards some research or literature on this technique?</p></li>
  <li><p>the main question: Is it accurate enough? Can the accuracy be improved?  I have just been told by an expert that the accuracy IS INDEED not sufficient. Is this the end of the line?</p></li>
  </ul>
  
  <p>Pi</p>
  
  <p>PS I get SO annoyed when I want to create tags, but cannot. :|  I have suggested to the maintainers that SO keep track of attempted tags,  but I'm sure I was ignored. We need tags for vDSP,  accelerate framework, cepstral analysis</p>