Use `np.diff()` on last 16 samples instead of only last datum pair
parent
c609e1b663
commit
efc16a7fb4
|
@ -285,7 +285,10 @@ class Viz(msgspec.Struct): # , frozen=True):
|
|||
) -> float:
|
||||
if self._index_step is None:
|
||||
index = self.shm.array[self.index_field]
|
||||
self._index_step = index[-1] - index[-2]
|
||||
self._index_step = max(
|
||||
np.diff(index[-16:]).max(),
|
||||
1,
|
||||
)
|
||||
|
||||
return self._index_step
|
||||
|
||||
|
|
Loading…
Reference in New Issue