Merge pull request #471 from corrscope/fix-trigger-corr-kernel

Fix bug which would add correlation buffers to slope finder
pull/473/head
fluffy kittem 2024-04-07 21:43:09 -07:00 zatwierdzone przez GitHub
commit 68c82a016b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -1,5 +1,10 @@
## 0.9.1 (unreleased)
### Major Changes
- Fix bug which would add correlation buffers to slope finder (#471, found by Tachometer)
- NOTE: This affects triggering behavior compared to older program versions.
## 0.9.0
### Features

Wyświetl plik

@ -438,7 +438,7 @@ class CorrelationTrigger(MainTrigger):
slope_width: float = np.clip(cfg.slope_width * period, 1.0, self.A / 3)
# This is a fudge factor. Adjust it until it feels right.
slope_strength = cfg.edge_strength * 5
slope_strength = cfg.edge_strength * 2
# slope_width is 1.0 or greater, so this doesn't divide by 0.
slope_finder = np.empty(kernel_size, dtype=f32) # type: np.ndarray[f32]
@ -548,11 +548,12 @@ class CorrelationTrigger(MainTrigger):
else:
corr_quality = np.zeros(corr_nsamp, f32)
# array[A+B] Amplitude
corr_kernel = slope_finder
del slope_finder
if corr_enabled:
corr_kernel += self._corr_buffer * cfg.buffer_strength
# array[A+B] Amplitude
# Don't mutate (self._prev_slope_finder = slope_finder).
corr_kernel = slope_finder + self._corr_buffer * cfg.buffer_strength
else:
corr_kernel = slope_finder
# `corr[x]` = correlation of kernel placed at position `x` in data.
# `corr_kernel` is not allowed to move past the boundaries of `data`.