commkit 3.7.0__tar.gz → 3.8.0__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.7.0 → commkit-3.8.0}/.github/workflows/ci.yml +2 -1
- {commkit-3.7.0 → commkit-3.8.0}/AGENTS.md +10 -8
- {commkit-3.7.0 → commkit-3.8.0}/CHANGELOG.md +107 -1
- {commkit-3.7.0 → commkit-3.8.0}/PKG-INFO +13 -13
- {commkit-3.7.0 → commkit-3.8.0}/README.md +12 -12
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/workloads.py +2 -4
- {commkit-3.7.0 → commkit-3.8.0}/commkit/__init__.py +6 -6
- commkit-3.8.0/commkit/_bits.py +44 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_circular.py +15 -6
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/__init__.py +103 -3
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/cs_block.cu +4 -3
- commkit-3.8.0/commkit/_cuda/src/interpolate.cu +155 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/llr.cu +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_fiber.py +29 -11
- commkit-3.8.0/commkit/_interpolation.py +88 -0
- commkit-3.8.0/commkit/_numba_frequency.py +68 -0
- commkit-3.8.0/commkit/_numba_interpolation.py +92 -0
- commkit-3.8.0/commkit/_overlap_save.py +82 -0
- commkit-3.8.0/commkit/_peaks.py +146 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_sequences.py +35 -19
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/__init__.py +15 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/interferometry.py +56 -27
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/linewidth/__init__.py +31 -6
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/linewidth/dsh.py +13 -7
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/linewidth/phase.py +75 -42
- commkit-3.8.0/commkit/analysis/linewidth/result.py +266 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/backend.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/_galois.py +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/_gf2.py +4 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/_numba_loops.py +71 -23
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/algebraic.py +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/base.py +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/crc.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/exit.py +85 -43
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/interleaving.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/ldpc.py +3 -3
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/linear.py +8 -8
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/polar.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/product.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/shaping.py +8 -5
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/turbo.py +14 -10
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/__init__.py +5 -4
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/frame.py +105 -50
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/__init__.py +18 -12
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_block/_blind.py +33 -12
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_block/_dd.py +5 -15
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_block/_engine.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_common.py +66 -9
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_numba_loops.py +60 -199
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_sequential/_blind.py +65 -7
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_sequential/_dd.py +11 -19
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_sequential/_setup.py +3 -9
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/linear.py +146 -102
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/pilots.py +4 -4
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/polarization.py +187 -82
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/result.py +38 -10
- {commkit-3.7.0 → commkit-3.8.0}/commkit/filtering/__init__.py +12 -8
- commkit-3.8.0/commkit/filtering/fiber/__init__.py +37 -0
- commkit-3.8.0/commkit/filtering/fiber/compensation.py +652 -0
- commkit-3.8.0/commkit/filtering/fiber/estimation.py +725 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/filtering/linear.py +114 -129
- {commkit-3.7.0 → commkit-3.8.0}/commkit/filtering/pulses.py +4 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/frequency.py +213 -223
- {commkit-3.7.0 → commkit-3.8.0}/commkit/impairments/__init__.py +10 -3
- {commkit-3.7.0 → commkit-3.8.0}/commkit/impairments/frontend.py +44 -19
- {commkit-3.7.0 → commkit-3.8.0}/commkit/impairments/noise.py +5 -2
- {commkit-3.7.0 → commkit-3.8.0}/commkit/impairments/source.py +72 -3
- {commkit-3.7.0 → commkit-3.8.0}/commkit/io.py +2 -0
- commkit-3.7.0/commkit/mapping/llr.py → commkit-3.8.0/commkit/mapping/_demap.py +14 -110
- commkit-3.8.0/commkit/mapping/_lattice.py +124 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/_numba_llr.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/constellation.py +12 -81
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/gray.py +0 -34
- commkit-3.8.0/commkit/mapping/llr.py +110 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/__init__.py +5 -5
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/_common.py +59 -10
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/awgn.py +2 -1
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/error_rates.py +10 -6
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/information.py +4 -4
- {commkit-3.7.0 → commkit-3.8.0}/commkit/metrics/quality.py +24 -14
- {commkit-3.7.0 → commkit-3.8.0}/commkit/multirate.py +32 -104
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/__init__.py +2 -5
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/analysis.py +41 -25
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/constellation.py +79 -151
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/equalizer.py +53 -19
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/eye.py +54 -150
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/frequency.py +44 -39
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/recovery.py +64 -88
- commkit-3.8.0/commkit/plotting/spectral.py +390 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/theme.py +53 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/timing.py +26 -22
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/waveform.py +37 -111
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/__init__.py +17 -6
- commkit-3.8.0/commkit/recovery/_numba_loops.py +401 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/bps.py +18 -88
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/carrier_phase.py +149 -58
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/corrections.py +38 -194
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/pilots.py +38 -37
- commkit-3.8.0/commkit/recovery/pll.py +184 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/tikhonov.py +22 -60
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/viterbi_viterbi.py +3 -3
- {commkit-3.7.0 → commkit-3.8.0}/commkit/spectral.py +169 -38
- {commkit-3.7.0 → commkit-3.8.0}/commkit/timing/__init__.py +9 -9
- {commkit-3.7.0 → commkit-3.8.0}/commkit/timing/_numba_loops.py +48 -48
- {commkit-3.7.0 → commkit-3.8.0}/commkit/timing/clock_recovery.py +179 -65
- {commkit-3.7.0 → commkit-3.8.0}/commkit/timing/synchronization.py +67 -151
- {commkit-3.7.0 → commkit-3.8.0}/examples/03-digital-filters.ipynb +19 -15
- {commkit-3.7.0 → commkit-3.8.0}/examples/04-pulse-shaping-and-matched-filtering.ipynb +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/examples/06-awgn-and-performance-metrics.ipynb +6 -6
- {commkit-3.7.0 → commkit-3.8.0}/examples/07-channel-coding.ipynb +5 -5
- {commkit-3.7.0 → commkit-3.8.0}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/examples/10-front-end-impairments.ipynb +260 -76
- {commkit-3.7.0 → commkit-3.8.0}/examples/11-frame-synchronization-and-timing.ipynb +3 -5
- commkit-3.8.0/examples/12-sampling-clock-recovery.ipynb +743 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/15-pilot-aided-carrier-recovery.ipynb +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/examples/16-linear-channel-equalization.ipynb +27 -25
- {commkit-3.7.0 → commkit-3.8.0}/examples/18-blind-equalization.ipynb +10 -4
- commkit-3.8.0/examples/22-direct-and-self-coherent-detection.ipynb +736 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/24-coherent-transceiver-end-to-end.ipynb +3 -5
- {commkit-3.7.0 → commkit-3.8.0}/examples/README.md +4 -4
- {commkit-3.7.0 → commkit-3.8.0}/pyproject.toml +6 -3
- {commkit-3.7.0 → commkit-3.8.0}/scripts/sanitize.sh +2 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_interferometry.py +42 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_linewidth.py +100 -19
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_coding_base.py +4 -4
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_crc.py +8 -8
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_exit.py +28 -8
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_interleaving.py +8 -6
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_ldpc.py +14 -11
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_ldpc_exit.py +6 -6
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_ldpc_kernel.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_ldpc_tables.py +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_performance.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_polar.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_ratematch.py +3 -3
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_shaping.py +5 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_turbo.py +27 -3
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/kernel_utils.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/reference_impl.py +68 -16
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/signals.py +3 -3
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_frame.py +77 -37
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_signal.py +0 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_blind.py +13 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_cold_start.py +30 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_cpr.py +0 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_cs_kernel.py +49 -4
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_equalizer_oracles.py +34 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_linear.py +114 -36
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_mimo.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_polarization.py +48 -48
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_result.py +0 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_sequential.py +80 -14
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_state.py +0 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/impairments/test_frontend.py +31 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/impairments/test_source.py +61 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/mapping/test_gray.py +2 -47
- commkit-3.8.0/tests/mapping/test_lattice.py +57 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/mapping/test_llr.py +6 -6
- {commkit-3.7.0 → commkit-3.8.0}/tests/metrics/test_common.py +43 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/metrics/test_error_rates.py +1 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/metrics/test_quality.py +13 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_analysis.py +14 -3
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_coding.py +2 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_equalizer.py +46 -13
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_frequency.py +4 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_recovery.py +0 -2
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_theme.py +89 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plugins/transfer_trace.py +6 -4
- commkit-3.8.0/tests/recovery/test_carrier_phase.py +49 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_corrections.py +24 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_pilots.py +5 -3
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_tikhonov.py +5 -5
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_viterbi_viterbi.py +0 -1
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_api_contracts.py +56 -27
- commkit-3.8.0/tests/test_bit_packing.py +31 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_fiber.py +28 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_filtering.py +184 -147
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_frequency.py +98 -62
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_import_hygiene.py +12 -0
- commkit-3.8.0/tests/test_interpolation.py +102 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_io.py +24 -7
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_multirate.py +9 -0
- commkit-3.8.0/tests/test_peaks.py +37 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_receiver_chain.py +4 -4
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_signal_pipeline.py +8 -8
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_spectral.py +42 -14
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_working_memory.py +8 -7
- {commkit-3.7.0 → commkit-3.8.0}/tests/timing/test_clock_recovery.py +135 -10
- {commkit-3.7.0 → commkit-3.8.0}/tests/timing/test_synchronization.py +65 -84
- {commkit-3.7.0 → commkit-3.8.0}/uv.lock +1 -1
- commkit-3.7.0/commkit/_overlap_save.py +0 -66
- commkit-3.7.0/commkit/analysis/linewidth/result.py +0 -145
- commkit-3.7.0/commkit/filtering/fiber.py +0 -1229
- commkit-3.7.0/commkit/plotting/spectral.py +0 -582
- commkit-3.7.0/commkit/recovery/pll.py +0 -417
- commkit-3.7.0/examples/12-sampling-clock-recovery.ipynb +0 -316
- commkit-3.7.0/examples/22-direct-and-self-coherent-detection.ipynb +0 -278
- {commkit-3.7.0 → commkit-3.8.0}/.gitattributes +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/.github/icon.svg +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/.github/logo.svg +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/.github/workflows/publish.yml +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/.gitignore +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/.python-version +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/LICENSE +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_block_blind.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_block_lms.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_bps.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_coding.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_equalizers.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_fiber.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_filters.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_gardner.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_import.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_llr.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_mapping.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_signal_pipeline.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/bench_sync_misc.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/benchutils.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/conftest.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/benchmarks/record_baseline.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_array.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_constants.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/compiler.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/graphs.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/algebraic.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/bps_anchor.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/bps_min_d2.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/iir.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/ldpc.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_cuda/src/selftest.cu +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_dispersion.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_fft.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/_random.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/_common.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/allan.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/drift.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/fm_noise.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/analysis/trajectory.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/_ldpc_tables.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/convolutional.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/performance.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/coding/ratematch.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/_signal_adapter.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/generation.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/preamble.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/core/signal.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_block/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/equalization/_sequential/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/filtering/response.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/impairments/fiber_channel.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/logger.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/bits.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/mapping/shaping.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/math.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/coding.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/plotting/filter_response.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/py.typed +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/recovery/_common.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/commkit/smoothing.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/00-getting-started.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/02-spectral-analysis.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/05-multirate-and-resampling.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/09-laser-phase-noise.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/13-frequency-offset-estimation.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/14-blind-carrier-phase-recovery.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/17-adaptive-equalization.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/19-polarization-multiplexing.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/20-chromatic-dispersion.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/23-fec-in-optical-standards.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/25-carrier-phase-characterization.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/26-laser-linewidth-self-heterodyne.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/27-laser-linewidth-short-delay-and-flicker.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/28-laser-linewidth-self-homodyne-iq.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/29-measurement-template-self-heterodyne.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/examples/30-measurement-template-self-homodyne-iq.ipynb +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_allan.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_drift.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_fm_noise.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/analysis/test_trajectory.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_algebraic.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_convolutional.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_gf2.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_linear_codes.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/coding/test_product.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/coding.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/conversions.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/memory.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/metrics.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/periodic.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/scoring.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/common/theory.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/conftest.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_generation.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_preamble.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_psqam.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_signal_adapter.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/core/test_signal_mimo.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_block.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_bps_kernel.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/equalization/test_winit.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/impairments/test_fiber_channel_linear.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/impairments/test_noise.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/mapping/test_bits.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/mapping/test_constellation.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/metrics/test_awgn.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/metrics/test_information.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_constellation.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_eye.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_filter_response.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_spectral.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_timing.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plotting/test_plot_waveform.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plugins/__init__.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/plugins/precision_trace.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_bps.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_joint.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_pll.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/recovery/test_recovery_oracles.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_array.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_backend.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_cuda_infra.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_dispersion.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_examples.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_filter_response.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_logger.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_math.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_pulse_shaping.py +0 -0
- {commkit-3.7.0 → commkit-3.8.0}/tests/test_smoothing.py +0 -0
|
@@ -122,13 +122,14 @@ jobs:
|
|
|
122
122
|
tests/coding/test_linear_codes.py::TestMaximumLikelihood
|
|
123
123
|
tests/timing/test_clock_recovery.py::TestEstimate::test_matches_oracle
|
|
124
124
|
tests/timing/test_clock_recovery.py::TestValidation
|
|
125
|
+
tests/test_interpolation.py
|
|
125
126
|
-k "not waterfall and not threshold"
|
|
126
127
|
--device=cpu --cov=commkit --cov-report=
|
|
127
128
|
|
|
128
129
|
- name: Kernel coverage report
|
|
129
130
|
run: >-
|
|
130
131
|
uv run coverage report --show-missing --fail-under=85
|
|
131
|
-
--include="commkit/equalization/_numba_loops.py,commkit/equalization/_sequential/*,commkit/
|
|
132
|
+
--include="commkit/equalization/_numba_loops.py,commkit/equalization/_sequential/*,commkit/_numba_frequency.py,commkit/recovery/*,commkit/coding/ldpc.py,commkit/coding/shaping.py,commkit/coding/polar.py,commkit/coding/convolutional.py,commkit/coding/turbo.py,commkit/timing/_numba_loops.py,commkit/_numba_interpolation.py"
|
|
132
133
|
|
|
133
134
|
# GPU legs (--device=gpu / --device=all) require CuPy + CUDA and are run
|
|
134
135
|
# manually or on a self-hosted runner; they are intentionally not part of
|
|
@@ -75,7 +75,7 @@ Dependencies point downward only:
|
|
|
75
75
|
| Layer | Modules | May import |
|
|
76
76
|
| --- | --- | --- |
|
|
77
77
|
| Infrastructure | `backend`, `logger`, `_cuda` | NumPy, CuPy |
|
|
78
|
-
| Array and math helpers | `_array` (shape and validation), `math` (power, normalization, dB, linear trend) | infrastructure |
|
|
78
|
+
| Array and math helpers | `_array` (shape and validation), `_bits` (bit rows and integers), `_peaks` (sub-bin peak fits), `math` (power, normalization, dB, linear trend) | infrastructure |
|
|
79
79
|
| Value objects | `mapping.Constellation`, pulse classes, `recovery` CPR configs, `coding` (code objects with their `encode` / `decode`; array-only, never imports `core`) | layers above |
|
|
80
80
|
| Core | `core` (`Signal`, frames, generation), `io` | layers above |
|
|
81
81
|
| DSP | `mapping`, `filtering`, `multirate`, `spectral`, `smoothing`, `impairments`, `timing`, `frequency`, `recovery`, `equalization`, `metrics`, `analysis` | layers above, and lower DSP modules |
|
|
@@ -129,9 +129,10 @@ Dependencies point downward only:
|
|
|
129
129
|
|
|
130
130
|
- **Transforms:** array in gives array out on the same device; Signal in gives a new Signal (with `sampling_rate` updated when the rate changes).
|
|
131
131
|
- **Estimators** reduce over the time axis: `(N,)` gives 0-d, `(C, N)` gives `(C,)`, on the input device.
|
|
132
|
-
- **Metrics** (`evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`) and **analysis summaries** (`estimate_linewidth`, `allan_deviation`, the `frequency_drift` statistics, which fit plot-sized reductions) return host values: a `float` for 1-D input, `np.ndarray (C,)` for 2-D. Sample-rate outputs (trajectories, PSDs, `dsh_phase`) stay on the input device.
|
|
132
|
+
- **Metrics** (`evm`, `snr`, `noise_variance`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`) and **analysis summaries** (`estimate_linewidth`, `allan_deviation`, the `frequency_drift` statistics, which fit plot-sized reductions) return host values: a `float` for 1-D input, `np.ndarray (C,)` for 2-D. Sample-rate outputs (trajectories, PSDs, `dsh_phase`) stay on the input device.
|
|
133
133
|
- Metrics **raise** on empty selections, never return `None` or `0.0` for "nothing measured", and never silently align, rotate or permute against the reference.
|
|
134
134
|
- **More than one value** is a frozen dataclass with named fields. No dicts, no tuples longer than two.
|
|
135
|
+
- **Diagnostics that depend on the method** go in a subclass: the estimate class holds the fields every method gives (`value`, ...), and each method or family of methods returns a subclass with its own fields, none of them `None`. A subclass that one method returns is named after it (`MthPowerEstimate`, `PilotTonesEstimate`); one that several return is named after what they share (`BlockPhaseEstimate` for BPS, Viterbi-Viterbi and Tikhonov, `DispersionScanEstimate`). A method without fields of its own returns its family's class or the base. The verbs and plots take the base class.
|
|
135
136
|
- **Equalizers** return `EqualizerResult`: `y_hat` is always an array, `signal` the 1-SPS Signal for Signal input, `state` the continuation state (`state=result.state`), and diagnostics as data.
|
|
136
137
|
|
|
137
138
|
### Naming
|
|
@@ -139,7 +140,7 @@ Dependencies point downward only:
|
|
|
139
140
|
| Prefix | Meaning |
|
|
140
141
|
| --- | --- |
|
|
141
142
|
| `apply_*` | add an impairment or apply a model |
|
|
142
|
-
| `estimate_<quantity>(x, method)` | measure, never change the data; returns a frozen `<Quantity>Estimate` (value plus diagnostics) |
|
|
143
|
+
| `estimate_<quantity>(x, method)` | measure, never change the data; returns a frozen `<Quantity>Estimate` (value plus diagnostics), as the subclass of the method where its diagnostics differ (see Returns) |
|
|
143
144
|
| `correct_<quantity>(x, how)` | remove the impairment; returns only the corrected data. `how` is an estimate or an algorithm object (which estimates first) |
|
|
144
145
|
| `resolve_*` | pick among discrete candidates (π/2 rotation, channel permutation); nothing else |
|
|
145
146
|
| `generate` | synthesis from parameters, takes `rng` |
|
|
@@ -150,7 +151,7 @@ Dependencies point downward only:
|
|
|
150
151
|
- Computations use plain nouns (`allan_deviation`).
|
|
151
152
|
- **Glossary**, one name each:
|
|
152
153
|
- `num_taps`, `step_size`, `sps`, `constellation`, `pulse`, `rng`, `num_symbols`, `num_channels` (never streams), `sampling_rate`, `symbol_rate`, `noise_var`, `nfft`, `regularization`, `max_iterations`.
|
|
153
|
-
- Noise has three names, each with one meaning: `noise_var` is the variance E|n|² of the noise in the samples a function receives (measured by `
|
|
154
|
+
- Noise has three names, each with one meaning: `noise_var` is the variance E|n|² of the noise in the samples a function receives (measured by `noise_variance`); `snr_db` a power ratio in those samples (measured by `snr`); `esn0_db` the channel's textbook Es/N0, independent of the dtype (real samples carry the in-phase half of the noise, `N0/2`). A function taking `noise_var` for a demapping model (`compute_llr`, `mi`, `gmi`, `ngmi`) uses the likelihood of complex or real noise after the samples' dtype and also accepts `esn0_db`, so users never convert by hand.
|
|
154
155
|
- A size names its unit: `num_symbols`, `num_blocks` (codewords of a FEC code), `info_bits` (a code's information length where it is a parameter), `blocks_per_frame`, `num_variables`, `num_segments`. In `coding`, `length` and `n` mean the codeword length in bits and `k` the information length, nothing else.
|
|
155
156
|
- A seeded part of a factory takes `<part>_rng` (`payload_rng`), with the semantics of `rng`.
|
|
156
157
|
- `method=` strings name only a numerical flavor of one algorithm (`method="maxlog" | "exact"`); algorithms are objects.
|
|
@@ -185,9 +186,9 @@ Docstrings describe the code as it is; a change in behavior updates them in the
|
|
|
185
186
|
- **Storage dtypes:** `complex64` for IQ samples, `float32` for real signals; `generate`, frames and `load_npz` produce them, so single precision is the default path.
|
|
186
187
|
- **Precision contract.** Every function computes in a predictable precision, and none promotes single-precision data on its own:
|
|
187
188
|
- **Transforms keep the input's precision** throughout (filters, impairments, the fiber solver and DBP, resampling, delays, carrier-phase correction): complex64 in and out, complex128 in and out.
|
|
188
|
-
- **Fixed-precision blocks** compute in single precision whatever the input: the equalizers in complex64, `compute_llr` / `Constellation.llr` in float32. Double input emits `commkit.PrecisionWarning` (`_array.warn_if_double`, attributed to the caller's line). The test suite turns it into an error (`pytest_configure` in `tests/conftest.py`; not pyproject's `filterwarnings`, which imports commkit before coverage starts), so a library path feeding double data to these blocks fails CI. Training and reference symbols are not checked.
|
|
189
|
+
- **Fixed-precision blocks** compute in single precision whatever the input: the equalizers and the Gardner timing loop in complex64 (`correct_sampling_clock_offset` interpolates in the input's precision), `compute_llr` / `Constellation.llr` in float32. Double input emits `commkit.PrecisionWarning` (`_array.warn_if_double`, attributed to the caller's line). The test suite turns it into an error (`pytest_configure` in `tests/conftest.py`; not pyproject's `filterwarnings`, which imports commkit before coverage starts), so a library path feeding double data to these blocks fails CI. Training and reference symbols are not checked.
|
|
189
190
|
- **Deliberate float64 / complex128**, documented where it happens, only on phases, small arrays or accumulators, never on sample-rate data that is then cast back:
|
|
190
|
-
- phases before `xp.unwrap()` (float32 rounding causes spurious quadrant slips), phase trajectories and ramps (wrapped in float64, rotated in the data's precision), the strobe positions of clock recovery (symbol rate
|
|
191
|
+
- phases before `xp.unwrap()` (float32 rounding causes spurious quadrant slips), phase trajectories and ramps (wrapped in float64, rotated in the data's precision), the strobe positions of clock recovery (symbol rate) and the instants of the interpolator in `_interpolation` built from them or from a constant rate (each formed in float64, a scalar per instant in both kernels; the output is in the data's precision), frequency grids and estimates;
|
|
191
192
|
- recursion state: PLL, Tikhonov/Kalman block transitions, the IIR filter's sections and state (poles near z = 1);
|
|
192
193
|
- RLS keeps `P`, the gain `k` and the regressor buffers in complex128 (in single precision `P` loses positive definiteness and the filter diverges);
|
|
193
194
|
- LMS/CMA/RDE accumulate dot products and gradient updates in complex128 around complex64 inputs and weights; the block equalizers stay complex64, as their tap sums run inside the FFTs;
|
|
@@ -205,7 +206,8 @@ Docstrings describe the code as it is; a change in behavior updates them in the
|
|
|
205
206
|
| --- | --- | --- |
|
|
206
207
|
| Vectorized: filters, resampling, spectra, impairments, metrics, frequency-domain equalizers | NumPy/CuPy via `x, xp, sp = dispatch(samples)` | follows the input |
|
|
207
208
|
| Per-symbol searches over a small table: LLRs (all points, or per axis for separable QAM; max-log without a prior in closed form), hard decisions without a square lattice | CPU: Numba `parallel=True` over blocks of symbols (LLRs), chunked NumPy (decisions). GPU: one thread per symbol (`llr`, `llr_separable`, `llr_separable_maxlog`, `bps_min_d2`'s nearest-point mode); decisions on double input or above 1024 points use the chunked search on both devices; LLRs above 16 bits per symbol raise on the GPU | follows the input |
|
|
208
|
-
| Sequential recursions: LMS/RLS/CMA/RDE, PLL, Gardner clock recovery, Tikhonov, cycle slips, the Mengali-Morelli bootstrap, per-codeword decoders on trellises and trees (CCDM, polar SC/SCL, Viterbi, BCJR, turbo, recursive systematic encoding) | Numba `@njit(cache=True, fastmath=True, nogil=True)`, independent rows in `prange`. The equalizers' kernel with inline carrier recovery compiles strict (unwrap, running sums) and calls fast-math tap and distance loops as separate functions (an `inline="always"` helper takes its caller's flags) | CPU; GPU input does one round trip |
|
|
209
|
+
| Sequential recursions: LMS/RLS/CMA/RDE, PLL, Gardner clock recovery, Tikhonov, cycle slips, the Mengali-Morelli bootstrap, per-codeword decoders on trellises and trees (CCDM, polar SC/SCL, Viterbi, BCJR, turbo, recursive systematic encoding) | Numba `@njit(cache=True, fastmath=True, nogil=True)`, independent rows in `prange`. The `coding` kernels (trellis and tree decoders, CCDM, `algebraic_correct`) compile without `fastmath`: their infinite sentinels would not survive its no-Inf flag. The equalizers' kernel with inline carrier recovery compiles strict (unwrap, running sums) and calls fast-math tap and distance loops as separate functions (an `inline="always"` helper takes its caller's flags) | CPU; GPU input does one round trip |
|
|
210
|
+
| Interpolation at arbitrary instants (clock offset, jitter, clock-recovery output), one windowed sinc in `_interpolation` | CPU: Numba `parallel=True` over the instants, taps in float64 registers; the Gardner loop inlines its helper with 16 taps. GPU: `interpolate` kernel, one thread per instant, taps in the samples' real precision and shared by the channels that share the instant (a CuPy gather of strided windows was bound by its taps-by-instants intermediates and lost to a host round trip) | follows the input |
|
|
209
211
|
| Linear recursions: IIR filtering | CPU: Numba without `fastmath`, so double input matches SciPy bit for bit. GPU: `iir` kernel: each block's state from a zero start in parallel, states carried across blocks in two levels (groups, then across groups), blocks filtered again, in double precision | follows the input |
|
|
210
212
|
| Binary linear algebra of codes: encoding, syndromes, ML-decoding correlations on the GPU, Chase's test patterns | one float32 GEMM per chunk (`coding._gf2.matmul_mod2`), exact below an inner dimension of 2^24, parity in place (CPU) or by one elementwise kernel writing int8 (GPU); small tables cached per code and device (`backend._device_tables`) | follows the input |
|
|
211
213
|
| Algebraic decoding (BCH, Reed-Solomon): Berlekamp-Massey, Chien search to the locator's degree, Forney | CPU: Numba `parallel=True` over codewords. GPU: `algebraic_correct`, one thread per codeword in integer table arithmetic, so both agree exactly | follows the input |
|
|
@@ -215,7 +217,7 @@ Docstrings describe the code as it is; a change in behavior updates them in the
|
|
|
215
217
|
| Elementwise chains between multi-core FFTs (fiber solver's Kerr and PMD stages) | NumPy: a Numba `parallel=True` pass competes with `scipy.fft`'s threads; adopt one only on a paired end-to-end A/B | CPU |
|
|
216
218
|
| Other hot spots limited by intermediates, launches or round trips | CUDA C++ via CuPy `RawModule` (`commkit/_cuda/src`) | GPU |
|
|
217
219
|
|
|
218
|
-
**Numba kernels live at module level** in a private module (`equalization/_numba_loops.py`, `coding/_numba_loops.py`, `mapping/_numba_llr.py`, `timing/_numba_loops.py`) that a getter `_get_numba_<name>()`, defined in the module that calls the kernel, imports on first use, so `import commkit` does not load Numba and `cache=True` works across processes. A kernel defined inside a function that calls another kernel defined there recompiles in every process (Numba's cache key misses the captured dispatcher); a getter may build a closure that captures only constants (`_get_numba_sos`).
|
|
220
|
+
**Numba kernels live at module level** in a private module (`equalization/_numba_loops.py`, `recovery/_numba_loops.py`, `coding/_numba_loops.py`, `mapping/_numba_llr.py`, `timing/_numba_loops.py`, `_numba_interpolation.py`, `_numba_frequency.py`) that a getter `_get_numba_<name>()`, defined in the module that calls the kernel, imports on first use, so `import commkit` does not load Numba and `cache=True` works across processes. A kernel defined inside a function that calls another kernel defined there recompiles in every process (Numba's cache key misses the captured dispatcher); a getter may build a closure that captures only constants (`_get_numba_sos`).
|
|
219
221
|
|
|
220
222
|
**Host-sync hygiene:**
|
|
221
223
|
|
|
@@ -4,6 +4,110 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.8.0] - 2026-11-12
|
|
8
|
+
|
|
9
|
+
The fixes of a full review of 3.7.1. Gardner clock recovery holds its loop bandwidth up to the largest offset it accepts, resampling keeps its accuracy at any record length, block backpropagation bounds its memory, and the fibre kernels form their phase in double precision. One interpolation kernel serves clock offset, jitter and Gardner on both devices, and `fir_filter`, `apply_taps`, `welch_psd` and the trace plots are several times faster. Names follow the verb rules: an estimator returns the estimate subclass of its method, with no field left `None`, and `cma` takes its default step from the constellation and warns where the constant-modulus criterion cannot work. The migration list below comes first.
|
|
10
|
+
|
|
11
|
+
### Changes that may need code updates
|
|
12
|
+
|
|
13
|
+
- Factories take their secondary parameters by keyword: `LDPCCode.dvbs2(rate, frame=...)`, `LDPCCode.quasi_cyclic(base, lifting=...)`, `CRC.nr(name, info_bits=...)` and `Interleaver.block(rows=..., columns=...)`. Add the keywords to existing calls.
|
|
14
|
+
- `SingleCarrierFrame` needs a payload length: give `payload_num_symbols=` or, with a `payload_code`, `payload_blocks=`. It no longer defaults to 1000 symbols.
|
|
15
|
+
- `SingleCarrierFrame(pilot_seed=)` is `pilot_rng=`, with the semantics of `payload_rng` (an integer or a Generator, kept as the integer seed). Files saved with `pilot_seed` still load.
|
|
16
|
+
- `TurboIterations(iterations=)` is `max_iterations=`, as decoding now stops early; positional calls are unchanged. Rename the keyword in existing calls.
|
|
17
|
+
- `decoder_exit_curve`, `demapper_exit_curve` and `ldpc_exit_curves` take `num_points=` instead of `points=`.
|
|
18
|
+
- `demapper_exit_curve(noise_var=)` on a real constellation (PAM) is the variance of the real noise, as for `compute_llr`; it was the variance per complex symbol, twice the real noise. Halve `noise_var` in existing PAM calls to keep their curves, or pass the new `esn0_db=`.
|
|
19
|
+
- The `spectrum` of an `MthPower` estimate covers the bins of its `search_range` (all bins without one) in ascending frequency, and `spectrum_frequencies` lists those bins; it held all `nfft` bins in `fftfreq` order, zero outside the range. Code that indexed it by FFT bin reads the frequency from `spectrum_frequencies`.
|
|
20
|
+
- `resample(sps_out=)` raises when `sps_out / sps_in` has no fraction with terms up to 1000; such ratios designed filters of up to millions of taps. Give `up` and `down` explicitly.
|
|
21
|
+
- `zadoff_chu_sequence` raises on a root that shares a factor with the length, and the per-channel roots of a MIMO ZC `Preamble` skip such roots: on a composite length they gave full-height autocorrelation sidelobes. Preambles of prime length are unchanged; a MIMO preamble of length 64 now uses the roots 1, 3, 5, 7 instead of 1, 2, 3, 4.
|
|
22
|
+
- `estimate_iq_imbalance`, `apply_iq_imbalance` and `correct_iq_imbalance` raise `ValueError` on real samples instead of returning NaN, the input unchanged or a NumPy error.
|
|
23
|
+
- `SingleCarrierFrame.get_structure_map` returns a `FrameStructure` with the fields `pilots`, `payload`, `preamble` and `guard` (read-only, `None` where the map leaves a segment out) instead of a dict: `layout["pilots"]` becomes `layout.pilots`.
|
|
24
|
+
- `ser` and `evm` raise when the reference symbols are not points of the decision constellation (for `evm`, when one is known: the argument or the Signal's), for example after remapping the samples without the reference; they reported a SER of 0.75 and an EVM of 138 % for unipolar PAM-4 shifted to bipolar levels. A reference rescaled to its measured power still passes.
|
|
25
|
+
- The adaptive equalizers raise when `training_symbols` is longer than the record; the excess was dropped with a WARNING.
|
|
26
|
+
- `ols_fir_filter` is merged into `fir_filter`, which picks direct convolution, one FFT of the record or overlap-save from the sizes and the device, and takes `causal=` (also with `periodic=True`). Replace `ols_fir_filter(x, taps, causal=c)` by `fir_filter(x, taps, causal=c)`; the block size `nfft=` is gone, as the method is no longer the caller's choice.
|
|
27
|
+
- Names that carried their implementation follow the verb rules: `timing.cross_correlate_fft` is `cross_correlate`, `fft_fractional_delay` is `apply_delay`, and `estimate_fractional_delay`, which refines a peak of a correlation rather than estimating from the signal, is `peak_offset`, its `fit=` now `method=`. Rename the calls; arguments and results are unchanged.
|
|
28
|
+
- `estimate_noise_variance` is `metrics.noise_variance`, a metric beside `snr` that returns host values, and `recovery.smooth_phase_wiener` is `smooth_phase` (still the Wiener smoother). Rename the calls; arguments and results are unchanged.
|
|
29
|
+
- `estimate_transfer_function` and `zf_equalizer` are the pair `estimate_channel` and `correct_channel`. `estimate_channel` returns a `ChannelEstimate` holding the taps, their `center_tap` and the frequency response (`response`, what the call returned without `num_taps`); `num_taps=None` now gives `nfft` taps. `correct_channel(samples, how, noise_var=)` takes the estimate, which carries its centre tap, or raw taps with `center_tap=` as before, and is ZF at `noise_var=0` and MMSE above, which the old name hid. `plot_zf_equalizer_response` is `plot_channel_correction` and takes the same `how`. `zf_equalizer(rx, estimate_transfer_function(rx, tx, num_taps=L), center_tap=L // 2)` becomes `correct_channel(rx, estimate_channel(rx, tx, num_taps=L))`.
|
|
30
|
+
- `estimate_polarization_tones(x, tone_frequencies=..., ...)` is `estimate_polarization(x, PolarizationTones(tone_frequencies=..., ...), sampling_rate=)`: the method's settings (`track_bandwidth`, `num_taps`, `grid_step`, `refine_tones`, `search_band`) move to the method object, which validates them on construction. The result `JonesTrack` is `PolarizationTonesEstimate`, a subclass of `PolarizationEstimate` (the class to build for other matrix stacks), with the same fields; `tone_frequencies` exists on the subclass only and is set by keyword. `correct_polarization` also takes the method itself, estimating first (with `sampling_rate=` for array input).
|
|
31
|
+
- `estimate_chromatic_dispersion` returns a `DispersionScanEstimate` (`ClockToneScan`, `FourthMomentScan`: `candidates`, `metric`) or a `QuadraticPhaseFitEstimate` (`QuadraticPhaseFit`: `frequencies`, `group_delay`), subclasses of `ChromaticDispersionEstimate`, which keeps `value` and `method`. Reading a field is unchanged; the fields a method does not fill no longer exist, so `est.candidates is None` tests become `isinstance` tests.
|
|
32
|
+
- `estimate_linewidth` returns the subclass of `LinewidthEstimate` that holds its method's diagnostics, instead of one class of 27 fields with 25 `None` for any method: `BetaSeparationEstimate` and `DshFmFitEstimate` (both `FmNoiseFitEstimate`), `IncrementEstimate` (`IncrementSubtract`), `IncrementSlopeEstimate` and `DshIncrementEstimate`, and `DshLorentzianEstimate`. Reading a field is unchanged; a test that a field `is None` becomes an `isinstance` test.
|
|
33
|
+
- `estimate_carrier_phase` returns `BlockPhaseEstimate` (BPS, Viterbi-Viterbi, Tikhonov: `block_centers`, `block_phase`), `PilotInterpolationEstimate` (`PilotInterpolation`), `PilotToneEstimate` (`PilotTone`) or `PilotTonesEstimate` (`PilotTones`, a `PilotToneEstimate`), subclasses of `CarrierPhaseEstimate`, which `PLL` and `ConstantPhase` return and which keeps `value`. Reading a field is unchanged; a test that a field `is None` becomes an `isinstance` test.
|
|
34
|
+
- `estimate_frequency_offset` returns `MthPowerEstimate` (`power`, `spectrum`, `spectrum_frequencies`), `MengaliMorelliEstimate` (`power`, `autocorrelation`), `PilotSlopeEstimate` (`pilot_phase`, `pilot_indices`) or, with a `block_size`, `BlockwiseFrequencyEstimate` (`block_centers`, `block_values`), subclasses of `FrequencyOffsetEstimate`, which `SpectralPeak` returns and which keeps `value`, `weights` and `combined()`. Reading a field is unchanged; `combined()` of a static estimate drops the per-channel diagnostics (it kept `power`).
|
|
35
|
+
- The default `step_size` of `cma` and `block_cma` follows the constellation: 1e-3 for PSK, 16-QAM and without a constellation as before, less for denser sets, whose error floor rose with the step (1.6e-4 for 64-QAM, 3.7e-5 for 256-QAM; on 64-QAM at 26 dB Es/N0 the blind SER falls from 0.03 to 0.001). Convergence on dense sets is slower in proportion. Pass `step_size=1e-3` to keep the former behaviour.
|
|
36
|
+
- Logging: WARNINGs that only restated the call's own parameters are DEBUG (equalizer `sps` and short `num_taps`, `rls` at `sps > 1`, small `BPS`, Viterbi-Viterbi and Tikhonov blocks on QAM, M-th power above symmetry 4, a narrow `PilotTone` band, real input to `plot_constellation`); the snapping of `shift_frequency` and `add_pilot_tone` is in their INFO line. Metrics, `estimate_timing`, `correct_timing`, `rls`, `ConstantPhase` and `resolve_phase_ambiguity` log one INFO line per call, the channels in a list. Filters that matched those messages need updating.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- `demapper_exit_curve(esn0_db=)` as an alternative to `noise_var`.
|
|
41
|
+
- `SingleCarrierFrame.pilot_indices(include_preamble=)`: the symbol positions of `pilot_symbols`, for pilot-aided methods of your own.
|
|
42
|
+
- `impairments.apply_frequency_offset`: a carrier frequency offset at any value (not snapped to the FFT grid like `shift_frequency`), per channel if needed, the exact inverse of `correct_frequency_offset`.
|
|
43
|
+
- `correct_cycle_slips` accepts a `(C, B)` trajectory and repairs each row on its own.
|
|
44
|
+
- `max_points=` on `plot_carrier_phase_trajectory`, `plot_carrier_phase_decomposition`, `plot_frequency_drift`, `plot_frequency_offset_spectrum`, `plot_mm_autocorrelation`, `plot_timing_correlation` and `plot_pilot_phase_estimate`, as the other trace plots have.
|
|
45
|
+
- A WARNING when `cma` or `block_cma` is given a constellation too close to Gaussian for the constant-modulus criterion (kurtosis above 1.85 for complex sets, as for probabilistically shaped 64-QAM from entropy 5), which does not converge there; the docstrings recommend `rde` or a decision-directed `lms`.
|
|
46
|
+
- A WARNING when the decisions of `lms`, `block_lms` or `rls` collapse onto a few points (blind unipolar PAM-4 below about 8 dB Es/N0 decides every symbol as the lowest level).
|
|
47
|
+
|
|
48
|
+
### Performance
|
|
49
|
+
|
|
50
|
+
The figures of this release are from a Ryzen 7 5700X and an RTX 3070 (WSL2), timed against the former code on the same machine.
|
|
51
|
+
|
|
52
|
+
- `iir_filter` and the per-channel `PLL` run their channels in parallel on the CPU.
|
|
53
|
+
- `apply_sampling_clock_offset`, `apply_sampling_jitter` and the resampling of `correct_sampling_clock_offset` interpolate through a Numba kernel on the CPU, parallel over the output: 0.07 and 0.11 of the former time (clock offset and jitter, 2 x 2^20 complex64 samples). The Gardner loop's interpolator steps its window by a rotation instead of a cosine per tap. `correct_sampling_clock_offset` with `Gardner` takes 0.21 of the former time on the CPU and 0.62 on GPU input (2^18 symbols at 2 sps).
|
|
54
|
+
- On GPU input `apply_sampling_clock_offset`, `apply_sampling_jitter` and the resampling of `correct_sampling_clock_offset` run a CUDA kernel, one thread per output instant, instead of CuPy gathers: 0.004 and 0.015 of the former time (clock offset and jitter, 2 x 2^23 complex64 samples); `correct_sampling_clock_offset` with `Gardner` 0.74 (2 x 2^18 symbols at 2 sps, now bound by the CPU loop).
|
|
55
|
+
- Turbo decoding stops a block once its two decoders take the same hard decision on every information bit, and `DecodeResult.iterations` reports the iterations run. LTE K = 6144 at Eb/N0 = 1 dB takes 4.1 iterations of the 8 allowed, K = 128 at 3 dB 1.7; 32 blocks of K = 1024 at Es/N0 = 0 dB (the benchmark) decode in 0.56 of the former time (max-log) and 0.59 (log-MAP), and in the waterfall (K = 6144, 0.5 dB) in 0.97. The FER is unchanged from K = 40 to 6144 (2^15 frames at K = 128 and 2 dB: 121 failures against 115).
|
|
56
|
+
- `apply_taps` filters by overlap-save, with a guard as long as the taps: 0.45 of the former time on the CPU and 0.84 on GPU input (2 x 2 x 21 taps, 2^19 symbols at 2 sps). The einsum over strided windows ran NumPy's plain loop. A weight array whose channel count differs from the samples' raises `ValueError` naming `weights`.
|
|
57
|
+
- `fir_filter`, and with it `matched_filter`, picks its method from the sizes and the device: direct convolution for short filters on short records (NumPy's `convolve` on the CPU, one CuPy kernel on the GPU), one FFT of the record, and beyond 2^13 samples on the CPU and 2^18 on the GPU overlap-save through multi-threaded FFTs, with a guard as long as the filter's transient and real FFTs for real data; SciPy's `convolve` transformed the whole record on one core. For complex64 samples: 0.11 of the former time for 5 taps on 64 samples, 0.57 for 65 taps on 512, 0.51 for 5 taps on 2^15, 0.08 for 65 taps on 2^20 and 0.11 for 1501 taps; on GPU input 0.42, 0.47, 0.33, 0.79 and 0.93.
|
|
58
|
+
- `welch_psd` transforms its segments in batches on the input's device instead of through `scipy.signal.welch`, which in SciPy 1.18 calls the FFT once per segment: 0.13 of the former time on the CPU (2^20 complex64 samples, `nperseg=256`), 0.34 at `nperseg=4096`, and 0.9 on GPU input. The estimate is SciPy's to rounding (1e-6 of the peak in single precision); a record shorter than `nperseg` logs a WARNING instead of SciPy's `UserWarning`.
|
|
59
|
+
- The plots of sample-rate traces (carrier-phase trajectory and decomposition, frequency drift, M-th power spectrum, Mengali-Morelli autocorrelation, timing correlation, pilot-tone spectrum and phase, pilot phase trajectory) draw a trace longer than `max_points` (default 4000) as its min/max envelope, reduced on the data's device, so GPU input moves only the drawn points to the host; they moved and drew every sample. `plot_pilot_tone_phase_estimate` computes its spectrum on the samples' device.
|
|
60
|
+
- The cycle-slip repair of the CPR methods (`CycleSlip`) makes one host round trip for all channels of GPU input instead of one per channel.
|
|
61
|
+
- `correct_fiber_propagation` with `method="blocks"` backpropagates its blocks in batches of 2^16 samples per polarization on the CPU, which stay in cache: 0.64 of the former time (2 x 2^20 samples, 4 x 80 km, 10 steps per span), 0.85 at 2^23 samples. GPU input is unchanged.
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- The inline cycle-slip repair of the equalizers (`lms`, `rls` and `block_lms` with `cpr=...(cycle_slip=CycleSlip(history=...))`) predicts each phase by a line through its history after `min(10, history)` values, as `correct_cycle_slips` and the standalone CPR methods do. With `history` below 10 it predicted by the newest value throughout, a different recursion from the one documented. Histories of 10 and more, the defaults among them, are unchanged.
|
|
66
|
+
- CMA on a constellation that is not at unit power and has an explicit `pmf` used the Godard radius of the unit-power set (1.32 instead of 5.28 for 16-QAM at power 4).
|
|
67
|
+
- `evm(blind=True)` divides the error by the power of the decided points: 16-QAM at power 4 read 20 % where the data-aided EVM is 10 %.
|
|
68
|
+
- `correct_polarization` with a tracked estimate (then a `JonesTrack`) keeps complex128 input in double precision; it computed in complex64 and cast back.
|
|
69
|
+
- Gardner clock recovery emits `PrecisionWarning` on double input, as the loop computes in complex64.
|
|
70
|
+
- `apply_sampling_clock_offset` and `correct_sampling_clock_offset` keep their -119 dB interpolation accuracy at any record length. They formed the sampling instants in float32, whose rounding grew with the accumulated drift: -84 dB at the end of 2^20 complex64 samples at 2000 ppm, -68 dB at 2^23 samples and 1000 ppm. Complex128 input to the Gardner resampling also had its fractions rounded to float32.
|
|
71
|
+
- Gardner clock recovery calibrates its detector gain in blocks short against the clock drift and starts its integrator at the measured offset. A single fit over 2048 symbols scaled the gain by `sinc(2048 ε)`, so the loop ran at twice the requested bandwidth at 300 ppm and slipped from about 450 ppm (classical detector, rolloff 0.1); the gain now stays within a few percent of its zero-offset value up to `max_offset_ppm`, and offsets of 900 ppm are measured within 1 ppm by both detectors.
|
|
72
|
+
- `correct_fiber_propagation` with `method="blocks"` bounds its working memory, as documented: it propagated every block of the record at once, with an index array as large as the record. Peak host memory on 2 x 2^23 complex64 samples: 2.5 times the input (320 MiB), against 5.2 times before and 4 times for `"whole_record"`.
|
|
73
|
+
- `BetaSeparation` reads whether a bin lies above the β-line from its fitted model, and from the bin itself only where the bin exceeds the model beyond the fit's spur screen (drift, a modulation line). Thresholding the noisy Welch bins kept upward fluctuations near the crossover: on white FM with 70 bins below it the mean read 1.03 of the linewidth, now 0.99, and the spread of one record halves (0.04 of the linewidth at 7 bins, from 0.12). A WARNING fires below 10 bins, where it fired below about 3; the docstring states the measured spread.
|
|
74
|
+
- `apply_fiber_propagation` and `correct_fiber_propagation` on complex64 GPU input form each stage's dispersion phase in float64, reduced modulo 2π, before the fused kernels take it in float32; the kernels scaled a float32 phase of 1 km, whose rounding repeated in every span. Linear propagation over 20 x 80 km at 1 THz against complex128: -101 dB, from -60 dB (the CPU's complex64: -107 dB). At 64 GS/s the change is below 1 dB.
|
|
75
|
+
- `MengaliMorelli` keeps its autocorrelation in the data's precision; a float64 lag array promoted it to complex128.
|
|
76
|
+
- `plot_frequency_offset_blockwise_result` and two frequency axes label their unit with an SI prefix chosen from the data, instead of hand-scaled kHz or plain Hz.
|
|
77
|
+
- Error messages of `dispersion_compensation_taps`, the dispersion estimators, `PLL`, `BPS` and `Tikhonov` name the function or class.
|
|
78
|
+
- Docstrings: `Gaussian(fwhm=)` is the amplitude FWHM; the loop bandwidth of `Gardner` and `PLL` is nominal (the second-order loop's noise bandwidth is `1.25·B·T`); a frame's Es/N0 under `apply_awgn` is the frame average, not the payload's.
|
|
79
|
+
- `import commkit` no longer exposes `Any` and `importlib`.
|
|
80
|
+
- `dsh_phase`, `estimate_linewidth` with the DSH methods and `dsh_beat` keep single-precision input in single precision, widening only the phase to float64 before the unwrap; they computed the beat in complex128. Complex64 and complex128 runs agree to below 1e-6 rad per sample.
|
|
81
|
+
- `plot_channel_correction` (then `plot_zf_equalizer_response`) plots the equalizer `correct_channel` applies; for MIMO it showed a scalar inverse per path instead of the matrix inverse, and the combined panel is now the matrix product `W·H`.
|
|
82
|
+
|
|
83
|
+
### Development
|
|
84
|
+
|
|
85
|
+
- Structure: the Numba kernels of `recovery` and `frequency` at module level in private kernel modules, loaded from the cache in a fresh process; the array-only LLR core below `Constellation`, so `mapping` no longer imports `core`; `filtering/fiber/` split into estimation and compensation; shared private modules for bit packing, the QAM lattice, sub-bin peak fits and interpolation, replacing private imports across packages; one inlined cycle-slip step for the equalizers and the standalone repair, one PLL kernel, and the plots without private twins (405 lines fewer, pixel identical).
|
|
86
|
+
- `AGENTS.md`: the `coding` kernels compile without `fastmath`, Gardner is a fixed-precision block, method diagnostics live in estimate subclasses named after their method or family.
|
|
87
|
+
- Tests: oracles for the calibrated Gardner gain at 300 and 900 ppm, the interpolation kernel against its CPU reference in double precision, bounded DBP memory, the β-separation spread on Wiener phase noise, early turbo stopping at unchanged FER, the CMA step scale against the closed forms of square QAM, and RDE against CMA on shaped 64-QAM.
|
|
88
|
+
- compute-sanitizer clean (memcheck, racecheck, synccheck, initcheck) on the new `interpolate` kernel and the changed fibre and cycle-slip kernels.
|
|
89
|
+
|
|
90
|
+
## [3.7.1] - 2026-11-10
|
|
91
|
+
|
|
92
|
+
Gardner clock recovery no longer runs away when its loop is too wide: the integrator is bounded to plausible clock offsets, and slips are reported. The notebooks on clock recovery, direct and coherent detection and the ADC now introduce their topics with figures.
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- `timing.Gardner(max_offset_ppm=1000.0)`: the largest clock offset the loop tracks. The loop's integrator is held within it.
|
|
97
|
+
- A WARNING when Gardner clock recovery slips whole symbols (the timing moves by more than 0.75 symbol within `8 / (B·T)` symbols), after which output symbols no longer match the transmitted ones in order. A second WARNING when the estimated offset sits at `max_offset_ppm`.
|
|
98
|
+
|
|
99
|
+
### Performance
|
|
100
|
+
|
|
101
|
+
- Gardner clock recovery checks its trajectory for slips after the loop: 1.01 to 1.04 of the former time (paired runs, 2^17 symbols).
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
|
|
105
|
+
- A Gardner loop too wide for its detector's noise, such as the classical detector at `normalized_bandwidth=1e-2` on a 0.1-rolloff signal, no longer runs away in frequency without notice. Once it slipped, nothing pulled its integrator back, and it reached tens of thousands of ppm on a 50 ppm clock, with thousands of extra symbols in the corrected output. The bounded loop keeps returning to lock and reports the slips.
|
|
106
|
+
|
|
107
|
+
### Development
|
|
108
|
+
|
|
109
|
+
- Notebooks 12 (sampling-clock recovery), 22 (direct and self-coherent detection, now also coherent detection and its LO gain) and the skew and ADC sections of 10 explain their topics with figures: the drifting eye, how the Gardner detector tells early from late, loop bandwidth and cycle slips, PAM-4 eyes and sensitivity, thermal against shot noise, laser RIN, balanced photodiodes, quantization and jitter.
|
|
110
|
+
|
|
7
111
|
## [3.7.0] - 2026-11-10
|
|
8
112
|
|
|
9
113
|
The receiver's analog front end and the detector, at absolute power. The ADC clock, its jitter and quantizer, IQ skew and the photodiode join the impairments, with Gardner clock recovery as the inverse of the clock; coherent and square-law detection turn received and LO powers into the noise they give. Closed-form AWGN error rates and information rates sit next to the measured ones. Blind decision-directed equalizers no longer lock falsely on unipolar PAM and dense QAM, because their input scaling hands the slicer the right gain.
|
|
@@ -503,7 +607,9 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
|
|
|
503
607
|
|
|
504
608
|
First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
|
|
505
609
|
|
|
506
|
-
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.
|
|
610
|
+
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.8.0...HEAD
|
|
611
|
+
[3.8.0]: https://github.com/lokgar/commkit/compare/v3.7.1...v3.8.0
|
|
612
|
+
[3.7.1]: https://github.com/lokgar/commkit/compare/v3.7.0...v3.7.1
|
|
507
613
|
[3.7.0]: https://github.com/lokgar/commkit/compare/v3.6.1...v3.7.0
|
|
508
614
|
[3.6.1]: https://github.com/lokgar/commkit/compare/v3.6.0...v3.6.1
|
|
509
615
|
[3.6.0]: https://github.com/lokgar/commkit/compare/v3.5.0...v3.6.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: commkit
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.8.0
|
|
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
|
|
@@ -79,7 +79,7 @@ res = ck.equalization.lms(
|
|
|
79
79
|
y = res.signal # 1-SPS Signal, reference aligned
|
|
80
80
|
print(f"EVM {ck.metrics.evm(y, num_skip_symbols=2000):.1f} %, "
|
|
81
81
|
f"BER {ck.metrics.ber(y, num_skip_symbols=2000):.1e}")
|
|
82
|
-
# EVM 12.7 %, BER 2.
|
|
82
|
+
# EVM 12.7 %, BER 2.0e-04 (on the CPU; the GPU draws other noise)
|
|
83
83
|
|
|
84
84
|
# The next record continues from the converged taps and CPR state.
|
|
85
85
|
res2 = ck.equalization.lms(rx, num_taps=21, step_size=1e-3, cpr=cpr, state=res.state)
|
|
@@ -142,15 +142,15 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
142
142
|
| --- | --- |
|
|
143
143
|
| [`commkit.core`](https://github.com/lokgar/commkit/tree/main/commkit/core) | `Signal`, `Reference`, `generate` (uniform, shaped through a distribution matcher, or coded with `code=`), `SingleCarrierFrame` and `Preamble` (pilots, guard intervals, MIMO channels), `extract_payload`. |
|
|
144
144
|
| [`commkit.mapping`](https://github.com/lokgar/commkit/tree/main/commkit/mapping) | `Constellation` (QAM, PSK, PAM, arbitrary points; Gray labels; probabilistic shaping with `.shaped()`), bit mapping, hard demapping, max-log and exact LLRs. |
|
|
145
|
-
| [`commkit.filtering`](https://github.com/lokgar/commkit/tree/main/commkit/filtering) | Pulses (`RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`), FIR and IIR design (Butterworth, Chebyshev I/II, elliptic, Bessel), numerical filter responses, `fir_filter
|
|
145
|
+
| [`commkit.filtering`](https://github.com/lokgar/commkit/tree/main/commkit/filtering) | Pulses (`RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`), FIR and IIR design (Butterworth, Chebyshev I/II, elliptic, Bessel), numerical filter responses, `fir_filter` (direct, FFT or overlap-save convolution after the sizes), `iir_filter`, `matched_filter`, chromatic-dispersion estimation and compensation and digital backpropagation (`correct_fiber_propagation`). |
|
|
146
146
|
| [`commkit.multirate`](https://github.com/lokgar/commkit/blob/main/commkit/multirate.py) | `resample` (fractional), `decimate`, `upsample`, `decimate_to_symbol_rate`. |
|
|
147
147
|
| [`commkit.spectral`](https://github.com/lokgar/commkit/blob/main/commkit/spectral.py) | Welch PSD, spectrograms, frequency shifting, pilot tones. |
|
|
148
|
-
| [`commkit.impairments`](https://github.com/lokgar/commkit/tree/main/commkit/impairments) | AWGN at an Es/N0 (measured as energy per symbol) or of an absolute variance, ASE at an OSNR (`apply_ase`), phase noise, IQ imbalance (blind estimate; Löwdin and Gram-Schmidt correction), chromatic dispersion, PMD and polarization mixing, and nonlinear fiber propagation over amplified spans (split-step Kerr effect with dispersion, loss, PMD and ASE) of a `Fiber`. |
|
|
149
|
-
| [`commkit.timing`](https://github.com/lokgar/commkit/tree/main/commkit/timing) | Barker and Zadoff-Chu sequences, `estimate_timing` / `correct_timing`,
|
|
148
|
+
| [`commkit.impairments`](https://github.com/lokgar/commkit/tree/main/commkit/impairments) | AWGN at an Es/N0 (measured as energy per symbol) or of an absolute variance, ASE at an OSNR (`apply_ase`), phase noise, carrier frequency offset, IQ imbalance (blind estimate; Löwdin and Gram-Schmidt correction), sampling-clock offset and jitter, ADC quantization, photodetection, coherent detection and intensity noise, chromatic dispersion, PMD and polarization mixing, and nonlinear fiber propagation over amplified spans (split-step Kerr effect with dispersion, loss, PMD and ASE) of a `Fiber`. |
|
|
149
|
+
| [`commkit.timing`](https://github.com/lokgar/commkit/tree/main/commkit/timing) | Barker and Zadoff-Chu sequences, `estimate_timing` / `correct_timing`, `cross_correlate`, `peak_offset` and `apply_delay`, sampling-clock recovery (`estimate_sampling_clock_offset` / `correct_sampling_clock_offset` with `Gardner`). |
|
|
150
150
|
| [`commkit.frequency`](https://github.com/lokgar/commkit/blob/main/commkit/frequency.py) | `estimate_frequency_offset` / `correct_frequency_offset` with `MthPower`, `MengaliMorelli`, `PilotSlope` and `SpectralPeak`; static and blockwise. |
|
|
151
|
-
| [`commkit.recovery`](https://github.com/lokgar/commkit/tree/main/commkit/recovery) | `estimate_carrier_phase` / `correct_carrier_phase` with `ViterbiViterbi`, `BPS`, `PLL`, `Tikhonov`, `ConstantPhase`, `PilotInterpolation`, `PilotTone(s)`; cycle-slip correction; `resolve_phase_ambiguity` and `resolve_channel_permutation`. |
|
|
152
|
-
| [`commkit.equalization`](https://github.com/lokgar/commkit/tree/main/commkit/equalization) | Sequential `lms`, `rls`, `cma`, `rde` (Numba) and frequency-domain `block_lms`, `block_cma`, `block_rde` (CuPy, CUDA graphs), butterfly MIMO, inline carrier recovery (`cpr=PLL()` / `BPS()`), continuation with `state=`, `
|
|
153
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `
|
|
151
|
+
| [`commkit.recovery`](https://github.com/lokgar/commkit/tree/main/commkit/recovery) | `estimate_carrier_phase` / `correct_carrier_phase` with `ViterbiViterbi`, `BPS`, `PLL`, `Tikhonov`, `ConstantPhase`, `PilotInterpolation`, `PilotTone(s)`; cycle-slip correction; the Wiener phase smoother `smooth_phase`; `resolve_phase_ambiguity` and `resolve_channel_permutation`. |
|
|
152
|
+
| [`commkit.equalization`](https://github.com/lokgar/commkit/tree/main/commkit/equalization) | Sequential `lms`, `rls`, `cma`, `rde` (Numba) and frequency-domain `block_lms`, `block_cma`, `block_rde` (CuPy, CUDA graphs), butterfly MIMO, inline carrier recovery (`cpr=PLL()` / `BPS()`), continuation with `state=`, `estimate_channel` and `correct_channel` (ZF / MMSE); pilot-aided CMA and RDE from a frame's pilots (`EqualizerPilots`); polarization demultiplexing on pilot tones (`estimate_polarization(x, PolarizationTones(...))` / `correct_polarization`). |
|
|
153
|
+
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
154
154
|
| [`commkit.analysis`](https://github.com/lokgar/commkit/tree/main/commkit/analysis) | Laser and carrier-phase characterization: `estimate_linewidth` (increment slope, β-separation, delayed self-heterodyne FM-PSD / increment / Lorentzian), FM-noise PSDs, drift separation, Allan deviation. |
|
|
155
155
|
| [`commkit.math`](https://github.com/lokgar/commkit/blob/main/commkit/math.py) | `rms`, `normalize`, dB conversions. |
|
|
156
156
|
| [`commkit.smoothing`](https://github.com/lokgar/commkit/blob/main/commkit/smoothing.py) | Display and estimation smoothers (moving average, Savitzky-Golay, 2-D density). Signal-chain filters are in `filtering`. |
|
|
@@ -186,15 +186,15 @@ With [`uv`](https://github.com/astral-sh/uv), use `uv pip install` in place of `
|
|
|
186
186
|
|
|
187
187
|
## Examples
|
|
188
188
|
|
|
189
|
-
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in
|
|
189
|
+
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in 31 Jupyter notebooks, one topic each, in teaching order (install the `notebook` extra and run `jupyter lab examples`):
|
|
190
190
|
|
|
191
191
|
- **00-05, signals and DSP**: the `Signal`, constellations and bit mapping, spectra, filters, pulse shaping and matched filtering, resampling;
|
|
192
192
|
- **06-10, channel, coding and performance**: AWGN and the metrics (SNR, BER, LLRs, GMI), channel coding, probabilistic shaping and coded modulation, laser phase noise, front-end impairments;
|
|
193
|
-
- **11-
|
|
194
|
-
- **
|
|
195
|
-
- **
|
|
193
|
+
- **11-19, receiver algorithms**: frame synchronization, sampling-clock recovery, frequency-offset estimation, blind and pilot-aided carrier recovery, linear, adaptive and blind equalization, polarization demultiplexing;
|
|
194
|
+
- **20-24, optical fiber systems**: chromatic dispersion, the nonlinear fiber with digital backpropagation, direct and self-coherent detection, FEC in optical standards, and an end-to-end coherent transceiver;
|
|
195
|
+
- **25-30, characterization**: carrier phase and laser linewidth measurements, with templates for real captures.
|
|
196
196
|
|
|
197
|
-
[`examples/README.md`](https://github.com/lokgar/commkit/blob/main/examples/README.md) lists every notebook with its topics. The quickstart above appears cell by cell in `00-getting-started` and `
|
|
197
|
+
[`examples/README.md`](https://github.com/lokgar/commkit/blob/main/examples/README.md) lists every notebook with its topics. The quickstart above appears cell by cell in `00-getting-started` and `17-adaptive-equalization`. The notebooks are committed without outputs and run in CI.
|
|
198
198
|
|
|
199
199
|
## Development
|
|
200
200
|
|
|
@@ -43,7 +43,7 @@ res = ck.equalization.lms(
|
|
|
43
43
|
y = res.signal # 1-SPS Signal, reference aligned
|
|
44
44
|
print(f"EVM {ck.metrics.evm(y, num_skip_symbols=2000):.1f} %, "
|
|
45
45
|
f"BER {ck.metrics.ber(y, num_skip_symbols=2000):.1e}")
|
|
46
|
-
# EVM 12.7 %, BER 2.
|
|
46
|
+
# EVM 12.7 %, BER 2.0e-04 (on the CPU; the GPU draws other noise)
|
|
47
47
|
|
|
48
48
|
# The next record continues from the converged taps and CPR state.
|
|
49
49
|
res2 = ck.equalization.lms(rx, num_taps=21, step_size=1e-3, cpr=cpr, state=res.state)
|
|
@@ -106,15 +106,15 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
106
106
|
| --- | --- |
|
|
107
107
|
| [`commkit.core`](https://github.com/lokgar/commkit/tree/main/commkit/core) | `Signal`, `Reference`, `generate` (uniform, shaped through a distribution matcher, or coded with `code=`), `SingleCarrierFrame` and `Preamble` (pilots, guard intervals, MIMO channels), `extract_payload`. |
|
|
108
108
|
| [`commkit.mapping`](https://github.com/lokgar/commkit/tree/main/commkit/mapping) | `Constellation` (QAM, PSK, PAM, arbitrary points; Gray labels; probabilistic shaping with `.shaped()`), bit mapping, hard demapping, max-log and exact LLRs. |
|
|
109
|
-
| [`commkit.filtering`](https://github.com/lokgar/commkit/tree/main/commkit/filtering) | Pulses (`RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`), FIR and IIR design (Butterworth, Chebyshev I/II, elliptic, Bessel), numerical filter responses, `fir_filter
|
|
109
|
+
| [`commkit.filtering`](https://github.com/lokgar/commkit/tree/main/commkit/filtering) | Pulses (`RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`), FIR and IIR design (Butterworth, Chebyshev I/II, elliptic, Bessel), numerical filter responses, `fir_filter` (direct, FFT or overlap-save convolution after the sizes), `iir_filter`, `matched_filter`, chromatic-dispersion estimation and compensation and digital backpropagation (`correct_fiber_propagation`). |
|
|
110
110
|
| [`commkit.multirate`](https://github.com/lokgar/commkit/blob/main/commkit/multirate.py) | `resample` (fractional), `decimate`, `upsample`, `decimate_to_symbol_rate`. |
|
|
111
111
|
| [`commkit.spectral`](https://github.com/lokgar/commkit/blob/main/commkit/spectral.py) | Welch PSD, spectrograms, frequency shifting, pilot tones. |
|
|
112
|
-
| [`commkit.impairments`](https://github.com/lokgar/commkit/tree/main/commkit/impairments) | AWGN at an Es/N0 (measured as energy per symbol) or of an absolute variance, ASE at an OSNR (`apply_ase`), phase noise, IQ imbalance (blind estimate; Löwdin and Gram-Schmidt correction), chromatic dispersion, PMD and polarization mixing, and nonlinear fiber propagation over amplified spans (split-step Kerr effect with dispersion, loss, PMD and ASE) of a `Fiber`. |
|
|
113
|
-
| [`commkit.timing`](https://github.com/lokgar/commkit/tree/main/commkit/timing) | Barker and Zadoff-Chu sequences, `estimate_timing` / `correct_timing`,
|
|
112
|
+
| [`commkit.impairments`](https://github.com/lokgar/commkit/tree/main/commkit/impairments) | AWGN at an Es/N0 (measured as energy per symbol) or of an absolute variance, ASE at an OSNR (`apply_ase`), phase noise, carrier frequency offset, IQ imbalance (blind estimate; Löwdin and Gram-Schmidt correction), sampling-clock offset and jitter, ADC quantization, photodetection, coherent detection and intensity noise, chromatic dispersion, PMD and polarization mixing, and nonlinear fiber propagation over amplified spans (split-step Kerr effect with dispersion, loss, PMD and ASE) of a `Fiber`. |
|
|
113
|
+
| [`commkit.timing`](https://github.com/lokgar/commkit/tree/main/commkit/timing) | Barker and Zadoff-Chu sequences, `estimate_timing` / `correct_timing`, `cross_correlate`, `peak_offset` and `apply_delay`, sampling-clock recovery (`estimate_sampling_clock_offset` / `correct_sampling_clock_offset` with `Gardner`). |
|
|
114
114
|
| [`commkit.frequency`](https://github.com/lokgar/commkit/blob/main/commkit/frequency.py) | `estimate_frequency_offset` / `correct_frequency_offset` with `MthPower`, `MengaliMorelli`, `PilotSlope` and `SpectralPeak`; static and blockwise. |
|
|
115
|
-
| [`commkit.recovery`](https://github.com/lokgar/commkit/tree/main/commkit/recovery) | `estimate_carrier_phase` / `correct_carrier_phase` with `ViterbiViterbi`, `BPS`, `PLL`, `Tikhonov`, `ConstantPhase`, `PilotInterpolation`, `PilotTone(s)`; cycle-slip correction; `resolve_phase_ambiguity` and `resolve_channel_permutation`. |
|
|
116
|
-
| [`commkit.equalization`](https://github.com/lokgar/commkit/tree/main/commkit/equalization) | Sequential `lms`, `rls`, `cma`, `rde` (Numba) and frequency-domain `block_lms`, `block_cma`, `block_rde` (CuPy, CUDA graphs), butterfly MIMO, inline carrier recovery (`cpr=PLL()` / `BPS()`), continuation with `state=`, `
|
|
117
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `
|
|
115
|
+
| [`commkit.recovery`](https://github.com/lokgar/commkit/tree/main/commkit/recovery) | `estimate_carrier_phase` / `correct_carrier_phase` with `ViterbiViterbi`, `BPS`, `PLL`, `Tikhonov`, `ConstantPhase`, `PilotInterpolation`, `PilotTone(s)`; cycle-slip correction; the Wiener phase smoother `smooth_phase`; `resolve_phase_ambiguity` and `resolve_channel_permutation`. |
|
|
116
|
+
| [`commkit.equalization`](https://github.com/lokgar/commkit/tree/main/commkit/equalization) | Sequential `lms`, `rls`, `cma`, `rde` (Numba) and frequency-domain `block_lms`, `block_cma`, `block_rde` (CuPy, CUDA graphs), butterfly MIMO, inline carrier recovery (`cpr=PLL()` / `BPS()`), continuation with `state=`, `estimate_channel` and `correct_channel` (ZF / MMSE); pilot-aided CMA and RDE from a frame's pilots (`EqualizerPilots`); polarization demultiplexing on pilot tones (`estimate_polarization(x, PolarizationTones(...))` / `correct_polarization`). |
|
|
117
|
+
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
118
118
|
| [`commkit.analysis`](https://github.com/lokgar/commkit/tree/main/commkit/analysis) | Laser and carrier-phase characterization: `estimate_linewidth` (increment slope, β-separation, delayed self-heterodyne FM-PSD / increment / Lorentzian), FM-noise PSDs, drift separation, Allan deviation. |
|
|
119
119
|
| [`commkit.math`](https://github.com/lokgar/commkit/blob/main/commkit/math.py) | `rms`, `normalize`, dB conversions. |
|
|
120
120
|
| [`commkit.smoothing`](https://github.com/lokgar/commkit/blob/main/commkit/smoothing.py) | Display and estimation smoothers (moving average, Savitzky-Golay, 2-D density). Signal-chain filters are in `filtering`. |
|
|
@@ -150,15 +150,15 @@ With [`uv`](https://github.com/astral-sh/uv), use `uv pip install` in place of `
|
|
|
150
150
|
|
|
151
151
|
## Examples
|
|
152
152
|
|
|
153
|
-
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in
|
|
153
|
+
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in 31 Jupyter notebooks, one topic each, in teaching order (install the `notebook` extra and run `jupyter lab examples`):
|
|
154
154
|
|
|
155
155
|
- **00-05, signals and DSP**: the `Signal`, constellations and bit mapping, spectra, filters, pulse shaping and matched filtering, resampling;
|
|
156
156
|
- **06-10, channel, coding and performance**: AWGN and the metrics (SNR, BER, LLRs, GMI), channel coding, probabilistic shaping and coded modulation, laser phase noise, front-end impairments;
|
|
157
|
-
- **11-
|
|
158
|
-
- **
|
|
159
|
-
- **
|
|
157
|
+
- **11-19, receiver algorithms**: frame synchronization, sampling-clock recovery, frequency-offset estimation, blind and pilot-aided carrier recovery, linear, adaptive and blind equalization, polarization demultiplexing;
|
|
158
|
+
- **20-24, optical fiber systems**: chromatic dispersion, the nonlinear fiber with digital backpropagation, direct and self-coherent detection, FEC in optical standards, and an end-to-end coherent transceiver;
|
|
159
|
+
- **25-30, characterization**: carrier phase and laser linewidth measurements, with templates for real captures.
|
|
160
160
|
|
|
161
|
-
[`examples/README.md`](https://github.com/lokgar/commkit/blob/main/examples/README.md) lists every notebook with its topics. The quickstart above appears cell by cell in `00-getting-started` and `
|
|
161
|
+
[`examples/README.md`](https://github.com/lokgar/commkit/blob/main/examples/README.md) lists every notebook with its topics. The quickstart above appears cell by cell in `00-getting-started` and `17-adaptive-equalization`. The notebooks are committed without outputs and run in CI.
|
|
162
162
|
|
|
163
163
|
## Development
|
|
164
164
|
|
|
@@ -180,7 +180,7 @@ def clock_offset_workload(
|
|
|
180
180
|
from commkit.core import generate
|
|
181
181
|
from commkit.filtering import matched_filter
|
|
182
182
|
from commkit.impairments import apply_sampling_clock_offset
|
|
183
|
-
from commkit.timing import
|
|
183
|
+
from commkit.timing import apply_delay
|
|
184
184
|
|
|
185
185
|
tx = generate(
|
|
186
186
|
Constellation.qam(16),
|
|
@@ -192,8 +192,6 @@ def clock_offset_workload(
|
|
|
192
192
|
rng=seed,
|
|
193
193
|
)
|
|
194
194
|
rx = apply_awgn(tx, esn0_db=20.0, rng=seed + 1)
|
|
195
|
-
rx = apply_sampling_clock_offset(
|
|
196
|
-
fft_fractional_delay(rx, delay=0.37), offset_ppm=ppm
|
|
197
|
-
)
|
|
195
|
+
rx = apply_sampling_clock_offset(apply_delay(rx, delay=0.37), offset_ppm=ppm)
|
|
198
196
|
mf = matched_filter(rx)
|
|
199
197
|
return np.asarray(mf.samples, dtype=np.complex64), np.asarray(tx.reference.symbols)
|
|
@@ -28,10 +28,10 @@ Importing commkit has no side effects: it does not configure logging or
|
|
|
28
28
|
Matplotlib, change warning filters, or touch the GPU.
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
|
-
import importlib
|
|
32
|
-
from typing import Any
|
|
31
|
+
import importlib as _importlib
|
|
32
|
+
from typing import Any as _Any
|
|
33
33
|
|
|
34
|
-
__version__ = "3.
|
|
34
|
+
__version__ = "3.8.0"
|
|
35
35
|
|
|
36
36
|
from .backend import PrecisionWarning
|
|
37
37
|
from .core import (
|
|
@@ -79,11 +79,11 @@ _LAZY_NAMES = {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
def __getattr__(name: str) ->
|
|
82
|
+
def __getattr__(name: str) -> _Any:
|
|
83
83
|
if name in _SUBMODULES:
|
|
84
|
-
return
|
|
84
|
+
return _importlib.import_module(f".{name}", __name__)
|
|
85
85
|
if name in _LAZY_NAMES:
|
|
86
|
-
module =
|
|
86
|
+
module = _importlib.import_module(f".{_LAZY_NAMES[name]}", __name__)
|
|
87
87
|
return getattr(module, name)
|
|
88
88
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
89
89
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""MSB-first bit rows and the integers they label (private).
|
|
2
|
+
|
|
3
|
+
:func:`pack_bits` and :func:`unpack_bits`, on the device of their input,
|
|
4
|
+
shared by :mod:`commkit.mapping` (bit labels of constellation points) and
|
|
5
|
+
:mod:`commkit.coding` (codewords and syndromes as integers). Below both in
|
|
6
|
+
the layering, so the value objects of ``coding`` need not import a DSP
|
|
7
|
+
module.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from .backend import ArrayType, dispatch
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def pack_bits(labels: ArrayType) -> ArrayType:
|
|
14
|
+
"""MSB-first bit rows ``(..., k)`` to integers, int64, on their device.
|
|
15
|
+
|
|
16
|
+
The inverse of :func:`unpack_bits`.
|
|
17
|
+
"""
|
|
18
|
+
labels, xp, _ = dispatch(labels)
|
|
19
|
+
k = labels.shape[-1]
|
|
20
|
+
weights = xp.left_shift(1, xp.arange(k - 1, -1, -1, dtype=xp.int64))
|
|
21
|
+
return (labels.astype(xp.int64) * weights).sum(axis=-1)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def unpack_bits(indices: ArrayType, k: int) -> ArrayType:
|
|
25
|
+
"""Unpack integer indices into their k-bit binary representation (MSB-first).
|
|
26
|
+
|
|
27
|
+
Runs with the array module of ``indices``, so a GPU-resident
|
|
28
|
+
index array (e.g. from hard-decision demapping on CuPy) unpacks without
|
|
29
|
+
a host round trip.
|
|
30
|
+
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
indices : array_like, shape (N,), integer dtype
|
|
34
|
+
k : int
|
|
35
|
+
Number of bits per index.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
ndarray, shape (N, k), int8
|
|
40
|
+
MSB-first bit pattern per index, on the device of ``indices``.
|
|
41
|
+
"""
|
|
42
|
+
indices, xp, _ = dispatch(indices)
|
|
43
|
+
shifts = xp.arange(k - 1, -1, -1, dtype="int32")
|
|
44
|
+
return ((indices[:, xp.newaxis] >> shifts) & 1).astype(xp.int8)
|
|
@@ -14,11 +14,13 @@ from . import _fft
|
|
|
14
14
|
from .backend import ArrayType, dispatch, to_device
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def circular_kernel(
|
|
17
|
+
def circular_kernel(
|
|
18
|
+
taps: ArrayType, length: int, center: int | None = None
|
|
19
|
+
) -> np.ndarray:
|
|
18
20
|
"""Fold ``taps`` into a length-``length`` circular kernel on the host.
|
|
19
21
|
|
|
20
|
-
Tap ``
|
|
21
|
-
|
|
22
|
+
Tap ``center`` goes to index 0; taps longer than ``length`` wrap around
|
|
23
|
+
and add up, which is exactly circular convolution with them.
|
|
22
24
|
|
|
23
25
|
Parameters
|
|
24
26
|
----------
|
|
@@ -26,6 +28,8 @@ def circular_kernel(taps: ArrayType, length: int) -> np.ndarray:
|
|
|
26
28
|
Filter taps, ``(L,)``, on any device.
|
|
27
29
|
length : int
|
|
28
30
|
Period of the sequence the kernel is applied to.
|
|
31
|
+
center : int, optional
|
|
32
|
+
Tap that lands on the output sample; ``None`` takes ``(L - 1) // 2``.
|
|
29
33
|
|
|
30
34
|
Returns
|
|
31
35
|
-------
|
|
@@ -34,12 +38,15 @@ def circular_kernel(taps: ArrayType, length: int) -> np.ndarray:
|
|
|
34
38
|
"""
|
|
35
39
|
h = np.asarray(to_device(taps, "cpu"))
|
|
36
40
|
kernel = np.zeros(length, dtype=h.dtype)
|
|
37
|
-
|
|
41
|
+
c = (h.size - 1) // 2 if center is None else center
|
|
42
|
+
idx = (np.arange(h.size) - c) % length
|
|
38
43
|
np.add.at(kernel, idx, h)
|
|
39
44
|
return kernel
|
|
40
45
|
|
|
41
46
|
|
|
42
|
-
def convolve_periodic(
|
|
47
|
+
def convolve_periodic(
|
|
48
|
+
samples: ArrayType, taps: ArrayType, center: int | None = None
|
|
49
|
+
) -> ArrayType:
|
|
43
50
|
"""Circular convolution of each row of ``samples`` with ``taps``.
|
|
44
51
|
|
|
45
52
|
Parameters
|
|
@@ -48,6 +55,8 @@ def convolve_periodic(samples: ArrayType, taps: ArrayType) -> ArrayType:
|
|
|
48
55
|
One period of the input, time on the last axis.
|
|
49
56
|
taps : array_like
|
|
50
57
|
Filter taps, ``(L,)``; any ``L``.
|
|
58
|
+
center : int, optional
|
|
59
|
+
Tap that lands on the output sample; ``None`` takes ``(L - 1) // 2``.
|
|
51
60
|
|
|
52
61
|
Returns
|
|
53
62
|
-------
|
|
@@ -57,7 +66,7 @@ def convolve_periodic(samples: ArrayType, taps: ArrayType) -> ArrayType:
|
|
|
57
66
|
"""
|
|
58
67
|
x, xp, _ = dispatch(samples)
|
|
59
68
|
n = x.shape[-1]
|
|
60
|
-
kernel = circular_kernel(taps, n)
|
|
69
|
+
kernel = circular_kernel(taps, n, center)
|
|
61
70
|
real = not (xp.iscomplexobj(x) or np.iscomplexobj(kernel))
|
|
62
71
|
# Kernel at the sample precision, so complex64 data is not promoted.
|
|
63
72
|
precision = np.dtype(x.real.dtype)
|