Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary FFT work in comm_tod_noise_mod #148

Open
mreineck opened this issue Oct 5, 2022 · 0 comments
Open

Unnecessary FFT work in comm_tod_noise_mod #148

mreineck opened this issue Oct 5, 2022 · 0 comments

Comments

@mreineck
Copy link

mreineck commented Oct 5, 2022

In several places in comm_tod_noise_mod.f90 there is code analogous to

          dt(1:ntod)           = d_prime(:)
          dt(2*ntod:ntod+1:-1) = dt(1:ntod)
          call sfftw_execute_dft_r2c(plan_fwd, dt, dv)

The array dt represents an even function, i.e. the FFT transforms a function symmetric around the origin. This is in fact a discrete cosine transform of type 2, which can in principle be computed twice as quickly than the real-valued FFT used by the code.

If a significant fraction of overall run time is spent on these FFTs, it's probably worth switching to DCTs. They are supported by FFTW (see http://www.fftw.org/fftw3_doc/Real-even_002fodd-DFTs-_0028cosine_002fsine-transforms_0029.html).

@unfunfunt unfunfunt assigned unfunfunt and unassigned unfunfunt Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants