3 freq diversion
This commit is contained in:
@ -16,6 +16,14 @@ def test_ring_buffer_allocates_fft_buffers_from_first_push():
|
||||
assert ring.fft_bins == ring.ring_fft.shape[1]
|
||||
assert ring.fft_bins == ring.fft_depth_axis_m.size
|
||||
assert ring.fft_bins == ring.last_fft_vals.size
|
||||
assert ring.last_fft_third_axes_m != (None, None, None)
|
||||
assert ring.last_fft_third_vals != (None, None, None)
|
||||
for axis, vals in zip(ring.last_fft_third_axes_m, ring.last_fft_third_vals):
|
||||
assert axis is not None
|
||||
assert vals is not None
|
||||
assert axis.dtype == np.float32
|
||||
assert vals.dtype == np.float32
|
||||
assert axis.size == vals.size
|
||||
# Legacy alias kept for compatibility with existing GUI code paths.
|
||||
assert ring.fft_time_axis is ring.fft_depth_axis_m
|
||||
|
||||
@ -48,6 +56,8 @@ def test_ring_buffer_mode_switch_resets_fft_buffers_only():
|
||||
assert ring.ring is not None
|
||||
assert ring.ring_fft is not None
|
||||
raw_before = ring.ring.copy()
|
||||
assert ring.last_fft_third_axes_m != (None, None, None)
|
||||
assert ring.last_fft_third_vals != (None, None, None)
|
||||
|
||||
changed = ring.set_fft_complex_mode("diff")
|
||||
assert changed is True
|
||||
@ -57,9 +67,35 @@ def test_ring_buffer_mode_switch_resets_fft_buffers_only():
|
||||
assert ring.ring_fft is None
|
||||
assert ring.fft_depth_axis_m is None
|
||||
assert ring.last_fft_vals is None
|
||||
assert ring.last_fft_third_axes_m == (None, None, None)
|
||||
assert ring.last_fft_third_vals == (None, None, None)
|
||||
assert ring.fft_bins == 0
|
||||
|
||||
ring.push(np.linspace(-1.0, 1.0, 128, dtype=np.float32))
|
||||
assert ring.ring_fft is not None
|
||||
assert ring.fft_depth_axis_m is not None
|
||||
assert ring.last_fft_vals is not None
|
||||
assert ring.last_fft_third_axes_m != (None, None, None)
|
||||
assert ring.last_fft_third_vals != (None, None, None)
|
||||
for axis, vals in zip(ring.last_fft_third_axes_m, ring.last_fft_third_vals):
|
||||
assert axis is not None
|
||||
assert vals is not None
|
||||
assert axis.dtype == np.float32
|
||||
assert vals.dtype == np.float32
|
||||
assert axis.size == vals.size
|
||||
|
||||
|
||||
def test_ring_buffer_short_sweeps_keep_third_profiles_well_formed():
|
||||
for n in (1, 2, 3):
|
||||
ring = RingBuffer(max_sweeps=4)
|
||||
ring.ensure_init(n)
|
||||
ring.push(np.linspace(-1.0, 1.0, n, dtype=np.float32))
|
||||
|
||||
assert ring.last_fft_third_axes_m != (None, None, None)
|
||||
assert ring.last_fft_third_vals != (None, None, None)
|
||||
for axis, vals in zip(ring.last_fft_third_axes_m, ring.last_fft_third_vals):
|
||||
assert axis is not None
|
||||
assert vals is not None
|
||||
assert axis.dtype == np.float32
|
||||
assert vals.dtype == np.float32
|
||||
assert axis.size == vals.size
|
||||
|
||||
Reference in New Issue
Block a user