zfp-oss #27

Merged
benchinnery merged 15 commits from zfp-oss into main 2026-04-23 11:10:43 -04:00
Showing only changes of commit 39d5d74d6a - Show all commits

View File

@ -70,6 +70,12 @@ _MOD_TABLE: dict[str, tuple[int, str]] = {
_SPECIAL_MODS = {"FSK", "OOK", "GMSK", "OQPSK"} _SPECIAL_MODS = {"FSK", "OOK", "GMSK", "OQPSK"}
# usrp-uhd-client's tx_recording() streams 2 000-sample chunks and loops the
# source buffer for the full tx_time, so only this many samples ever need to
# be in RAM regardless of step duration or sample rate.
# 50 000 complex64 samples ≈ 400 kB — enough spectral diversity for looping.
_SYNTH_BLOCK_SAMPLES = 50_000
class TxExecutor: class TxExecutor:
"""Synthesise and transmit a signal campaign via a local SDR. """Synthesise and transmit a signal campaign via a local SDR.
@ -145,7 +151,12 @@ class TxExecutor:
) )
num_samples = int(duration * sample_rate) num_samples = int(duration * sample_rate)
signal = self._synthesise(modulation, sps, num_samples, filter_type, rolloff)
# Synthesise a short representative block. tx_recording() loops this
# buffer for the full tx_time using a 2 000-sample streaming callback,
# so peak memory is O(_SYNTH_BLOCK_SAMPLES) regardless of duration.
block_size = min(num_samples, _SYNTH_BLOCK_SAMPLES)
signal = self._synthesise(modulation, sps, block_size, filter_type, rolloff)
if self._sdr is not None: if self._sdr is not None:
try: try: