0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % Compute Signal-to-Noise Ratio for temperature annealing in mcmc as
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % described in Neil J. Cornish et al (arXiv:gr-qc/0701167v1).
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % Returns SNR for each channel.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 % - Inputs are -the outputs from both channels
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 % -the inverse cross-spectrum matrix elements
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 % -the template (arXiv:gr-qc/0701167v1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 % Karnesis 24-07-2011
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 function snrexp = stnr(tmplt1,tmplt2,out1,out2,InvS11,InvS22,InvS12,InvS21)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 if tmplt2 == 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 hs = 4*real(sum(abs(tmplt1.*(InvS11.*conj(out1)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 hh = 4*real(sum(abs(tmplt1.*(InvS11.*conj(tmplt1)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 snrexp = sqrt(2)*hs/sqrt(hh);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 hs1 = 4*real(sum(abs(tmplt1.*(InvS11.*conj(out1) + InvS12.*conj(out2)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 hs2 = 4*real(sum(abs(tmplt2.*(InvS21.*conj(out1) + InvS22.*conj(out2)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 hh1 = 4*real(sum(abs(tmplt1.*(InvS11.*conj(tmplt1) + InvS12.*conj(tmplt2)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 hh2 = 4*real(sum(abs(tmplt2.*(InvS21.*conj(tmplt1) + InvS22.*conj(tmplt2)))));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 %snrexp = [sqrt(2)*hs1/sqrt(hh1) sqrt(2)*hs2/sqrt(hh2)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 snrexp = sqrt(2)*(hs1+hs2)/sqrt(hh1+hh2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 end |