Chris@3
|
1 <html>
|
Chris@1
|
2
|
Chris@3
|
3 <meta charset="UTF-8">
|
Chris@1
|
4
|
Chris@3
|
5 <style type="text/css">
|
Chris@3
|
6 body { margin: 5%; }
|
Chris@3
|
7 table, td, th { border: 0.1em solid #e0e0e0; border-collapse: collapse }
|
Chris@3
|
8 td, th { padding: 0.5em }
|
Chris@3
|
9 </style>
|
Chris@3
|
10
|
Chris@3
|
11 <script src="nayuki/fft.js"></script>
|
Chris@3
|
12 <script src="fft.js/lib/complex.js"></script>
|
Chris@3
|
13 <script src="jsfft/lib/complex_array.js"></script>
|
Chris@3
|
14 <script src="jsfft/lib/fft.js"></script>
|
Chris@3
|
15 <script src="test.js"></script>
|
Chris@1
|
16
|
Chris@3
|
17 <body>
|
Chris@2
|
18
|
Chris@3
|
19 <h3>Results</h3>
|
Chris@1
|
20
|
Chris@3
|
21 <p id="test-description"></p>
|
Chris@3
|
22
|
Chris@3
|
23 <table>
|
Chris@3
|
24 <tr>
|
Chris@3
|
25 <th>Implementation</th><th>Result</th><th>Time (first half)</th><th>Time (second half)</th><th>Rate (second half)</th>
|
Chris@3
|
26 </tr>
|
Chris@3
|
27 <tr>
|
Chris@3
|
28 <td>Nayuki</td><td id="nayuki-result"></td><td id="nayuki-1"></td><td id="nayuki-2"></td><td id="nayuki-itr"></td>
|
Chris@3
|
29 </tr><tr>
|
Chris@3
|
30 <td>Nockert</td><td id="nockert-result"></td><td id="nockert-1"></td><td id="nockert-2"></td><td id="nockert-itr"></td>
|
Chris@3
|
31 </tr><tr>
|
Chris@3
|
32 <td>Dntj</td><td id="dntj-result"></td><td id="dntj-1"></td><td id="dntj-2"></td><td id="dntj-itr"></td>
|
Chris@3
|
33 </tr>
|
Chris@3
|
34 </table>
|
Chris@1
|
35
|
Chris@3
|
36 <h3>Notes</h3>
|
Chris@1
|
37
|
Chris@3
|
38 <ul>
|
Chris@3
|
39 <li><b>Nayuki</b>: in-place single-precision complex-complex</li>
|
Chris@3
|
40 <li><b>Nockert</b>: double-precision real-complex</li>
|
Chris@4
|
41 <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>
|
Chris@3
|
42 </ul>
|
Chris@3
|
43
|
Chris@3
|
44 <h3>Rationale</h3>
|
Chris@1
|
45
|
Chris@3
|
46 <p>If 2150 iterations of real-to-complex FFT of size 2048 takes less
|
Chris@3
|
47 than 10 seconds, then we may be able to make a high quality
|
Chris@3
|
48 real-time phase vocoder (just).</p>
|
Chris@1
|
49
|
Chris@3
|
50 <p>A phase-vocoder of course must use overlapped windowed FFT
|
Chris@3
|
51 (although you can choose the size, within limits), IFFT, and
|
Chris@3
|
52 cartesian-polar conversion to calculate the phase for the
|
Chris@3
|
53 instantaneous frequency.</p>
|
Chris@1
|
54
|
Chris@3
|
55 <p>A reasonable estimate of CPU cost for the whole thing is
|
Chris@3
|
56 somewhere around 10x the cost of simple non-overlapping short-time
|
Chris@3
|
57 forward Fourier transforms across the signal. </p>
|
Chris@1
|
58
|
Chris@3
|
59 <p>2150 iterations corresponds to 100 seconds of audio
|
Chris@3
|
60 non-overlapped at 44.1kHz, so if that takes less than 10 seconds,
|
Chris@3
|
61 then in theory we might be OK.</p>
|
Chris@1
|
62
|
Chris@3
|
63 </body>
|
Chris@1
|
64
|