Skip to content

Commit

Permalink
if no corr_data is given c2 can be sped up by remove one mean
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusSifft committed Nov 3, 2023
1 parent d8de7f9 commit eac65fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/signalsnap/spectrum_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,16 @@ def c2(self, a_w, a_w_corr):

if self.config.coherent:
s2 = mean_1

else:

mean_2 = mean(a_w, dim=2)
mean_3 = mean(conj(a_w_corr), dim=2)

if self.config.corr_data is None and self.config.corr_path is None:
mean_3 = conj(mean_2)
else:
mean_3 = mean(conj(a_w_corr), dim=2)

s2 = m / (m - 1) * (mean_1 - mean_2 * mean_3)
return s2

Expand Down

0 comments on commit eac65fd

Please sign in to comment.