Signal Visibility Reduction in Spectrograms Following Whitening Process (PyCBC)

Dear all,

I am currently using PyCBC to simulate gravitational wave data and have encountered an output related to spectrogram that I would like to better understand.

Enclosed are three spectrogram images for your perusal:

  1. The first image illustrates the spectrogram generated without the application of whitening or band-pass filtering, where the signal is clearly visible.
  2. The subsequent images depict the results after implementing whitening and band-pass filtering processes, where, intriguingly, the signal seems to vanish.

I have utilized the noise data from the LIGO website, and I find it quite strange that the signal disappears after the whitening process. Could you please share your thoughts on this?

Best regards,

Hi Elahe:
It seems that you’re suffering from whitening.
Can you tell us how do you perform the whitening? Since the motivation of whitening is to mitigate the effect of instrumental noise. So you should select a stationary segment near the data and then estimate your PSD on it, then perform the whitening on the data. (I suppose you’re whitening with the data contains the signal which will mitigate the signal itself)

BTW, if you’re using gwpy package, I mean gwpy timeseries, their q_transform and spectrogram has a normalization( I’ve mentioned this in a thread about spectrogram) on the time-frequency plot which is pretty similar to the whitening of the data, so one might not be able to find much difference between them. A suggestion is write your own q-transform of spectrogram plot without applying the normalization strategy to see the differences.

Hello Barry,

Thank you for your detailed explanation. Upon reviewing the code, I noticed that the amplitude of the generated signal is larger than that of the noise. I’m not sure where I might have made a mistake. Here is the code:

params = dict(
wf_approximant=“SEOBNRv4” ,
luminosity_distance = 400,
def strain_T(params):
hp, hc = get_td_waveform(
delta_t=1.0 / params[‘sample_rate’]
return hp, hc


psd = pycbc.psd.aLIGODesignSensitivityP1200087(flen, delta_f, low_frequency_cutoff)
noise = pycbc.noise.noise_from_psd(len(, delta_t, psd, seed=127)
data= hp+noise

Once this issue is resolved, I will proceed with applying the whitening process as you suggested.

It can be the problem of parameter selection.
An idea is:

  1. Obtain the PSD of the current noise
  2. Use the noise PSD to calculate the current SNR
  3. set new_sig = sig/current_SNR * tartget_SNR to obtain a signal with specified SNR


Yes, Thanks so much for your time and help.

1 Like