title: Deciding on length of FFT
body: <p>I am working on a tool to compare two wave files for similarity in their waveforms. Ex, I have a wave file of duration 1min and i make another wave file using the first one but have made each 5sec data at an interval of 5sec to 0.
  Now my software will tell that there is waveform difference at time interval 5sec to 10sec, 15sec to 20sec, 25sec to 30 sec and so on...</p>
  
  <p>As of now, with initial development, this is working fine.
  Following are 3 test sets:</p>
  
  <ol>
  <li><p>I have two wave files with sampling rate of 960Hz, mono, with no of data samples as 138551 (arnd 1min 12sec files). I am using 128 point FFT (splitting file in 128 samples chunk) and results are good.</p></li>
  <li><p>When I use the same algorithm on wave files of sampling rate 48KHz, 2-channel with no of data samples 6927361 for each channel (arnd 2min 24 sec file), the process becomes too slow. When I use 4096 point FFT, the process is better.</p></li>
  <li><p>But, the 4096 point FFT on files of 22050Hz, 2-channels with number of data samples 55776 for each channel (arnd 0.6sec file) gives very poor results. In this case 128 point FFT gives good result.</p></li>
  </ol>
  
  <p>So, I am confused on how to decide the length of FFT so that my results are good in each case.</p>
  
  <p>I guess the length should depend on number of samples and sampling rate.
  Please give your inputs on this.</p>
  
  <p>Thanks</p>