Mercurial > hg > js-dsp-test
view fft/test.html @ 12:281c44ba1d2e
Don't generate separate memory init files (after all)
author | Chris Cannam |
---|---|
date | Mon, 05 Oct 2015 14:36:24 +0100 |
parents | ae456984c912 |
children | 9619d2da67c2 |
line wrap: on
line source
<html> <head> <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="cross/Cross.js"></script> <script src="cross/FFT.js"></script> <script src="kissfft/KissFFT.js"></script> <script src="kissfft/FFT.js"></script> <script src="test.js"></script> </head> <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><tr> <td>Cross</td><td id="cross-result"></td><td id="cross-1"></td><td id="cross-2"></td><td id="cross-itr"></td> </tr><tr> <td>KissFFT</td><td id="kissfft-result"></td><td id="kissfft-1"></td><td id="kissfft-2"></td><td id="kissfft-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> <li><b>Cross</b>: double-precision real-complex in C, compiled with Emscripten. This is considered a slow implementation amongst native code ones.</li> <li><b>KissFFT</b>: single-precision real-complex in C, compiled with Emscripten. This should be faster than Cross. Despite its name, it is the most sophisticated implementation here.</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>