Re: [scipy/scipy] ENH: signal.csd: add `maxhold`, `minhold` options for `average` (PR #21487)

Folks,
Some enhancement to the csd or cross spectral density function were required to get the matlab like “maxhold” and “minhold” capability. Would like to get some feedback on the above mentioned pull request.

AFAIK, the Welch’s Method was designed to estimate PSDs of stationary processes. Having a max/min-hold functionality seems conceptually a bit odd to me. Wouldn’t make it more sense to apply those to cross-spectrograms (which are provided by ShortTimeFFT.spectrogram)?

There are some caveats, like the choice of window and overlap, which makes interpreting the results quantitatively non-trivial. Therefore it would be great, if you could provide a reference which discusses the methodological aspects of utilizing max/min-hold statistics on cross-spectrograms (or on Welch’s method). Matlab is not a good role-model in that regard, IMO.

Perhaps, it would be sufficient, to document in csd(), how to obtain a cross-spectral density by utilizing ShortTimeFFT.spectrogram, which is illustrated in this helper. This would enable users to easily implement their own custom statistics.