commkit 3.10.1__tar.gz → 3.11.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.1 → commkit-3.11.0}/AGENTS.md +13 -7
- {commkit-3.10.1 → commkit-3.11.0}/CHANGELOG.md +92 -1
- {commkit-3.10.1 → commkit-3.11.0}/PKG-INFO +4 -4
- {commkit-3.10.1 → commkit-3.11.0}/README.md +3 -3
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_fiber.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_sync_misc.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/__init__.py +15 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_array.py +64 -3
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_constants.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_dispersion.py +4 -3
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_fiber.py +4 -11
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_sequences.py +3 -2
- commkit-3.11.0/commkit/_value.py +122 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/allan.py +39 -11
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/drift.py +28 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/fm_noise.py +2 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/linewidth/dsh.py +5 -9
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/linewidth/phase.py +12 -10
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/linewidth/result.py +6 -3
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/trajectory.py +21 -2
- {commkit-3.10.1 → commkit-3.11.0}/commkit/backend.py +21 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/algebraic.py +16 -2
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/base.py +7 -43
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/convolutional.py +7 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/crc.py +4 -6
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/exit.py +25 -46
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/interleaving.py +5 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/ldpc.py +24 -20
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/linear.py +24 -18
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/performance.py +25 -18
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/polar.py +10 -8
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/product.py +21 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/ratematch.py +7 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/shaping.py +5 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/turbo.py +3 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/_signal_input.py +5 -15
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/frame.py +24 -26
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/generation.py +24 -20
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/preamble.py +7 -19
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/signal.py +11 -32
- commkit-3.11.0/commkit/equalization/__init__.py +119 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_block/_dd.py +16 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_block/_engine.py +2 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_numba_loops.py +13 -10
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_sequential/_setup.py +12 -3
- {commkit-3.10.1/commkit/filtering → commkit-3.11.0/commkit/equalization}/fiber/__init__.py +2 -2
- {commkit-3.10.1/commkit/filtering → commkit-3.11.0/commkit/equalization}/fiber/compensation.py +19 -27
- {commkit-3.10.1/commkit/filtering → commkit-3.11.0/commkit/equalization}/fiber/estimation.py +13 -14
- commkit-3.11.0/commkit/equalization/iq.py +308 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/linear.py +199 -26
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/pilots.py +5 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/polarization.py +8 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/result.py +3 -2
- {commkit-3.10.1 → commkit-3.11.0}/commkit/filtering/__init__.py +5 -35
- {commkit-3.10.1 → commkit-3.11.0}/commkit/filtering/linear.py +33 -17
- {commkit-3.10.1 → commkit-3.11.0}/commkit/filtering/pulses.py +3 -26
- {commkit-3.10.1 → commkit-3.11.0}/commkit/filtering/response.py +22 -20
- {commkit-3.10.1 → commkit-3.11.0}/commkit/frequency.py +77 -57
- {commkit-3.10.1 → commkit-3.11.0}/commkit/impairments/__init__.py +7 -13
- {commkit-3.10.1 → commkit-3.11.0}/commkit/impairments/fiber_channel.py +15 -15
- {commkit-3.10.1 → commkit-3.11.0}/commkit/impairments/frontend.py +17 -316
- {commkit-3.10.1 → commkit-3.11.0}/commkit/impairments/noise.py +18 -38
- {commkit-3.10.1 → commkit-3.11.0}/commkit/impairments/source.py +7 -13
- {commkit-3.10.1 → commkit-3.11.0}/commkit/io.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/logger.py +8 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/_demap.py +3 -9
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/constellation.py +14 -13
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/gray.py +3 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/shaping.py +4 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/math.py +33 -1
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/__init__.py +8 -6
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/_common.py +4 -40
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/awgn.py +13 -2
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/error_rates.py +2 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/quality.py +65 -41
- {commkit-3.10.1 → commkit-3.11.0}/commkit/multirate.py +3 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/__init__.py +10 -26
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/analysis.py +131 -53
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/filter_response.py +5 -8
- commkit-3.11.0/commkit/plotting/frequency.py +398 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/recovery.py +227 -161
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/spectral.py +34 -7
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/timing.py +5 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/_common.py +3 -3
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/bps.py +3 -4
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/corrections.py +51 -43
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/estimates.py +14 -6
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/pilots.py +18 -19
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/pll.py +1 -2
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/tikhonov.py +14 -19
- {commkit-3.10.1 → commkit-3.11.0}/commkit/smoothing.py +2 -8
- {commkit-3.10.1 → commkit-3.11.0}/commkit/spectral.py +17 -12
- {commkit-3.10.1 → commkit-3.11.0}/commkit/timing/clock_recovery.py +6 -5
- {commkit-3.10.1 → commkit-3.11.0}/commkit/timing/synchronization.py +61 -54
- {commkit-3.10.1 → commkit-3.11.0}/examples/10-front-end-impairments.ipynb +5 -5
- {commkit-3.10.1 → commkit-3.11.0}/examples/11-frame-synchronization-and-timing.ipynb +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/examples/13-frequency-offset-estimation.ipynb +9 -11
- {commkit-3.10.1 → commkit-3.11.0}/examples/15-pilot-aided-carrier-recovery.ipynb +2 -5
- {commkit-3.10.1 → commkit-3.11.0}/examples/20-chromatic-dispersion.ipynb +14 -12
- {commkit-3.10.1 → commkit-3.11.0}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/examples/24-coherent-transceiver-end-to-end.ipynb +6 -5
- {commkit-3.10.1 → commkit-3.11.0}/examples/25-carrier-phase-characterization.ipynb +2 -3
- {commkit-3.10.1 → commkit-3.11.0}/examples/26-laser-linewidth-self-heterodyne.ipynb +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/examples/27-laser-linewidth-short-delay-and-flicker.ipynb +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/examples/28-laser-linewidth-self-homodyne-iq.ipynb +4 -9
- {commkit-3.10.1 → commkit-3.11.0}/examples/29-measurement-template-self-heterodyne.ipynb +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/examples/30-measurement-template-self-homodyne-iq.ipynb +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/pyproject.toml +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_allan.py +36 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_drift.py +15 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_linewidth.py +11 -8
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_trajectory.py +13 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_coding_base.py +84 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_exit.py +14 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_ldpc.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_performance.py +46 -1
- commkit-3.11.0/tests/common/transfers.py +150 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_frame.py +3 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_generation.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_signal.py +14 -14
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_blind.py +5 -3
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_block.py +18 -0
- commkit-3.11.0/tests/equalization/test_fiber_compensation.py +572 -0
- commkit-3.11.0/tests/equalization/test_fiber_estimation.py +228 -0
- commkit-3.11.0/tests/equalization/test_iq.py +230 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_linear.py +117 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_polarization.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_state.py +30 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/impairments/test_fiber_channel_linear.py +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/impairments/test_frontend.py +3 -206
- {commkit-3.10.1 → commkit-3.11.0}/tests/impairments/test_noise.py +7 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/mapping/test_constellation.py +5 -3
- {commkit-3.10.1 → commkit-3.11.0}/tests/mapping/test_gray.py +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/metrics/test_error_rates.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/metrics/test_quality.py +28 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_analysis.py +21 -27
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_filter_response.py +2 -2
- commkit-3.11.0/tests/plotting/test_plot_frequency.py +153 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_recovery.py +47 -44
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_spectral.py +38 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_theme.py +171 -72
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_timing.py +5 -5
- {commkit-3.10.1 → commkit-3.11.0}/tests/plugins/transfer_trace.py +41 -105
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_corrections.py +49 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_pll.py +9 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_api_contracts.py +118 -32
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_array.py +42 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_dispersion.py +44 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_fiber.py +2 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_filter_response.py +3 -2
- commkit-3.11.0/tests/test_filtering.py +596 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_frequency.py +19 -3
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_import_hygiene.py +5 -6
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_multirate.py +4 -2
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_pulse_shaping.py +4 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_receiver_chain.py +1 -1
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_spectral.py +10 -0
- commkit-3.11.0/tests/test_value.py +80 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/timing/test_synchronization.py +38 -1
- {commkit-3.10.1 → commkit-3.11.0}/uv.lock +1 -1
- commkit-3.10.1/commkit/equalization/__init__.py +0 -58
- commkit-3.10.1/commkit/plotting/frequency.py +0 -384
- commkit-3.10.1/tests/plotting/test_plot_frequency.py +0 -115
- commkit-3.10.1/tests/test_filtering.py +0 -1322
- {commkit-3.10.1 → commkit-3.11.0}/.gitattributes +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.github/icon.svg +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.github/logo.svg +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.github/workflows/ci.yml +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.github/workflows/publish.yml +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.gitignore +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/.python-version +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/LICENSE +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_block_blind.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_block_lms.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_bps.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_coding.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_equalizers.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_filters.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_gardner.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_import.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_llr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_mapping.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/bench_signal_pipeline.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/benchutils.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/conftest.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/record_baseline.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/benchmarks/workloads.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_bits.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_circular.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/bps.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/coding.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/compiler.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/filters.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/graphs.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/llr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/selftest.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/algebraic.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/bps_anchor.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/bps_min_d2.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/cs_block.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/iir.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/interpolate.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/ldpc.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/llr.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_cuda/src/selftest.cu +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_fft.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_interpolation.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_numba_frequency.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_numba_interpolation.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_overlap_save.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_peaks.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/_random.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/_common.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/interferometry.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/analysis/linewidth/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/_galois.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/_gf2.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/_ldpc_tables.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/coding/_numba_loops.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/core/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_block/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_block/_blind.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_common.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_sequential/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_sequential/_blind.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/equalization/_sequential/_dd.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/_lattice.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/_numba_llr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/bits.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/mapping/llr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/metrics/information.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/coding.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/constellation.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/equalizer.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/eye.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/theme.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/plotting/waveform.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/py.typed +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/_numba_loops.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/carrier_phase.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/recovery/viterbi_viterbi.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/timing/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/commkit/timing/_numba_loops.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/00-getting-started.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/02-spectral-analysis.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/03-digital-filters.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/04-pulse-shaping-and-matched-filtering.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/05-multirate-and-resampling.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/06-awgn-and-performance-metrics.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/07-channel-coding.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/09-laser-phase-noise.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/12-sampling-clock-recovery.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/14-blind-carrier-phase-recovery.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/16-linear-channel-equalization.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/17-adaptive-equalization.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/18-blind-equalization.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/19-polarization-multiplexing.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/22-direct-and-self-coherent-detection.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/23-fec-in-optical-standards.ipynb +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/examples/README.md +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/scripts/sanitize.sh +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_fm_noise.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/analysis/test_interferometry.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_algebraic.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_convolutional.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_crc.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_gf2.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_interleaving.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_ldpc_exit.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_ldpc_kernel.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_ldpc_tables.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_linear_codes.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_polar.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_product.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_ratematch.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_shaping.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/coding/test_turbo.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/coding.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/conversions.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/kernel_utils.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/memory.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/metrics.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/periodic.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/reference_impl.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/scoring.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/signals.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/theory.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/common/user_block.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/conftest.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_preamble.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_psqam.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_signal_input.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/core/test_signal_mimo.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_bps_kernel.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_cold_start.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_cpr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_cs_kernel.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_equalizer_oracles.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_mimo.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_result.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_sequential.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/equalization/test_winit.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/impairments/test_source.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/mapping/test_bits.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/mapping/test_lattice.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/mapping/test_llr.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/metrics/test_awgn.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/metrics/test_common.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/metrics/test_information.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_coding.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_constellation.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_equalizer.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_eye.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plotting/test_plot_waveform.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plugins/__init__.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/plugins/precision_trace.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_bps.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_carrier_phase.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_joint.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_pilots.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_recovery_oracles.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_tikhonov.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/recovery/test_viterbi_viterbi.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_backend.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_bit_packing.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_cuda_infra.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_examples.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_interpolation.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_io.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_logger.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_math.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_peaks.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_signal_pipeline.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_smoothing.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/test_working_memory.py +0 -0
- {commkit-3.10.1 → commkit-3.11.0}/tests/timing/test_clock_recovery.py +0 -0
|
@@ -77,13 +77,17 @@ Dependencies point downward only:
|
|
|
77
77
|
| Layer | Modules | May import |
|
|
78
78
|
| --- | --- | --- |
|
|
79
79
|
| Infrastructure | `backend`, `logger`, `_cuda` | NumPy, CuPy |
|
|
80
|
-
| Array and math helpers | `_array` (shape and validation), `_bits` (bit rows and integers), `_peaks` (sub-bin peak fits), `math` (power, normalization, dB, linear trend) | infrastructure |
|
|
80
|
+
| Array and math helpers | `_array` (shape and validation), `_value` (equality of the frozen dataclasses), `_bits` (bit rows and integers), `_peaks` (sub-bin peak fits), `math` (power, normalization, dB, linear trend, data-aided gain) | infrastructure |
|
|
81
81
|
| Value objects | `mapping.Constellation`, pulse classes, `recovery` CPR configs, `coding` (code objects with their `encode` / `decode`; array-only, never imports `core`) | layers above |
|
|
82
82
|
| Core | `core` (`Signal`, frames, generation), `io` | layers above |
|
|
83
83
|
| DSP | `mapping`, `filtering`, `multirate`, `spectral`, `smoothing`, `impairments`, `timing`, `frequency`, `recovery`, `equalization`, `metrics`, `analysis` | layers above, and lower DSP modules |
|
|
84
84
|
| Presentation | `plotting` | everything; **nothing imports plotting** (no `debug_plot`: plot functions consume results or recompute through public functions) |
|
|
85
85
|
|
|
86
|
-
- **
|
|
86
|
+
- **Placement by role.** Where a name lives follows from what it does, so a user finds the inverse of `apply_x` without searching:
|
|
87
|
+
- `impairments` holds the forward models only: every `apply_*` that degrades a signal, `generate_phase_noise` and the model objects (`Fiber`). No `estimate_*` or `correct_*`.
|
|
88
|
+
- Each quantity's `estimate_*` / `correct_*` / `resolve_*`, its method objects and its estimate classes live together in the receiver module of that quantity: `timing` (frame timing, sampling clock), `frequency` (carrier frequency offset), `recovery` (carrier phase, cycle slips, phase and channel ambiguities), `equalization` (the inverse of a channel or front-end response: linear channel, gain, polarization, chromatic dispersion, fiber propagation (DBP), IQ imbalance, and the adaptive equalizers).
|
|
89
|
+
- `filtering` holds generic filters (pulses, FIR and IIR design, responses, application), nothing tied to one impairment; `smoothing` display and estimation smoothers only; `spectral` spectra and spectral operations (`shift_frequency`, `add_pilot_tone`); `analysis` laser and phase characterization; `metrics` is the reporting layer.
|
|
90
|
+
- An operation both ends use stays with its domain, not in `impairments`: `timing.apply_delay`, `equalization.apply_taps`.
|
|
87
91
|
- **Plot styling comes from the theme.** Plot functions take colors, fonts and sizes from `matplotlib.rcParams`, so they work under `apply_default_theme(dark=True)`, `dark=False` or any other style: cycle colors `C0`, `C1`, ... for curves and fitted annotations; `_reference_line()` (`plotting/theme.py`: the light red `_accent()`, its shade chosen by the background's luminance, a long dash, three quarters of `lines.linewidth`) for reference lines and guides, set apart from the faint grid; `_foreground()` (the text color) for markers that must contrast with the background and `_background()` for their edges; `image.cmap` for density images and spectrograms (a `cmap=None` default), with empty cells masked; `_line_width(scale)` and `_marker_area(scale)` relative to `lines.linewidth` and `lines.markersize`. Never a named or hex color, a `fontsize` or a fixed width or size outside `theme.py`; `"gray"` is the one neutral literal, for faint structure (rings, shading, legend keys). `tests/plotting/test_plot_theme.py` scans the sources for them.
|
|
88
92
|
- **Plot axes in SI units** are labelled with the base unit in brackets (`Frequency [Hz]`, `Time [s]`) and get `_set_eng_formatter` (`plotting/theme.py`): at each draw it picks one SI prefix from the visible ticks and writes it into the label's unit (`Frequency [GHz]`), with plain numbers on the ticks. Pass data in SI units and never pre-scale it or prefix the label by hand; log axes keep a prefix per tick, as no single one fits decades.
|
|
89
93
|
- **Codes are storable:** `io` stores a code as its class and constructor fields, so those fields are numbers, strings, tuples, host arrays, constellations or other codes.
|
|
@@ -116,6 +120,7 @@ Dependencies point downward only:
|
|
|
116
120
|
- **Properties versus defaults.** Properties of the samples (`sampling_rate`, `symbol_rate`, hence `sps`, `center_frequency`, `domain` and the optical carrier's wavelength) come from the Signal; a conflicting argument raises `ValueError`, an equal one is fine, and a missing property for array input raises. Defaults (decision `constellation`, `pulse`, the reference symbols) come from the Signal too; an explicit argument wins. Neither case warns. `SignalInput` resolves each through a method named after it (`inp.sampling_rate(sampling_rate)`, `inp.integer_sps(sps)`, `inp.constellation(constellation, required=True, purpose=" for its decisions")`, `inp.reference_symbols(reference)`); called without an argument, it returns the Signal's value. A function never reads these from `inp.signal`.
|
|
117
121
|
- Integer-SPS algorithms validate with `inp.integer_sps()` (`require_integer_sps()` where there is no Signal input) before any cast; never truncate 1.5 SPS to 1.
|
|
118
122
|
- **Shapes:** SISO is `(N,)`, MIMO `(C, N)`. Use `as_2d`, `restore_1d`, `broadcast_channels` and `require_channels`; never hand-roll the promote/squeeze idiom.
|
|
123
|
+
- **Equality.** Every frozen dataclass compares by value. One with arrays derives from a base in `_value`: `_Value` for descriptions and host-only results whose arrays are read-only host copies (codes, interleavers, algorithm objects with arrays, frame maps, EXIT and error-rate curves), equal and hashable by shape, dtype and bytes (`Constellation` keeps an equivalent of its own that ignores its `family` label and treats -0.0 as 0.0); `_Record` for data and results whose arrays may be on the GPU (`Signal`, `Reference`, every estimate and result), equal field by field (NaN equal to NaN, arrays on different devices unequal, no transfer) and unhashable. Never `eq=False` alone: identity equality makes two equal estimates compare unequal.
|
|
119
124
|
- **Value objects are frozen dataclasses** with read-only NumPy arrays:
|
|
120
125
|
- `Constellation`: `.qam(M)`, `.psk(M)`, `.pam(M, unipolar=)`, or arbitrary `points`; `.shaped(nu=|entropy=)` keeps unit power. Functions accept the object only, never strings.
|
|
121
126
|
- Pulses: `RRC`, `RC`, `Gaussian`, `Rect`, `SmoothRect`. A raw taps array is accepted wherever a pulse is.
|
|
@@ -135,7 +140,7 @@ Dependencies point downward only:
|
|
|
135
140
|
- **Metrics** (`evm`, `snr`, `noise_variance`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`) and **analysis summaries** (`estimate_linewidth`, `allan_deviation`, the `frequency_drift` statistics, which fit plot-sized reductions) return host values: a `float` for 1-D input, `np.ndarray (C,)` for 2-D. Sample-rate outputs (trajectories, PSDs, `dsh_phase`) stay on the input device.
|
|
136
141
|
- Metrics **raise** on empty selections, never return `None` or `0.0` for "nothing measured", and never silently align, rotate or permute against the reference.
|
|
137
142
|
- **More than one value** is a frozen dataclass with named fields. No dicts, no tuples longer than two.
|
|
138
|
-
- **Diagnostics that depend on the method** go in a subclass: the estimate class holds the fields every method gives (`value`, ...), and each method or family of methods returns a subclass with its own fields, none of them `None`. A subclass that one method returns is named after it (`MthPowerEstimate`, `PilotTonesEstimate`); one that several return is named after what they share (`BlockPhaseEstimate` for BPS, Viterbi-Viterbi and Tikhonov, `DispersionScanEstimate`). A method without fields of its own returns its family's class or the base. The verbs and plots take the base class.
|
|
143
|
+
- **Diagnostics that depend on the method** go in a subclass: the estimate class holds the fields every method gives (`value`, ...), and each method or family of methods returns a subclass with its own fields, none of them `None`. A subclass that one method returns is named after it (`MthPowerEstimate`, `PilotTonesEstimate`); one that several return is named after what they share (`BlockPhaseEstimate` for BPS, Viterbi-Viterbi and Tikhonov, `DispersionScanEstimate`). A method without fields of its own returns its family's class or the base. The verbs and plots take the base class: one `plot_<quantity>_estimate` per quantity draws the diagnostics of the estimate's class (`plot_carrier_phase_estimate`, `plot_frequency_offset_estimate`, `plot_linewidth_estimate`, `plot_timing_estimate`). An estimate carries what its plot needs (the sampling rate, the record length, the method), so nothing is passed twice.
|
|
139
144
|
- **Equalizers** return `EqualizerResult`: `y_hat` is always an array, `signal` the 1-SPS Signal for Signal input, `state` the continuation state (`state=result.state`), and diagnostics as data.
|
|
140
145
|
|
|
141
146
|
### Naming
|
|
@@ -148,13 +153,13 @@ Dependencies point downward only:
|
|
|
148
153
|
| `resolve_*` | pick among discrete candidates (π/2 rotation, channel permutation); nothing else |
|
|
149
154
|
| `generate` | synthesis from parameters, takes `rng` |
|
|
150
155
|
| `encode` / `decode` | information bits to a code's transmitted bits, and LLRs (or hard decisions) back to a `DecodeResult`; dispatched on the code object, the decoder chosen by a `method` object |
|
|
151
|
-
| `plot_*` | every public plotting function (only `apply_default_theme` is exempt) |
|
|
156
|
+
| `plot_*` | every public plotting function (only `apply_default_theme` is exempt); `plot_<quantity>_estimate` for an estimate |
|
|
152
157
|
|
|
153
158
|
- The algorithm is chosen by an object, never by the function name or a string: `estimate_carrier_phase(y, BPS())`, not `recover_carrier_phase_bps(y)`. The verb function dispatches on the object's type through a private table in its module. There is no `recover_*` or `compensate_*`.
|
|
154
159
|
- Computations use plain nouns (`allan_deviation`).
|
|
155
160
|
- **Glossary**, one name each:
|
|
156
161
|
- `num_taps`, `step_size`, `sps`, `constellation`, `pulse`, `rng`, `num_symbols`, `num_channels` (never streams), `sampling_rate`, `symbol_rate`, `noise_var`, `nfft`, `regularization`, `max_iterations`.
|
|
157
|
-
- Noise has three names, each with one meaning: `noise_var` is the variance E|n|² of the noise in the samples a function receives (measured by `noise_variance`); `snr_db` a power ratio in those samples (measured by `snr`); `esn0_db` the channel's textbook Es/N0, independent of the dtype (real samples carry the in-phase half of the noise, `N0/2`). A function taking `noise_var` for a demapping model (`compute_llr`, `mi`, `gmi`, `ngmi`) uses the likelihood of complex or real noise after the samples' dtype and also accepts `esn0_db`, so users never convert by hand.
|
|
162
|
+
- Noise has three names, each with one meaning: `noise_var` is the variance E|n|² of the noise in the samples a function receives (measured by `noise_variance` on the scale of a unit-power reference, where `correct_gain` puts the symbols); `snr_db` a power ratio in those samples (measured by `snr`); `esn0_db` the channel's textbook Es/N0, independent of the dtype (real samples carry the in-phase half of the noise, `N0/2`). A function taking `noise_var` for a demapping model (`compute_llr`, `mi`, `gmi`, `ngmi`) uses the likelihood of complex or real noise after the samples' dtype and also accepts `esn0_db`, so users never convert by hand.
|
|
158
163
|
- A size names its unit: `num_symbols`, `num_blocks` (codewords of a FEC code), `info_bits` (a code's information length where it is a parameter), `blocks_per_frame`, `num_variables`, `num_segments`. In `coding`, `length` and `n` mean the codeword length in bits and `k` the information length, nothing else.
|
|
159
164
|
- A seeded part of a factory takes `<part>_rng` (`payload_rng`), with the semantics of `rng`.
|
|
160
165
|
- `method=` strings name only a numerical flavor of one algorithm (`method="maxlog" | "exact"`); algorithms are objects.
|
|
@@ -176,7 +181,7 @@ Docstrings describe the code as it is; a change in behavior updates them in the
|
|
|
176
181
|
|
|
177
182
|
### Errors and logging
|
|
178
183
|
|
|
179
|
-
- Wrong input raises, with a message naming the argument.
|
|
184
|
+
- Wrong input raises, with a message naming the argument: a wrong type (a float or `bool` for an integer, a string for a number) `TypeError`, a wrong value `ValueError`. Scalars are checked with `_array.require_int` and `require_finite`, never a hand-written `isinstance` chain; empty data raises naming the argument, before any library call fails on it.
|
|
180
185
|
- **No fallbacks for a broken environment.** Code never catches a failure of CuPy, a CUDA kernel (compile, load, launch), a graph capture or another dependency to run a different implementation; the failure raises to the caller. A path kept "just in case" is code no test or user runs. (Dispatch on the *input* is allowed; see the kernel policy in [Performance](#6-performance).)
|
|
181
186
|
- `logger` is for diagnostics only. Per-channel logging that needs a device-to-host transfer is wrapped in `if logger.isEnabledFor(logging.INFO):`.
|
|
182
187
|
- **Levels:** `DEBUG` traces what a call is about to do (method, parameters, sizes). `INFO` is one summary per public call of what a user would print next (the values found, the parameters applied, an equalizer's exit MSE, a decoder's failed checks, what `generate` or `io` produced). `WARNING` flags a returned but suspect result (no convergence, a fit outside its valid range, near-zero power, a code with 4-cycles). Value objects and pure helpers do not log.
|
|
@@ -230,7 +235,8 @@ Docstrings describe the code as it is; a change in behavior updates them in the
|
|
|
230
235
|
- Every FFT goes through `commkit._fft` (`fft`, `ifft`, `rfft`, `irfft`), never `np.fft` / `xp.fft` (frequency grids excepted): on the CPU it runs multi-threaded `scipy.fft` and keeps complex64 in single precision (NumPy 2 computes it in double); on the GPU it is `cupy.fft`.
|
|
231
236
|
- Pass whole records to compiled code. No Python loops over symbols or small blocks, except inside a CUDA graph.
|
|
232
237
|
- Repeated GPU work with fixed buffers (the block equalizers' blocks, the fiber solver's spans) is replayed from CUDA graphs through `_cuda.graphs.GraphRunner`: warm once, capture on the second run, replay; a failed capture raises. Per-replay offsets come from a device index the graph advances, so the host launches one graph per block. Its stream is reused per device and thread, because CuPy's pool caches freed blocks per stream.
|
|
233
|
-
- **
|
|
238
|
+
- **Plots reduce on the device** to what is drawn: traces to their min/max envelope (`max_points`), images to a fixed grid (density and eye grids, at most `max_rows` spectrogram rows), so the copy to the host is bounded by the drawing whatever the record length. `TestDeviceReduction` in `tests/plotting/test_plot_theme.py` draws each plot at two record lengths and bounds its largest copy.
|
|
239
|
+
- **Audit with `tests/plugins/transfer_trace.py`** after touching a GPU path; the contract registry cannot see a silent round trip through the host. The plugin records every sample-rate host-device copy during a `--device=gpu` run (traced at CuPy's level by `tests/common/transfers.py`, which tests use to bound one call's copies) and fails on a site missing from its documented list (the sequential recursions' round trip, equalizer continuation state, the reporting layer, explicit device moves, the transmitted payload, host values such as reference symbols or SciPy windows moved to the device). A new site is fixed or added to the list with its reason.
|
|
234
240
|
|
|
235
241
|
**Kernel policy:**
|
|
236
242
|
|
|
@@ -4,6 +4,95 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.11.0] - 2026-11-24
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
### Changes that may need code updates
|
|
12
|
+
|
|
13
|
+
- **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.
|
|
14
|
+
- From `commkit.filtering`: `estimate_chromatic_dispersion`, `correct_chromatic_dispersion`, `dispersion_compensation_taps`, `correct_fiber_propagation`, `ClockToneScan`, `FourthMomentScan`, `QuadraticPhaseFit`, `ChromaticDispersionEstimate`, `DispersionScanEstimate`, `QuadraticPhaseFitEstimate`.
|
|
15
|
+
- From `commkit.impairments`: `estimate_iq_imbalance`, `correct_iq_imbalance`, `Lowdin`, `GramSchmidt`, `IQImbalanceEstimate`.
|
|
16
|
+
- **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:
|
|
17
|
+
|
|
18
|
+
| Before | Now |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `plot_pilot_phase_estimate(est, sampling_rate=)` (PilotInterpolation) | `plot_carrier_phase_estimate(est)` |
|
|
21
|
+
| `plot_pilot_tone_phase_estimate(est, x, method=, sampling_rate=)` | `plot_carrier_phase_estimate(est, x)` |
|
|
22
|
+
| `plot_pilot_tones_phase_estimate(est)` | `plot_carrier_phase_estimate(est)` |
|
|
23
|
+
| `plot_carrier_phase_trajectory(est)` with an estimate | `plot_carrier_phase_estimate(est)`; the trajectory plot takes arrays |
|
|
24
|
+
| `plot_frequency_offset_spectrum(est, search_range=)` | `plot_frequency_offset_estimate(est)` |
|
|
25
|
+
| `plot_mm_autocorrelation(est, sampling_rate=)` | `plot_frequency_offset_estimate(est)` |
|
|
26
|
+
| `plot_frequency_offset_blockwise_result(est, num_samples=, sampling_rate=)` | `plot_frequency_offset_estimate(est)` |
|
|
27
|
+
| `plot_pilot_phase_estimate(est, sampling_rate=)` (PilotSlope) | `plot_frequency_offset_estimate(est)` |
|
|
28
|
+
| `plot_frequency_noise_psd`, `plot_increment_variance`, `plot_dsh_beat_psd` | `plot_linewidth_estimate(est)` |
|
|
29
|
+
| `plot_timing_correlation(est)` | `plot_timing_estimate(est)` |
|
|
30
|
+
| `plot_frequency_drift(drift, sampling_rate=)` | `plot_frequency_drift(drift)` |
|
|
31
|
+
|
|
32
|
+
- **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.
|
|
33
|
+
- **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.
|
|
34
|
+
- **`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.
|
|
35
|
+
- **`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.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- `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.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- `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.
|
|
44
|
+
- `carrier_phase_trajectory(channel_pairing="swap")` raises for a single channel instead of acting as `"identity"`.
|
|
45
|
+
- `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).
|
|
46
|
+
- `spectrogram` names `samples` when they are empty, instead of SciPy's message.
|
|
47
|
+
- `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.
|
|
48
|
+
- `cross_correlate` checks `mode` before computing the correlation.
|
|
49
|
+
- `plot_spectrogram` copies at most `max_rows` x `nfft` values to the host; it copied about 1.14 times the record.
|
|
50
|
+
- 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.
|
|
51
|
+
- 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).
|
|
52
|
+
|
|
53
|
+
### Development
|
|
54
|
+
|
|
55
|
+
- `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.
|
|
56
|
+
- The contract registry checks that each row's data-argument count equals the signature's positional parameters.
|
|
57
|
+
- 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.
|
|
58
|
+
|
|
59
|
+
## [3.10.2] - 2026-11-24
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
|
|
63
|
+
### Changes that may need code updates
|
|
64
|
+
|
|
65
|
+
- `welch_psd` raises `ValueError` for empty samples instead of returning an empty PSD.
|
|
66
|
+
- `smooth_phase` raises when `process_variance` is given together with `linewidth` or `sampling_rate`; it ignored them before.
|
|
67
|
+
- An invalid type in `Signal`, `Reference` or `SingleCarrierFrame` raises `TypeError` instead of `ValueError`.
|
|
68
|
+
- Estimates and results no longer raise on `==`; they compare by identity (replaced by value equality in the next release).
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- **Core, backend and value objects**:
|
|
73
|
+
- Routed `freeze_host` and validation-time host reads across value objects (`Constellation`, `EqualizerPilots`, `LinearBlockCode`, `LDPCCode`, `PolarCode`, `Interleaver`, `Punctured`, `ExitCurve`, `ErrorRateCurve`) through `_array.host_array`, consolidating device-to-host copies to one documented audit site.
|
|
74
|
+
- Added `eq=False` to array-holding estimate and result dataclasses (`EqualizerPilots`, `ChannelEstimate`, `PolarizationEstimate`, `PolarizationTonesEstimate`, `CarrierPhaseEstimate` and subclasses, `DecodeResult`, `FrameStructure`, `FilterResponse`, `ChromaticDispersionEstimate` and subclasses, `FrequencyOffsetEstimate` and subclasses, `IQImbalanceEstimate`, `Spectrogram`, `SamplingClockOffsetEstimate`, `TimingEstimate`) so `==` no longer raises NumPy's ambiguous truth-value `ValueError`; `ExitCurve`, `ExitChart` and `ErrorRateCurve` now inherit `_Value` for value equality and hashing.
|
|
75
|
+
- Unified invalid-type checks in `Signal`, `Reference` and `SingleCarrierFrame` to raise `TypeError` (matching `SignalInput` and `generate`), moved `require_device` into `commkit.backend` (removing `coding/exit.py::_check_device`), and aligned `commkit.__all__` with all public top-level submodules.
|
|
76
|
+
- **Equalization and carrier recovery**:
|
|
77
|
+
- Persisted the data-aided BPS anchor buffer (`bps_da_buf`, `bps_da_sum`, `bps_da_ptr`) in `EqualizerState` across `resume` in sequential equalizers so `n_train > resume` no longer resets the anchor window.
|
|
78
|
+
- Unified `_resolve_pll_gains` to return plain `float` tuples in both branches (avoiding duplicate Numba specializations), allowed `constellation=None` in fully trained `block_lms` runs without CPR (matching `lms`), and vectorized `Tikhonov` smoothing across channels (`axis=-1`).
|
|
79
|
+
- **Channel coding**:
|
|
80
|
+
- Added recursive upfront method validation on composite codes (`PAS`, `Concatenated`, `Punctured`, `Shortened`, `_Repeat`) so invalid inner decoder methods fail immediately on empty inputs and before Monte Carlo batches in `error_rate_curve` and `decoder_exit_curve`.
|
|
81
|
+
- Avoided GPU upload/download round trips for host-side codes (`CCDM`, `PAS`, `TurboCode`) in `error_rate_curve` and `decoder_exit_curve`, eliminated double GF(2) row reduction in `LDPCCode._build_encoder`, and skipped unused soft-output buffers and kernel compilation when `MaximumLikelihood(soft=False)`.
|
|
82
|
+
- Tightened strict integer (rejecting `bool`/`float`) and construction-time validation in `ReedSolomonCode`, `BCHCode`, `PolarCode.nr`, `LDPCCode.quasi_cyclic`, `LDPCCode.from_parity_check`, `CRC`, `ConvolutionalCode` and `PAS`.
|
|
83
|
+
- **Front-end DSP, filtering, metrics and analysis**:
|
|
84
|
+
- Routed `iir_filter` with more than 16 second-order sections on the GPU to the CPU Numba kernel instead of raising `ValueError`, avoided double `_zero_phase_padding` in zero-phase IIR filtering, deferred unit-circle phasor evaluation in `filter_response`, and removed `DEBUG` logging from `Pulse.taps()` helpers while validating `sps`.
|
|
85
|
+
- Made real-input behaviour consistent across optical linear transforms: `apply_chromatic_dispersion`, `correct_chromatic_dispersion` (`"whole_record"` and `"fir"`) and `apply_pmd` now return complex output without `ComplexWarning` (matching `apply_fiber_propagation`).
|
|
86
|
+
- Switched block framing in `estimate_frequency_offset` to zero-copy `as_strided`, deferred unused host frequency arrays in `_mth_power`, and anchored blockwise frequency-offset correction at `theta[0] = 0` (matching static correction).
|
|
87
|
+
- Used `rfft`/`irfft` for real inputs and validated `delay` shapes in `apply_delay`, and used the winning transmit stream's energy in MIMO `estimate_timing` coherence.
|
|
88
|
+
- Cached Gauss-Hermite nodes in `metrics.awgn` and divided by `ref_pwr` across data-aided `evm`, `snr` and `noise_variance` so all three stay unbiased and mutually consistent when `|pwr - 1| <= 1e-3`.
|
|
89
|
+
- Closed remaining parameter-validation gaps in `smooth_phase`, `resolve_phase_ambiguity`, `correct_channel`, `carrier_phase_trajectory`, `frequency_drift`, `allan_deviation` and `welch_psd` (empty input).
|
|
90
|
+
|
|
91
|
+
### Development
|
|
92
|
+
|
|
93
|
+
- Broadened `tests/test_api_contracts.py` with `conflict=` checks for `correct_polarization`, `apply_polarization_mixing`, `correct_carrier_phase` and `estimate_timing`, and `call=` builders for `dsh_phase`, `estimate_linewidth`, `carrier_phase_trajectory`, `estimate_channel`, `estimate_polarization` and `estimate_iq_imbalance`.
|
|
94
|
+
- Tightened `tests/plotting/test_plot_theme.py` to catch dict-literal style kwargs, reversed format strings, `ms=` and leading-dot floats, expanded `TestDeviceReduction` across all sample-rate plots, and replaced `tests/plugins/transfer_trace.py`'s blanket `plotting/` exemption with a plot-sized D2H ceiling (`_PLOT_MAX = 300_000`) and peak-size reporting.
|
|
95
|
+
|
|
7
96
|
## [3.10.1] - 2026-11-23
|
|
8
97
|
|
|
9
98
|
Bug fixes and alignment cleanups across the library from a full audit: stricter precision and host-sync hygiene, staircase and EXIT-chart correctness fixes, SI tick formatting, lazy `filtering` import, and tightened input validation. No public signatures changed.
|
|
@@ -708,7 +797,9 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
|
|
|
708
797
|
|
|
709
798
|
First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
|
|
710
799
|
|
|
711
|
-
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.
|
|
800
|
+
[Unreleased]: https://github.com/lokgar/commkit/compare/v3.11.0...HEAD
|
|
801
|
+
[3.11.0]: https://github.com/lokgar/commkit/compare/v3.10.2...v3.11.0
|
|
802
|
+
[3.10.2]: https://github.com/lokgar/commkit/compare/v3.10.1...v3.10.2
|
|
712
803
|
[3.10.1]: https://github.com/lokgar/commkit/compare/v3.10.0...v3.10.1
|
|
713
804
|
[3.10.0]: https://github.com/lokgar/commkit/compare/v3.9.0...v3.10.0
|
|
714
805
|
[3.9.0]: https://github.com/lokgar/commkit/compare/v3.8.0...v3.9.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: commkit
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.11.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,14 +149,14 @@ 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`). |
|
|
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
160
|
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
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. |
|
|
@@ -113,14 +113,14 @@ 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`). |
|
|
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
124
|
| [`commkit.metrics`](https://github.com/lokgar/commkit/blob/main/commkit/metrics.py) | `evm`, `snr`, `ber`, `fer`, `ser`, `gmi`, `ngmi`, `mi`, including shaped constellations; pre-FEC and post-FEC (`ber(decoded, sig)`); `noise_variance` for LLRs; the AWGN closed forms `awgn_ser`, `awgn_ber`, `awgn_mi`, `awgn_gmi`; host values per channel. |
|
|
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. |
|
|
@@ -11,7 +11,7 @@ import pytest
|
|
|
11
11
|
from workloads import fiber_workload
|
|
12
12
|
|
|
13
13
|
from commkit import _fiber
|
|
14
|
-
from commkit.
|
|
14
|
+
from commkit.equalization import correct_fiber_propagation
|
|
15
15
|
from commkit.impairments import Fiber, apply_fiber_propagation
|
|
16
16
|
|
|
17
17
|
ROUNDS = dict(rounds=3, warmup_rounds=1, iterations=1)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from workloads import FS, bps_workload, iq_imbalance_workload, rotated_symbols_workload
|
|
4
4
|
|
|
5
5
|
from commkit import frequency, recovery
|
|
6
|
-
from commkit.
|
|
6
|
+
from commkit.equalization import Lowdin, correct_iq_imbalance
|
|
7
7
|
from commkit.mapping import Constellation
|
|
8
8
|
from commkit.metrics import evm
|
|
9
9
|
|
|
@@ -31,7 +31,7 @@ Matplotlib, change warning filters, or touch the GPU.
|
|
|
31
31
|
import importlib as _importlib
|
|
32
32
|
from typing import Any as _Any
|
|
33
33
|
|
|
34
|
-
__version__ = "3.
|
|
34
|
+
__version__ = "3.11.0"
|
|
35
35
|
|
|
36
36
|
from .backend import PrecisionWarning
|
|
37
37
|
from .core import (
|
|
@@ -95,27 +95,37 @@ def __dir__() -> list[str]:
|
|
|
95
95
|
__all__ = [
|
|
96
96
|
"Constellation",
|
|
97
97
|
"Gaussian",
|
|
98
|
+
"Preamble",
|
|
99
|
+
"PrecisionWarning",
|
|
98
100
|
"RC",
|
|
99
101
|
"RRC",
|
|
100
|
-
"Reference",
|
|
101
102
|
"Rect",
|
|
102
|
-
"
|
|
103
|
-
"Preamble",
|
|
104
|
-
"PrecisionWarning",
|
|
103
|
+
"Reference",
|
|
105
104
|
"Signal",
|
|
106
105
|
"SingleCarrierFrame",
|
|
106
|
+
"SmoothRect",
|
|
107
107
|
"__version__",
|
|
108
108
|
"analysis",
|
|
109
|
+
"backend",
|
|
109
110
|
"coding",
|
|
111
|
+
"core",
|
|
110
112
|
"equalization",
|
|
113
|
+
"filtering",
|
|
111
114
|
"frequency",
|
|
112
115
|
"generate",
|
|
113
116
|
"impairments",
|
|
117
|
+
"io",
|
|
114
118
|
"load_npz",
|
|
119
|
+
"logger",
|
|
120
|
+
"mapping",
|
|
121
|
+
"math",
|
|
115
122
|
"metrics",
|
|
123
|
+
"multirate",
|
|
124
|
+
"plotting",
|
|
116
125
|
"recovery",
|
|
117
126
|
"save_npz",
|
|
118
127
|
"set_log_level",
|
|
128
|
+
"smoothing",
|
|
119
129
|
"spectral",
|
|
120
130
|
"timing",
|
|
121
131
|
]
|
|
@@ -4,8 +4,8 @@ Indexing, broadcasting and coercion operations on NumPy/CuPy arrays, used by
|
|
|
4
4
|
every module: :func:`validate_array`, the SISO/MIMO shape pair
|
|
5
5
|
:func:`as_2d` / :func:`restore_1d`, :func:`broadcast_channels`,
|
|
6
6
|
:func:`require_channels`, :func:`to_report_scalar` (host values of the
|
|
7
|
-
metrics and summaries), :func:`freeze_host` (the
|
|
8
|
-
value objects) and :func:`warn_if_double` (the
|
|
7
|
+
metrics and summaries), :func:`host_array` / :func:`freeze_host` (the
|
|
8
|
+
read-only host fields of value objects) and :func:`warn_if_double` (the
|
|
9
9
|
:class:`~commkit.PrecisionWarning` of the fixed-precision blocks). This
|
|
10
10
|
module imports only ``backend``: nothing from ``core``, DSP modules or
|
|
11
11
|
plotting.
|
|
@@ -31,6 +31,57 @@ from .backend import (
|
|
|
31
31
|
# ---------------------------------------------------------------------------
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
def require_int(
|
|
35
|
+
value: Any, name: str, *, low: int | None = None, high: int | None = None
|
|
36
|
+
) -> int:
|
|
37
|
+
"""``value`` as a Python ``int``, checked to lie in ``[low, high]``.
|
|
38
|
+
|
|
39
|
+
``name`` labels the argument in the message, with its function where the
|
|
40
|
+
caller gives one (``"allan_deviation(): num_taus"``). A ``bool``, a
|
|
41
|
+
float (``2.0`` included) or any other non-integer raises ``TypeError``;
|
|
42
|
+
an integer outside the bounds (``None``: unbounded) raises
|
|
43
|
+
``ValueError``.
|
|
44
|
+
"""
|
|
45
|
+
if isinstance(value, bool) or not isinstance(value, int | np.integer):
|
|
46
|
+
raise TypeError(f"{name} must be an integer, got {value!r}.")
|
|
47
|
+
if (low is not None and value < low) or (high is not None and value > high):
|
|
48
|
+
if high is None:
|
|
49
|
+
bound = f">= {low}"
|
|
50
|
+
elif low is None:
|
|
51
|
+
bound = f"<= {high}"
|
|
52
|
+
else:
|
|
53
|
+
bound = f"in [{low}, {high}]"
|
|
54
|
+
raise ValueError(f"{name} must be an integer {bound}, got {value!r}.")
|
|
55
|
+
return int(value)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def require_finite(
|
|
59
|
+
value: Any, name: str, *, low: float | None = None, inclusive: bool = False
|
|
60
|
+
) -> float:
|
|
61
|
+
"""``value`` as a Python ``float``, checked to be finite and above ``low``.
|
|
62
|
+
|
|
63
|
+
``low=None`` checks finiteness only; otherwise the value must exceed
|
|
64
|
+
``low`` (``inclusive=True``: be at least ``low``). A ``bool`` or a
|
|
65
|
+
non-number raises ``TypeError``, a NaN, an infinity or a value out of
|
|
66
|
+
range ``ValueError``. A 0-d array is accepted.
|
|
67
|
+
"""
|
|
68
|
+
scalar = not isinstance(value, bool) and isinstance(
|
|
69
|
+
value, int | float | np.integer | np.floating
|
|
70
|
+
)
|
|
71
|
+
array = (isinstance(value, np.ndarray) or _is_cupy_array(value)) and (
|
|
72
|
+
value.ndim == 0 and value.dtype.kind in "iuf"
|
|
73
|
+
)
|
|
74
|
+
if not (scalar or array):
|
|
75
|
+
raise TypeError(f"{name} must be a real number, got {value!r}.")
|
|
76
|
+
v = float(value)
|
|
77
|
+
if not np.isfinite(v):
|
|
78
|
+
raise ValueError(f"{name} must be finite, got {value!r}.")
|
|
79
|
+
if low is not None and (v < low if inclusive else v <= low):
|
|
80
|
+
bound = f">= {low:g}" if inclusive else f"> {low:g}"
|
|
81
|
+
raise ValueError(f"{name} must be {bound}, got {value!r}.")
|
|
82
|
+
return v
|
|
83
|
+
|
|
84
|
+
|
|
34
85
|
def validate_array(
|
|
35
86
|
v: Any, name: str = "array", complex_only: bool = False
|
|
36
87
|
) -> ArrayType:
|
|
@@ -87,6 +138,16 @@ def validate_array(
|
|
|
87
138
|
return v
|
|
88
139
|
|
|
89
140
|
|
|
141
|
+
def host_array(value: Any, dtype: Any = None) -> np.ndarray:
|
|
142
|
+
"""Return ``value`` as a host NumPy array for value-object construction.
|
|
143
|
+
|
|
144
|
+
One transfer for device input (documented in ``transfer_trace``), used by
|
|
145
|
+
:func:`freeze_host` and by value objects or constructors that inspect or
|
|
146
|
+
transform an array before freezing it.
|
|
147
|
+
"""
|
|
148
|
+
return _to_host(value, dtype)
|
|
149
|
+
|
|
150
|
+
|
|
90
151
|
def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarray:
|
|
91
152
|
"""Store ``value`` as field ``name`` of the frozen dataclass ``obj``.
|
|
92
153
|
|
|
@@ -94,7 +155,7 @@ def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarra
|
|
|
94
155
|
so the caller's array stays writable and a value object never holds
|
|
95
156
|
device memory. Returns the stored array.
|
|
96
157
|
"""
|
|
97
|
-
arr = np.array(
|
|
158
|
+
arr = np.array(host_array(value), dtype=dtype)
|
|
98
159
|
arr.setflags(write=False)
|
|
99
160
|
object.__setattr__(obj, name, arr)
|
|
100
161
|
return arr
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Physical constants shared across the package (private).
|
|
2
2
|
|
|
3
3
|
Used by :mod:`commkit._dispersion`, :mod:`commkit.core.signal`,
|
|
4
|
-
:mod:`commkit.
|
|
4
|
+
:mod:`commkit.equalization.fiber.estimation`, :mod:`commkit.impairments.noise`
|
|
5
5
|
and :mod:`commkit.plotting.spectral`.
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -176,6 +176,7 @@ def apply_dispersion(
|
|
|
176
176
|
"""
|
|
177
177
|
samples, xp, _ = dispatch(samples)
|
|
178
178
|
samples, was_1d = as_2d(samples, name="samples")
|
|
179
|
+
out_dtype = np.result_type(samples.dtype, np.complex64)
|
|
179
180
|
h = transfer_function(
|
|
180
181
|
samples.shape[-1],
|
|
181
182
|
sampling_rate=sampling_rate,
|
|
@@ -185,9 +186,9 @@ def apply_dispersion(
|
|
|
185
186
|
),
|
|
186
187
|
inverse=inverse,
|
|
187
188
|
xp=xp,
|
|
188
|
-
dtype=
|
|
189
|
+
dtype=out_dtype,
|
|
189
190
|
)
|
|
190
191
|
result = _fft.ifft(_fft.fft(samples, axis=-1) * h[None, :], axis=-1)
|
|
191
|
-
if result.dtype !=
|
|
192
|
-
result = result.astype(
|
|
192
|
+
if result.dtype != out_dtype:
|
|
193
|
+
result = result.astype(out_dtype)
|
|
193
194
|
return restore_1d(was_1d, result)
|
|
@@ -74,7 +74,7 @@ from typing import Any
|
|
|
74
74
|
import numpy as np
|
|
75
75
|
|
|
76
76
|
from . import _fft
|
|
77
|
-
from ._array import as_2d
|
|
77
|
+
from ._array import as_2d, require_finite, require_int
|
|
78
78
|
from ._cuda.graphs import GraphRunner
|
|
79
79
|
from ._dispersion import (
|
|
80
80
|
_SPEED_OF_LIGHT,
|
|
@@ -190,13 +190,9 @@ def check_link(
|
|
|
190
190
|
("span_length_km", span_length_km),
|
|
191
191
|
("center_wavelength_nm", center_wavelength_nm),
|
|
192
192
|
):
|
|
193
|
-
|
|
194
|
-
raise ValueError(f"{function_name}: {name} must be > 0, got {value!r}.")
|
|
193
|
+
require_finite(value, f"{function_name}: {name}", low=0.0)
|
|
195
194
|
for name, value in (("num_spans", num_spans), ("steps_per_span", steps_per_span)):
|
|
196
|
-
|
|
197
|
-
raise ValueError(
|
|
198
|
-
f"{function_name}: {name} must be a positive integer, got {value!r}."
|
|
199
|
-
)
|
|
195
|
+
require_int(value, f"{function_name}: {name}", low=1)
|
|
200
196
|
return _Link(
|
|
201
197
|
fiber,
|
|
202
198
|
float(span_length_km),
|
|
@@ -216,10 +212,7 @@ def to_watts(
|
|
|
216
212
|
``launch_power_dbm``. Divide the result by ``scale`` to return to the
|
|
217
213
|
input's units.
|
|
218
214
|
"""
|
|
219
|
-
|
|
220
|
-
raise ValueError(
|
|
221
|
-
f"{function_name}: launch_power_dbm must be finite, got {launch_power_dbm!r}."
|
|
222
|
-
)
|
|
215
|
+
require_finite(launch_power_dbm, f"{function_name}: launch_power_dbm")
|
|
223
216
|
x2, was_1d = as_2d(x, name="samples")
|
|
224
217
|
if x2.shape[0] not in (1, 2):
|
|
225
218
|
raise ValueError(
|
|
@@ -9,6 +9,7 @@ import math
|
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
|
|
12
|
+
from ._array import require_int
|
|
12
13
|
from .logger import logger
|
|
13
14
|
|
|
14
15
|
# Standard Barker codes
|
|
@@ -94,8 +95,8 @@ def zadoff_chu_sequence(num_symbols: int, *, root: int = 1) -> np.ndarray:
|
|
|
94
95
|
- For odd lengths: x[n] = exp(-j * pi * u * n * (n + 1) / N_ZC)
|
|
95
96
|
- For even lengths: x[n] = exp(-j * pi * u * n^2 / N_ZC)
|
|
96
97
|
"""
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
num_symbols = require_int(num_symbols, "num_symbols", low=1)
|
|
99
|
+
root = require_int(root, "root")
|
|
99
100
|
if root < 1 or root >= num_symbols:
|
|
100
101
|
raise ValueError(f"Root must be in [1, {num_symbols - 1}].")
|
|
101
102
|
if math.gcd(root, num_symbols) != 1:
|