commkit 3.10.2__tar.gz → 3.12.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.10.2 → commkit-3.12.0}/.github/workflows/ci.yml +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/.github/workflows/publish.yml +1 -1
- commkit-3.12.0/AGENTS.md +189 -0
- {commkit-3.10.2 → commkit-3.12.0}/CHANGELOG.md +145 -1
- {commkit-3.10.2 → commkit-3.12.0}/PKG-INFO +5 -5
- {commkit-3.10.2 → commkit-3.12.0}/README.md +4 -4
- commkit-3.12.0/benchmarks/baselines/Linux-CPython-3.14-64bit/0009_audit_2026_12.json +6920 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_fiber.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_filters.py +2 -1
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_sync_misc.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/conftest.py +16 -9
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/record_baseline.py +6 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/__init__.py +22 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_array.py +97 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_constants.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/__init__.py +18 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/bps.py +15 -8
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/coding.py +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/compiler.py +21 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/filters.py +17 -20
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/graphs.py +45 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/llr.py +6 -4
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/selftest.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/bps_anchor.cu +15 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/bps_min_d2.cu +13 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/interpolate.cu +4 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/ldpc.cu +26 -12
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/llr.cu +89 -37
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_dispersion.py +13 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_fiber.py +79 -86
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_interpolation.py +8 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_numba_frequency.py +1 -1
- commkit-3.12.0/commkit/_numba_interpolation.py +173 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_peaks.py +18 -7
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_sequences.py +3 -2
- commkit-3.12.0/commkit/_value.py +132 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/_common.py +23 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/allan.py +32 -25
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/drift.py +22 -17
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/fm_noise.py +2 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/interferometry.py +3 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/linewidth/__init__.py +3 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/linewidth/dsh.py +36 -26
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/linewidth/phase.py +22 -19
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/linewidth/result.py +9 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/trajectory.py +11 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/backend.py +13 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/_numba_loops.py +28 -460
- commkit-3.12.0/commkit/coding/_numba_trellis.py +486 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/algebraic.py +10 -21
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/base.py +9 -42
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/convolutional.py +10 -13
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/crc.py +4 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/exit.py +16 -38
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/interleaving.py +3 -5
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/ldpc.py +7 -18
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/linear.py +33 -37
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/performance.py +25 -17
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/polar.py +6 -11
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/product.py +5 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/ratematch.py +2 -5
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/shaping.py +4 -12
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/turbo.py +18 -12
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/__init__.py +4 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/_signal_input.py +112 -37
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/frame.py +114 -29
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/generation.py +23 -19
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/preamble.py +15 -21
- {commkit-3.10.2 → commkit-3.12.0}/commkit/core/signal.py +108 -56
- commkit-3.12.0/commkit/equalization/__init__.py +119 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_block/_blind.py +17 -19
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_block/_dd.py +97 -52
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_block/_engine.py +46 -47
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_common.py +28 -33
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_numba_loops.py +10 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_sequential/_blind.py +8 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_sequential/_dd.py +98 -82
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_sequential/_setup.py +1 -3
- {commkit-3.10.2/commkit/filtering → commkit-3.12.0/commkit/equalization}/fiber/__init__.py +2 -2
- {commkit-3.10.2/commkit/filtering → commkit-3.12.0/commkit/equalization}/fiber/compensation.py +24 -29
- {commkit-3.10.2/commkit/filtering → commkit-3.12.0/commkit/equalization}/fiber/estimation.py +100 -37
- commkit-3.12.0/commkit/equalization/iq.py +316 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/linear.py +194 -32
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/pilots.py +2 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/polarization.py +27 -49
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/result.py +12 -7
- {commkit-3.10.2 → commkit-3.12.0}/commkit/filtering/__init__.py +5 -35
- commkit-3.12.0/commkit/filtering/_numba_loops.py +35 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/filtering/linear.py +59 -68
- {commkit-3.10.2 → commkit-3.12.0}/commkit/filtering/pulses.py +16 -24
- {commkit-3.10.2 → commkit-3.12.0}/commkit/filtering/response.py +8 -13
- {commkit-3.10.2 → commkit-3.12.0}/commkit/frequency.py +106 -52
- {commkit-3.10.2 → commkit-3.12.0}/commkit/impairments/__init__.py +7 -13
- {commkit-3.10.2 → commkit-3.12.0}/commkit/impairments/fiber_channel.py +11 -13
- {commkit-3.10.2 → commkit-3.12.0}/commkit/impairments/frontend.py +27 -331
- {commkit-3.10.2 → commkit-3.12.0}/commkit/impairments/noise.py +24 -49
- {commkit-3.10.2 → commkit-3.12.0}/commkit/impairments/source.py +5 -11
- {commkit-3.10.2 → commkit-3.12.0}/commkit/io.py +85 -63
- {commkit-3.10.2 → commkit-3.12.0}/commkit/logger.py +26 -16
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/__init__.py +27 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/_demap.py +25 -33
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/_numba_llr.py +95 -33
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/constellation.py +32 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/gray.py +42 -72
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/shaping.py +4 -4
- {commkit-3.10.2 → commkit-3.12.0}/commkit/math.py +60 -44
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/__init__.py +8 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/_common.py +6 -42
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/awgn.py +27 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/error_rates.py +2 -5
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/information.py +58 -33
- {commkit-3.10.2 → commkit-3.12.0}/commkit/metrics/quality.py +66 -41
- {commkit-3.10.2 → commkit-3.12.0}/commkit/multirate.py +9 -22
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/__init__.py +10 -26
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/analysis.py +156 -76
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/coding.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/constellation.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/equalizer.py +7 -6
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/filter_response.py +168 -103
- commkit-3.12.0/commkit/plotting/frequency.py +398 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/recovery.py +264 -193
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/spectral.py +52 -18
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/theme.py +58 -41
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/timing.py +14 -14
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/waveform.py +5 -35
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/__init__.py +0 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/_common.py +5 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/_numba_loops.py +23 -2
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/bps.py +18 -14
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/carrier_phase.py +1 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/corrections.py +83 -90
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/estimates.py +9 -1
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/pilots.py +55 -30
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/pll.py +11 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/tikhonov.py +6 -10
- {commkit-3.10.2 → commkit-3.12.0}/commkit/recovery/viterbi_viterbi.py +3 -3
- {commkit-3.10.2 → commkit-3.12.0}/commkit/smoothing.py +2 -8
- {commkit-3.10.2 → commkit-3.12.0}/commkit/spectral.py +47 -22
- {commkit-3.10.2 → commkit-3.12.0}/commkit/timing/_numba_loops.py +34 -15
- {commkit-3.10.2 → commkit-3.12.0}/commkit/timing/clock_recovery.py +53 -23
- {commkit-3.10.2 → commkit-3.12.0}/commkit/timing/synchronization.py +67 -90
- {commkit-3.10.2 → commkit-3.12.0}/examples/00-getting-started.ipynb +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/examples/10-front-end-impairments.ipynb +5 -5
- {commkit-3.10.2 → commkit-3.12.0}/examples/11-frame-synchronization-and-timing.ipynb +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/examples/12-sampling-clock-recovery.ipynb +13 -9
- {commkit-3.10.2 → commkit-3.12.0}/examples/13-frequency-offset-estimation.ipynb +9 -11
- {commkit-3.10.2 → commkit-3.12.0}/examples/15-pilot-aided-carrier-recovery.ipynb +2 -5
- {commkit-3.10.2 → commkit-3.12.0}/examples/20-chromatic-dispersion.ipynb +14 -12
- {commkit-3.10.2 → commkit-3.12.0}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/examples/24-coherent-transceiver-end-to-end.ipynb +6 -5
- {commkit-3.10.2 → commkit-3.12.0}/examples/25-carrier-phase-characterization.ipynb +2 -3
- {commkit-3.10.2 → commkit-3.12.0}/examples/26-laser-linewidth-self-heterodyne.ipynb +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/examples/27-laser-linewidth-short-delay-and-flicker.ipynb +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/examples/28-laser-linewidth-self-homodyne-iq.ipynb +4 -9
- {commkit-3.10.2 → commkit-3.12.0}/examples/29-measurement-template-self-heterodyne.ipynb +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/examples/30-measurement-template-self-homodyne-iq.ipynb +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/pyproject.toml +11 -29
- {commkit-3.10.2 → commkit-3.12.0}/scripts/sanitize.sh +62 -11
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_allan.py +30 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_drift.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_linewidth.py +53 -8
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_trajectory.py +3 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_algebraic.py +0 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_coding_base.py +10 -10
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_convolutional.py +34 -4
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_ldpc.py +53 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_ldpc_kernel.py +18 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_performance.py +25 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_product.py +48 -10
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_turbo.py +16 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/__init__.py +0 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/kernel_utils.py +0 -12
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/reference_impl.py +3 -2
- commkit-3.12.0/tests/common/transfers.py +186 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_frame.py +58 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_generation.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_preamble.py +10 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_psqam.py +12 -4
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_signal.py +103 -8
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_signal_input.py +54 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_blind.py +6 -5
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_block.py +32 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_bps_kernel.py +57 -11
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_cs_kernel.py +0 -4
- commkit-3.12.0/tests/equalization/test_fiber_compensation.py +604 -0
- commkit-3.12.0/tests/equalization/test_fiber_estimation.py +283 -0
- commkit-3.12.0/tests/equalization/test_iq.py +250 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_linear.py +154 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_polarization.py +25 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_state.py +50 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/impairments/test_fiber_channel_linear.py +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/impairments/test_frontend.py +3 -206
- {commkit-3.10.2 → commkit-3.12.0}/tests/impairments/test_noise.py +9 -4
- {commkit-3.10.2 → commkit-3.12.0}/tests/mapping/test_constellation.py +14 -3
- {commkit-3.10.2 → commkit-3.12.0}/tests/mapping/test_gray.py +15 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/mapping/test_llr.py +168 -15
- {commkit-3.10.2 → commkit-3.12.0}/tests/metrics/test_awgn.py +20 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/metrics/test_common.py +4 -3
- {commkit-3.10.2 → commkit-3.12.0}/tests/metrics/test_error_rates.py +7 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/metrics/test_information.py +49 -20
- {commkit-3.10.2 → commkit-3.12.0}/tests/metrics/test_quality.py +32 -21
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_analysis.py +21 -27
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_filter_response.py +2 -2
- commkit-3.12.0/tests/plotting/test_plot_frequency.py +153 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_recovery.py +47 -44
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_spectral.py +52 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_theme.py +145 -74
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_timing.py +5 -5
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_waveform.py +29 -10
- {commkit-3.10.2 → commkit-3.12.0}/tests/plugins/precision_trace.py +62 -28
- {commkit-3.10.2 → commkit-3.12.0}/tests/plugins/transfer_trace.py +54 -109
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_bps.py +15 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_corrections.py +81 -3
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_pilots.py +73 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_viterbi_viterbi.py +22 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_api_contracts.py +234 -74
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_array.py +46 -3
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_cuda_infra.py +76 -5
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_dispersion.py +21 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_fiber.py +2 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_filter_response.py +3 -2
- commkit-3.12.0/tests/test_filtering.py +626 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_frequency.py +51 -3
- commkit-3.12.0/tests/test_imports.py +142 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_interpolation.py +11 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_io.py +55 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_logger.py +21 -3
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_multirate.py +6 -2
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_pulse_shaping.py +9 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_receiver_chain.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_spectral.py +54 -3
- commkit-3.12.0/tests/test_value.py +80 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_working_memory.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/tests/timing/test_clock_recovery.py +24 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/timing/test_synchronization.py +1 -1
- {commkit-3.10.2 → commkit-3.12.0}/uv.lock +1 -1
- commkit-3.10.2/AGENTS.md +0 -297
- commkit-3.10.2/commkit/_numba_interpolation.py +0 -95
- commkit-3.10.2/commkit/equalization/__init__.py +0 -58
- commkit-3.10.2/commkit/plotting/frequency.py +0 -384
- commkit-3.10.2/tests/plotting/test_plot_frequency.py +0 -115
- commkit-3.10.2/tests/test_filtering.py +0 -1363
- {commkit-3.10.2 → commkit-3.12.0}/.gitattributes +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/.github/icon.svg +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/.github/logo.svg +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/.gitignore +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/.python-version +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/LICENSE +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_block_blind.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_block_lms.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_bps.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_coding.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_equalizers.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_gardner.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_import.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_llr.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_mapping.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/bench_signal_pipeline.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/benchutils.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/benchmarks/workloads.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_bits.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_circular.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/algebraic.cu +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/cs_block.cu +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/iir.cu +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_cuda/src/selftest.cu +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_fft.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_overlap_save.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/_random.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/analysis/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/_galois.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/_gf2.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/coding/_ldpc_tables.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_block/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/equalization/_sequential/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/_lattice.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/bits.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/mapping/llr.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/plotting/eye.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/py.typed +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/commkit/timing/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/02-spectral-analysis.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/03-digital-filters.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/04-pulse-shaping-and-matched-filtering.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/05-multirate-and-resampling.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/06-awgn-and-performance-metrics.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/07-channel-coding.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/09-laser-phase-noise.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/14-blind-carrier-phase-recovery.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/16-linear-channel-equalization.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/17-adaptive-equalization.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/18-blind-equalization.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/19-polarization-multiplexing.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/22-direct-and-self-coherent-detection.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/23-fec-in-optical-standards.ipynb +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/examples/README.md +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_fm_noise.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/analysis/test_interferometry.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_crc.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_exit.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_gf2.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_interleaving.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_ldpc_exit.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_ldpc_tables.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_linear_codes.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_polar.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_ratematch.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/coding/test_shaping.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/coding.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/conversions.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/memory.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/metrics.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/periodic.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/scoring.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/signals.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/theory.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/common/user_block.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/conftest.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/core/test_signal_mimo.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_cold_start.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_cpr.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_equalizer_oracles.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_mimo.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_result.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_sequential.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/equalization/test_winit.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/impairments/test_source.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/mapping/test_bits.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/mapping/test_lattice.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_coding.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_constellation.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_equalizer.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plotting/test_plot_eye.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/plugins/__init__.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_carrier_phase.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_joint.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_pll.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_recovery_oracles.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/recovery/test_tikhonov.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_backend.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_bit_packing.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_examples.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_import_hygiene.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_math.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_peaks.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_signal_pipeline.py +0 -0
- {commkit-3.10.2 → commkit-3.12.0}/tests/test_smoothing.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.12.0/AGENTS.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
|
|
93
|
+
### Signatures, Signal awareness & objects
|
|
94
|
+
|
|
95
|
+
- `f(data, other_data, *, params)`: keyword-only after data arguments (no-data functions may keep one primary positional arg, e.g. `barker_sequence(13)`).
|
|
96
|
+
- **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.
|
|
97
|
+
- **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()`.
|
|
98
|
+
- **Shapes:** SISO `(N,)`, MIMO `(C, N)`. Use `_array.as_2d`, `restore_1d`, `broadcast_channels`, `require_channels`.
|
|
99
|
+
- **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).
|
|
100
|
+
- **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`).
|
|
101
|
+
- **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.
|
|
102
|
+
- **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()`.
|
|
103
|
+
|
|
104
|
+
### Returns, naming & glossary
|
|
105
|
+
|
|
106
|
+
- **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`, `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`.
|
|
107
|
+
- **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.
|
|
108
|
+
- **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`).
|
|
109
|
+
- **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: `noise_var` = E|n|² in received samples (unit-power reference scale), `snr_db` = sample power ratio, `esn0_db` = textbook Es/N0 independent of dtype (real samples carry N0/2; demapping/information funcs accept `noise_var` or `esn0_db`). 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: `normalize` (measure & rescale), `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_*`).
|
|
110
|
+
|
|
111
|
+
### Code style & simplicity
|
|
112
|
+
|
|
113
|
+
- **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.
|
|
114
|
+
- **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.
|
|
115
|
+
- **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.
|
|
116
|
+
- **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.
|
|
117
|
+
|
|
118
|
+
### Typing, docstrings, errors & logging
|
|
119
|
+
|
|
120
|
+
- **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).
|
|
121
|
+
- **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)`.
|
|
122
|
+
- **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.
|
|
123
|
+
- **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.)
|
|
124
|
+
- **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.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 5. Numerics
|
|
129
|
+
|
|
130
|
+
- **Storage defaults:** `complex64` (IQ) and `float32` (real). `generate` and frames produce them; `load_npz` preserves the saved dtype.
|
|
131
|
+
- **Precision contract:**
|
|
132
|
+
- **Transforms** preserve input precision throughout (`complex64` or `complex128`).
|
|
133
|
+
- **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.
|
|
134
|
+
- **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.
|
|
135
|
+
- **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.
|
|
136
|
+
- **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).
|
|
137
|
+
- **Normalization invariant:** `E[|x|²] = 1/sps` at `sps` samples/symbol; `E[|x|²] = 1` at symbol rate.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 6. Performance
|
|
142
|
+
|
|
143
|
+
| Algorithm structure | Implementation | Device |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| Vectorized (filters, resampling, spectra, impairments, metrics, FD equalizers, MC sweeps) | NumPy/CuPy via `x, xp, sp = dispatch(samples)` | input (`device` for factories) |
|
|
146
|
+
| 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 |
|
|
147
|
+
| 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) |
|
|
148
|
+
| Linear recursion (IIR) | CPU: strict Numba (bit-exact to SciPy in float64); GPU: block-scan `iir` (<= 16 sections; > 16 routes to CPU) | input |
|
|
149
|
+
| Arbitrary-instant interpolation | CPU: parallel Numba windowed sinc; GPU: `interpolate` kernel (shared taps across channels) | input |
|
|
150
|
+
| GF(2) algebra (`coding._gf2`) | Chunked float32 GEMM (exact for dim < 2^24) + cached device tables (`backend._device_tables`) | input |
|
|
151
|
+
| Algebraic / layered LDPC / ML decoding | CPU: parallel Numba; GPU: `algebraic_correct`, `ldpc_layered`, or GEMM + `ReductionKernel` | input |
|
|
152
|
+
| Chains between multi-core FFTs (Kerr/PMD) | NumPy on CPU (Numba competes with `scipy.fft`/BLAS; adopt only on paired A/B) | CPU / CuPy |
|
|
153
|
+
| Launch-/intermediate-bound GPU hot spots | CUDA C++ via CuPy `RawModule` (`commkit/_cuda/src`) | GPU |
|
|
154
|
+
|
|
155
|
+
- **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.
|
|
156
|
+
- **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).
|
|
157
|
+
- **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`.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 7. Tests
|
|
162
|
+
|
|
163
|
+
- **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.
|
|
164
|
+
- **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).
|
|
165
|
+
- **Oracles & mathematical rigor:** test sequential kernels against `tests/common/reference_impl.py`, CUDA kernels against CPU references, and definitions against independently derived expectations.
|
|
166
|
+
- **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).
|
|
167
|
+
- **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.
|
|
168
|
+
- **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).
|
|
169
|
+
- **Coverage floors (CI):** >= 78 % package, >= 85 % Numba kernel modules (`NUMBA_DISABLE_JIT=1`).
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 8. Benchmarks
|
|
174
|
+
|
|
175
|
+
`benchmarks/` tracks GPU-relevant hot paths; baselines live in `benchmarks/baselines/` (current reference: `0009` / `audit_2026_12`, RTX 4070 Ti, 7800X3D, WSL2).
|
|
176
|
+
|
|
177
|
+
- Equalizer benchmarks assert convergence (`benchutils.assert_converged`); random workloads come from `benchmarks/workloads.py` with fixed seeds.
|
|
178
|
+
- 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`.
|
|
179
|
+
- 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.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 9. Release
|
|
184
|
+
|
|
185
|
+
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.
|
|
186
|
+
2. Update `CHANGELOG.md` (`## [X.Y.Z] - YYYY-MM-DD`: breaking/migration, Added, Performance as new/old ratio, Fixed, Development, compare link) and commit.
|
|
187
|
+
3. Run `uv run bump-my-version bump {patch|minor|major}`.
|
|
188
|
+
4. `git push origin main --tags` (admins bypass PR ruleset for release commits).
|
|
189
|
+
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,10 +4,152 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.12.0] - 2026-12-06
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
### Changes that may need code updates
|
|
12
|
+
|
|
13
|
+
- **`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`.
|
|
14
|
+
- **`Signal.backend` is `Signal.device`**, lowercase (`"cpu"`, `"gpu"`), as `device=` everywhere else.
|
|
15
|
+
- **`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.
|
|
16
|
+
- **`Signal` rejects a `reference` on another device or with another channel layout** than its samples.
|
|
17
|
+
- **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.
|
|
18
|
+
- **`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).
|
|
19
|
+
- **`Rect(rise_time > 0)` taps are symmetric** (ramps sampled at bin centres), so the filter has linear phase; the taps change.
|
|
20
|
+
- **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.
|
|
21
|
+
- **`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.
|
|
22
|
+
- **`Preamble.barker` raises for `root != 1`**, which it ignored.
|
|
23
|
+
- **`plot_time_domain(max_points=None)` or `<= 0` draws every sample**; `max_points` caps all decimating plots at `max_points + 2` points.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- `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.
|
|
28
|
+
- `TurboIterations(early_stop=True)`: turn the hard-decision-aided stop off. It no longer stops after the first iteration or returns stale parity LLRs.
|
|
29
|
+
- `error_rate_curve(llr_method="maxlog" | "exact")`.
|
|
30
|
+
- `SingleCarrierFrame.replace()`, `Signal.num_samples`; `SignalInput.<property>(required=False)`, `SignalInput.reference()` and `frame()` for user blocks.
|
|
31
|
+
- Real `float32` PAM frames for IM/DD.
|
|
32
|
+
- `save_npz` writes `format_version = 1`; `load_npz` reads older archives, refuses newer ones, and names a malformed archive's missing entry.
|
|
33
|
+
|
|
34
|
+
### Performance
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
- 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.
|
|
39
|
+
- 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.
|
|
40
|
+
- 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).
|
|
41
|
+
- `lms` with inline BPS: 0.80 on both devices.
|
|
42
|
+
- 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).
|
|
43
|
+
- The pilot-phase plots fit their line on the device and copy only the drawn points.
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- **Coding**:
|
|
48
|
+
- 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.
|
|
49
|
+
- `SumProduct`'s `phi` uses `log1p(2 / expm1(x))` and sums in float64: `tanh` rounded to 1 from `x = 17.6` in float32.
|
|
50
|
+
- `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.
|
|
51
|
+
- `BCJR` normalizes the forward and backward metrics each step: generators with a zero LSB or MSB overflowed to infinity.
|
|
52
|
+
- **Equalization**:
|
|
53
|
+
- `rls(..., state=)` continuation keeps `res2.signal` aligned with its reference (its SER was 0.76 from a shift of `num_taps // 2`).
|
|
54
|
+
- `block_lms` with MIMO input and shared 1-D training symbols read past the training buffer on the GPU.
|
|
55
|
+
- `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.
|
|
56
|
+
- Pilots at `sps > 1` scale the reference instead of notching the pulse.
|
|
57
|
+
- `apply_taps(samples_prefix=)` with one tap took the whole prefix and delayed the output by a sample.
|
|
58
|
+
- `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.
|
|
59
|
+
- `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).
|
|
60
|
+
- `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.
|
|
61
|
+
- **Synchronization and recovery**:
|
|
62
|
+
- `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.
|
|
63
|
+
- `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.
|
|
64
|
+
- `resolve_channel_permutation(metric="phase_increment")` wraps the phase increments (it picked the wrong pairing near ±π).
|
|
65
|
+
- Block phase estimators and the blockwise frequency estimate centre blocks at `b·B + (B - 1)/2`: half a symbol late before.
|
|
66
|
+
- `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`.
|
|
67
|
+
- `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).
|
|
68
|
+
- BPS uses the float64 square grid for complex128 input and chunks its metrics by `B · C`.
|
|
69
|
+
- `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.
|
|
70
|
+
- **Mapping and metrics**:
|
|
71
|
+
- 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.
|
|
72
|
+
- Points with `pmf == 0` are left out of the LLRs (they flipped signs at high SNR).
|
|
73
|
+
- Real symbols on a complex non-separable constellation keep the imaginary parts of the points on the CPU, as on the GPU.
|
|
74
|
+
- `awgn_gmi` and `Constellation.pam(4, unipolar=True).shaped(nu=...)` handle zero-probability points.
|
|
75
|
+
- **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.
|
|
76
|
+
- **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.
|
|
77
|
+
- **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`).
|
|
78
|
+
- **Plotting**: `plot_spectrogram` crops its time axis without copying it; the timing plots use the theme's reference line.
|
|
79
|
+
|
|
80
|
+
### Development
|
|
81
|
+
|
|
82
|
+
- 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`.
|
|
83
|
+
- `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).
|
|
84
|
+
- The trellis and turbo kernels moved to `coding/_numba_trellis.py`; `sos_loop` to `filtering/_numba_loops.py`.
|
|
85
|
+
- 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.
|
|
86
|
+
- 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.
|
|
87
|
+
- `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.
|
|
88
|
+
- `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.
|
|
89
|
+
|
|
90
|
+
## [3.11.0] - 2026-11-24
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
|
|
94
|
+
### Changes that may need code updates
|
|
95
|
+
|
|
96
|
+
- **Estimation and correction live with their quantity.** `impairments` now holds forward models only and `filtering` generic filters; the compensations moved to `commkit.equalization`, the inverses of channel and front-end responses. Change the import; the old names are gone.
|
|
97
|
+
- From `commkit.filtering`: `estimate_chromatic_dispersion`, `correct_chromatic_dispersion`, `dispersion_compensation_taps`, `correct_fiber_propagation`, `ClockToneScan`, `FourthMomentScan`, `QuadraticPhaseFit`, `ChromaticDispersionEstimate`, `DispersionScanEstimate`, `QuadraticPhaseFitEstimate`.
|
|
98
|
+
- From `commkit.impairments`: `estimate_iq_imbalance`, `correct_iq_imbalance`, `Lowdin`, `GramSchmidt`, `IQImbalanceEstimate`.
|
|
99
|
+
- **One plot per estimated quantity**, drawing the diagnostics of the estimate's class. The estimate carries the sampling rate, record length and method its axes need, so these arguments are gone:
|
|
100
|
+
|
|
101
|
+
| Before | Now |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `plot_pilot_phase_estimate(est, sampling_rate=)` (PilotInterpolation) | `plot_carrier_phase_estimate(est)` |
|
|
104
|
+
| `plot_pilot_tone_phase_estimate(est, x, method=, sampling_rate=)` | `plot_carrier_phase_estimate(est, x)` |
|
|
105
|
+
| `plot_pilot_tones_phase_estimate(est)` | `plot_carrier_phase_estimate(est)` |
|
|
106
|
+
| `plot_carrier_phase_trajectory(est)` with an estimate | `plot_carrier_phase_estimate(est)`; the trajectory plot takes arrays |
|
|
107
|
+
| `plot_frequency_offset_spectrum(est, search_range=)` | `plot_frequency_offset_estimate(est)` |
|
|
108
|
+
| `plot_mm_autocorrelation(est, sampling_rate=)` | `plot_frequency_offset_estimate(est)` |
|
|
109
|
+
| `plot_frequency_offset_blockwise_result(est, num_samples=, sampling_rate=)` | `plot_frequency_offset_estimate(est)` |
|
|
110
|
+
| `plot_pilot_phase_estimate(est, sampling_rate=)` (PilotSlope) | `plot_frequency_offset_estimate(est)` |
|
|
111
|
+
| `plot_frequency_noise_psd`, `plot_increment_variance`, `plot_dsh_beat_psd` | `plot_linewidth_estimate(est)` |
|
|
112
|
+
| `plot_timing_correlation(est)` | `plot_timing_estimate(est)` |
|
|
113
|
+
| `plot_frequency_drift(drift, sampling_rate=)` | `plot_frequency_drift(drift)` |
|
|
114
|
+
|
|
115
|
+
- **New fields on estimates.** `FrequencyOffsetEstimate` and its subclasses hold `sampling_rate`, `BlockwiseFrequencyEstimate` also `num_samples`, `PilotToneEstimate` and `PilotTonesEstimate` `method` and `sampling_rate`, `FrequencyDrift` `sampling_rate`. Code building them by hand passes these.
|
|
116
|
+
- **Results compare by value.** `Signal`, `Reference` and every estimate and result compare field by field (arrays by value, NaN equal to NaN, arrays on different devices unequal) and are unhashable; 3.10.2 compared them by identity. Algorithm objects with arrays (`PilotSlope`, `PilotInterpolation`, `ConstantPhase`, `IncrementSubtract`, `QuadraticPhaseFit`, `EqualizerPilots`) and `FrameStructure` now compare and hash by value instead of identity.
|
|
117
|
+
- **`TypeError` for a wrong type.** An integer argument given a float (`2.0` included) or a `bool`, or a number given a string, raises `TypeError` instead of `ValueError`, across the library. `upsample` and the other rate changers no longer accept an integral float factor. The rest of the scalar checks (block sizes, test phases, `nfft`, bandwidths, responsivities, `noise_var`, ...) follow the same rule, and a non-string `device` or `set_log_level` level raises `TypeError` too.
|
|
118
|
+
- **`plot_spectrogram` averages long spectrograms** in groups of segments on the device, to at most `max_rows=1000` rows (in power; every k-th row for the phase modes). Pass `max_rows=0` to draw every segment.
|
|
119
|
+
|
|
120
|
+
### Added
|
|
121
|
+
|
|
122
|
+
- `commkit.equalization.estimate_gain`, `correct_gain` and `GainEstimate`: the data-aided amplitude gain the metrics divide by, which puts symbols on the reference's scale before `compute_llr`. On 16-QAM at Es/N0 = 0 dB, LLRs of power-normalized symbols with `noise_variance` reach a GMI of 0.764 bit; after `correct_gain`, 0.866 bit, within 6e-4 bit of LLRs with the true gain and noise variance.
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- `evm`, `snr` and `noise_variance` measure the error relative to the reference's power whatever the scale of either input; the 1e-3 tolerance around unit reference power, and the normalization behind it, are gone.
|
|
127
|
+
- `carrier_phase_trajectory(channel_pairing="swap")` raises for a single channel instead of acting as `"identity"`.
|
|
128
|
+
- `allan_deviation` raises when none of `taus` fits the record instead of returning an empty result; its documentation no longer promises NaN for averaging times that do not fit (they are left out).
|
|
129
|
+
- `spectrogram` names `samples` when they are empty, instead of SciPy's message.
|
|
130
|
+
- `plot_frequency_offset_estimate` draws every channel of a blockwise estimate, on a time axis in seconds; it drew the first channel only, against the sample index.
|
|
131
|
+
- `cross_correlate` checks `mode` before computing the correlation.
|
|
132
|
+
- `plot_spectrogram` copies at most `max_rows` x `nfft` values to the host; it copied about 1.14 times the record.
|
|
133
|
+
- Raises sections added or completed for `correct_channel`, `welch_psd`, `spectrogram`, `smooth_phase`, `allan_deviation`, `frequency_drift` and `carrier_phase_trajectory`; `smooth_phase`'s messages name the function.
|
|
134
|
+
- Duplicated validation replaced by two helpers, so integer and finite-number checks agree everywhere (`edge_trim` accepted `2.0` in the linewidth methods and rejected it in `frequency_drift`; `BPS(block_size=2.5)`, `Tikhonov(block_size=2.5)` and `estimate_channel(nfft=64.5)` passed validation).
|
|
135
|
+
|
|
136
|
+
### Development
|
|
137
|
+
|
|
138
|
+
- `tests/common/transfers.py` traces host-device copies at CuPy's level; the transfer audit and `TestDeviceReduction` share it. `TestDeviceReduction` no longer patches `to_device` (which hid its copies from the audit and missed direct `.get()` calls) and draws every plot at two record lengths, so a copy that grows with the record fails.
|
|
139
|
+
- The contract registry checks that each row's data-argument count equals the signature's positional parameters.
|
|
140
|
+
- Fiber and IQ compensation tests moved to `tests/equalization/test_fiber_compensation.py`, `test_fiber_estimation.py` and `test_iq.py`; the quality-metric test checks scale invariance against AWGN theory instead of the removed tolerance branch; the gain tests score against the true gain and oracle LLRs, each with a failing baseline.
|
|
141
|
+
|
|
7
142
|
## [3.10.2] - 2026-11-24
|
|
8
143
|
|
|
9
144
|
Follow-up polish and fixes from the alignment review: unified value-object host copying and equality semantics, persistent BPS anchor state across sequential equalizer resumes, upfront composite-code validation, GPU IIR support beyond 16 sections, consistent real-input optical transforms, zero-copy frequency-offset framing, unbiased quality metrics, and stricter contract/theme/transfer audits. No public signatures changed.
|
|
10
145
|
|
|
146
|
+
### Changes that may need code updates
|
|
147
|
+
|
|
148
|
+
- `welch_psd` raises `ValueError` for empty samples instead of returning an empty PSD.
|
|
149
|
+
- `smooth_phase` raises when `process_variance` is given together with `linewidth` or `sampling_rate`; it ignored them before.
|
|
150
|
+
- An invalid type in `Signal`, `Reference` or `SingleCarrierFrame` raises `TypeError` instead of `ValueError`.
|
|
151
|
+
- Estimates and results no longer raise on `==`; they compare by identity (replaced by value equality in the next release).
|
|
152
|
+
|
|
11
153
|
### Fixed
|
|
12
154
|
|
|
13
155
|
- **Core, backend and value objects**:
|
|
@@ -738,7 +880,9 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
|
|
|
738
880
|
|
|
739
881
|
First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
|
|
740
882
|
|
|
741
|
-
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.
|
|
883
|
+
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.12.0...HEAD
|
|
884
|
+
[3.12.0]: https://github.com/lokgar/commkit/compare/v3.11.0...v3.12.0
|
|
885
|
+
[3.11.0]: https://github.com/lokgar/commkit/compare/v3.10.2...v3.11.0
|
|
742
886
|
[3.10.2]: https://github.com/lokgar/commkit/compare/v3.10.1...v3.10.2
|
|
743
887
|
[3.10.1]: https://github.com/lokgar/commkit/compare/v3.10.0...v3.10.1
|
|
744
888
|
[3.10.0]: https://github.com/lokgar/commkit/compare/v3.9.0...v3.10.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: commkit
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.12.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
|
|
@@ -149,15 +149,15 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
149
149
|
| --- | --- |
|
|
150
150
|
| [`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`. |
|
|
151
151
|
| [`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. |
|
|
152
|
-
| [`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
|
|
152
|
+
| [`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`. Generic filters only: the compensation of an impairment is in `equalization`. |
|
|
153
153
|
| [`commkit.multirate`](https://github.com/lokgar/commkit/blob/main/commkit/multirate.py) | `resample` (fractional), `decimate`, `upsample`, `decimate_to_symbol_rate`. |
|
|
154
154
|
| [`commkit.spectral`](https://github.com/lokgar/commkit/blob/main/commkit/spectral.py) | Welch PSD, spectrograms, frequency shifting, pilot tones. |
|
|
155
|
-
| [`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
|
|
155
|
+
| [`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, 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`. Forward models only: each effect's estimation and correction is in the receiver module of its quantity. |
|
|
156
156
|
| [`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`). |
|
|
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
|
-
| [`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`). |
|
|
160
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/
|
|
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/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; 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`. |
|
|
@@ -113,15 +113,15 @@ CommKit never picks a device for you: data stays where you put it, and each func
|
|
|
113
113
|
| --- | --- |
|
|
114
114
|
| [`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`. |
|
|
115
115
|
| [`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. |
|
|
116
|
-
| [`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
|
|
116
|
+
| [`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`. Generic filters only: the compensation of an impairment is in `equalization`. |
|
|
117
117
|
| [`commkit.multirate`](https://github.com/lokgar/commkit/blob/main/commkit/multirate.py) | `resample` (fractional), `decimate`, `upsample`, `decimate_to_symbol_rate`. |
|
|
118
118
|
| [`commkit.spectral`](https://github.com/lokgar/commkit/blob/main/commkit/spectral.py) | Welch PSD, spectrograms, frequency shifting, pilot tones. |
|
|
119
|
-
| [`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
|
|
119
|
+
| [`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, 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`. Forward models only: each effect's estimation and correction is in the receiver module of its quantity. |
|
|
120
120
|
| [`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`). |
|
|
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
|
-
| [`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`). |
|
|
124
|
-
| [`commkit.metrics`](https://github.com/lokgar/commkit/
|
|
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/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; 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`. |
|