Skip to content

Faster routines for Fourier transform (e.g., by using external libraries like FFTW) #213

@zinphi

Description

@zinphi

Description

I'm experiencing a very poor performance when trying to generate longer noise time series from a PSD. For a month with 5s sampling (about 500k elements), I need to wait already several minutes for the generator to complete. Basically, generating noise from a PSD just requiers a fft transform of the noise frequency series into the time domain. Using FFTW (e.g., through Matlab), transforming a 500k vector takes about 4ms:
vec=randn(5e5,1); tic;vect=fft(vec);toc
I looked into the specific code and saw that GROOPS uses its own fft implementation. Without further investigation, I would assume that this function is the bottleneck. My suggestion is to replace the Fourier transforms (dft, dct) with fftw routines both for speed and numerical accuracy (since fftw is heavily used and tested all over the world).
The current performance is really painful when trying to generate longer contiguous noise time series for simulation purpose. Generating just the noise for all instruments for a monthly SST solution takes several hours on my machine. I did not yet dare to repeat it with a 1s sampling since I fear that the runtime scaling is far from beeing linear...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions