Skip to content

Unnecessary FFT work in comm_tod_noise_mod #148

Description

@mreineck

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions