Mercurial > hg > js-dsp-test
comparison fft/test.html @ 19:26056e866c29
Add FFTW to comparison table
author | Chris Cannam |
---|---|
date | Tue, 06 Oct 2015 13:08:39 +0100 |
parents | 9619d2da67c2 |
children |
comparison
equal
deleted
inserted
replaced
18:8db794ca3e0b | 19:26056e866c29 |
---|---|
16 <script src="jsfft/lib/fft.js"></script> | 16 <script src="jsfft/lib/fft.js"></script> |
17 <script src="cross/Cross.js"></script> | 17 <script src="cross/Cross.js"></script> |
18 <script src="cross/FFT.js"></script> | 18 <script src="cross/FFT.js"></script> |
19 <script src="kissfft/KissFFT.js"></script> | 19 <script src="kissfft/KissFFT.js"></script> |
20 <script src="kissfft/FFT.js"></script> | 20 <script src="kissfft/FFT.js"></script> |
21 <script src="fftw/FFTW.js"></script> | |
22 <script src="fftw/FFT.js"></script> | |
21 <script src="test.js"></script> | 23 <script src="test.js"></script> |
22 | 24 |
23 </head> | 25 </head> |
24 <body> | 26 <body> |
25 | 27 |
41 <td>Dntj</td><td id="dntj-result"></td><td id="dntj-1"></td><td id="dntj-2"></td><td id="dntj-itr"></td> | 43 <td>Dntj</td><td id="dntj-result"></td><td id="dntj-1"></td><td id="dntj-2"></td><td id="dntj-itr"></td> |
42 </tr><tr> | 44 </tr><tr> |
43 <td>Cross</td><td id="cross-result"></td><td id="cross-1"></td><td id="cross-2"></td><td id="cross-itr"></td> | 45 <td>Cross</td><td id="cross-result"></td><td id="cross-1"></td><td id="cross-2"></td><td id="cross-itr"></td> |
44 </tr><tr> | 46 </tr><tr> |
45 <td>KissFFT</td><td id="kissfft-result"></td><td id="kissfft-1"></td><td id="kissfft-2"></td><td id="kissfft-itr"></td> | 47 <td>KissFFT</td><td id="kissfft-result"></td><td id="kissfft-1"></td><td id="kissfft-2"></td><td id="kissfft-itr"></td> |
48 </tr><tr> | |
49 <td>FFTW</td><td id="fftw-result"></td><td id="fftw-1"></td><td id="fftw-2"></td><td id="fftw-itr"></td> | |
46 </tr> | 50 </tr> |
47 </table> | 51 </table> |
48 | 52 |
49 <h3>Notes</h3> | 53 <h3>Notes</h3> |
50 | 54 |
51 <ul> | 55 <ul> |
52 <li><b>Nayuki</b>: in-place single-precision complex-complex</li> | 56 <li><b>Nayuki</b>: in-place single-precision complex-complex. Around 7kb.</li> |
53 <li><b>Nayuki (obj)</b>: Nayuki with the sin/cos tables pre-calculated on object construction</li> | 57 <li><b>Nayuki (obj)</b>: Nayuki with the sin/cos tables pre-calculated on object construction. Around 4kb.</li> |
54 <li><b>Nockert</b>: double-precision real-complex</li> | 58 <li><b>Nockert</b>: double-precision real-complex. Around 25kb.</li> |
55 <li><b>Dntj</b>: double-precision complex-complex. Forward | 59 <li><b>Dntj</b>: double-precision complex-complex. Forward |
56 transform is scaled and I've scaled it back again here, which may | 60 transform is scaled and I've scaled it back again here, which may |
57 introduce rounding error.</li> | 61 introduce rounding error. Around 10kb.</li> |
58 <li><b>Cross</b>: double-precision real-complex in C, compiled | 62 <li><b>Cross</b>: double-precision real-complex in C, compiled |
59 with Emscripten. This is considered a slow implementation amongst | 63 with Emscripten. This is considered a slow implementation amongst |
60 native code ones.</li> | 64 native code ones. Around 60kb.</li> |
61 <li><b>KissFFT</b>: single-precision real-complex in C, compiled | 65 <li><b>KissFFT</b>: single-precision real-complex in C, compiled |
62 with Emscripten. This should be faster than Cross. Despite its | 66 with Emscripten. A reasonably sophisticated implementation. Around |
63 name, it is the most sophisticated implementation here.</li> | 67 70kb.</li> |
68 <li><b>FFTW</b>: single-precision real-complex in C, compiled with | |
69 Emscripten. GPL licensed. Around 3Mb.</li> | |
64 </ul> | 70 </ul> |
65 | 71 |
66 <h3>Rationale</h3> | |
67 | |
68 <p>If 2150 iterations of real-to-complex FFT of size 2048 takes less | |
69 than 10 seconds, then we may be able to make a high quality | |
70 real-time phase vocoder (just).</p> | |
71 | |
72 <p>A phase-vocoder of course must use overlapped windowed FFT | |
73 (although you can choose the size, within limits), IFFT, and | |
74 cartesian-polar conversion to calculate the phase for the | |
75 instantaneous frequency.</p> | |
76 | |
77 <p>A reasonable estimate of CPU cost for the whole thing is | |
78 somewhere around 10x the cost of simple non-overlapping short-time | |
79 forward Fourier transforms across the signal. </p> | |
80 | |
81 <p>2150 iterations corresponds to 100 seconds of audio | |
82 non-overlapped at 44.1kHz, so if that takes less than 10 seconds, | |
83 then in theory we might be OK.</p> | |
84 | |
85 </body> | 72 </body> |
86 | 73 |