# Choice of PSD for SNR

**URL:** https://ask.igwn.org/t/choice-of-psd-for-snr/1043
**Category:** Data Analysis
**Created:** [May 21, 2024, 1:07pm UTC](https://ask.igwn.org/t/choice-of-psd-for-snr/1043 "2024-05-21T13:07:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yidelee](https://avatars.discourse-cdn.com/v4/letter/y/e56c9b/32.png) [@yidelee](https://ask.igwn.org/u/yidelee)
#### Post date: [May 21, 2024, 1:07pm UTC](https://ask.igwn.org/t/choice-of-psd-for-snr/1043/1 "2024-05-21T13:07:10Z")

</div>

Dear colleagues,

I would like to ask which PSD shall I use when calculating SNR. Currently I came up with two possible methods:

1. When calculating the SNR between original template and raw data, use the PSD from raw noises:  

2. When calcluating the SNR between whitened template and whitened data, use the PSD from whitened noises:  

Personaly, I think both of them are fine. However, in [GWOSC tutorial 2.2](https://github.com/gw-odw/odw-2024/blob/main/Tutorials/Day_2/Tuto_2.2_Matched_Filtering_In_action.ipynb), it seems that the code calcuates SNR (in match-filter) between whitened noise and unwhiten template using whitened PSD. Is there any misunderstanding?

---

<div class="post-metadata">

### Author: ![jonah](https://yyz1.discourse-cdn.com/flex031/user_avatar/ask.igwn.org/jonah/32/10_2.png) [@jonah](https://ask.igwn.org/u/jonah)
#### Post date: [May 22, 2024, 11:34pm UTC](https://ask.igwn.org/t/choice-of-psd-for-snr/1043/2 "2024-05-22T23:34:14Z")

</div>

Hi! Thank you for the question.

I like the explanation of the SNR calculation in the [FINDChirp paper](https://arxiv.org/abs/gr-qc/0509116).

One can say either:

- The SNR is computed as an inner product between whitened strain and a whitened template

OR

- The SNR is computed as an inner product between “raw” strain and “raw” template, weighted by the inverse of the PSD

I would say “When calculating the SNR between original template and raw data, use the PSD from raw noises” is a correct description.

I took a quick look at the tutorial. I am sorry, but I disagree with how you’ve described what’s presented there. I see the “conditioned data” used in the SNR calculation, and in the PSD calculation. The conditioned data in this tutorial is not whitened.

Good luck!

---

<div class="post-metadata">

### Author: ![yidelee](https://avatars.discourse-cdn.com/v4/letter/y/e56c9b/32.png) [@yidelee](https://ask.igwn.org/u/yidelee)
#### Post date: [May 27, 2024, 2:00pm UTC](https://ask.igwn.org/t/choice-of-psd-for-snr/1043/3 "2024-05-27T14:00:26Z")

</div>

Thank you very much for the reference and pointing me out. I missed the line doing filtering in the code and thought the PSD and the singal weren’t consistent.
