commkit 3.11.0__tar.gz → 3.13.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.11.0 → commkit-3.13.0}/.github/workflows/ci.yml +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/.github/workflows/publish.yml +1 -1
- commkit-3.13.0/AGENTS.md +191 -0
- {commkit-3.11.0 → commkit-3.13.0}/CHANGELOG.md +117 -1
- {commkit-3.11.0 → commkit-3.13.0}/PKG-INFO +5 -4
- {commkit-3.11.0 → commkit-3.13.0}/README.md +4 -3
- commkit-3.13.0/benchmarks/baselines/Linux-CPython-3.14-64bit/0009_audit_2026_12.json +6920 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_filters.py +2 -1
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_signal_pipeline.py +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/conftest.py +16 -9
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/record_baseline.py +6 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/__init__.py +22 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_array.py +46 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/__init__.py +18 -6
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/bps.py +15 -8
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/coding.py +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/compiler.py +21 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/filters.py +17 -20
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/graphs.py +45 -6
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/llr.py +6 -4
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/selftest.py +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/bps_anchor.cu +15 -10
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/bps_min_d2.cu +13 -10
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/interpolate.cu +4 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/ldpc.cu +26 -12
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/llr.cu +89 -37
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_dispersion.py +13 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_fiber.py +75 -75
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_interpolation.py +8 -6
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_numba_frequency.py +1 -1
- commkit-3.13.0/commkit/_numba_interpolation.py +173 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_peaks.py +18 -7
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_value.py +18 -8
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/_common.py +23 -10
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/allan.py +5 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/interferometry.py +3 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/linewidth/__init__.py +3 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/linewidth/dsh.py +31 -17
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/linewidth/phase.py +15 -11
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/linewidth/result.py +4 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/backend.py +4 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/_numba_loops.py +28 -460
- commkit-3.13.0/commkit/coding/_numba_trellis.py +486 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/algebraic.py +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/base.py +7 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/convolutional.py +5 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/exit.py +9 -7
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/linear.py +29 -29
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/performance.py +20 -7
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/product.py +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/shaping.py +1 -5
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/turbo.py +16 -9
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/__init__.py +4 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/_signal_input.py +112 -41
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/frame.py +96 -9
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/generation.py +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/preamble.py +11 -5
- {commkit-3.11.0 → commkit-3.13.0}/commkit/core/signal.py +101 -28
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_block/_blind.py +17 -19
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_block/_dd.py +97 -52
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_block/_engine.py +45 -43
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_common.py +28 -33
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_numba_loops.py +10 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_sequential/_blind.py +8 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_sequential/_dd.py +98 -82
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_sequential/_setup.py +1 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/fiber/compensation.py +11 -5
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/fiber/estimation.py +91 -27
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/iq.py +12 -4
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/linear.py +110 -53
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/polarization.py +45 -64
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/result.py +9 -5
- commkit-3.13.0/commkit/filtering/_numba_loops.py +35 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/filtering/linear.py +59 -68
- {commkit-3.11.0 → commkit-3.13.0}/commkit/filtering/pulses.py +14 -16
- {commkit-3.11.0 → commkit-3.13.0}/commkit/frequency.py +56 -13
- {commkit-3.11.0 → commkit-3.13.0}/commkit/impairments/fiber_channel.py +3 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/impairments/frontend.py +11 -16
- {commkit-3.11.0 → commkit-3.13.0}/commkit/impairments/noise.py +6 -11
- {commkit-3.11.0 → commkit-3.13.0}/commkit/io.py +85 -63
- {commkit-3.11.0 → commkit-3.13.0}/commkit/logger.py +18 -15
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/__init__.py +27 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/_demap.py +22 -24
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/_numba_llr.py +95 -33
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/constellation.py +29 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/gray.py +39 -68
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/llr.py +4 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/math.py +183 -49
- commkit-3.13.0/commkit/metrics/__init__.py +186 -0
- commkit-3.13.0/commkit/metrics/_blind.py +405 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/metrics/_common.py +85 -9
- {commkit-3.11.0 → commkit-3.13.0}/commkit/metrics/awgn.py +27 -10
- {commkit-3.11.0 → commkit-3.13.0}/commkit/metrics/information.py +63 -34
- commkit-3.13.0/commkit/metrics/quality.py +560 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/multirate.py +16 -34
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/analysis.py +28 -26
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/coding.py +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/constellation.py +36 -21
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/equalizer.py +7 -6
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/filter_response.py +163 -95
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/frequency.py +5 -5
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/recovery.py +44 -39
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/spectral.py +19 -12
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/theme.py +58 -41
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/timing.py +9 -9
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/waveform.py +5 -35
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/__init__.py +0 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/_common.py +8 -4
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/_numba_loops.py +23 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/bps.py +26 -16
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/carrier_phase.py +1 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/corrections.py +41 -19
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/pilots.py +37 -11
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/pll.py +24 -10
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/tikhonov.py +3 -2
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/viterbi_viterbi.py +3 -3
- {commkit-3.11.0 → commkit-3.13.0}/commkit/spectral.py +36 -29
- {commkit-3.11.0 → commkit-3.13.0}/commkit/timing/_numba_loops.py +34 -15
- {commkit-3.11.0 → commkit-3.13.0}/commkit/timing/clock_recovery.py +48 -19
- {commkit-3.11.0 → commkit-3.13.0}/commkit/timing/synchronization.py +57 -73
- {commkit-3.11.0 → commkit-3.13.0}/examples/00-getting-started.ipynb +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/examples/06-awgn-and-performance-metrics.ipynb +7 -4
- {commkit-3.11.0 → commkit-3.13.0}/examples/09-laser-phase-noise.ipynb +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/examples/10-front-end-impairments.ipynb +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/examples/12-sampling-clock-recovery.ipynb +22 -11
- {commkit-3.11.0 → commkit-3.13.0}/examples/14-blind-carrier-phase-recovery.ipynb +14 -3
- {commkit-3.11.0 → commkit-3.13.0}/examples/15-pilot-aided-carrier-recovery.ipynb +11 -4
- {commkit-3.11.0 → commkit-3.13.0}/examples/17-adaptive-equalization.ipynb +17 -7
- {commkit-3.11.0 → commkit-3.13.0}/examples/20-chromatic-dispersion.ipynb +7 -1
- {commkit-3.11.0 → commkit-3.13.0}/examples/24-coherent-transceiver-end-to-end.ipynb +8 -3
- commkit-3.13.0/examples/25-noise-snr-and-metrics-in-the-receiver.ipynb +1495 -0
- commkit-3.11.0/examples/25-carrier-phase-characterization.ipynb → commkit-3.13.0/examples/26-carrier-phase-characterization.ipynb +2 -2
- commkit-3.11.0/examples/26-laser-linewidth-self-heterodyne.ipynb → commkit-3.13.0/examples/27-laser-linewidth-self-heterodyne.ipynb +10 -10
- commkit-3.11.0/examples/27-laser-linewidth-short-delay-and-flicker.ipynb → commkit-3.13.0/examples/28-laser-linewidth-short-delay-and-flicker.ipynb +5 -5
- commkit-3.11.0/examples/28-laser-linewidth-self-homodyne-iq.ipynb → commkit-3.13.0/examples/29-laser-linewidth-self-homodyne-iq.ipynb +5 -5
- commkit-3.11.0/examples/29-measurement-template-self-heterodyne.ipynb → commkit-3.13.0/examples/30-measurement-template-self-heterodyne.ipynb +2 -2
- commkit-3.11.0/examples/30-measurement-template-self-homodyne-iq.ipynb → commkit-3.13.0/examples/31-measurement-template-self-homodyne-iq.ipynb +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/examples/README.md +13 -7
- {commkit-3.11.0 → commkit-3.13.0}/pyproject.toml +11 -29
- {commkit-3.11.0 → commkit-3.13.0}/scripts/sanitize.sh +62 -11
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_allan.py +12 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_linewidth.py +42 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_algebraic.py +0 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_convolutional.py +34 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_ldpc.py +52 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_ldpc_kernel.py +18 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_performance.py +24 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_product.py +48 -10
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_turbo.py +16 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/__init__.py +0 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/kernel_utils.py +0 -12
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/reference_impl.py +24 -9
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/transfers.py +65 -29
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_frame.py +58 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_preamble.py +10 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_psqam.py +12 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_signal.py +107 -12
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_signal_input.py +54 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_blind.py +1 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_block.py +32 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_bps_kernel.py +57 -11
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_cs_kernel.py +0 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_fiber_compensation.py +32 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_fiber_estimation.py +64 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_iq.py +20 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_linear.py +75 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_polarization.py +70 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_state.py +50 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/impairments/test_noise.py +2 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/mapping/test_constellation.py +9 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/mapping/test_gray.py +13 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/mapping/test_llr.py +168 -15
- {commkit-3.11.0 → commkit-3.13.0}/tests/metrics/test_awgn.py +20 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/metrics/test_common.py +14 -7
- {commkit-3.11.0 → commkit-3.13.0}/tests/metrics/test_error_rates.py +6 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/metrics/test_information.py +54 -20
- commkit-3.13.0/tests/metrics/test_quality.py +661 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_constellation.py +31 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_spectral.py +14 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_theme.py +71 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_waveform.py +29 -10
- {commkit-3.11.0 → commkit-3.13.0}/tests/plugins/precision_trace.py +62 -28
- {commkit-3.11.0 → commkit-3.13.0}/tests/plugins/transfer_trace.py +36 -8
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_bps.py +70 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_corrections.py +79 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_pilots.py +73 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_pll.py +21 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_viterbi_viterbi.py +22 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_api_contracts.py +169 -46
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_array.py +4 -3
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_cuda_infra.py +76 -5
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_dispersion.py +20 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_filtering.py +34 -4
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_frequency.py +48 -2
- commkit-3.13.0/tests/test_imports.py +142 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_interpolation.py +11 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_io.py +55 -2
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_logger.py +21 -3
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_math.py +45 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_multirate.py +2 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_pulse_shaping.py +5 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_signal_pipeline.py +4 -12
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_spectral.py +46 -15
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_working_memory.py +1 -1
- {commkit-3.11.0 → commkit-3.13.0}/tests/timing/test_clock_recovery.py +24 -0
- {commkit-3.11.0 → commkit-3.13.0}/uv.lock +1 -1
- commkit-3.11.0/AGENTS.md +0 -303
- commkit-3.11.0/commkit/_numba_interpolation.py +0 -95
- commkit-3.11.0/commkit/metrics/__init__.py +0 -135
- commkit-3.11.0/commkit/metrics/quality.py +0 -281
- commkit-3.11.0/tests/metrics/test_quality.py +0 -226
- {commkit-3.11.0 → commkit-3.13.0}/.gitattributes +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/.github/icon.svg +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/.github/logo.svg +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/.gitignore +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/.python-version +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/LICENSE +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_block_blind.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_block_lms.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_bps.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_coding.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_equalizers.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_fiber.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_gardner.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_import.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_llr.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_mapping.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/bench_sync_misc.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/benchutils.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/benchmarks/workloads.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_bits.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_circular.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_constants.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/algebraic.cu +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/cs_block.cu +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/iir.cu +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_cuda/src/selftest.cu +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_fft.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_overlap_save.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_random.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/_sequences.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/drift.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/fm_noise.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/analysis/trajectory.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/_galois.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/_gf2.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/_ldpc_tables.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/crc.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/interleaving.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/ldpc.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/polar.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/coding/ratematch.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_block/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/_sequential/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/fiber/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/equalization/pilots.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/filtering/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/filtering/response.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/impairments/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/impairments/source.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/_lattice.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/bits.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/mapping/shaping.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/metrics/error_rates.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/plotting/eye.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/py.typed +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/recovery/estimates.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/smoothing.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/commkit/timing/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/02-spectral-analysis.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/03-digital-filters.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/04-pulse-shaping-and-matched-filtering.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/05-multirate-and-resampling.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/07-channel-coding.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/11-frame-synchronization-and-timing.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/13-frequency-offset-estimation.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/16-linear-channel-equalization.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/18-blind-equalization.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/19-polarization-multiplexing.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/22-direct-and-self-coherent-detection.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/examples/23-fec-in-optical-standards.ipynb +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_drift.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_fm_noise.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_interferometry.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/analysis/test_trajectory.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_coding_base.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_crc.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_exit.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_gf2.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_interleaving.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_ldpc_exit.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_ldpc_tables.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_linear_codes.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_polar.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_ratematch.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/coding/test_shaping.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/coding.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/conversions.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/memory.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/metrics.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/periodic.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/scoring.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/signals.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/theory.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/common/user_block.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/conftest.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_generation.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/core/test_signal_mimo.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_cold_start.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_cpr.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_equalizer_oracles.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_mimo.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_result.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_sequential.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/equalization/test_winit.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/impairments/test_fiber_channel_linear.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/impairments/test_frontend.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/impairments/test_source.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/mapping/test_bits.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/mapping/test_lattice.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_analysis.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_coding.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_equalizer.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_eye.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_filter_response.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_frequency.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_recovery.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plotting/test_plot_timing.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/plugins/__init__.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_carrier_phase.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_joint.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_recovery_oracles.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/recovery/test_tikhonov.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_backend.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_bit_packing.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_examples.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_fiber.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_filter_response.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_import_hygiene.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_peaks.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_receiver_chain.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_smoothing.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/test_value.py +0 -0
- {commkit-3.11.0 → commkit-3.13.0}/tests/timing/test_synchronization.py +0 -0
|
@@ -130,7 +130,7 @@ jobs:
|
|
|
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/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"
|
|
133
|
+
--include="commkit/equalization/_numba_loops.py,commkit/mapping/_numba_llr.py,commkit/recovery/_numba_loops.py,commkit/coding/_numba_loops.py,commkit/coding/_numba_trellis.py,commkit/timing/_numba_loops.py,commkit/filtering/_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
|
commkit-3.13.0/AGENTS.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Guide for humans and coding agents changing **CommKit**.
|
|
4
|
+
|
|
5
|
+
These rules describe the code as it is. New code follows them; a change that breaks a rule updates this file in the same commit.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. What CommKit is
|
|
10
|
+
|
|
11
|
+
A Python 3.12+ library for digital-communications research (simulation, receiver DSP, channel coding, metrics, plotting and experimental captures) on NumPy (CPU) and CuPy (GPU). Not differentiable: JAX blocks belong in *commax*, which depends on commkit, never the reverse.
|
|
12
|
+
|
|
13
|
+
- **Plain functions + inline value objects:** data is a `Signal` or array; modulations, pulses and embedded sub-algorithms are small frozen dataclasses written inline (`lms(rx, num_taps=21, step_size=1e-3, cpr=BPS(test_phases=64))`).
|
|
14
|
+
- **Pure Python:** no config files, registries, global switches or multi-step setup.
|
|
15
|
+
- **Equal terms for user code:** user blocks accept arrays or Signals via public `commkit.core.SignalInput`.
|
|
16
|
+
- **Deliberately omitted:** pipeline/receiver classes, DSP methods on `Signal`, string shorthands for constellations, per-algorithm config objects.
|
|
17
|
+
- **Scope:** the textbook reference model and its inverse (e.g. CD and compensation, split-step fiber and standard DBP), not a catalogue of research variants.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. Commands
|
|
22
|
+
|
|
23
|
+
Always use `uv` (Python 3.12+).
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
uv sync --all-extras # env incl. GPU packages
|
|
27
|
+
uv run nbstripout --install # once per clone: strip notebook outputs
|
|
28
|
+
git config filter.nbstripout.extrakeys "metadata.kernelspec metadata.language_info.version"
|
|
29
|
+
uv run pytest # CPU + GPU (--device=all default)
|
|
30
|
+
uv run pytest --device=cpu # CI target
|
|
31
|
+
uv run pytest --run-slow # include slow statistical tests
|
|
32
|
+
uv run pytest --cov=commkit # coverage
|
|
33
|
+
uv run pytest --device=cpu -p tests.plugins.precision_trace --ignore=tests/test_examples.py
|
|
34
|
+
uv run pytest --device=gpu -p tests.plugins.transfer_trace --ignore=tests/test_examples.py
|
|
35
|
+
scripts/sanitize.sh # CUDA kernels under compute-sanitizer
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Numba kernel coverage runs under `NUMBA_DISABLE_JIT=1` (see `kernel-coverage` in `.github/workflows/ci.yml`).
|
|
39
|
+
|
|
40
|
+
**Commit gate** (format *before* type-checking and testing so the verified code is committed):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv run ruff check . --fix
|
|
44
|
+
uv run ruff format .
|
|
45
|
+
uv run mypy commkit/
|
|
46
|
+
uv run pytest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Pure non-behavioural text edits (Markdown, comments, non-executed docstrings) only need `ruff check` and `ruff format`.
|
|
50
|
+
|
|
51
|
+
**Benchmarks** are explicit-only; smoke-run whenever a public signature changes:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv run pytest benchmarks/ --benchmark-disable --device=all
|
|
55
|
+
uv run pytest benchmarks/ --benchmark-only --device=all \
|
|
56
|
+
--benchmark-compare=0009 --benchmark-storage=file://benchmarks/baselines
|
|
57
|
+
uv run python benchmarks/record_baseline.py NAME
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 3. Architecture
|
|
63
|
+
|
|
64
|
+
Dependencies point downward only:
|
|
65
|
+
|
|
66
|
+
| Layer | Modules | May import |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| Infrastructure | `backend`, `logger`, `_cuda`, `_constants` | NumPy, CuPy |
|
|
69
|
+
| Private & math | `_array`, `_value`, `_bits`, `_peaks`, `_fft`, `_random`, `_circular`, `_overlap_save`, `_interpolation`, `_numba_*`, `_sequences`, `_dispersion`, `_fiber`, `math` | infrastructure, peers |
|
|
70
|
+
| Coding | `coding` (array-only codes, `encode`/`decode`, EXIT & error-rate curves) | above + `Constellation`/`_lattice` (never `core` directly) |
|
|
71
|
+
| Core & I/O | `core` (`Signal`, `Reference`, `SignalInput`, frames, generation), `io` | above + value objects (`Constellation`, pulses) |
|
|
72
|
+
| DSP | `mapping`, `filtering`, `multirate`, `spectral`, `smoothing`, `impairments`, `timing`, `frequency`, `recovery`, `equalization`, `metrics`, `analysis` | above + lower DSP |
|
|
73
|
+
| Presentation | `plotting` | everything; **nothing imports `plotting`** |
|
|
74
|
+
|
|
75
|
+
- **Placement by role:** `impairments` = forward models only (`apply_*`, `generate_phase_noise`, `Fiber`). Receiver modules own `estimate_*`/`correct_*`/`resolve_*`, method objects and estimates: `timing` (frame sync, clock), `frequency` (CFO), `recovery` (phase, slips, ambiguities), `equalization` (channel/front-end inverses: linear, gain, polarization, CD, DBP, IQ, adaptive). `filtering` = generic filters/pulses; `smoothing` = display/estimation smoothers; `spectral` = spectra, `shift_frequency`, `add_pilot_tone`; `analysis` = laser/phase characterization; `metrics` = reporting. Dual-use tools stay in their domain (`timing.apply_delay`, `equalization.apply_taps`).
|
|
76
|
+
- **Shared physics:** forward models and inverses share one private module (`_dispersion`, `_fiber`).
|
|
77
|
+
- **Plot styling from `matplotlib.rcParams`:** works under `apply_default_theme(dark=True/False)` or custom styles. Use `C0`..., `_reference_line()`, `_foreground()`/`_background()`, `image.cmap` (`cmap=None`, empty cells masked), `_line_width()`, `_marker_area()`. No hardcoded colors (except `"gray"`), font sizes or fixed sizes outside `plotting/theme.py` (`tests/plotting/test_plot_theme.py`).
|
|
78
|
+
- **Plot SI axes:** base units in brackets (`Frequency [Hz]`, `Time [s]`) + `_set_eng_formatter`; pass unscaled SI data (log axes keep per-tick prefixes).
|
|
79
|
+
- **Storable codes:** `io` saves codes by class name and fields (`allow_pickle=False`), so fields must be primitives, tuples, host arrays, constellations or codes.
|
|
80
|
+
- **Module layout:** split a flat module into a package only past ~1000 lines *and* >= 2 concerns (no `utils/`, no one-function files). Every public name is re-exported by its package `__init__.py`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 4. API & coding rules
|
|
85
|
+
|
|
86
|
+
### Signal
|
|
87
|
+
|
|
88
|
+
- Fields: `samples` (`(N,)` or `(C, N)`, time last, NumPy or CuPy); properties (`sampling_rate`, `symbol_rate`, `center_frequency`, `domain` in `"DIG"|"RF"|"OPT"`, optical `center_wavelength_nm`); description (`constellation`, `pulse`); ground truth (`reference`: `symbols`, air `bits`, source `info_bits`, `code`; and `frame`).
|
|
89
|
+
- Never stores pipeline results; `__init__` does no hidden work (factories do generation/normalization). `to()` and `replace()` share arrays; `clone()` copies mutable waveform/reference arrays.
|
|
90
|
+
- **Alignment invariant:** reference symbol *k* matches symbol period *k*; trailing-trim transforms slice via `inp.wrap(y, num_symbols=n)`. Metrics raise on mismatch and never align, rotate or permute silently.
|
|
91
|
+
- **Dimensionless samples:** impairments never rescale the signal component. Absolute-power models take `<where>_power_dbm` (`launch_`, `received_`, `lo_`, summed over channels) and return samples in input units (square-law: input power units). PSDs are in sample units per Hz.
|
|
92
|
+
- **One reference scale, the constellation's:** whatever relates samples to a constellation (`noise_var`, decisions, distances, LLRs, overlays) is on its scale: `Es` = its average power at the symbol rate, `Es/sps` per sample on a waveform. A block that needs that scale fits it itself, by the data-aided gain against a reference (`math._data_aided_gain`) or the blind moment gain (`math._blind_gain`), never by measured average power, which counts the noise as signal (symbols `1/sqrt(1 + 1/SNR)` inside), and returns its data unrescaled (BPS, PLL, metrics, overlays). Metric and estimate gains measure magnitude only; a rotation stays visible.
|
|
93
|
+
- **No measured rescaling inside blocks:** blocks take no `normalize=` flag; a user rescales explicitly with `math.normalize`. The one exception is the adaptive equalizers' AGC (their step sizes need unit-power input), which returns its factor and accepts it back (`EqualizerResult.input_norm_factor`, `state`, `apply_taps(input_norm_factor=)`), so an absolute calibration (shot-noise units through frozen taps) survives the chain. Exact known gains (`correct_power`) are fine, and an estimate carries a meaningful scale itself rather than leaving one for the data to be rescaled by (tone polarization matrices have unit-norm columns: unitary for a lossless channel).
|
|
94
|
+
|
|
95
|
+
### Signatures, Signal awareness & objects
|
|
96
|
+
|
|
97
|
+
- `f(data, other_data, *, params)`: keyword-only after data arguments (no-data functions may keep one primary positional arg, e.g. `barker_sequence(13)`).
|
|
98
|
+
- **Signal awareness:** waveform/symbol functions unwrap once with `inp = SignalInput(samples, "f()")`, resolve metadata via `inp` methods, run array math, and return via `inp.wrap()` without re-entering the public function. Transforms type as `def f(samples: S, ...) -> S` (never reassign `samples`; name unwrapped array `x`). Derived-quantity and synthesis functions stay array-only.
|
|
99
|
+
- **Properties vs defaults:** sample properties (`sampling_rate`, `symbol_rate`, `sps`, `center_frequency`, `domain`, `wavelength_nm`) come from `Signal` (conflicts raise `ValueError`; required for arrays). Defaults (`constellation`, `pulse`, `reference`) come from `Signal` and explicit args win. Neither warns. Resolve through `inp.<field>()` rather than `inp.signal` (except where `SignalInput` lacks an optional-property or container accessor). Validate integer SPS with `inp.integer_sps()` / `require_integer_sps()`.
|
|
100
|
+
- **Shapes:** SISO `(N,)`, MIMO `(C, N)`. Use `_array.as_2d`, `restore_1d`, `broadcast_channels`, `require_channels`.
|
|
101
|
+
- **Value equality:** every frozen dataclass compares by value; never bare `eq=False`. Array-bearing dataclasses inherit `_value._Value` (hashable, read-only host copies via `freeze_host`: codes, interleavers, array-bearing algorithm objects, `FrameStructure`, `ExitCurve`, `ErrorRateCurve`; `Constellation` keeps an equivalent ignoring `family` and `-0.0`) or `_value._Record` (field-wise equality, `NaN == NaN`, cross-device unequal without transfer, unhashable: `Signal`, `Reference`, estimates, results).
|
|
102
|
+
- **Value objects:** `Constellation` (`.qam`, `.psk`, `.pam`, custom `points`, unit-power `.shaped()`), pulses (`RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`; raw taps accepted too), and algorithm objects (validated on construction, globally unique class names). Design and apply stay separate (`RRC().taps(sps)` + `fir_filter`, `butterworth_sos` + `iir_filter`).
|
|
103
|
+
- **Randomness:** `rng: int | np.random.Generator | None` (never global RNG). Transmitted payloads and fiber PMD waveplates are drawn on host (same across devices); channel noise is drawn on the data's device via `_random`. Seeds reproduce within one version only.
|
|
104
|
+
- **Device follows data:** no `backend=` arg or global switch; foreign arrays (JAX, PyTorch) raise `TypeError`. Only factories with no input data take `device: str = "cpu"` (`generate`, `generate_phase_noise`, `Preamble`/`SingleCarrierFrame.to_signal`, `load_npz`, `decoder_exit_curve`, `demapper_exit_curve`, `error_rate_curve`), validated by `backend.require_device()`.
|
|
105
|
+
|
|
106
|
+
### Returns, naming & glossary
|
|
107
|
+
|
|
108
|
+
- **Returns:** transforms preserve type/device/rank (updating `sampling_rate` on rate change); estimators reduce time on input device (`(N,) -> 0-d`, `(C, N) -> (C,)`); metrics & analysis summaries (`evm`, `snr`, `noise_variance`, `esn0`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, `estimate_linewidth`, `allan_deviation`, `frequency_drift`) return host `float` or `np.ndarray (C,)` and raise on empty selections; sample-rate outputs stay on device. Multi-value returns are frozen dataclasses (no dicts; no >2-tuples except `backend.dispatch()`). Equalizers return `EqualizerResult`.
|
|
109
|
+
- **Estimate subclasses:** method-specific diagnostics live in subclasses with no `None` fields (named for one method like `MthPowerEstimate` or a family like `BlockPhaseEstimate`). Verbs and plots accept the base class: one `plot_<quantity>_estimate` per quantity dispatches on subclass, and estimates carry the metadata their plot needs.
|
|
110
|
+
- **Verbs:** `apply_*` (impairment/model), `estimate_<q>(x, method)` (measure -> `<Q>Estimate`), `correct_<q>(x, how)` (remove via estimate or method -> corrected data), `resolve_*` (discrete ambiguity), `generate` (synthesis), `encode`/`decode` (FEC), `plot_*` (all plots except `apply_default_theme`). Choose algorithms by object, never function-name suffix or string (no `recover_*`/`compensate_*`); `method=` strings select numerical flavors or implementation modes (`"maxlog"|"exact"`, `"fir"|"fft"`, `"blocks"|"whole_record"`). Plain nouns for computations (`allan_deviation`).
|
|
111
|
+
- **Glossary:** `num_taps`, `step_size`, `sps`, `constellation`, `pulse`, `rng`, `<part>_rng`, `num_symbols`, `num_channels` (never `streams`), `sampling_rate`, `symbol_rate`, `nfft`, `regularization`, `max_iterations`. Noise (definitions in the `commkit.metrics` docstring): `noise_var` = E|n|² per sample in the samples received, which constellation-relating consumers (`compute_llr`, `mi`/`gmi`, EXIT, MMSE `correct_channel`, linewidth) take on the constellation's scale (`metrics.noise_variance` reports it there; `apply_awgn(noise_var=)` adds it in the samples' units, a fixed floor); `snr_db` = power ratio in the samples it is about (per sample over the simulated band for `apply_awgn`, per symbol for `metrics.snr`); `esn0_db` = textbook Es/N0 per symbol, independent of dtype (real samples carry N0/2; demapping/information funcs accept `noise_var` or `esn0_db`); Eb/N0 = Es/N0 per information bit (`ErrorRateCurve.ebn0_db`); `osnr_db` = signal over ASE power in `reference_bandwidth`. A blind variant of a data-aided metric is `blind=True` with a `constellation`, never a separate name. Unit-named sizes: `num_symbols`, `num_blocks`, `info_bits`, `blocks_per_frame`, `num_variables`, `num_segments` (in `coding`, `length`/`n` = codeword bits, `k` = info bits). Scaling: `math.normalize` (explicit measured rescale, never a block flag), `correct_power` (known rate-change gain), `*_normalization` (coefficient scale); plots use `relative` and `annotations` (`gid` via `_guide`). Windows: `search_range` `(start, stop)`, `search_band` (Hz half-width). SI values have no suffix (`_s` only if paired with samples); non-SI use `_db`, `_dbm`, `_deg`, `_nm`, `_km`, `_ps_nm_km`, `_ppm`, `_db_hz` (or `normalized_*`).
|
|
112
|
+
|
|
113
|
+
### Code style & simplicity
|
|
114
|
+
|
|
115
|
+
- **No unnecessary wrappers or single-use helpers:** write direct NumPy/CuPy/SciPy code rather than wrapping trivial expressions or single call sites in pass-through functions. Extract a helper only to eliminate real duplication, enforce a shared invariant (`SignalInput`, `require_int`, `_dispersion`), or isolate a compiled kernel.
|
|
116
|
+
- **No speculative abstractions or dead shims:** never add base classes, factories, registries or flags "for future use" when one concrete path exists. Delete dead code, unused aliases and obsolete compatibility shims outright rather than commenting them out.
|
|
117
|
+
- **Flat, pure, explicit flow:** validate inputs early with guard clauses and keep nesting shallow. Never mutate caller inputs (`samples`, `Signal`, arrays); avoid mutable module globals outside explicit, thread-safe caches for compiled kernels and device tables.
|
|
118
|
+
- **Modern Python 3.12+ & comments:** use built-in generics (`list[...]`, `X | Y`), follow `ruff` (`E/F/I/UP/B/G`, 88-char lines), and comment *why* (sign conventions, numerical stability, edge cases), never *what* obvious lines do.
|
|
119
|
+
|
|
120
|
+
### Typing, docstrings, errors & logging
|
|
121
|
+
|
|
122
|
+
- **Typing:** `py.typed` package, strict `mypy` on every module (`pyproject.toml`). Annotate new code, add `if TYPE_CHECKING:` imports for PEP 562 lazy exports, and list a new Numba `_numba_*` module by name in the kernel-body exemption override (an exact name in both overrides makes mypy drop the configuration).
|
|
123
|
+
- **Docstrings:** NumPy (numpydoc) order: Parameters, Returns, Raises, Warns, See Also, Notes, References, Examples. One-line summary ending in a period (imperative for functions; noun phrase for classes/modules/noun-functions). `Parameters` on functions & configurable objects; `Attributes` (stored types) on result dataclasses. Types: `array_like` / `array_like or Signal` in; `ndarray` / `ndarray or Signal` / `numpy.ndarray` (host) out; shapes in double backticks (``(C, N)``); plots `(fig, ax) or None` / `(fig, axes) or None`; defaults `name : type, default value` or `optional` for `None`. Private module summaries end with `(private)`.
|
|
124
|
+
- **Errors:** wrong type (incl. `bool` for int, `str` for number) raises `TypeError`; wrong value raises `ValueError`, naming the argument. Validate scalars with `_array.require_int` / `require_finite`; reject empty data early.
|
|
125
|
+
- **No fallbacks for a broken environment:** never catch CuPy, CUDA compile/load/launch, or graph-capture failures to run another path; let them raise. (Dispatch on documented *input* limits is allowed.)
|
|
126
|
+
- **Logging & warnings:** `logger` for diagnostics only; wrap per-channel D2H logs in `if logger.isEnabledFor(logging.INFO):`. `DEBUG` = call trace, `INFO` = one summary per public call, `WARNING` = returned but suspect result. Value objects and pure helpers never log. `warnings.warn` is reserved for `PrecisionWarning`. Zero side effects at import time.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 5. Numerics
|
|
131
|
+
|
|
132
|
+
- **Storage defaults:** `complex64` (IQ) and `float32` (real). `generate` and frames produce them; `load_npz` preserves the saved dtype.
|
|
133
|
+
- **Precision contract:**
|
|
134
|
+
- **Transforms** preserve input precision throughout (`complex64` or `complex128`).
|
|
135
|
+
- **Fixed-precision blocks** compute in single precision: equalizers, Gardner loop (`correct_sampling_clock_offset` interpolates in input precision), `compute_llr`/`Constellation.llr`, `coding.decode`. Double input emits `PrecisionWarning` (`_array.warn_if_double`, errored in `tests/conftest.py`). Training/reference symbols are exempt.
|
|
136
|
+
- **Deliberate `float64`/`complex128`** (documented in place; never promote sample-rate data only to cast back): phases before `unwrap`, phase trajectories/ramps (wrap in float64, rotate in input precision via `math._derotate`), interpolation instants & clock strobes, frequency grids/estimates, recursion state (PLL, Tikhonov/Kalman, IIR sections/state), RLS `P`/gain/regressors, sequential LMS/CMA/RDE butterfly dot-product accumulators (tap updates and block equalizers stay complex64), metric reduction sums. `complex128` fiber propagation runs plain CuPy stages on GPU.
|
|
137
|
+
- **NEP 50 trap:** under NumPy 2, NumPy scalars (`np.float64`, `np.sqrt(...)`, `np.pi * ...`) and float64 arrays (`fftfreq`) promote `complex64` to `complex128`. Combine single-precision data only with Python scalars or cast arrays; cast frequency responses before multiplying.
|
|
138
|
+
- **Precision audit:** run `tests/plugins/precision_trace.py` after numeric changes (CPU-only and report-only: inspect every reported site; deliberate float64 sites recur in each report).
|
|
139
|
+
- **Normalization invariant:** `E[|x|²] = 1/sps` at `sps` samples/symbol; `E[|x|²] = 1` at symbol rate.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 6. Performance
|
|
144
|
+
|
|
145
|
+
| Algorithm structure | Implementation | Device |
|
|
146
|
+
| --- | --- | --- |
|
|
147
|
+
| Vectorized (filters, resampling, spectra, impairments, metrics, FD equalizers, MC sweeps) | NumPy/CuPy via `x, xp, sp = dispatch(samples)` | input (`device` for factories) |
|
|
148
|
+
| Per-symbol small-table search (LLRs, non-lattice decisions, BPS metrics) | CPU: parallel Numba / chunked NumPy; GPU: 1 thread/symbol CUDA (`llr`, `bps_min_d2`) | input |
|
|
149
|
+
| Sequential recursions (LMS/RLS/CMA/RDE, PLL, Gardner, Tikhonov, cycle slips, trellis/tree/CCDM) | Numba `@njit(cache=True, nogil=True)` + `prange`; `fastmath=True` only if Inf/NaN, unwrap, integer math and running sums stay exact | CPU (1 round trip for GPU) |
|
|
150
|
+
| Linear recursion (IIR) | CPU: strict Numba (bit-exact to SciPy in float64); GPU: block-scan `iir` (<= 16 sections; > 16 routes to CPU) | input |
|
|
151
|
+
| Arbitrary-instant interpolation | CPU: parallel Numba windowed sinc; GPU: `interpolate` kernel (shared taps across channels) | input |
|
|
152
|
+
| GF(2) algebra (`coding._gf2`) | Chunked float32 GEMM (exact for dim < 2^24) + cached device tables (`backend._device_tables`) | input |
|
|
153
|
+
| Algebraic / layered LDPC / ML decoding | CPU: parallel Numba; GPU: `algebraic_correct`, `ldpc_layered`, or GEMM + `ReductionKernel` | input |
|
|
154
|
+
| Chains between multi-core FFTs (Kerr/PMD) | NumPy on CPU (Numba competes with `scipy.fft`/BLAS; adopt only on paired A/B) | CPU / CuPy |
|
|
155
|
+
| Launch-/intermediate-bound GPU hot spots | CUDA C++ via CuPy `RawModule` (`commkit/_cuda/src`) | GPU |
|
|
156
|
+
|
|
157
|
+
- **Numba hygiene:** keep `@njit` kernels at module level in private `_numba_*.py` modules, imported lazily via one `_numba()` getter per module (`_numba().lms_loop(...)`), keeping `import commkit` Numba-free and cross-process `cache=True` working.
|
|
158
|
+
- **Host-sync hygiene:** never pull scalars (`.item()`, `float(x[c])`) in loops; reduce/gather (`xp.take_along_axis`) on device; chunk `(N, M)` over `N`; build grids/windows on device; route all FFTs through `commkit._fft` (`scipy.fft` single-precision on CPU, `cupy.fft` on GPU); pass whole records to compiled code; replay fixed-buffer GPU loops via `_cuda.graphs.GraphRunner` (warm, capture, replay; failed capture raises; reuse stream per device/thread); reduce plots on device (`TestDeviceReduction`). Audit GPU paths with `tests/plugins/transfer_trace.py` (fails on undocumented >= 512-element copies; lists scalar syncs, `.item()`/`float(x)`, for review by hand).
|
|
159
|
+
- **Kernel policy:** `.cu` kernels need a benchmark vs CuPy and CPU-reference tests (`--device=all`). `_cuda.get_kernel` returns the wrapper or raises (CuPy input only); wrappers validate dtype/contiguity/shape/size, guard empty inputs, and grid-stride `y`/`z` > 65535. Documented input limits may route to an existing general path or raise (`compute_llr` > 16 bits/sym on GPU). Use `float32` literals; enable `--use_fast_math` per kernel after accuracy checks; use CuPy `ElementwiseKernel`/`ReductionKernel` (`commkit_*`) for short fused GPU chains. Never port whole-record sequential recursions to GPU (linear IIR and per-block scans replacing per-block round trips like `cs_block`/`bps_anchor` excepted). Changed kernels must pass `scripts/sanitize.sh`.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 7. Tests
|
|
164
|
+
|
|
165
|
+
- **Fixtures & skips:** use `backend_device`, `xp`, `xpt` (`xpt.assert_allclose`, `float(...)`). GPU legs skip only when CuPy is absent and fail under `--device=gpu`; broken CuPy fails everywhere. `gpu_only`/`cpu_only`/`slow` are deselected at collection. Never call `pytest.skip` for configuration.
|
|
166
|
+
- **Layout & contracts:** mirror source (`tests/<pkg>/test_<mod>.py`, unique basenames); shared builders in `tests/common/`. Every public callable has a row in `tests/test_api_contracts.py`; generic checks run only on rows with a `call` builder (do not repeat them per module for covered rows; add `call` builders for new behavioral functions).
|
|
167
|
+
- **Oracles & mathematical rigor:** test sequential kernels against `tests/common/reference_impl.py`, CUDA kernels against CPU references, and definitions against independently derived expectations.
|
|
168
|
+
- **Algorithm tests must fail on a plausibly wrong implementation:** score against ground truth (`tests/common/scoring.py`), resolve legitimate ambiguities once over the scored interval, assert a failing baseline, derive tolerances from theory (`tests/common/theory.py`) and document derivation + measured value, use realistic channels (`make_channel_signal`), verify failure by monkeypatching wrong behavior, and mark newly exposed faults `pytest.mark.xfail(strict=True, reason=...)` (fix in a dedicated commit).
|
|
169
|
+
- **Monte Carlo, chains & warnings:** state sample bounds and check operating point (`slow` for full trials); end-to-end chains live in `tests/test_receiver_chain.py`. Any `commkit` `WARNING` log fails tests unless marked `allow_warnings` or checked via `caplog`. API changes never alter expected numerical values.
|
|
170
|
+
- **Notebooks (`examples/`):** ordered course (`NN-lowercase-words.ipynb`), committed stripped (`nbstripout`), executed by `tests/test_examples.py` (<= ~20 s CPU, `to_device(x, "cpu")` for hand-computed plot arrays, printed numbers match prose, update `examples/README.md` and neighbor links).
|
|
171
|
+
- **Coverage floors (CI):** >= 78 % package, >= 85 % Numba kernel modules (`NUMBA_DISABLE_JIT=1`).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 8. Benchmarks
|
|
176
|
+
|
|
177
|
+
`benchmarks/` tracks GPU-relevant hot paths; baselines live in `benchmarks/baselines/` (current reference: `0009` / `audit_2026_12`, RTX 4070 Ti, 7800X3D, WSL2).
|
|
178
|
+
|
|
179
|
+
- Equalizer benchmarks assert convergence (`benchutils.assert_converged`); random workloads come from `benchmarks/workloads.py` with fixed seeds.
|
|
180
|
+
- Record baselines with `benchmarks/record_baseline.py` (separate process per file, best of `--passes`). End GPU timed bodies with `sync`; session fixture warms Numba's thread pool. `benchutils.py` provides `CudaEventTimer` and `nvtx_range`.
|
|
181
|
+
- Never trust a single run: confirm deltas with an isolated re-run, a paired A/B (>= 7 alternating runs) or `CudaEventTimer`. A single `pytest benchmarks/` process slows small GPU benchmarks that follow the equalizer workloads (2-12x), so compare a recorded baseline or paired runs; on WSL2 the GPU also has stretches of consecutive calls at about twice their time. Hot-path commits quote deltas against the reference baseline (or paired A/B across versions/unbaselined benchmarks); tolerance 5 % CPU, 10 % GPU.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 9. Release
|
|
186
|
+
|
|
187
|
+
1. On `main`: `uv run pytest -rs --run-slow` passes on CPU & GPU with no unexpected skips/failures; `scripts/sanitize.sh` clean if kernels changed; `uv build` and `uv run --with twine twine check dist/*` pass.
|
|
188
|
+
2. Update `CHANGELOG.md` (`## [X.Y.Z] - YYYY-MM-DD`: breaking/migration, Added, Performance as new/old ratio, Fixed, Development, compare link) and commit.
|
|
189
|
+
3. Run `uv run bump-my-version bump {patch|minor|major}`.
|
|
190
|
+
4. `git push origin main --tags` (admins bypass PR ruleset for release commits).
|
|
191
|
+
5. `gh release create vX.Y.Z --title vX.Y.Z --notes-file notes.md` (triggers `.github/workflows/publish.yml` via PyPI Trusted Publishing).
|
|
@@ -4,6 +4,120 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.13.0] - 2026-12-06
|
|
8
|
+
|
|
9
|
+
One reference scale, the constellation's: every block that relates samples to a constellation fits that scale itself and returns its data unrescaled, and blind metrics fit instead of deciding.
|
|
10
|
+
|
|
11
|
+
### Changes that may need code updates
|
|
12
|
+
|
|
13
|
+
- **`evm(blind=True)`, and the new blind `snr` and `noise_variance`, fit the gain and the noise by maximum likelihood** (the symbols as the constellation plus Gaussian noise) instead of measuring against the nearest point. The blind EVM now matches the data-aided one wherever the symbols show the constellation (uniform QAM and PSK from about −5 dB, shaped QAM near its operating point); the nearest-point reading was 1.7 dB (QPSK) to 6.3 dB (64-QAM) too optimistic at 0 dB. Where the clusters overlap too far for any blind estimate, a WARNING reports the fit's standard error and its likelihood margin over noise alone.
|
|
14
|
+
- **No block rescales data by a measured power any more**; rescale explicitly with `math.normalize`. Removed: `decimate_to_symbol_rate(normalize=)` (it discarded the absolute scale by default and never returned the factor), `apply_taps(normalize=)` (pass `input_norm_factor=result.input_norm_factor` to apply frozen taps on the run's scale; without it the taps filter the samples as given), `correct_polarization(normalize=)` and `add_pilot_tone(renormalize=)` (use `math.normalize(x, mode="symbol_power", sps=sps, axis=-1)`). The adaptive equalizers' AGC stays, with its factor returned.
|
|
15
|
+
- **Tone polarization estimates have unit-norm phasor columns**: `PolarizationEstimate` matrices are the channel's own inverse (unitary for a lossless channel) instead of carrying the inverse tone amplitude, ×4.5 at a −10 dB pilot and ×14 at −20 dB. `correct_polarization` output is in the input's units without a rescaling, and `PolarizationEstimate.matrix` seeds a butterfly equalizer at the right scale.
|
|
16
|
+
- **BPS and the decision-directed PLL put symbols on the constellation's scale by the blind moment (M2M4) gain**, not by average power, which counted the noise as signal: BPS at 8 dB on 16-QAM now errs 7.4° RMS instead of 8.4°, and the PLL's loop gain no longer scales with the constellation's power. Their results change slightly.
|
|
17
|
+
- **`plot_constellation(overlay_ideal=True)` scales the ideal points onto the data**: by the data-aided gain when the Signal's reference pairs with the symbols, by the blind gain otherwise.
|
|
18
|
+
- **`snr`, `evm` and `noise_variance` log a WARNING when the symbols are rotated against the reference** by more than 22.5°: the rotation counts as error and caps the SNR at `-10 log10(2 - 2 cos θ)` dB.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `metrics.esn0(samples, *, signal_band=None, nperseg=1024)`: Es/N0 from the spectrum before any DSP, with the noise floor as the median outside the band (robust to spurs and tones) and the band centre searched (robust to a frequency offset).
|
|
23
|
+
- `snr`, `noise_variance` with `blind=True` and a `constellation`; `estimate_gain(blind=True, constellation=)`, the phase-insensitive moment gain.
|
|
24
|
+
- Notebook 25, *Noise, SNR and metrics in the receiver*; notebooks 25 to 30 are now 26 to 31.
|
|
25
|
+
|
|
26
|
+
### Performance
|
|
27
|
+
|
|
28
|
+
- BPS and the PLL compute the blind moment gain instead of the power normalization: 1.05 (BPS) and 1.06 (PLL) on the CPU for 2 x 20 000 symbols (in-process paired A/B, 7 rounds; the fixed cost of the second moment), 1.08 and 1.07 on the GPU (paired A/B against 3.12.0, 7 alternating rounds, fastest runs). The moments are one fused, two-stage CuPy reduction on the GPU (0.14 ms for 2 x 2^20 samples against 2.2 ms for one stage).
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- The documented `esn0_db` equivalent of `noise_var` for real symbols (`snr - 3.01` dB, not `snr`).
|
|
33
|
+
|
|
34
|
+
### Development
|
|
35
|
+
|
|
36
|
+
- AGENTS.md rules "One reference scale, the constellation's" and "No measured rescaling inside blocks", and a rewritten noise glossary (`noise_var`, `snr_db`, `esn0_db`, Eb/N0, `osnr_db`, defined per symbol, sample or bit).
|
|
37
|
+
|
|
38
|
+
## [3.12.0] - 2026-12-06
|
|
39
|
+
|
|
40
|
+
The 2026-12-05 audit: high-severity numerical fixes across coding, equalization, synchronization and mapping; a reference-aided `mi`; an optional symbol rate; scalar validation on every value object; strict typing everywhere; and sharper audits.
|
|
41
|
+
|
|
42
|
+
### Changes that may need code updates
|
|
43
|
+
|
|
44
|
+
- **`mi(symbols, reference)` is a reference-aided mismatched AIR**, `H(X) + mean log2 q(x_n | r_n)` with the transmitted symbols from the Signal or the new `reference` argument. The blind plug-in estimate is gone: it gave 3.03 bit/symbol on pure noise and 3.16 on a 90°-rotated 16-QAM. Values now fall to 0 without information, and stay below the true MI for a wrong `noise_var`.
|
|
45
|
+
- **`Signal.backend` is `Signal.device`**, lowercase (`"cpu"`, `"gpu"`), as `device=` everywhere else.
|
|
46
|
+
- **`Signal.symbol_rate` is optional** (`None` by default) for CW lasers and beat notes; `Signal.sps` is then `None`, and the functions that need a symbol rate raise naming it.
|
|
47
|
+
- **`Signal` rejects a `reference` on another device or with another channel layout** than its samples.
|
|
48
|
+
- **Cross 32-QAM and 128-QAM have new bit labels**: a quasi-Gray wing relabelling with nearest neighbours at most 2 bits apart (the old fold had 8 distance-3 and 16 distance-4 edges). Results that depend on the labels (BER, GMI, stored bits) change for these orders.
|
|
49
|
+
- **`matched_filter` aligns even-length pulses** on tap `L // 2`: the symbol instants of `Rect` at even `sps` are at `offset=0` again (it gave 0.01 to 17 dB SNR there, the clean instant being one sample later).
|
|
50
|
+
- **`Rect(rise_time > 0)` taps are symmetric** (ramps sampled at bin centres), so the filter has linear phase; the taps change.
|
|
51
|
+
- **More `TypeError` for wrong types**, and **value objects reject `bool`, strings, NaN and infinity** for numbers: the pulses, `Fiber`, `Gardner`, `SpectralPeak`, `PLL`, `ViterbiViterbi`, `Chase` (non-`bool` `soft`), `TurboIterations`, `PilotTone`, `Tikhonov` and the linewidth methods; also `Constellation.shaped(nu, entropy)`, the dispersion taps' `bandwidth`, `demapper_exit_curve(esn0_db)`, `decimate_to_symbol_rate(offset)`, and `validate_array` of `None` or non-numeric data.
|
|
52
|
+
- **`set_log_level` keeps propagation** to the root logger (so `caplog` and file handlers see commkit), and colours its output only on a terminal or in Jupyter.
|
|
53
|
+
- **`Preamble.barker` raises for `root != 1`**, which it ignored.
|
|
54
|
+
- **`plot_time_domain(max_points=None)` or `<= 0` draws every sample**; `max_points` caps all decimating plots at `max_points + 2` points.
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- `QuadraticPhaseFit(search_band=5e9)`: the data-aided search for a carrier offset before the fit; the dispersion estimate held to 12 ps/nm up to 2.5 GHz of offset, where it failed from 100 MHz.
|
|
59
|
+
- `TurboIterations(early_stop=True)`: turn the hard-decision-aided stop off. It no longer stops after the first iteration or returns stale parity LLRs.
|
|
60
|
+
- `error_rate_curve(llr_method="maxlog" | "exact")`.
|
|
61
|
+
- `SingleCarrierFrame.replace()`, `Signal.num_samples`; `SignalInput.<property>(required=False)`, `SignalInput.reference()` and `frame()` for user blocks.
|
|
62
|
+
- Real `float32` PAM frames for IM/DD.
|
|
63
|
+
- `save_npz` writes `format_version = 1`; `load_npz` reads older archives, refuses newer ones, and names a malformed archive's missing entry.
|
|
64
|
+
|
|
65
|
+
### Performance
|
|
66
|
+
|
|
67
|
+
Ratios of new to 3.11.0 time on the reference machine (RTX 4070 Ti, Ryzen 7 7800X3D), from paired runs alternating the two versions.
|
|
68
|
+
|
|
69
|
+
- The LLRs are now accurate at any `|x|` (below), at a cost. CPU: uniform QAM 1.24 (max-log) and 1.13 (exact) at 16-QAM, 0.73 and 1.08 at 64-QAM, 1.08 and 0.95 at 256-QAM; general constellations 1.28 to 1.31 (max-log), exact unchanged. GPU: general constellations 1.04 to 1.16, uniform QAM exact 1.05 to 1.09.
|
|
70
|
+
- CPU interpolation (`correct_sampling_clock_offset`, `interpolate_at`) computes each instant's taps once for all the channels that share it: 0.87 with four channels, unchanged with one, but 1.05 to 1.10 with two on this CPU (0.83 on a laptop i7-10750H); 2^20 instants, bit-identical output.
|
|
71
|
+
- Precision fixes that cost time: LDPC `SumProduct` on the CPU 1.24 (`log1p`/`expm1`, float64 check-node sums), turbo max-log on the CPU 1.12 (normalized BCJR metrics), `MengaliMorelli` blockwise 1.08 (CPU) and 1.10 (GPU), and `block_lms` with BPS 1.05 to 1.06 on the CPU and 1.12 to 1.39 on the GPU (float64 running sums of the BPS window and of the data-aided anchor).
|
|
72
|
+
- `lms` with inline BPS: 0.80 on both devices.
|
|
73
|
+
- CUDA launch wrappers are built once per specialization with per-device placeholders, and the IIR sections and transitions are cached on the device (an IIR call no longer uploads up to 260 KB; GPU IIR time within noise at the benchmark's size).
|
|
74
|
+
- The pilot-phase plots fit their line on the device and copy only the drawn points.
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- **Coding**:
|
|
79
|
+
- Layered LDPC `MinSum` clips its messages (CPU and GPU): it overflowed to NaN on `d_v >= 3` codes and reported all-zero bits as `valid=True` (7169 bit errors on `LDPCCode.pon()`); a non-finite LLR now fails the check.
|
|
80
|
+
- `SumProduct`'s `phi` uses `log1p(2 / expm1(x))` and sums in float64: `tanh` rounded to 1 from `x = 17.6` in float32.
|
|
81
|
+
- `Chase` soft output adds `±β` to the channel LLR as extrinsic information instead of replacing it (EXIT of Hamming(7,4) at `I_A = 0.8`: 0.854, was 0.098), and passes the LLR through when no test word is valid.
|
|
82
|
+
- `BCJR` normalizes the forward and backward metrics each step: generators with a zero LSB or MSB overflowed to infinity.
|
|
83
|
+
- **Equalization**:
|
|
84
|
+
- `rls(..., state=)` continuation keeps `res2.signal` aligned with its reference (its SER was 0.76 from a shift of `num_taps // 2`).
|
|
85
|
+
- `block_lms` with MIMO input and shared 1-D training symbols read past the training buffer on the GPU.
|
|
86
|
+
- `correct_channel` inverts 2x2 responses in complex128 (NaN on near-singular complex64); `estimate_channel` handles `N == 1`; `estimate_gain` keeps float64; the inline BPS anchor no longer moves during training; `block_lms` continuation keeps its data-aided history and sums phases in float64; all-zero or real inputs raise instead of giving NaN.
|
|
87
|
+
- Pilots at `sps > 1` scale the reference instead of notching the pulse.
|
|
88
|
+
- `apply_taps(samples_prefix=)` with one tap took the whole prefix and delayed the output by a sample.
|
|
89
|
+
- `ClockToneScan` derotates each block's clock phase: for `sps = 3, 2.5, 1.5, 1.25` the blocks cancelled (3400 ps/nm came out between -8780 and +39711). One scan FFT instead of two.
|
|
90
|
+
- `correct_fiber_propagation(method="blocks")` sizes its overlap guard by the largest one-sided delay, which near the zero-dispersion wavelength (β3 ≠ 0) was half too small (error 6.5e-3, now 3.3e-4).
|
|
91
|
+
- `estimate_polarization(PolarizationTones(refine_tones=True))` finds the tone in the total power over the search band before refining; under a 1-bin offset it picked noise at a Dirichlet null.
|
|
92
|
+
- **Synchronization and recovery**:
|
|
93
|
+
- `Gardner(method="power")` detects a flipped S-curve in its calibration (multi-ring QAM above a rolloff of about 0.55 locked half a symbol off), and its documentation states the operating range the right way round.
|
|
94
|
+
- `MthPower` interpolates zero-padded spectra with the generalized Candan-Jacobsen estimator (the default `nfft` broke the plain one, 30x worse than parabolic at 4x padding); the record is scaled by a power of two before `x**M`; `N == 1` raises.
|
|
95
|
+
- `resolve_channel_permutation(metric="phase_increment")` wraps the phase increments (it picked the wrong pairing near ±π).
|
|
96
|
+
- Block phase estimators and the blockwise frequency estimate centre blocks at `b·B + (B - 1)/2`: half a symbol late before.
|
|
97
|
+
- `peak_offset` falls back to the parabolic fit on non-positive neighbours (a sinc peak was pulled by over 0.3 samples) and searches the upsampled peak within `±dft_upsample`.
|
|
98
|
+
- `PilotTone`/`PilotTones`: median noise floor corrected by ln 2 (+1.59 dB bias), the window's ENBW in the noise bandwidth, a band too wide for the record raises, no overflow on noiseless input, channels aligned to the strongest before they are summed (unaligned, they could cancel).
|
|
99
|
+
- BPS uses the float64 square grid for complex128 input and chunks its metrics by `B · C`.
|
|
100
|
+
- `smooth_phase` filters a mirrored track (edge error 2.7x the interior, now 1.08x); cycle-slip sums are refreshed once per window (0.28 rad drift after 1e7 values on the CPU); `resolve_phase_ambiguity` handles real arrays; `ConstantPhase` keeps complex64.
|
|
101
|
+
- **Mapping and metrics**:
|
|
102
|
+
- LLRs are computed relative to the nearest point, `D (2(x - r) - D)` with `D = s - r` (CPU and CUDA): no NaN or zero LLRs at large `|x|` (2.5e-7 of the largest LLR at `|x| = 3000`, was 4e-4 to 7e-4), no integer wrap above 1e19.
|
|
103
|
+
- Points with `pmf == 0` are left out of the LLRs (they flipped signs at high SNR).
|
|
104
|
+
- Real symbols on a complex non-separable constellation keep the imaginary parts of the points on the CPU, as on the GPU.
|
|
105
|
+
- `awgn_gmi` and `Constellation.pam(4, unipolar=True).shaped(nu=...)` handle zero-probability points.
|
|
106
|
+
- **Core and I/O**: `Signal.clone()` keeps value objects read-only and copies only the mutable arrays; `Reference` with `info_bits is bits` and a rate-1 code survives `to()`, `head()` and `save_npz`; `SingleCarrierFrame` validates `get_structure_map(unit=)`; `SignalInput` validates scalar properties and compares `domain` case-insensitively; `str(sig)` and `frame` validation; `save_npz` checks its argument and matches `.npz` case-insensitively; value equality of `-0.0`, nested arrays and arrays on different GPUs.
|
|
107
|
+
- **Signals and analysis**: `apply_sampling_jitter` keeps the instants in float64 (small negative jitters vanished in float32); `welch_psd` promotes integer ADC codes; `allan_deviation` removes the mean first; `add_pilot_tone` scales real tones by their actual power and raises for a DC or Nyquist tone without any; the dispersion band integral uses quadrature for small `|β2 L| W²`; the linewidth methods raise on short records and zero-width bins instead of returning NaN.
|
|
108
|
+
- **CUDA**: `GraphRunner` holds every allocation made during a capture until it drops its graphs (a temporary freed to the pool during capture was overwritten by each replay); it synchronizes its stream on every exit and no longer wraps `KeyboardInterrupt`. `interpolate` checks its window without signed overflow (a NaN instant read out of bounds). `bps_min_d2` propagates NaN like the CPU and rounds with `rintf`; `bps_anchor` slides its window sum in float64 (1.8e-6 rad drift at 2^18 columns, now 1.6e-7) and checks `symmetry >= 1`. The lazy kernel and table caches are thread-safe (`functools.cache`).
|
|
109
|
+
- **Plotting**: `plot_spectrogram` crops its time axis without copying it; the timing plots use the theme's reference line.
|
|
110
|
+
|
|
111
|
+
### Development
|
|
112
|
+
|
|
113
|
+
- Strict mypy on every module, plotting included (Numba kernel bodies exempt by name); `py.typed` consumers see the lazy top-level names and typed `Signal.frame` / `Reference.code`.
|
|
114
|
+
- `coding` and the value objects no longer load `core`: `require_integer_sps` and `require_complex` moved to `_array`, `mapping` loads its `bits`/`llr` modules lazily. `tests/test_imports.py` checks the layering on the static import graph (no `coding -> core`, nothing imports `plotting`, no cycles).
|
|
115
|
+
- The trellis and turbo kernels moved to `coding/_numba_trellis.py`; `sos_loop` to `filtering/_numba_loops.py`.
|
|
116
|
+
- Simplifications: shared inline-CPR setup for `lms`/`rls`, `plot_filter_response` split into panels, `as_2d`/`restore_1d` at every SISO/MIMO promotion, dead helpers, parameters and shims removed.
|
|
117
|
+
- Contract tests: builders for 12 more data functions (helpers included in the mutation and foreign-array checks), MIMO equalizer results, value-object scalar validation (83 cases), warnings allowed per row with a reason instead of globally.
|
|
118
|
+
- `precision_trace` follows NumPy array functions and watches constructors and SciPy spectra; `transfer_trace` catches `tolist`, list uploads and copies inside library helpers, and lists scalar syncs. `TestDeviceReduction` covers every sample-rate plot.
|
|
119
|
+
- `scripts/sanitize.sh` runs from any directory, covers DBP and `math`, kills a hung target after `SANITIZE_TIMEOUT` and reports it, keeps one log per target in `SANITIZE_LOGS` and reruns chosen files with `SANITIZE_FILES`; benchmarks record into the running Python's directory and skip the Numba warm-up on smoke runs; `publish.yml` on `setup-uv@v5`; `bump-my-version` refuses a dirty tree.
|
|
120
|
+
|
|
7
121
|
## [3.11.0] - 2026-11-24
|
|
8
122
|
|
|
9
123
|
Placement by role, one plot per estimate, value equality for every result, a public data-aided gain, and the review fixes of 3.10.1 and 3.10.2.
|
|
@@ -797,7 +911,9 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
|
|
|
797
911
|
|
|
798
912
|
First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
|
|
799
913
|
|
|
800
|
-
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.
|
|
914
|
+
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.13.0...HEAD
|
|
915
|
+
[3.13.0]: https://github.com/lokgar/commkit/compare/v3.12.0...v3.13.0
|
|
916
|
+
[3.12.0]: https://github.com/lokgar/commkit/compare/v3.11.0...v3.12.0
|
|
801
917
|
[3.11.0]: https://github.com/lokgar/commkit/compare/v3.10.2...v3.11.0
|
|
802
918
|
[3.10.2]: https://github.com/lokgar/commkit/compare/v3.10.1...v3.10.2
|
|
803
919
|
[3.10.1]: https://github.com/lokgar/commkit/compare/v3.10.0...v3.10.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: commkit
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.13.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
|
|
@@ -157,7 +157,7 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
157
157
|
| [`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. |
|
|
158
158
|
| [`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`. |
|
|
159
159
|
| [`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), the data-aided gain (`estimate_gain` / `correct_gain`); pilot-aided CMA and RDE from a frame's pilots (`EqualizerPilots`); polarization demultiplexing on pilot tones (`estimate_polarization(x, PolarizationTones(...))` / `correct_polarization`); chromatic-dispersion estimation (blind scans, data-aided fit) and compensation, digital backpropagation (`correct_fiber_propagation`); blind IQ-imbalance estimate and correction (inverse, Löwdin, Gram-Schmidt). |
|
|
160
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/
|
|
160
|
+
| [`commkit.metrics`](https://github.com/lokgar/commkit/tree/main/commkit/metrics) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; blind estimates (`blind=True`) and the spectral Es/N0 (`esn0`); the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
161
161
|
| [`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. |
|
|
162
162
|
| [`commkit.math`](https://github.com/lokgar/commkit/blob/main/commkit/math.py) | `rms`, `normalize`, dB conversions. |
|
|
163
163
|
| [`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`. |
|
|
@@ -193,13 +193,14 @@ With [`uv`](https://github.com/astral-sh/uv), use `uv pip install` in place of `
|
|
|
193
193
|
|
|
194
194
|
## Examples
|
|
195
195
|
|
|
196
|
-
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in
|
|
196
|
+
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in 32 Jupyter notebooks, one topic each, in teaching order (install the `notebook` extra and run `jupyter lab examples`):
|
|
197
197
|
|
|
198
198
|
- **00-05, signals and DSP**: the `Signal`, constellations and bit mapping, spectra, filters, pulse shaping and matched filtering, resampling;
|
|
199
199
|
- **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;
|
|
200
200
|
- **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;
|
|
201
201
|
- **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;
|
|
202
|
-
- **25
|
|
202
|
+
- **25, measuring performance**: noise, SNR and the metrics in a receiver (the data-aided model, rotations, the spectral Es/N0, blind estimates, keeping the absolute scale);
|
|
203
|
+
- **26-31, characterization**: carrier phase and laser linewidth measurements, with templates for real captures.
|
|
203
204
|
|
|
204
205
|
[`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.
|
|
205
206
|
|
|
@@ -121,7 +121,7 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
121
121
|
| [`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. |
|
|
122
122
|
| [`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`. |
|
|
123
123
|
| [`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), the data-aided gain (`estimate_gain` / `correct_gain`); pilot-aided CMA and RDE from a frame's pilots (`EqualizerPilots`); polarization demultiplexing on pilot tones (`estimate_polarization(x, PolarizationTones(...))` / `correct_polarization`); chromatic-dispersion estimation (blind scans, data-aided fit) and compensation, digital backpropagation (`correct_fiber_propagation`); blind IQ-imbalance estimate and correction (inverse, Löwdin, Gram-Schmidt). |
|
|
124
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/
|
|
124
|
+
| [`commkit.metrics`](https://github.com/lokgar/commkit/tree/main/commkit/metrics) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; blind estimates (`blind=True`) and the spectral Es/N0 (`esn0`); the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
125
125
|
| [`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. |
|
|
126
126
|
| [`commkit.math`](https://github.com/lokgar/commkit/blob/main/commkit/math.py) | `rms`, `normalize`, dB conversions. |
|
|
127
127
|
| [`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`. |
|
|
@@ -157,13 +157,14 @@ With [`uv`](https://github.com/astral-sh/uv), use `uv pip install` in place of `
|
|
|
157
157
|
|
|
158
158
|
## Examples
|
|
159
159
|
|
|
160
|
-
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in
|
|
160
|
+
[`examples/`](https://github.com/lokgar/commkit/tree/main/examples) is a course in 32 Jupyter notebooks, one topic each, in teaching order (install the `notebook` extra and run `jupyter lab examples`):
|
|
161
161
|
|
|
162
162
|
- **00-05, signals and DSP**: the `Signal`, constellations and bit mapping, spectra, filters, pulse shaping and matched filtering, resampling;
|
|
163
163
|
- **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;
|
|
164
164
|
- **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;
|
|
165
165
|
- **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;
|
|
166
|
-
- **25
|
|
166
|
+
- **25, measuring performance**: noise, SNR and the metrics in a receiver (the data-aided model, rotations, the spectral Es/N0, blind estimates, keeping the absolute scale);
|
|
167
|
+
- **26-31, characterization**: carrier phase and laser linewidth measurements, with templates for real captures.
|
|
167
168
|
|
|
168
169
|
[`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.
|
|
169
170
|
|