kopia lustrzana https://github.com/corrscope/corrscope
Debug period estimator
rodzic
9f512babca
commit
ce911d656d
|
@ -625,33 +625,33 @@ class CorrelationTrigger(MainTrigger):
|
|||
edge_score *= -cfg.edge_strength
|
||||
peaks += edge_score
|
||||
|
||||
self.custom_line(
|
||||
"corr_kernel",
|
||||
corr_kernel,
|
||||
np.arange(-self.A, self.B) * stride,
|
||||
False,
|
||||
)
|
||||
self.custom_line(
|
||||
"peak_kernel",
|
||||
self._corr_buffer,
|
||||
np.arange(-self.A, self.B) * stride,
|
||||
False,
|
||||
)
|
||||
# self.custom_line(
|
||||
# "corr_kernel",
|
||||
# corr_kernel,
|
||||
# np.arange(-self.A, self.B) * stride,
|
||||
# False,
|
||||
# )
|
||||
# self.custom_line(
|
||||
# "peak_kernel",
|
||||
# self._corr_buffer,
|
||||
# np.arange(-self.A, self.B) * stride,
|
||||
# False,
|
||||
# )
|
||||
|
||||
self.custom_line(
|
||||
"corr",
|
||||
corr,
|
||||
np.arange(trigger_begin, trigger_begin + stride * len(corr), stride),
|
||||
True,
|
||||
False,
|
||||
)
|
||||
self.custom_line(
|
||||
"peaks",
|
||||
peaks,
|
||||
np.arange(trigger_begin, trigger_begin + stride * len(corr), stride),
|
||||
True,
|
||||
False,
|
||||
)
|
||||
# self.custom_line(
|
||||
# "corr",
|
||||
# corr,
|
||||
# np.arange(trigger_begin, trigger_begin + stride * len(corr), stride),
|
||||
# True,
|
||||
# False,
|
||||
# )
|
||||
# self.custom_line(
|
||||
# "peaks",
|
||||
# peaks,
|
||||
# np.arange(trigger_begin, trigger_begin + stride * len(corr), stride),
|
||||
# True,
|
||||
# False,
|
||||
# )
|
||||
|
||||
# Don't pick peaks more than `period * trigger_radius_periods` away from the
|
||||
# center.
|
||||
|
@ -690,17 +690,17 @@ class CorrelationTrigger(MainTrigger):
|
|||
corr[1:][peaks[1:] < peaks[:-1]] = min_corr
|
||||
corr[0] = corr[-1] = min_corr
|
||||
|
||||
self.custom_line(
|
||||
"corr_peaks",
|
||||
corr,
|
||||
np.arange(
|
||||
trigger_begin + stride * (begin_offset),
|
||||
trigger_begin + stride * (begin_offset + len(corr)),
|
||||
stride,
|
||||
),
|
||||
True,
|
||||
False,
|
||||
)
|
||||
# self.custom_line(
|
||||
# "corr_peaks",
|
||||
# corr,
|
||||
# np.arange(
|
||||
# trigger_begin + stride * (begin_offset),
|
||||
# trigger_begin + stride * (begin_offset + len(corr)),
|
||||
# stride,
|
||||
# ),
|
||||
# True,
|
||||
# False,
|
||||
# )
|
||||
|
||||
# Find optimal offset
|
||||
peak_offset = np.argmax(corr) + begin_offset # type: int
|
||||
|
|
|
@ -107,9 +107,10 @@ def get_period(
|
|||
else:
|
||||
peakX = temp_peakX
|
||||
|
||||
# self.custom_line(
|
||||
# "autocorr", corr, np.arange(len(corr)) * self._stride, False, False
|
||||
# )
|
||||
self.custom_vline("minX", minX, False)
|
||||
self.custom_line(
|
||||
"autocorr", corr, np.arange(len(corr)) * self._stride, False, False
|
||||
)
|
||||
return int(peakX)
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue