Skip to content

Commit eac65fd

Browse files
committed
if no corr_data is given c2 can be sped up by remove one mean
1 parent d8de7f9 commit eac65fd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/signalsnap/spectrum_calculator.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,16 @@ def c2(self, a_w, a_w_corr):
580580

581581
if self.config.coherent:
582582
s2 = mean_1
583+
583584
else:
585+
584586
mean_2 = mean(a_w, dim=2)
585-
mean_3 = mean(conj(a_w_corr), dim=2)
587+
588+
if self.config.corr_data is None and self.config.corr_path is None:
589+
mean_3 = conj(mean_2)
590+
else:
591+
mean_3 = mean(conj(a_w_corr), dim=2)
592+
586593
s2 = m / (m - 1) * (mean_1 - mean_2 * mean_3)
587594
return s2
588595

0 commit comments

Comments
 (0)