Skip to content

Add Welch PSD function#209

Open
mmccrackan wants to merge 14 commits intomasterfrom
20250225_psd
Open

Add Welch PSD function#209
mmccrackan wants to merge 14 commits intomasterfrom
20250225_psd

Conversation

@mmccrackan
Copy link
Contributor

@mmccrackan mmccrackan commented Feb 26, 2025

Adds a parallelized Welch PSD function that closely mimics the functionality of scipy.welch, which sotodlib currently uses and does not use pyfftw. This uses FFTW's internal parallelization with OMP for most of the heavy lifting since that is more efficient than looping over and re-creating plans, though some other loops are also parallelized. We might get some marginal gains using ducc instead of FFTW based on some preliminary tests, but more tests need to be done. I leave the calculation of the frequency array up to python.

I've added a cmake directory similar to what was done in #189 to get both FFTW for single precision and FFTW withOMP parallelization enabled as the spt3g FindFFTW.cmake does not include either.

@mmccrackan mmccrackan marked this pull request as ready for review February 28, 2025 06:37
@mmccrackan mmccrackan requested a review from mhasself February 28, 2025 06:37
@tskisner
Copy link
Member

tskisner commented Jul 3, 2025

Just a note that this adds another compile-time dependency, and should not be merged until the wheel builds are also updated and passing.

@mmccrackan
Copy link
Contributor Author

Just a note that this adds another compile-time dependency, and should not be merged until the wheel builds are also updated and passing.

Thanks for the heads up. I should probably review the performance gain for this first to make sure it is worth it as it has been a while since I wrote it. The PSDs take like only 4 seconds in the current python version, though we do a lot of them.

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

Successfully merging this pull request may close these issues.

2 participants