title: Explanation for a function within xcorr in MATLAB
body: <p>Looking within the xcorr function, most of it is pretty straightforward, except for one function within xcorr called &quot;findTransformLength&quot;.</p>
  <pre><code>function m = findTransformLength(m)
      m = 2*m;
      while true
          r = m;
          for p = [2 3 5 7]
              while (r &gt; 1) &amp;&amp; (mod(r, p) == 0)
                  r = r / p;
              end
          end
          if r == 1
              break;
          end
          m = m + 1;
      end
  </code></pre>
  <p>With no comments, i fail to understand what this function is meant to acheive and what is the significance of p = [2 3 5 7]. Why those numbers specifically? Why not take a fixed FFT size instead? Is there a disadvantage(cause errors) to taking a fixed FFT size?</p>