The WelchConfig docstring has an interesting nugget:
|
!!! note |
|
|
|
WelchConfig precomputes an fft plan, and preallocates the necessary intermediate buffers. |
|
Thus, repeated calls to `welch_pgram` that use the same `WelchConfig` object |
|
will be more efficient than otherwise possible. |
The latter part encourages re-use, but the former part hints that concurrent re-use may have a race condition. It might be useful to call this out explicitly so that a naive
config = WelchConfig(...)
psds = Vector{Periodogram}(undef, length(signals))
Threads.@threads for (idx, sig) in enumerate(signals)
psds[idx] = welch_pgram(sig, config)
end
doesn't become a user footgun
The
WelchConfigdocstring has an interesting nugget:DSP.jl/src/periodograms.jl
Lines 545 to 549 in d08699a
The latter part encourages re-use, but the former part hints that concurrent re-use may have a race condition. It might be useful to call this out explicitly so that a naive
doesn't become a user footgun