Repository navigation
Whitening waveform from known PSD #3696
Answered
by
francois-rozet
francois-rozet
asked this question in
Q&A
|
Hi 👋, I am new to PyCBC and I'm trying to simulate and process waveforms in the frequency domain. In practice, I have a waveform cutoff_freq = 20.
psd = aLIGOZeroDetHighPower(len(s), s.delta_f, cutoff_freq)
noise = frequency_noise_from_psd(psd)
s = s + noiseIs there a way to perform whitening on |
Answered by
francois-rozet
Apr 17, 2021
Replies: 1 comment
|
I've done some research and looked at the source code. The solution I found is to normalize the signal with respect to the PSD. In my example, idx = int(psd.duration * cutoff_freq)
norm = np.sqrt(psd / psd.delta_f)
norm[:idx] = norm[idx]
norm[-1:] = norm[-2]
s = s / norm
|
0 replies
Answer selected by
francois-rozet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've done some research and looked at the source code. The solution I found is to normalize the signal with respect to the PSD.
In my example,
norm[:idx] = norm[idx]andnorm[-1:] = norm[-2]prevent divisions by zero for frequencies that are out-of-range.