commkit 3.10.0__tar.gz → 3.10.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {commkit-3.10.0 → commkit-3.10.2}/.github/workflows/ci.yml +2 -2
- {commkit-3.10.0 → commkit-3.10.2}/CHANGELOG.md +71 -1
- {commkit-3.10.0 → commkit-3.10.2}/PKG-INFO +1 -1
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/conftest.py +5 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/__init__.py +15 -5
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_array.py +15 -4
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_circular.py +25 -10
- commkit-3.10.2/commkit/_constants.py +9 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/bps.py +12 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/coding.py +17 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/graphs.py +3 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/llr.py +20 -10
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/selftest.py +8 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_dispersion.py +4 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_interpolation.py +7 -5
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_numba_interpolation.py +3 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_overlap_save.py +5 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/_common.py +5 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/allan.py +26 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/drift.py +20 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/interferometry.py +3 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/linewidth/dsh.py +2 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/trajectory.py +11 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/backend.py +19 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/algebraic.py +26 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/base.py +5 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/convolutional.py +6 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/crc.py +5 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/exit.py +25 -19
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/interleaving.py +3 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/ldpc.py +24 -9
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/linear.py +20 -10
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/performance.py +21 -9
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/polar.py +14 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/product.py +28 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/ratematch.py +6 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/shaping.py +2 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/_signal_input.py +2 -16
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/frame.py +34 -13
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/generation.py +56 -21
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/preamble.py +19 -8
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/signal.py +17 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_block/_dd.py +24 -16
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_block/_engine.py +6 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_common.py +4 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_numba_loops.py +21 -11
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_sequential/_dd.py +4 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_sequential/_setup.py +19 -11
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/linear.py +45 -11
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/pilots.py +3 -4
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/polarization.py +11 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/fiber/compensation.py +20 -7
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/fiber/estimation.py +11 -5
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/linear.py +46 -22
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/pulses.py +8 -25
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/response.py +14 -7
- {commkit-3.10.0 → commkit-3.10.2}/commkit/frequency.py +81 -34
- {commkit-3.10.0 → commkit-3.10.2}/commkit/impairments/fiber_channel.py +10 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/impairments/frontend.py +14 -10
- {commkit-3.10.0 → commkit-3.10.2}/commkit/impairments/noise.py +11 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/impairments/source.py +22 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/io.py +27 -14
- {commkit-3.10.0 → commkit-3.10.2}/commkit/logger.py +37 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/_demap.py +10 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/constellation.py +32 -19
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/llr.py +2 -7
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/shaping.py +26 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/math.py +4 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/_common.py +4 -4
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/awgn.py +13 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/quality.py +5 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/multirate.py +3 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/analysis.py +11 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/coding.py +1 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/constellation.py +3 -8
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/equalizer.py +6 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/eye.py +18 -9
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/filter_response.py +8 -8
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/frequency.py +18 -24
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/recovery.py +1 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/spectral.py +7 -9
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/theme.py +17 -13
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/timing.py +5 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/waveform.py +6 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/_common.py +5 -4
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/_numba_loops.py +2 -1
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/bps.py +2 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/corrections.py +77 -5
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/estimates.py +5 -5
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/pilots.py +53 -4
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/pll.py +1 -2
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/tikhonov.py +15 -14
- {commkit-3.10.0 → commkit-3.10.2}/commkit/smoothing.py +17 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/spectral.py +12 -6
- {commkit-3.10.0 → commkit-3.10.2}/commkit/timing/clock_recovery.py +9 -3
- {commkit-3.10.0 → commkit-3.10.2}/commkit/timing/synchronization.py +88 -40
- {commkit-3.10.0 → commkit-3.10.2}/pyproject.toml +4 -3
- {commkit-3.10.0 → commkit-3.10.2}/scripts/sanitize.sh +7 -2
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_allan.py +19 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_drift.py +15 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_trajectory.py +10 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_coding_base.py +84 -1
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_exit.py +45 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_performance.py +45 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_product.py +26 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_frame.py +3 -1
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_signal.py +14 -14
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_block.py +18 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_linear.py +12 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_state.py +30 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/metrics/test_quality.py +23 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_theme.py +169 -26
- {commkit-3.10.0 → commkit-3.10.2}/tests/plugins/transfer_trace.py +26 -9
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_corrections.py +49 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_pll.py +9 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_api_contracts.py +47 -6
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_dispersion.py +44 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_filtering.py +41 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_frequency.py +16 -2
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_import_hygiene.py +10 -9
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_interpolation.py +8 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_spectral.py +5 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/timing/test_synchronization.py +37 -0
- {commkit-3.10.0 → commkit-3.10.2}/uv.lock +14 -14
- commkit-3.10.0/commkit/_constants.py +0 -4
- {commkit-3.10.0 → commkit-3.10.2}/.gitattributes +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/.github/icon.svg +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/.github/logo.svg +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/.github/workflows/publish.yml +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/.gitignore +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/.python-version +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/AGENTS.md +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/LICENSE +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/README.md +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_block_blind.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_block_lms.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_bps.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_coding.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_equalizers.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_fiber.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_filters.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_gardner.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_import.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_llr.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_mapping.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_signal_pipeline.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/bench_sync_misc.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/benchutils.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/record_baseline.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/benchmarks/workloads.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_bits.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/compiler.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/filters.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/algebraic.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/bps_anchor.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/bps_min_d2.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/cs_block.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/iir.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/interpolate.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/ldpc.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/llr.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_cuda/src/selftest.cu +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_fft.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_fiber.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_numba_frequency.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_peaks.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_random.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/_sequences.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/fm_noise.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/linewidth/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/linewidth/phase.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/analysis/linewidth/result.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/_galois.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/_gf2.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/_ldpc_tables.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/_numba_loops.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/coding/turbo.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/core/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_block/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_block/_blind.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_sequential/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/_sequential/_blind.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/equalization/result.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/filtering/fiber/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/impairments/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/_lattice.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/_numba_llr.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/bits.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/mapping/gray.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/error_rates.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/metrics/information.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/plotting/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/py.typed +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/carrier_phase.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/recovery/viterbi_viterbi.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/timing/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/commkit/timing/_numba_loops.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/00-getting-started.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/02-spectral-analysis.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/03-digital-filters.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/04-pulse-shaping-and-matched-filtering.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/05-multirate-and-resampling.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/06-awgn-and-performance-metrics.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/07-channel-coding.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/09-laser-phase-noise.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/10-front-end-impairments.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/11-frame-synchronization-and-timing.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/12-sampling-clock-recovery.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/13-frequency-offset-estimation.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/14-blind-carrier-phase-recovery.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/15-pilot-aided-carrier-recovery.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/16-linear-channel-equalization.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/17-adaptive-equalization.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/18-blind-equalization.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/19-polarization-multiplexing.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/20-chromatic-dispersion.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/22-direct-and-self-coherent-detection.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/23-fec-in-optical-standards.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/24-coherent-transceiver-end-to-end.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/25-carrier-phase-characterization.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/26-laser-linewidth-self-heterodyne.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/27-laser-linewidth-short-delay-and-flicker.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/28-laser-linewidth-self-homodyne-iq.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/29-measurement-template-self-heterodyne.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/30-measurement-template-self-homodyne-iq.ipynb +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/examples/README.md +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_fm_noise.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_interferometry.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/analysis/test_linewidth.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_algebraic.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_convolutional.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_crc.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_gf2.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_interleaving.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_ldpc.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_ldpc_exit.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_ldpc_kernel.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_ldpc_tables.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_linear_codes.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_polar.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_ratematch.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_shaping.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/coding/test_turbo.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/coding.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/conversions.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/kernel_utils.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/memory.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/metrics.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/periodic.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/reference_impl.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/scoring.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/signals.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/theory.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/common/user_block.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/conftest.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_generation.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_preamble.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_psqam.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_signal_input.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/core/test_signal_mimo.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_blind.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_bps_kernel.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_cold_start.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_cpr.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_cs_kernel.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_equalizer_oracles.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_mimo.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_polarization.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_result.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_sequential.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/equalization/test_winit.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/impairments/test_fiber_channel_linear.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/impairments/test_frontend.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/impairments/test_noise.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/impairments/test_source.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/mapping/test_bits.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/mapping/test_constellation.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/mapping/test_gray.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/mapping/test_lattice.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/mapping/test_llr.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/metrics/test_awgn.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/metrics/test_common.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/metrics/test_error_rates.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/metrics/test_information.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_analysis.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_coding.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_constellation.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_equalizer.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_eye.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_filter_response.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_frequency.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_recovery.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_spectral.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_timing.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plotting/test_plot_waveform.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plugins/__init__.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/plugins/precision_trace.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_bps.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_carrier_phase.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_joint.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_pilots.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_recovery_oracles.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_tikhonov.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/recovery/test_viterbi_viterbi.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_array.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_backend.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_bit_packing.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_cuda_infra.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_examples.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_fiber.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_filter_response.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_io.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_logger.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_math.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_multirate.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_peaks.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_pulse_shaping.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_receiver_chain.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_signal_pipeline.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_smoothing.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/test_working_memory.py +0 -0
- {commkit-3.10.0 → commkit-3.10.2}/tests/timing/test_clock_recovery.py +0 -0
|
@@ -123,14 +123,14 @@ jobs:
|
|
|
123
123
|
tests/coding/test_linear_codes.py::TestMaximumLikelihood
|
|
124
124
|
tests/timing/test_clock_recovery.py::TestEstimate::test_matches_oracle
|
|
125
125
|
tests/timing/test_clock_recovery.py::TestValidation
|
|
126
|
-
tests/test_interpolation.py
|
|
126
|
+
tests/test_interpolation.py tests/test_filtering.py
|
|
127
127
|
-k "not waterfall and not threshold"
|
|
128
128
|
--device=cpu --cov=commkit --cov-report=
|
|
129
129
|
|
|
130
130
|
- name: Kernel coverage report
|
|
131
131
|
run: >-
|
|
132
132
|
uv run coverage report --show-missing --fail-under=85
|
|
133
|
-
--include="commkit/equalization/_numba_loops.py,commkit/
|
|
133
|
+
--include="commkit/equalization/_numba_loops.py,commkit/mapping/_numba_llr.py,commkit/recovery/_numba_loops.py,commkit/coding/_numba_loops.py,commkit/timing/_numba_loops.py,commkit/_numba_interpolation.py,commkit/_numba_frequency.py"
|
|
134
134
|
|
|
135
135
|
# GPU legs (--device=gpu / --device=all) require CuPy + CUDA and are run
|
|
136
136
|
# manually or on a self-hosted runner; they are intentionally not part of
|
|
@@ -4,6 +4,74 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.10.2] - 2026-11-24
|
|
8
|
+
|
|
9
|
+
Follow-up polish and fixes from the alignment review: unified value-object host copying and equality semantics, persistent BPS anchor state across sequential equalizer resumes, upfront composite-code validation, GPU IIR support beyond 16 sections, consistent real-input optical transforms, zero-copy frequency-offset framing, unbiased quality metrics, and stricter contract/theme/transfer audits. No public signatures changed.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Core, backend and value objects**:
|
|
14
|
+
- Routed `freeze_host` and validation-time host reads across value objects (`Constellation`, `EqualizerPilots`, `LinearBlockCode`, `LDPCCode`, `PolarCode`, `Interleaver`, `Punctured`, `ExitCurve`, `ErrorRateCurve`) through `_array.host_array`, consolidating device-to-host copies to one documented audit site.
|
|
15
|
+
- Added `eq=False` to array-holding estimate and result dataclasses (`EqualizerPilots`, `ChannelEstimate`, `PolarizationEstimate`, `PolarizationTonesEstimate`, `CarrierPhaseEstimate` and subclasses, `DecodeResult`, `FrameStructure`, `FilterResponse`, `ChromaticDispersionEstimate` and subclasses, `FrequencyOffsetEstimate` and subclasses, `IQImbalanceEstimate`, `Spectrogram`, `SamplingClockOffsetEstimate`, `TimingEstimate`) so `==` no longer raises NumPy's ambiguous truth-value `ValueError`; `ExitCurve`, `ExitChart` and `ErrorRateCurve` now inherit `_Value` for value equality and hashing.
|
|
16
|
+
- Unified invalid-type checks in `Signal`, `Reference` and `SingleCarrierFrame` to raise `TypeError` (matching `SignalInput` and `generate`), moved `require_device` into `commkit.backend` (removing `coding/exit.py::_check_device`), and aligned `commkit.__all__` with all public top-level submodules.
|
|
17
|
+
- **Equalization and carrier recovery**:
|
|
18
|
+
- Persisted the data-aided BPS anchor buffer (`bps_da_buf`, `bps_da_sum`, `bps_da_ptr`) in `EqualizerState` across `resume` in sequential equalizers so `n_train > resume` no longer resets the anchor window.
|
|
19
|
+
- Unified `_resolve_pll_gains` to return plain `float` tuples in both branches (avoiding duplicate Numba specializations), allowed `constellation=None` in fully trained `block_lms` runs without CPR (matching `lms`), and vectorized `Tikhonov` smoothing across channels (`axis=-1`).
|
|
20
|
+
- **Channel coding**:
|
|
21
|
+
- Added recursive upfront method validation on composite codes (`PAS`, `Concatenated`, `Punctured`, `Shortened`, `_Repeat`) so invalid inner decoder methods fail immediately on empty inputs and before Monte Carlo batches in `error_rate_curve` and `decoder_exit_curve`.
|
|
22
|
+
- Avoided GPU upload/download round trips for host-side codes (`CCDM`, `PAS`, `TurboCode`) in `error_rate_curve` and `decoder_exit_curve`, eliminated double GF(2) row reduction in `LDPCCode._build_encoder`, and skipped unused soft-output buffers and kernel compilation when `MaximumLikelihood(soft=False)`.
|
|
23
|
+
- Tightened strict integer (rejecting `bool`/`float`) and construction-time validation in `ReedSolomonCode`, `BCHCode`, `PolarCode.nr`, `LDPCCode.quasi_cyclic`, `LDPCCode.from_parity_check`, `CRC`, `ConvolutionalCode` and `PAS`.
|
|
24
|
+
- **Front-end DSP, filtering, metrics and analysis**:
|
|
25
|
+
- Routed `iir_filter` with more than 16 second-order sections on the GPU to the CPU Numba kernel instead of raising `ValueError`, avoided double `_zero_phase_padding` in zero-phase IIR filtering, deferred unit-circle phasor evaluation in `filter_response`, and removed `DEBUG` logging from `Pulse.taps()` helpers while validating `sps`.
|
|
26
|
+
- Made real-input behaviour consistent across optical linear transforms: `apply_chromatic_dispersion`, `correct_chromatic_dispersion` (`"whole_record"` and `"fir"`) and `apply_pmd` now return complex output without `ComplexWarning` (matching `apply_fiber_propagation`).
|
|
27
|
+
- Switched block framing in `estimate_frequency_offset` to zero-copy `as_strided`, deferred unused host frequency arrays in `_mth_power`, and anchored blockwise frequency-offset correction at `theta[0] = 0` (matching static correction).
|
|
28
|
+
- Used `rfft`/`irfft` for real inputs and validated `delay` shapes in `apply_delay`, and used the winning transmit stream's energy in MIMO `estimate_timing` coherence.
|
|
29
|
+
- Cached Gauss-Hermite nodes in `metrics.awgn` and divided by `ref_pwr` across data-aided `evm`, `snr` and `noise_variance` so all three stay unbiased and mutually consistent when `|pwr - 1| <= 1e-3`.
|
|
30
|
+
- Closed remaining parameter-validation gaps in `smooth_phase`, `resolve_phase_ambiguity`, `correct_channel`, `carrier_phase_trajectory`, `frequency_drift`, `allan_deviation` and `welch_psd` (empty input).
|
|
31
|
+
|
|
32
|
+
### Development
|
|
33
|
+
|
|
34
|
+
- Broadened `tests/test_api_contracts.py` with `conflict=` checks for `correct_polarization`, `apply_polarization_mixing`, `correct_carrier_phase` and `estimate_timing`, and `call=` builders for `dsh_phase`, `estimate_linewidth`, `carrier_phase_trajectory`, `estimate_channel`, `estimate_polarization` and `estimate_iq_imbalance`.
|
|
35
|
+
- Tightened `tests/plotting/test_plot_theme.py` to catch dict-literal style kwargs, reversed format strings, `ms=` and leading-dot floats, expanded `TestDeviceReduction` across all sample-rate plots, and replaced `tests/plugins/transfer_trace.py`'s blanket `plotting/` exemption with a plot-sized D2H ceiling (`_PLOT_MAX = 300_000`) and peak-size reporting.
|
|
36
|
+
|
|
37
|
+
## [3.10.1] - 2026-11-23
|
|
38
|
+
|
|
39
|
+
Bug fixes and alignment cleanups across the library from a full audit: stricter precision and host-sync hygiene, staircase and EXIT-chart correctness fixes, SI tick formatting, lazy `filtering` import, and tightened input validation. No public signatures changed.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **Core, I/O and mapping**:
|
|
44
|
+
- `import commkit` no longer eagerly imports `commkit.filtering` (nor Numba). `Preamble.symbols` and cached `SingleCarrierFrame` payload/pilot arrays are now read-only.
|
|
45
|
+
- `save_npz` and `load_npz` append `.npz` when missing without clobbering earlier dots in the filename (e.g. `run_1.5GHz` saves to `run_1.5GHz.npz`).
|
|
46
|
+
- `optimal_nu` and `Constellation.shaped(entropy=...)` reject entropies at or below the minimum-energy shell limit `log2(m_min)` instead of overflowing and returning the wrong entropy.
|
|
47
|
+
- `compute_llr` and `Constellation.llr` accept Python lists/sequences, reject non-positive or non-finite `noise_var`, and `Constellation._nearest` preserves double precision for non-square constellations and no longer divides by zero on integer inputs.
|
|
48
|
+
- `shape_pulse` handles integer symbol inputs and complex taps without truncation; `to_device` and `db_to_linear` reject foreign array types with `TypeError`; `validate_array` accepts NumPy scalars; `set_log_level` validates level names with `ValueError`.
|
|
49
|
+
- **Front-end DSP (`filtering`, `impairments`, `multirate`, `spectral`, `smoothing`, `timing`, `frequency`)**:
|
|
50
|
+
- `_numba_interpolation.interp` matches the GPU kernel when `p - floor(p)` rounds to `1.0` (e.g. `p = -1e-17`), preventing `NaN` outputs; empty `interpolate_piecewise` inputs now behave identically on CPU and GPU.
|
|
51
|
+
- `fir_filter(..., periodic=True)` folds taps on the data's device (no record-length host allocation on GPU), handles empty inputs and complex taps on real samples cleanly; `iir_filter` rejects empty `(0, 6)` SOS arrays; `fir_taps` validates `btype`.
|
|
52
|
+
- `apply_frequency_offset` accepts GPU `offset` arrays; `correct_frequency_offset` validates channel counts instead of broadcasting 1-D inputs into 2-D; `apply_coherent_detection` avoids catastrophic cancellation when LO RIN dominates; `add_pilot_tone` delivers the requested PSR on real inputs (`sqrt(2)` cosine amplitude); `decimate(..., factor=1)` succeeds with the default method.
|
|
53
|
+
- `correct_timing(mode="zero")` handles scalar shifts `abs(shift) >= N`; `correct_sampling_clock_offset` allows odd `sps` when given a `SamplingClockOffsetEstimate`; conflicting `Signal` properties are now checked in `apply_polarization_mixing` (`drift_rate=0`), `apply_awgn` (`snr_db`/`noise_var`), `estimate_timing` (array template) and `correct_polarization` (estimate/matrix).
|
|
54
|
+
- Fixed the dispersion sign in `apply_fiber_propagation`'s NLSE docstring to match the code (`+ j β₂/2`).
|
|
55
|
+
- **Receiver DSP (`equalization`, `recovery`, `metrics`, `analysis`)**:
|
|
56
|
+
- `cycle_slip` and `cs_block` Numba kernels compile without `fastmath` so running sums are not reassociated; inline cycle-slip repair in `cpr_loop` updates `bps_prev4`/`pll_phi` after a slip.
|
|
57
|
+
- `apply_taps` preserves `complex128` with `samples_prefix` / non-zero `pad_mode` and avoids NEP 50 promotion on MIMO prefixes; `block_lms` stores `phase_trajectory` in `float64`, keeps full BPS window length across short/final blocks and preserves `cs_H` across continuation calls.
|
|
58
|
+
- Adaptive equalizers align `lead = c_tap` and pilot de-boosting cleanly when `N % sps != 0`; `estimate_channel` dispatches on `samples` (not `reference`); `rls` checks weight finiteness before logging decision-power warnings.
|
|
59
|
+
- `Tikhonov` uses PMF-weighted power for shaped constellations and accounts for `C * block_size` in joint-channel mode; `_mth_power_geometry` handles constellations with a point at `0+0j`; `PilotTones` batches coherence host transfers out of the per-tone loop and validates Nyquist/channel bounds; BPS candidate angles are formed in `float64`; metrics `_unit_reference` and `_gain` accumulate in double precision; `dsh_phase` accumulates parallel transport in `float64`; `_dsh_fm_psd` computes real-beat support across all MIMO channels; `_whittle_fit` guards zero PSD bins.
|
|
60
|
+
- **Channel coding and CUDA wrappers**:
|
|
61
|
+
- `StaircaseCode` decoding rejects BCH row miscorrections that flip known-zero positions instead of injecting errors into the frame.
|
|
62
|
+
- `demapper_exit_curve` detects real constellations via `constellation.is_complex` (fixing a 3 dB noise-variance mismatch on complex BPSK); `decoder_exit_curve` handles infinite LLRs without `NaN` or zeroing mutual information.
|
|
63
|
+
- `PolarCode` encoding caches `info_positions` on the device via `_device_tables`.
|
|
64
|
+
- CUDA launch wrappers guard empty/zero grids and array dimensions and raise `ValueError` on invalid specializations; `GraphRunner` captures `end_capture()` failures with context and avoids masking exceptions in `__exit__`.
|
|
65
|
+
- **Plotting**:
|
|
66
|
+
- `_SIAxisFormatter` picks decimal precision from the scaled tick values instead of only the tick step, fixing duplicate/rounded labels on offset ticks (e.g. `[0.5, 1.5, 2.5] MHz`).
|
|
67
|
+
- `plot_frequency_offset_blockwise_result` reduces and decimates on-device (no full sample-rate GPU→CPU copy) and handles multi-channel estimates cleanly.
|
|
68
|
+
- `plot_llr_distribution` moves `bits` to `llrs`'s device; `plot_constellation(..., overlay_reference=True)` validates before opening a figure; `plot_channel_correction` titles the combined response `|W·H(f)|` and validates `nfft >= len(h)`; `plot_dsh_beat_psd` floors zero PSD bins; `plot_eye_diagram`, `plot_frequency_offset_spectrum`, `plot_psd`, `plot_time_domain`, `plot_filter_response`, `plot_pilot_tone_phase_estimate` and `plot_timing_correlation` tighten axis, legend and argument validation.
|
|
69
|
+
|
|
70
|
+
### Development
|
|
71
|
+
|
|
72
|
+
- CI `kernel-coverage` `--include` list updated to cover all current Numba kernel modules (`coding/_numba_loops.py`, `mapping/_numba_llr.py`, `recovery/_numba_loops.py`, `equalization/_numba_loops.py`, `timing/_numba_loops.py`, `_numba_interpolation.py`, `_numba_frequency.py`; 99 % coverage).
|
|
73
|
+
- Strict mypy enabled for `commkit.timing.*`; `scripts/sanitize.sh` covers `test_linear_codes.py` and `test_gf2.py` and propagates non-zero exit codes; `benchmarks/conftest.py` fails on broken CuPy or missing CuPy under `--device=gpu`.
|
|
74
|
+
|
|
7
75
|
## [3.10.0] - 2026-11-20
|
|
8
76
|
|
|
9
77
|
Plots for both backgrounds and for comparisons: `apply_default_theme(dark=False)` adds a light theme, and every plot takes its colors, color maps and sizes from the current style, so guides stay visible on white and under a style of your own. `relative=True` draws filter responses, spectra, spectrograms and eyes relative to their peaks, `annotations=True` adds -3 dB, half-symbol-rate, symbol-instant and final-value guides, and `plot_filter_response` draws an FIR filter as `fir_filter` applies it. The group delay of linear-phase filters is exact, so its plot is flat instead of spiking at the stopband zeros. Eight notebooks show the new features.
|
|
@@ -670,7 +738,9 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
|
|
|
670
738
|
|
|
671
739
|
First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
|
|
672
740
|
|
|
673
|
-
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.10.
|
|
741
|
+
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.10.2...HEAD
|
|
742
|
+
[3.10.2]: https://github.com/lokgar/commkit/compare/v3.10.1...v3.10.2
|
|
743
|
+
[3.10.1]: https://github.com/lokgar/commkit/compare/v3.10.0...v3.10.1
|
|
674
744
|
[3.10.0]: https://github.com/lokgar/commkit/compare/v3.9.0...v3.10.0
|
|
675
745
|
[3.9.0]: https://github.com/lokgar/commkit/compare/v3.8.0...v3.9.0
|
|
676
746
|
[3.8.0]: https://github.com/lokgar/commkit/compare/v3.7.1...v3.8.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: commkit
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.2
|
|
4
4
|
Summary: A Python library for high-performance digital communications research.
|
|
5
5
|
Project-URL: Homepage, https://github.com/lokgar/commkit
|
|
6
6
|
Project-URL: Repository, https://github.com/lokgar/commkit
|
|
@@ -95,15 +95,18 @@ def _warm_numba_threads():
|
|
|
95
95
|
|
|
96
96
|
@pytest.fixture
|
|
97
97
|
def backend_device(request):
|
|
98
|
-
"""Current backend device name;
|
|
98
|
+
"""Current backend device name; fails on explicit --device=gpu or broken CuPy."""
|
|
99
99
|
device = request.param
|
|
100
|
+
device_opt = request.config.getoption("--device")
|
|
100
101
|
if device == "gpu":
|
|
101
102
|
if not _CUPY_AVAILABLE:
|
|
103
|
+
if device_opt == "gpu":
|
|
104
|
+
pytest.fail("--device=gpu was requested but CuPy is not installed")
|
|
102
105
|
pytest.skip("CuPy not installed, skipping GPU benchmarks")
|
|
103
106
|
try:
|
|
104
107
|
cp.zeros(1)
|
|
105
108
|
except Exception as e: # pragma: no cover - environment-dependent
|
|
106
|
-
pytest.
|
|
109
|
+
pytest.fail(f"CuPy is installed but not functional: {e}")
|
|
107
110
|
yield device
|
|
108
111
|
|
|
109
112
|
|
|
@@ -31,7 +31,7 @@ Matplotlib, change warning filters, or touch the GPU.
|
|
|
31
31
|
import importlib as _importlib
|
|
32
32
|
from typing import Any as _Any
|
|
33
33
|
|
|
34
|
-
__version__ = "3.10.
|
|
34
|
+
__version__ = "3.10.2"
|
|
35
35
|
|
|
36
36
|
from .backend import PrecisionWarning
|
|
37
37
|
from .core import (
|
|
@@ -95,27 +95,37 @@ def __dir__() -> list[str]:
|
|
|
95
95
|
__all__ = [
|
|
96
96
|
"Constellation",
|
|
97
97
|
"Gaussian",
|
|
98
|
+
"Preamble",
|
|
99
|
+
"PrecisionWarning",
|
|
98
100
|
"RC",
|
|
99
101
|
"RRC",
|
|
100
|
-
"Reference",
|
|
101
102
|
"Rect",
|
|
102
|
-
"
|
|
103
|
-
"Preamble",
|
|
104
|
-
"PrecisionWarning",
|
|
103
|
+
"Reference",
|
|
105
104
|
"Signal",
|
|
106
105
|
"SingleCarrierFrame",
|
|
106
|
+
"SmoothRect",
|
|
107
107
|
"__version__",
|
|
108
108
|
"analysis",
|
|
109
|
+
"backend",
|
|
109
110
|
"coding",
|
|
111
|
+
"core",
|
|
110
112
|
"equalization",
|
|
113
|
+
"filtering",
|
|
111
114
|
"frequency",
|
|
112
115
|
"generate",
|
|
113
116
|
"impairments",
|
|
117
|
+
"io",
|
|
114
118
|
"load_npz",
|
|
119
|
+
"logger",
|
|
120
|
+
"mapping",
|
|
121
|
+
"math",
|
|
115
122
|
"metrics",
|
|
123
|
+
"multirate",
|
|
124
|
+
"plotting",
|
|
116
125
|
"recovery",
|
|
117
126
|
"save_npz",
|
|
118
127
|
"set_log_level",
|
|
128
|
+
"smoothing",
|
|
119
129
|
"spectral",
|
|
120
130
|
"timing",
|
|
121
131
|
]
|
|
@@ -4,8 +4,8 @@ Indexing, broadcasting and coercion operations on NumPy/CuPy arrays, used by
|
|
|
4
4
|
every module: :func:`validate_array`, the SISO/MIMO shape pair
|
|
5
5
|
:func:`as_2d` / :func:`restore_1d`, :func:`broadcast_channels`,
|
|
6
6
|
:func:`require_channels`, :func:`to_report_scalar` (host values of the
|
|
7
|
-
metrics and summaries), :func:`freeze_host` (the
|
|
8
|
-
value objects) and :func:`warn_if_double` (the
|
|
7
|
+
metrics and summaries), :func:`host_array` / :func:`freeze_host` (the
|
|
8
|
+
read-only host fields of value objects) and :func:`warn_if_double` (the
|
|
9
9
|
:class:`~commkit.PrecisionWarning` of the fixed-precision blocks). This
|
|
10
10
|
module imports only ``backend``: nothing from ``core``, DSP modules or
|
|
11
11
|
plotting.
|
|
@@ -62,8 +62,9 @@ def validate_array(
|
|
|
62
62
|
"""
|
|
63
63
|
# Coerce lists/tuples and scalars to NumPy; arrays from other frameworks
|
|
64
64
|
# (JAX, PyTorch, ...) are rejected rather than silently copied.
|
|
65
|
-
if not (isinstance(v, np.ndarray) or _is_cupy_array(v)):
|
|
65
|
+
if not (isinstance(v, np.ndarray | np.generic) or _is_cupy_array(v)):
|
|
66
66
|
_reject_foreign_array(v)
|
|
67
|
+
if not (isinstance(v, np.ndarray) or _is_cupy_array(v)):
|
|
67
68
|
try:
|
|
68
69
|
v = np.asarray(v)
|
|
69
70
|
except Exception as err:
|
|
@@ -86,6 +87,16 @@ def validate_array(
|
|
|
86
87
|
return v
|
|
87
88
|
|
|
88
89
|
|
|
90
|
+
def host_array(value: Any, dtype: Any = None) -> np.ndarray:
|
|
91
|
+
"""Return ``value`` as a host NumPy array for value-object construction.
|
|
92
|
+
|
|
93
|
+
One transfer for device input (documented in ``transfer_trace``), used by
|
|
94
|
+
:func:`freeze_host` and by value objects or constructors that inspect or
|
|
95
|
+
transform an array before freezing it.
|
|
96
|
+
"""
|
|
97
|
+
return _to_host(value, dtype)
|
|
98
|
+
|
|
99
|
+
|
|
89
100
|
def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarray:
|
|
90
101
|
"""Store ``value`` as field ``name`` of the frozen dataclass ``obj``.
|
|
91
102
|
|
|
@@ -93,7 +104,7 @@ def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarra
|
|
|
93
104
|
so the caller's array stays writable and a value object never holds
|
|
94
105
|
device memory. Returns the stored array.
|
|
95
106
|
"""
|
|
96
|
-
arr = np.array(
|
|
107
|
+
arr = np.array(host_array(value), dtype=dtype)
|
|
97
108
|
arr.setflags(write=False)
|
|
98
109
|
object.__setattr__(obj, name, arr)
|
|
99
110
|
return arr
|
|
@@ -66,17 +66,32 @@ def convolve_periodic(
|
|
|
66
66
|
"""
|
|
67
67
|
x, xp, _ = dispatch(samples)
|
|
68
68
|
n = x.shape[-1]
|
|
69
|
-
|
|
70
|
-
real = not (xp.iscomplexobj(x) or
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
h_raw = xp.asarray(taps)
|
|
70
|
+
real = not (xp.iscomplexobj(x) or xp.iscomplexobj(h_raw))
|
|
71
|
+
real_dtype = x.real.dtype if x.real.dtype.kind == "f" else np.dtype(np.float32)
|
|
72
|
+
out_dtype = real_dtype if real else np.result_type(real_dtype, np.complex64)
|
|
73
|
+
if n == 0:
|
|
74
|
+
return xp.empty(x.shape, dtype=out_dtype)
|
|
75
|
+
# Fold taps on the data's device (avoids a record-length H2D copy on GPU).
|
|
76
|
+
precision = (
|
|
77
|
+
np.result_type(real_dtype, np.complex64)
|
|
78
|
+
if xp.iscomplexobj(h_raw)
|
|
79
|
+
else real_dtype
|
|
80
|
+
)
|
|
81
|
+
h = h_raw.astype(precision, copy=False).ravel()
|
|
82
|
+
c = (h.size - 1) // 2 if center is None else center
|
|
83
|
+
kernel = xp.zeros(n, dtype=precision)
|
|
84
|
+
if h.size <= n:
|
|
85
|
+
kernel[: h.size] = h
|
|
86
|
+
if c:
|
|
87
|
+
kernel = xp.roll(kernel, -c)
|
|
88
|
+
else:
|
|
89
|
+
idx = (xp.arange(h.size) - c) % n
|
|
90
|
+
xp.add.at(kernel, idx, h)
|
|
76
91
|
if real:
|
|
77
|
-
h_f = _fft.rfft(
|
|
92
|
+
h_f = _fft.rfft(kernel)
|
|
78
93
|
out = _fft.irfft(_fft.rfft(x, axis=-1) * h_f, n=n, axis=-1)
|
|
79
94
|
else:
|
|
80
|
-
h_f = _fft.fft(
|
|
95
|
+
h_f = _fft.fft(kernel)
|
|
81
96
|
out = _fft.ifft(_fft.fft(x, axis=-1) * h_f, axis=-1)
|
|
82
|
-
return out.astype(
|
|
97
|
+
return out.astype(out_dtype, copy=False)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Physical constants shared across the package (private).
|
|
2
|
+
|
|
3
|
+
Used by :mod:`commkit._dispersion`, :mod:`commkit.core.signal`,
|
|
4
|
+
:mod:`commkit.filtering.fiber.estimation`, :mod:`commkit.impairments.noise`
|
|
5
|
+
and :mod:`commkit.plotting.spectral`.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
SPEED_OF_LIGHT = 299_792_458.0 # m/s, exact (SI definition)
|
|
9
|
+
ELEMENTARY_CHARGE = 1.602_176_634e-19 # C, exact (SI definition)
|
|
@@ -22,7 +22,10 @@ def _bps_min_d2_factory(mode: str = "table", return_argmin: bool = False) -> Cal
|
|
|
22
22
|
|
|
23
23
|
from . import compiler
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
modes = {"table": 0, "grid": 1}
|
|
26
|
+
if mode not in modes:
|
|
27
|
+
raise ValueError(f"bps_min_d2: mode must be 'table' or 'grid', got {mode!r}.")
|
|
28
|
+
mode_id = modes[mode]
|
|
26
29
|
if mode_id == 1 and return_argmin:
|
|
27
30
|
raise ValueError("return_argmin is only supported in TABLE mode")
|
|
28
31
|
kern = compiler.get_raw_kernel(
|
|
@@ -144,7 +147,11 @@ def _cs_block_factory() -> Callable:
|
|
|
144
147
|
``max_block`` symbols.
|
|
145
148
|
"""
|
|
146
149
|
C = cs_buf_ptr.shape[0] if cs_buf_ptr.ndim == 1 else -1
|
|
150
|
+
if C < 1:
|
|
151
|
+
raise ValueError(f"cs_block: expected at least 1 channel, got C={C}")
|
|
147
152
|
cs_H = int(cs_H)
|
|
153
|
+
if cs_H < 1:
|
|
154
|
+
raise ValueError(f"cs_block: cs_H must be >= 1, got {cs_H}")
|
|
148
155
|
compiler.check_arrays(
|
|
149
156
|
("cs_buf_y", cs_buf_y, cp.float64, (C, cs_H)),
|
|
150
157
|
("cs_buf_ptr", cs_buf_ptr, cp.int64, (C,)),
|
|
@@ -219,15 +226,17 @@ def _bps_anchor_factory() -> Callable:
|
|
|
219
226
|
"""Anchored phase ``(C, n)`` float64 and the new ``(C, K-1)`` history."""
|
|
220
227
|
compiler.check_arrays(("y", y, cp.complex64, (None, None)))
|
|
221
228
|
C, n = y.shape
|
|
229
|
+
if C < 1:
|
|
230
|
+
raise ValueError("y must have at least one channel")
|
|
222
231
|
if n < 1:
|
|
223
232
|
raise ValueError("y must have at least one training column")
|
|
224
|
-
H = hist.shape[-1]
|
|
225
233
|
compiler.check_arrays(
|
|
226
234
|
("d", d, cp.complex64, (C, n)),
|
|
227
|
-
("hist", hist, cp.complex64, (C,
|
|
235
|
+
("hist", hist, cp.complex64, (C, None)),
|
|
228
236
|
("offset4", offset4, cp.float64, (C,)),
|
|
229
237
|
("prev4", prev4, cp.float64, (C,)),
|
|
230
238
|
)
|
|
239
|
+
H = hist.shape[-1]
|
|
231
240
|
phi = cp.empty((C, n), dtype=cp.float64)
|
|
232
241
|
hist_out = cp.empty((C, H), dtype=cp.complex64)
|
|
233
242
|
total = cp.zeros(n if joint else 0, dtype=cp.complex64)
|
|
@@ -43,6 +43,11 @@ def _ldpc_layered_factory(sum_product: bool = False) -> Callable:
|
|
|
43
43
|
("layer_ptr", layer_ptr, cp.int32, (None,)),
|
|
44
44
|
)
|
|
45
45
|
B, N = app.shape
|
|
46
|
+
if row_ptr.size < 2 or layer_ptr.size < 2:
|
|
47
|
+
raise ValueError(
|
|
48
|
+
f"row_ptr and layer_ptr need at least 2 entries, got "
|
|
49
|
+
f"{row_ptr.size} and {layer_ptr.size}"
|
|
50
|
+
)
|
|
46
51
|
m, E = row_ptr.size - 1, cols.size
|
|
47
52
|
iters = cp.zeros(B, dtype=cp.int32)
|
|
48
53
|
valid = cp.zeros(B, dtype=cp.uint8)
|
|
@@ -90,13 +95,22 @@ def _algebraic_correct_factory() -> Callable:
|
|
|
90
95
|
binary: bool,
|
|
91
96
|
) -> Any:
|
|
92
97
|
"""Correct ``words`` ``(B, n m)`` int8 in place; ``valid`` ``(B,)``."""
|
|
98
|
+
if t < 1:
|
|
99
|
+
raise ValueError(f"t must be >= 1, got {t}")
|
|
100
|
+
if m < 1:
|
|
101
|
+
raise ValueError(f"m must be >= 1, got {m}")
|
|
102
|
+
compiler.check_arrays(
|
|
103
|
+
("words", words, cp.int8, (None, None)),
|
|
104
|
+
("locator_logs", locator_logs, cp.int64, (None,)),
|
|
105
|
+
("exp", exp, cp.int64, (None,)),
|
|
106
|
+
("log", log, cp.int64, (None,)),
|
|
107
|
+
)
|
|
93
108
|
B = words.shape[0]
|
|
94
109
|
n = locator_logs.size
|
|
110
|
+
if log.size < 2:
|
|
111
|
+
raise ValueError(f"log table must have at least 2 entries, got {log.size}")
|
|
95
112
|
compiler.check_arrays(
|
|
96
113
|
("s", s, cp.int64, (B, 2 * t)),
|
|
97
|
-
("exp", exp, cp.int64, (None,)),
|
|
98
|
-
("log", log, cp.int64, (None,)),
|
|
99
|
-
("locator_logs", locator_logs, cp.int64, (None,)),
|
|
100
114
|
("words", words, cp.int8, (B, n * m)),
|
|
101
115
|
)
|
|
102
116
|
if exp.size != 2 * log.size:
|
|
@@ -82,7 +82,8 @@ class GraphRunner:
|
|
|
82
82
|
def __exit__(self, *exc: object) -> None:
|
|
83
83
|
if self._stream is not None:
|
|
84
84
|
self._stream.__exit__(*exc)
|
|
85
|
-
|
|
85
|
+
if exc[0] is None:
|
|
86
|
+
self._stream.synchronize()
|
|
86
87
|
|
|
87
88
|
def run(self, key: Hashable, body: Callable[[], Any]) -> Any:
|
|
88
89
|
"""Run ``body()`` for ``key``; ``None`` or ``False`` runs it eagerly.
|
|
@@ -100,6 +101,7 @@ class GraphRunner:
|
|
|
100
101
|
self._stream.begin_capture()
|
|
101
102
|
try:
|
|
102
103
|
out = body()
|
|
104
|
+
graph = self._stream.end_capture()
|
|
103
105
|
except BaseException as exc:
|
|
104
106
|
with contextlib.suppress(Exception):
|
|
105
107
|
self._stream.end_capture()
|
|
@@ -107,7 +109,6 @@ class GraphRunner:
|
|
|
107
109
|
f"{self.name}: CUDA-graph capture failed; the captured body must "
|
|
108
110
|
"only launch work on fixed buffers"
|
|
109
111
|
) from exc
|
|
110
|
-
graph = self._stream.end_capture()
|
|
111
112
|
self._graphs[key] = graph
|
|
112
113
|
graph.launch()
|
|
113
114
|
return out
|
|
@@ -60,11 +60,15 @@ def _llr_factory() -> Callable:
|
|
|
60
60
|
"""LLRs of the ``(n,)`` complex64 symbols ``x``, shape ``(n, k)``."""
|
|
61
61
|
if not 1 <= k <= LLR_MAX_K:
|
|
62
62
|
raise ValueError(f"bits per symbol must be in [1, {LLR_MAX_K}], got {k}")
|
|
63
|
+
compiler.check_arrays(
|
|
64
|
+
("x", x, cp.complex64, (None,)),
|
|
65
|
+
("points", points, cp.complex64, (None,)),
|
|
66
|
+
)
|
|
63
67
|
n = x.shape[0]
|
|
64
68
|
M = points.shape[0]
|
|
69
|
+
if M < 1:
|
|
70
|
+
raise ValueError(f"points must be non-empty, got M={M}")
|
|
65
71
|
compiler.check_arrays(
|
|
66
|
-
("x", x, cp.complex64, (n,)),
|
|
67
|
-
("points", points, cp.complex64, (M,)),
|
|
68
72
|
("log_pmf", log_pmf, cp.float32, (M,)),
|
|
69
73
|
("labels", labels, cp.int32, (M,)),
|
|
70
74
|
)
|
|
@@ -106,20 +110,25 @@ def _llr_separable_factory() -> Callable:
|
|
|
106
110
|
``re`` and ``im`` are each ``(levels, log_prior, labels, positions)``
|
|
107
111
|
of one axis: float32, float32 and int32 ``(L,)``, int32 ``(k_axis,)``.
|
|
108
112
|
"""
|
|
113
|
+
compiler.check_arrays(("x", x, cp.complex64, (None,)))
|
|
109
114
|
n = x.shape[0]
|
|
110
|
-
checks
|
|
115
|
+
checks: list[tuple[str, Any, Any, tuple[int, ...]]] = []
|
|
111
116
|
axis_args: list[Any] = []
|
|
112
117
|
for name, (lev, logp, lab, pos) in (("re", re), ("im", im)):
|
|
118
|
+
compiler.check_arrays(
|
|
119
|
+
(f"{name} levels", lev, cp.float32, (None,)),
|
|
120
|
+
(f"{name} positions", pos, cp.int32, (None,)),
|
|
121
|
+
)
|
|
113
122
|
L, kb = lev.shape[0], pos.shape[0]
|
|
123
|
+
if L < 1:
|
|
124
|
+
raise ValueError(f"the {name} axis needs at least 1 level, got {L}")
|
|
114
125
|
if not 1 <= kb <= LLR_MAX_K:
|
|
115
126
|
raise ValueError(
|
|
116
127
|
f"bits of the {name} axis must be in [1, {LLR_MAX_K}], got {kb}"
|
|
117
128
|
)
|
|
118
129
|
checks += [
|
|
119
|
-
(f"{name} levels", lev, cp.float32, (L,)),
|
|
120
130
|
(f"{name} log prior", logp, cp.float32, (L,)),
|
|
121
131
|
(f"{name} labels", lab, cp.int32, (L,)),
|
|
122
|
-
(f"{name} positions", pos, cp.int32, (kb,)),
|
|
123
132
|
]
|
|
124
133
|
axis_args += [lev, logp, lab, pos, cp.int32(L), cp.int32(kb)]
|
|
125
134
|
compiler.check_arrays(*checks)
|
|
@@ -164,12 +173,15 @@ def _llr_separable_maxlog_factory() -> Callable:
|
|
|
164
173
|
one axis: float32 and int32 ``(L,)``, int32 ``(k_axis, L)`` twice,
|
|
165
174
|
int32 ``(k_axis,)``; ``L >= 2`` equally spaced ascending levels.
|
|
166
175
|
"""
|
|
176
|
+
compiler.check_arrays(("x", x, cp.complex64, (None,)))
|
|
167
177
|
n = x.shape[0]
|
|
168
|
-
checks: list[tuple[str, Any, Any, tuple[int, ...]]] = [
|
|
169
|
-
("x", x, cp.complex64, (n,))
|
|
170
|
-
]
|
|
178
|
+
checks: list[tuple[str, Any, Any, tuple[int, ...]]] = []
|
|
171
179
|
axis_args: list[Any] = []
|
|
172
180
|
for name, (lev, lab, lo, hi, pos) in (("re", re), ("im", im)):
|
|
181
|
+
compiler.check_arrays(
|
|
182
|
+
(f"{name} levels", lev, cp.float32, (None,)),
|
|
183
|
+
(f"{name} positions", pos, cp.int32, (None,)),
|
|
184
|
+
)
|
|
173
185
|
L, kb = lev.shape[0], pos.shape[0]
|
|
174
186
|
if not 1 <= kb <= LLR_MAX_K:
|
|
175
187
|
raise ValueError(
|
|
@@ -178,11 +190,9 @@ def _llr_separable_maxlog_factory() -> Callable:
|
|
|
178
190
|
if L < 2:
|
|
179
191
|
raise ValueError(f"the {name} axis needs at least 2 levels, got {L}")
|
|
180
192
|
checks += [
|
|
181
|
-
(f"{name} levels", lev, cp.float32, (L,)),
|
|
182
193
|
(f"{name} labels", lab, cp.int32, (L,)),
|
|
183
194
|
(f"{name} lo", lo, cp.int32, (kb, L)),
|
|
184
195
|
(f"{name} hi", hi, cp.int32, (kb, L)),
|
|
185
|
-
(f"{name} positions", pos, cp.int32, (kb,)),
|
|
186
196
|
]
|
|
187
197
|
axis_args += [lev, lab, lo, hi, pos, cp.int32(L), cp.int32(kb)]
|
|
188
198
|
compiler.check_arrays(*checks)
|
|
@@ -18,7 +18,12 @@ def _selftest_scale_factory(dtype: str = "float32") -> Callable:
|
|
|
18
18
|
|
|
19
19
|
from . import compiler
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
ctypes = {"float32": "float", "float64": "double"}
|
|
22
|
+
if dtype not in ctypes:
|
|
23
|
+
raise ValueError(
|
|
24
|
+
f"selftest_scale: dtype must be 'float32' or 'float64', got {dtype!r}."
|
|
25
|
+
)
|
|
26
|
+
ctype = ctypes[dtype]
|
|
22
27
|
kern = compiler.get_raw_kernel("selftest", f"selftest_scale<{ctype}>")
|
|
23
28
|
np_dtype = cp.dtype(dtype)
|
|
24
29
|
block = 256
|
|
@@ -29,6 +34,8 @@ def _selftest_scale_factory(dtype: str = "float32") -> Callable:
|
|
|
29
34
|
compiler.check_arrays(("x", x, np_dtype, (None,) * x.ndim))
|
|
30
35
|
y = cp.empty_like(x)
|
|
31
36
|
n = x.size
|
|
37
|
+
if n == 0:
|
|
38
|
+
return y
|
|
32
39
|
grid = (n + block - 1) // block
|
|
33
40
|
kern((grid,), (block,), (x, y, np_dtype.type(alpha), cp.int64(n)))
|
|
34
41
|
return y
|
|
@@ -176,6 +176,7 @@ def apply_dispersion(
|
|
|
176
176
|
"""
|
|
177
177
|
samples, xp, _ = dispatch(samples)
|
|
178
178
|
samples, was_1d = as_2d(samples, name="samples")
|
|
179
|
+
out_dtype = np.result_type(samples.dtype, np.complex64)
|
|
179
180
|
h = transfer_function(
|
|
180
181
|
samples.shape[-1],
|
|
181
182
|
sampling_rate=sampling_rate,
|
|
@@ -185,9 +186,9 @@ def apply_dispersion(
|
|
|
185
186
|
),
|
|
186
187
|
inverse=inverse,
|
|
187
188
|
xp=xp,
|
|
188
|
-
dtype=
|
|
189
|
+
dtype=out_dtype,
|
|
189
190
|
)
|
|
190
191
|
result = _fft.ifft(_fft.fft(samples, axis=-1) * h[None, :], axis=-1)
|
|
191
|
-
if result.dtype !=
|
|
192
|
-
result = result.astype(
|
|
192
|
+
if result.dtype != out_dtype:
|
|
193
|
+
result = result.astype(out_dtype)
|
|
193
194
|
return restore_1d(was_1d, result)
|
|
@@ -70,12 +70,14 @@ def interpolate_piecewise(x: ArrayType, knots: np.ndarray, sub: int) -> ArrayTyp
|
|
|
70
70
|
interval, ``sub · (K - 1)`` per channel. Returns ``(C, sub · (K - 1))``."""
|
|
71
71
|
x, xp, _ = dispatch(x)
|
|
72
72
|
knots = np.ascontiguousarray(knots, dtype=np.float64)
|
|
73
|
+
n_out = sub * (knots.shape[1] - 1)
|
|
74
|
+
if n_out == 0 or x.shape[0] == 0:
|
|
75
|
+
return xp.empty((x.shape[0], n_out), dtype=x.dtype)
|
|
73
76
|
if xp is np:
|
|
74
|
-
out = np.empty((x.shape[0],
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
kernels.interp_piecewise(x, knots, sub, HALF_WIDTH, re, im, write_imag)
|
|
77
|
+
out = np.empty((x.shape[0], n_out), dtype=x.dtype)
|
|
78
|
+
kernels = _numba()
|
|
79
|
+
re, im, write_imag = _parts(out)
|
|
80
|
+
kernels.interp_piecewise(x, knots, sub, HALF_WIDTH, re, im, write_imag)
|
|
79
81
|
return out
|
|
80
82
|
launch = get_kernel("interpolate", half=HALF_WIDTH)
|
|
81
83
|
return launch(xp.ascontiguousarray(x), knots=xp.asarray(knots), sub=sub)
|
|
@@ -53,6 +53,11 @@ def ols_apply(
|
|
|
53
53
|
"""
|
|
54
54
|
_, xp, _ = dispatch(samples)
|
|
55
55
|
num_ch, N = samples.shape
|
|
56
|
+
if N == 0:
|
|
57
|
+
out_dtype = (
|
|
58
|
+
samples.dtype if real else xp.result_type(samples.dtype, xp.complex64)
|
|
59
|
+
)
|
|
60
|
+
return xp.empty((num_ch, 0), dtype=out_dtype)
|
|
56
61
|
discard = N_fft // 4 if guard is None else guard # symmetric guard
|
|
57
62
|
B = N_fft - 2 * discard # hop
|
|
58
63
|
num_blocks = (N + B - 1) // B
|
|
@@ -341,9 +341,12 @@ def _whittle_fit(
|
|
|
341
341
|
theta = np.zeros(X.shape[1])
|
|
342
342
|
for _ in range(max_rounds):
|
|
343
343
|
Pk, Xk = P[kept], X[kept]
|
|
344
|
+
if Pk.size == 0 or float(np.max(Pk)) <= 0.0:
|
|
345
|
+
break
|
|
346
|
+
Pk_safe = np.maximum(Pk, 1e-300)
|
|
344
347
|
# Start from relative least squares (weights 1/P), then reweight by
|
|
345
348
|
# the model: the fixed point solves the Whittle score equation.
|
|
346
|
-
theta = nnls(Xk /
|
|
349
|
+
theta = nnls(Xk / Pk_safe[:, None], np.ones(Pk.size))[0]
|
|
347
350
|
for _ in range(max_iter):
|
|
348
351
|
M = np.maximum(Xk @ theta, 1e-300)
|
|
349
352
|
new = nnls(Xk / M[:, None], Pk / M)[0]
|
|
@@ -353,7 +356,7 @@ def _whittle_fit(
|
|
|
353
356
|
break
|
|
354
357
|
threshold = chi2.isf(alpha / P.size, dof) / dof
|
|
355
358
|
spurs = kept & (P > threshold * np.maximum(X @ theta, 1e-300))
|
|
356
|
-
if not spurs.any():
|
|
359
|
+
if not spurs.any() or int((kept & ~spurs).sum()) < X.shape[1]:
|
|
357
360
|
break
|
|
358
361
|
kept &= ~spurs
|
|
359
362
|
return theta, kept
|
|
@@ -82,10 +82,26 @@ def allan_deviation(
|
|
|
82
82
|
scalloped ADEV with nulls at ``τ = k·T_m``; those dips are not a lower
|
|
83
83
|
noise floor.
|
|
84
84
|
"""
|
|
85
|
+
fs = float(sampling_rate)
|
|
86
|
+
if not (np.isfinite(fs) and fs > 0.0):
|
|
87
|
+
raise ValueError(
|
|
88
|
+
f"allan_deviation(): sampling_rate must be finite and > 0, got {sampling_rate!r}."
|
|
89
|
+
)
|
|
90
|
+
if (
|
|
91
|
+
isinstance(num_taus, bool)
|
|
92
|
+
or not isinstance(num_taus, int | np.integer)
|
|
93
|
+
or int(num_taus) < 1
|
|
94
|
+
):
|
|
95
|
+
raise ValueError(
|
|
96
|
+
f"allan_deviation(): num_taus must be an integer >= 1, got {num_taus!r}."
|
|
97
|
+
)
|
|
98
|
+
num_taus = int(num_taus)
|
|
85
99
|
df_arr, xp, _ = dispatch(df)
|
|
86
100
|
y2, was_1d = as_2d(df_arr, name="df")
|
|
87
101
|
c, n = y2.shape
|
|
88
|
-
|
|
102
|
+
if n < 2:
|
|
103
|
+
raise ValueError(f"allan_deviation(): df needs at least 2 samples, got {n}.")
|
|
104
|
+
tau0 = 1.0 / fs
|
|
89
105
|
|
|
90
106
|
# Cumulative phase (time error) x_i = Σ y · τ0, in one float64 buffer.
|
|
91
107
|
x = xp.empty((c, n + 1), dtype=xp.float64)
|
|
@@ -98,6 +114,15 @@ def allan_deviation(
|
|
|
98
114
|
ms = np.unique(np.round(np.geomspace(1, m_max, num_taus)).astype(int))
|
|
99
115
|
else:
|
|
100
116
|
taus_cpu = _to_host(taus, np.float64)
|
|
117
|
+
if (
|
|
118
|
+
taus_cpu.ndim != 1
|
|
119
|
+
or taus_cpu.size == 0
|
|
120
|
+
or not np.all(np.isfinite(taus_cpu) & (taus_cpu > 0.0))
|
|
121
|
+
):
|
|
122
|
+
raise ValueError(
|
|
123
|
+
"allan_deviation(): taus must be a non-empty 1-D array of finite "
|
|
124
|
+
"values > 0."
|
|
125
|
+
)
|
|
101
126
|
ms = np.unique(np.maximum(1, np.round(taus_cpu / tau0).astype(int)))
|
|
102
127
|
ms = ms[ms <= max(1, (x.shape[-1] - 1) // 2)]
|
|
103
128
|
|