Ongoing inconsistencies when changing `overlap_factor` and windows.
( Related to #75 (closed) ) In trying to fix the bias factors and other terms which are hard-coded for an overlap factor of 50%, I have run into another issue.
My main concern is with the pwelch calculation : I can't remember why, but the Welch PSD calculation implemented here is ad-hoc, and not the gwpy/scipy implementation. This is creating a lot of confusion when trying to fix overlap factor issues. There should be two overlap factors: one is the overlap between consecutive segments analysed, and one is the overlap in consecutive chunks used within a segment when doing the pwelch calculation. I don't see why these two overlaps should have to match, yet they do in the current implementation, as does the choice of window function used for the Welch calculation and all the other fftgrams. I was looking for where in the code we impose them to be the same, and have narrowed it down to this line:
https://git.ligo.org/pygwb/pygwb/-/blob/master/pygwb/spectral.py#L522
I think the overlap_factor
passed here to the fftgram
function is actually the pwelch_overlap_factor
. Can someone (@shivaraj.kandhasamy ?) confirm this? If so, I can hard-code this to be 0.5 and fix the window to be a 'hann' window, and/or add these as parameters in their own right (perhaps later on, if there are no other inconsistencies linked to this...).
Beyond this, is there any other issue (together with the bias_factor
one #75 (closed) ) linked to a change in the overlap factor, i.e., in the PSD/CSD estimations, together with a change in window? If I were to use a tukey
window with no overlap, for example, vs. a tukey
window with overlap, should we have a check that states "overlap ... not consistent with choice of window ..." ?
Thanks in advance for thoughts!