Skip to content

Bind end-to-end SDR precision analysis (analysis/sdr_precision.hpp) #127

Description

@Ravenwater

Bind the end-to-end SDR precision analysis — the per-block precision sweep
that is the point of the whole module.

Upstream source: include/sw/dsp/analysis/sdr_precision.hpp (closes upstream
#103). Upstream tests: tests/test_sdr_precision.cpp.

Surface

  • enum class SdrBlock { none, constellation, tx_shaping, rx_matched, whole_chain } + to_string
  • SdrLinkConfigmodulation, samples_per_symbol, rolloff, rrc_span,
    ebn0_db, num_symbols, seed
  • SdrLinkResultblock, scalar_type, bit_width, modulation,
    ebn0_db, evm_rms, and the rest of the measured fields
  • run_link<Narrow>(cfg, block) -> SdrLinkResult
  • analyze_blocks<Narrow>(cfg, ...) -> std::vector<SdrLinkResult>
  • SdrParetoPoint
  • evm_budget(Modulation) -> double

Binding notes

  • This is the direct analogue of the acquisition precision primitives already
    bound in src/analysis_bindings.cpp (AcquisitionPrecisionRow,
    CICBitGrowthReport, write_acquisition_csv). Follow that file's shape,
    including a write_sdr_csv counterpart if upstream has one — check before
    inventing one.
  • run_link / analyze_blocks are templated on Narrow and dispatch through
    dispatch_dtype_fn. Single axis — dtype= is correct here, no scalar-pair
    scheme needed. The link is double throughout; Narrow selects which named
    block gets projected, which is what SdrBlock enumerates.
  • SdrLinkConfig.seed is unsigned and the link is stochastic. Bind the seed
    and default it, so Python results are reproducible; tests must set it
    explicitly.
  • analyze_blocks over all five SdrBlock values across the dtype table is
    the expensive call. Note the runtime in the docstring.
  • Carry upstream's corrected premise into the docstrings. Upstream issue
    0.6.0 Phase 2: expose CoeffScalar/T in window and FIR design bindings #85's epic assumed posit reaches a higher modulation order than cfloat or
    fixpnt at equal bit width; the bindings gap Phase 3: bind RealtimeSpectrum + detector modes #104 sweep measured the opposite at full
    scale, because an amplitude-normalized link keeps the waveform inside one
    octave and a uniform step is optimal against an absolute error metric there.
    If the Python docstrings restate the old premise they will actively mislead.
    Read upstream's docs-site/src/content/docs/sdr/precision.md first.
  • Result structs bind with def_ro scalar properties.

Depends on

Constellation issue (Modulation enum); metrics issue (EvmResult shape
informs SdrLinkResult). Does not depend on the scalar-pair decision.

Deliverables

  • Bindings — decide whether these live in src/sdr_bindings.cpp or
    src/analysis_bindings.cpp. The upstream header is under analysis/,
    which argues for the latter and keeps the precision primitives together.
  • Exported by explicit name in python/mpdsp/__init__.py.
  • tests/test_sdr_precision.py — a fixed seed reproduces exactly;
    SdrBlock::none is the double reference; narrowing whole_chain
    degrades EVM monotonically relative to none.
  • scripts/build_api_ref.py tables updated, docs/api_reference.md
    regenerated.

Part of the SDR binding epic #130.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions