Skip to content

Commit 6f8e4c8

Browse files
committed
add a comment on FFT savings
1 parent 17e8e04 commit 6f8e4c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/fft.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ void do_fft(FINUFFT_PLAN p) {
4444
#ifdef FINUFFT_NO_DUCC0_TWEAKS
4545
ducc0::c2c(data, data, axes, p->fftSign < 0, FLT(1), nthreads);
4646
#else
47+
/* For type 1 NUFFTs, only the low-frequency parts of the output fine grid are
48+
going to be used, and for type 2 NUFFTs, the high frequency parts of the
49+
input fine grid are zero by definition. This can be used to reduce the
50+
total FFT work for 2D and 3D NUFFTs. One of the FFT axes always has to be
51+
transformed fully (that's why there is no savings for 1D NUFFTs), for the
52+
second axis we need to do (roughly) a fraction of 1/oversampling_factor
53+
of all 1D FFTs, and for the last remaining axis the factor is
54+
1/oversampling_factor^2. */
4755
if (p->dim == 1) // 1D: no chance for FFT shortcuts
4856
ducc0::c2c(data, data, axes, p->fftSign < 0, FLT(1), nthreads);
4957
else if (p->dim == 2) { // 2D: do partial FFTs

0 commit comments

Comments
 (0)