view fft/test.html @ 6:91d77df352fa

Make an object (& put allocation in it)
author Chris Cannam
date Mon, 05 Oct 2015 11:54:32 +0100
parents fcb64e4b8393
children 47f08ebded06
line wrap: on
line source
<html>

  <meta charset="UTF-8">

  <style type="text/css">
    body { margin: 5%; }
    table, td, th { border: 0.1em solid #e0e0e0; border-collapse: collapse }
    td, th { padding: 0.5em }
  </style>
  
  <script src="nayuki/fft.js"></script>
  <script src="fft.js/lib/complex.js"></script>
  <script src="jsfft/lib/complex_array.js"></script>
  <script src="jsfft/lib/fft.js"></script>
  <script src="test.js"></script>

<body>

  <h3>Results</h3>

  <p id="test-description"></p>
  
  <table>
    <tr>
      <th>Implementation</th><th>Result</th><th>Time (first half)</th><th>Time (second half)</th><th>Rate (second half)</th>
    </tr>
    <tr>
      <td>Nayuki</td><td id="nayuki-result"></td><td id="nayuki-1"></td><td id="nayuki-2"></td><td id="nayuki-itr"></td>
    </tr><tr>
      <td>Nockert</td><td id="nockert-result"></td><td id="nockert-1"></td><td id="nockert-2"></td><td id="nockert-itr"></td>
    </tr><tr>
      <td>Dntj</td><td id="dntj-result"></td><td id="dntj-1"></td><td id="dntj-2"></td><td id="dntj-itr"></td>
    </tr>
  </table>

  <h3>Notes</h3>

  <ul>
    <li><b>Nayuki</b>: in-place single-precision complex-complex</li>
    <li><b>Nockert</b>: double-precision real-complex</li>
    <li><b>Nayuki</b>: double-precision complex-complex. Forward transform is scaled and I've scaled it back again here, which may introduce rounding error.</li>
  </ul>
  
  <h3>Rationale</h3>

  <p>If 2150 iterations of real-to-complex FFT of size 2048 takes less
    than 10 seconds, then we may be able to make a high quality
    real-time phase vocoder (just).</p>

  <p>A phase-vocoder of course must use overlapped windowed FFT
    (although you can choose the size, within limits), IFFT, and
    cartesian-polar conversion to calculate the phase for the
    instantaneous frequency.</p>

  <p>A reasonable estimate of CPU cost for the whole thing is
    somewhere around 10x the cost of simple non-overlapping short-time
    forward Fourier transforms across the signal. </p>

  <p>2150 iterations corresponds to 100 seconds of audio
    non-overlapped at 44.1kHz, so if that takes less than 10 seconds,
    then in theory we might be OK.</p>

</body>