Skip to content

Add configurable sweep-length bounds to LFM and ChirpSS - #494

Open
ahmed100553 wants to merge 1 commit into
TorchDSP:mainfrom
ahmed100553:feat/sweep-length-bounds-490
Open

ahmed100553 wants to merge 1 commit into
TorchDSP:mainfrom
ahmed100553:feat/sweep-length-bounds-490

Conversation

@ahmed100553

Copy link
Copy Markdown

Summary

Fixes #490.

Add optional samples_per_symbol_min and samples_per_symbol_max metadata to the LFM and ChirpSS generators and pass these bounds through their modulators to the baseband sweep-length selection.

  • Bounds are inclusive and expressed in baseband samples.
  • Both bounds omitted: retain the exact legacy draw and seeded output.
  • Equal bounds: use the pinned length without consuming a length draw.
  • Explicit bounds must be integers satisfying 1 <= min <= max <= max_num_samples; invalid or incomplete bounds raise ValueError.
  • Share the selection/validation helper in the existing chirp module and document the optional parameters.
  • Bump the package version from 2.2.0 to 2.3.0 as requested by CONTRIBUTING.md. Packaging and documentation read this single version source; release numbering can be coordinated with other pending changes.

The output sweep length is the baseband length multiplied by sample_rate / (4 * bandwidth). The existing defaults and ChirpSS symbol mapping are unchanged.

Verification

Local environment: Conda, Python 3.12, NumPy 2.5.4, PyTorch 2.5.1 CPU.

  • make test: 2753 passed, 9 skipped on this isolated branch.
  • pylint --rcfile=.pylintrc torchsig: exit 0, score 9.74/10.
  • python -m build --no-isolation: source distribution and wheel built successfully.
  • Regressions cover legacy RNG/output behavior, equal bounds without a length draw, inclusive upper bounds, invalid inputs, resampled instantaneous-frequency periods, and metadata propagation.
  • Direct comparisons against the previous implementation found default IQ and final RNG states bit-identical in 45 seeded cases.
  • Independent generated-IQ experiment: 360 pinned cases across LFM radar and ChirpSS, lengths 64/128/256, resampling factors 1/2/40, and 20 seeds. The blind period estimator matched 358 cases. For the two ambiguous filtered ChirpSS cases, tracing the real generator and independently reconstructing the analytic chirps with NumPy convolution confirmed 64-sample symbols (RMS IQ error 2.8e-7); alternative lengths 13/63/65 had errors greater than 1.28. The ambiguous blind estimates were detector artifacts, not changed to passes by relaxing the timing tolerance.
  • An additional 40 randomized-bound cases produced measured lengths within the configured 64–256 range.

Local verification used Python 3.12; the repository CI provides the Python 3.10 check. No RF hardware or GPU validation is claimed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Let the caller bound the sweep length of the LFM and chirp-spread-spectrum builders

1 participant