kopia lustrzana https://github.com/corrscope/corrscope
Merge pull request #471 from corrscope/fix-trigger-corr-kernel
Fix bug which would add correlation buffers to slope finderpull/473/head
commit
68c82a016b
|
@ -1,5 +1,10 @@
|
||||||
## 0.9.1 (unreleased)
|
## 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
|
## 0.9.0
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -438,7 +438,7 @@ class CorrelationTrigger(MainTrigger):
|
||||||
slope_width: float = np.clip(cfg.slope_width * period, 1.0, self.A / 3)
|
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.
|
# 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_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]
|
slope_finder = np.empty(kernel_size, dtype=f32) # type: np.ndarray[f32]
|
||||||
|
@ -548,11 +548,12 @@ class CorrelationTrigger(MainTrigger):
|
||||||
else:
|
else:
|
||||||
corr_quality = np.zeros(corr_nsamp, f32)
|
corr_quality = np.zeros(corr_nsamp, f32)
|
||||||
|
|
||||||
# array[A+B] Amplitude
|
|
||||||
corr_kernel = slope_finder
|
|
||||||
del slope_finder
|
|
||||||
if corr_enabled:
|
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[x]` = correlation of kernel placed at position `x` in data.
|
||||||
# `corr_kernel` is not allowed to move past the boundaries of `data`.
|
# `corr_kernel` is not allowed to move past the boundaries of `data`.
|
||||||
|
|
Ładowanie…
Reference in New Issue