commkit 3.10.1__tar.gz → 3.10.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. {commkit-3.10.1 → commkit-3.10.2}/CHANGELOG.md +32 -1
  2. {commkit-3.10.1 → commkit-3.10.2}/PKG-INFO +1 -1
  3. {commkit-3.10.1 → commkit-3.10.2}/commkit/__init__.py +15 -5
  4. {commkit-3.10.1 → commkit-3.10.2}/commkit/_array.py +13 -3
  5. {commkit-3.10.1 → commkit-3.10.2}/commkit/_dispersion.py +4 -3
  6. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/allan.py +26 -1
  7. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/drift.py +20 -1
  8. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/trajectory.py +11 -0
  9. {commkit-3.10.1 → commkit-3.10.2}/commkit/backend.py +13 -0
  10. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/algebraic.py +26 -1
  11. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/base.py +5 -1
  12. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/convolutional.py +6 -1
  13. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/crc.py +5 -1
  14. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/exit.py +19 -16
  15. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/interleaving.py +3 -3
  16. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/ldpc.py +24 -9
  17. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/linear.py +20 -10
  18. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/performance.py +21 -9
  19. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/polar.py +12 -5
  20. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/product.py +18 -0
  21. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/ratematch.py +6 -3
  22. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/shaping.py +2 -0
  23. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/_signal_input.py +1 -15
  24. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/frame.py +5 -5
  25. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/generation.py +2 -2
  26. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/preamble.py +2 -2
  27. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/signal.py +4 -4
  28. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_block/_dd.py +16 -7
  29. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_numba_loops.py +13 -10
  30. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_sequential/_setup.py +12 -3
  31. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/linear.py +19 -5
  32. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/pilots.py +3 -4
  33. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/polarization.py +2 -2
  34. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/fiber/compensation.py +5 -2
  35. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/fiber/estimation.py +3 -3
  36. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/linear.py +33 -17
  37. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/pulses.py +8 -25
  38. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/response.py +14 -7
  39. {commkit-3.10.1 → commkit-3.10.2}/commkit/frequency.py +27 -18
  40. {commkit-3.10.1 → commkit-3.10.2}/commkit/impairments/fiber_channel.py +7 -5
  41. {commkit-3.10.1 → commkit-3.10.2}/commkit/impairments/frontend.py +1 -1
  42. {commkit-3.10.1 → commkit-3.10.2}/commkit/impairments/source.py +2 -2
  43. {commkit-3.10.1 → commkit-3.10.2}/commkit/io.py +1 -1
  44. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/constellation.py +5 -5
  45. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/awgn.py +13 -2
  46. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/quality.py +5 -6
  47. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/_common.py +3 -3
  48. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/corrections.py +40 -3
  49. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/estimates.py +5 -5
  50. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/pll.py +1 -2
  51. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/tikhonov.py +11 -11
  52. {commkit-3.10.1 → commkit-3.10.2}/commkit/spectral.py +2 -2
  53. {commkit-3.10.1 → commkit-3.10.2}/commkit/timing/clock_recovery.py +1 -1
  54. {commkit-3.10.1 → commkit-3.10.2}/commkit/timing/synchronization.py +51 -37
  55. {commkit-3.10.1 → commkit-3.10.2}/pyproject.toml +2 -2
  56. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_allan.py +19 -0
  57. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_drift.py +15 -0
  58. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_trajectory.py +10 -0
  59. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_coding_base.py +84 -1
  60. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_exit.py +14 -0
  61. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_performance.py +45 -0
  62. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_frame.py +3 -1
  63. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_signal.py +14 -14
  64. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_block.py +18 -0
  65. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_linear.py +12 -0
  66. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_state.py +30 -0
  67. {commkit-3.10.1 → commkit-3.10.2}/tests/metrics/test_quality.py +23 -0
  68. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_theme.py +123 -26
  69. {commkit-3.10.1 → commkit-3.10.2}/tests/plugins/transfer_trace.py +26 -9
  70. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_corrections.py +49 -0
  71. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_pll.py +9 -0
  72. {commkit-3.10.1 → commkit-3.10.2}/tests/test_api_contracts.py +47 -6
  73. {commkit-3.10.1 → commkit-3.10.2}/tests/test_dispersion.py +44 -0
  74. {commkit-3.10.1 → commkit-3.10.2}/tests/test_filtering.py +41 -0
  75. {commkit-3.10.1 → commkit-3.10.2}/tests/test_frequency.py +16 -2
  76. {commkit-3.10.1 → commkit-3.10.2}/tests/test_import_hygiene.py +5 -6
  77. {commkit-3.10.1 → commkit-3.10.2}/tests/test_spectral.py +5 -0
  78. {commkit-3.10.1 → commkit-3.10.2}/tests/timing/test_synchronization.py +37 -0
  79. {commkit-3.10.1 → commkit-3.10.2}/uv.lock +1 -1
  80. {commkit-3.10.1 → commkit-3.10.2}/.gitattributes +0 -0
  81. {commkit-3.10.1 → commkit-3.10.2}/.github/icon.svg +0 -0
  82. {commkit-3.10.1 → commkit-3.10.2}/.github/logo.svg +0 -0
  83. {commkit-3.10.1 → commkit-3.10.2}/.github/workflows/ci.yml +0 -0
  84. {commkit-3.10.1 → commkit-3.10.2}/.github/workflows/publish.yml +0 -0
  85. {commkit-3.10.1 → commkit-3.10.2}/.gitignore +0 -0
  86. {commkit-3.10.1 → commkit-3.10.2}/.python-version +0 -0
  87. {commkit-3.10.1 → commkit-3.10.2}/AGENTS.md +0 -0
  88. {commkit-3.10.1 → commkit-3.10.2}/LICENSE +0 -0
  89. {commkit-3.10.1 → commkit-3.10.2}/README.md +0 -0
  90. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0002_pre_v2.json +0 -0
  91. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0003_v2_0.json +0 -0
  92. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0004_fiber_dbp.json +0 -0
  93. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0005_gpu_decoder_path.json +0 -0
  94. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0006_perf_cleanup.json +0 -0
  95. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0007_v3_0.json +0 -0
  96. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/baselines/Linux-CPython-3.14-64bit/0008_v3_1.json +0 -0
  97. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_block_blind.py +0 -0
  98. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_block_lms.py +0 -0
  99. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_bps.py +0 -0
  100. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_coding.py +0 -0
  101. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_equalizers.py +0 -0
  102. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_fiber.py +0 -0
  103. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_filters.py +0 -0
  104. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_gardner.py +0 -0
  105. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_import.py +0 -0
  106. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_llr.py +0 -0
  107. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_mapping.py +0 -0
  108. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_signal_pipeline.py +0 -0
  109. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/bench_sync_misc.py +0 -0
  110. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/benchutils.py +0 -0
  111. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/conftest.py +0 -0
  112. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/record_baseline.py +0 -0
  113. {commkit-3.10.1 → commkit-3.10.2}/benchmarks/workloads.py +0 -0
  114. {commkit-3.10.1 → commkit-3.10.2}/commkit/_bits.py +0 -0
  115. {commkit-3.10.1 → commkit-3.10.2}/commkit/_circular.py +0 -0
  116. {commkit-3.10.1 → commkit-3.10.2}/commkit/_constants.py +0 -0
  117. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/__init__.py +0 -0
  118. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/bps.py +0 -0
  119. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/coding.py +0 -0
  120. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/compiler.py +0 -0
  121. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/filters.py +0 -0
  122. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/graphs.py +0 -0
  123. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/llr.py +0 -0
  124. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/selftest.py +0 -0
  125. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/algebraic.cu +0 -0
  126. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/bps_anchor.cu +0 -0
  127. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/bps_min_d2.cu +0 -0
  128. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/cs_block.cu +0 -0
  129. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/iir.cu +0 -0
  130. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/interpolate.cu +0 -0
  131. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/ldpc.cu +0 -0
  132. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/llr.cu +0 -0
  133. {commkit-3.10.1 → commkit-3.10.2}/commkit/_cuda/src/selftest.cu +0 -0
  134. {commkit-3.10.1 → commkit-3.10.2}/commkit/_fft.py +0 -0
  135. {commkit-3.10.1 → commkit-3.10.2}/commkit/_fiber.py +0 -0
  136. {commkit-3.10.1 → commkit-3.10.2}/commkit/_interpolation.py +0 -0
  137. {commkit-3.10.1 → commkit-3.10.2}/commkit/_numba_frequency.py +0 -0
  138. {commkit-3.10.1 → commkit-3.10.2}/commkit/_numba_interpolation.py +0 -0
  139. {commkit-3.10.1 → commkit-3.10.2}/commkit/_overlap_save.py +0 -0
  140. {commkit-3.10.1 → commkit-3.10.2}/commkit/_peaks.py +0 -0
  141. {commkit-3.10.1 → commkit-3.10.2}/commkit/_random.py +0 -0
  142. {commkit-3.10.1 → commkit-3.10.2}/commkit/_sequences.py +0 -0
  143. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/__init__.py +0 -0
  144. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/_common.py +0 -0
  145. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/fm_noise.py +0 -0
  146. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/interferometry.py +0 -0
  147. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/linewidth/__init__.py +0 -0
  148. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/linewidth/dsh.py +0 -0
  149. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/linewidth/phase.py +0 -0
  150. {commkit-3.10.1 → commkit-3.10.2}/commkit/analysis/linewidth/result.py +0 -0
  151. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/__init__.py +0 -0
  152. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/_galois.py +0 -0
  153. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/_gf2.py +0 -0
  154. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/_ldpc_tables.py +0 -0
  155. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/_numba_loops.py +0 -0
  156. {commkit-3.10.1 → commkit-3.10.2}/commkit/coding/turbo.py +0 -0
  157. {commkit-3.10.1 → commkit-3.10.2}/commkit/core/__init__.py +0 -0
  158. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/__init__.py +0 -0
  159. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_block/__init__.py +0 -0
  160. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_block/_blind.py +0 -0
  161. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_block/_engine.py +0 -0
  162. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_common.py +0 -0
  163. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_sequential/__init__.py +0 -0
  164. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_sequential/_blind.py +0 -0
  165. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/_sequential/_dd.py +0 -0
  166. {commkit-3.10.1 → commkit-3.10.2}/commkit/equalization/result.py +0 -0
  167. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/__init__.py +0 -0
  168. {commkit-3.10.1 → commkit-3.10.2}/commkit/filtering/fiber/__init__.py +0 -0
  169. {commkit-3.10.1 → commkit-3.10.2}/commkit/impairments/__init__.py +0 -0
  170. {commkit-3.10.1 → commkit-3.10.2}/commkit/impairments/noise.py +0 -0
  171. {commkit-3.10.1 → commkit-3.10.2}/commkit/logger.py +0 -0
  172. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/__init__.py +0 -0
  173. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/_demap.py +0 -0
  174. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/_lattice.py +0 -0
  175. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/_numba_llr.py +0 -0
  176. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/bits.py +0 -0
  177. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/gray.py +0 -0
  178. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/llr.py +0 -0
  179. {commkit-3.10.1 → commkit-3.10.2}/commkit/mapping/shaping.py +0 -0
  180. {commkit-3.10.1 → commkit-3.10.2}/commkit/math.py +0 -0
  181. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/__init__.py +0 -0
  182. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/_common.py +0 -0
  183. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/error_rates.py +0 -0
  184. {commkit-3.10.1 → commkit-3.10.2}/commkit/metrics/information.py +0 -0
  185. {commkit-3.10.1 → commkit-3.10.2}/commkit/multirate.py +0 -0
  186. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/__init__.py +0 -0
  187. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/analysis.py +0 -0
  188. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/coding.py +0 -0
  189. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/constellation.py +0 -0
  190. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/equalizer.py +0 -0
  191. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/eye.py +0 -0
  192. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/filter_response.py +0 -0
  193. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/frequency.py +0 -0
  194. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/recovery.py +0 -0
  195. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/spectral.py +0 -0
  196. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/theme.py +0 -0
  197. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/timing.py +0 -0
  198. {commkit-3.10.1 → commkit-3.10.2}/commkit/plotting/waveform.py +0 -0
  199. {commkit-3.10.1 → commkit-3.10.2}/commkit/py.typed +0 -0
  200. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/__init__.py +0 -0
  201. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/_numba_loops.py +0 -0
  202. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/bps.py +0 -0
  203. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/carrier_phase.py +0 -0
  204. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/pilots.py +0 -0
  205. {commkit-3.10.1 → commkit-3.10.2}/commkit/recovery/viterbi_viterbi.py +0 -0
  206. {commkit-3.10.1 → commkit-3.10.2}/commkit/smoothing.py +0 -0
  207. {commkit-3.10.1 → commkit-3.10.2}/commkit/timing/__init__.py +0 -0
  208. {commkit-3.10.1 → commkit-3.10.2}/commkit/timing/_numba_loops.py +0 -0
  209. {commkit-3.10.1 → commkit-3.10.2}/examples/00-getting-started.ipynb +0 -0
  210. {commkit-3.10.1 → commkit-3.10.2}/examples/01-constellations-and-bit-mapping.ipynb +0 -0
  211. {commkit-3.10.1 → commkit-3.10.2}/examples/02-spectral-analysis.ipynb +0 -0
  212. {commkit-3.10.1 → commkit-3.10.2}/examples/03-digital-filters.ipynb +0 -0
  213. {commkit-3.10.1 → commkit-3.10.2}/examples/04-pulse-shaping-and-matched-filtering.ipynb +0 -0
  214. {commkit-3.10.1 → commkit-3.10.2}/examples/05-multirate-and-resampling.ipynb +0 -0
  215. {commkit-3.10.1 → commkit-3.10.2}/examples/06-awgn-and-performance-metrics.ipynb +0 -0
  216. {commkit-3.10.1 → commkit-3.10.2}/examples/07-channel-coding.ipynb +0 -0
  217. {commkit-3.10.1 → commkit-3.10.2}/examples/08-probabilistic-shaping-and-coded-modulation.ipynb +0 -0
  218. {commkit-3.10.1 → commkit-3.10.2}/examples/09-laser-phase-noise.ipynb +0 -0
  219. {commkit-3.10.1 → commkit-3.10.2}/examples/10-front-end-impairments.ipynb +0 -0
  220. {commkit-3.10.1 → commkit-3.10.2}/examples/11-frame-synchronization-and-timing.ipynb +0 -0
  221. {commkit-3.10.1 → commkit-3.10.2}/examples/12-sampling-clock-recovery.ipynb +0 -0
  222. {commkit-3.10.1 → commkit-3.10.2}/examples/13-frequency-offset-estimation.ipynb +0 -0
  223. {commkit-3.10.1 → commkit-3.10.2}/examples/14-blind-carrier-phase-recovery.ipynb +0 -0
  224. {commkit-3.10.1 → commkit-3.10.2}/examples/15-pilot-aided-carrier-recovery.ipynb +0 -0
  225. {commkit-3.10.1 → commkit-3.10.2}/examples/16-linear-channel-equalization.ipynb +0 -0
  226. {commkit-3.10.1 → commkit-3.10.2}/examples/17-adaptive-equalization.ipynb +0 -0
  227. {commkit-3.10.1 → commkit-3.10.2}/examples/18-blind-equalization.ipynb +0 -0
  228. {commkit-3.10.1 → commkit-3.10.2}/examples/19-polarization-multiplexing.ipynb +0 -0
  229. {commkit-3.10.1 → commkit-3.10.2}/examples/20-chromatic-dispersion.ipynb +0 -0
  230. {commkit-3.10.1 → commkit-3.10.2}/examples/21-nonlinear-fiber-and-backpropagation.ipynb +0 -0
  231. {commkit-3.10.1 → commkit-3.10.2}/examples/22-direct-and-self-coherent-detection.ipynb +0 -0
  232. {commkit-3.10.1 → commkit-3.10.2}/examples/23-fec-in-optical-standards.ipynb +0 -0
  233. {commkit-3.10.1 → commkit-3.10.2}/examples/24-coherent-transceiver-end-to-end.ipynb +0 -0
  234. {commkit-3.10.1 → commkit-3.10.2}/examples/25-carrier-phase-characterization.ipynb +0 -0
  235. {commkit-3.10.1 → commkit-3.10.2}/examples/26-laser-linewidth-self-heterodyne.ipynb +0 -0
  236. {commkit-3.10.1 → commkit-3.10.2}/examples/27-laser-linewidth-short-delay-and-flicker.ipynb +0 -0
  237. {commkit-3.10.1 → commkit-3.10.2}/examples/28-laser-linewidth-self-homodyne-iq.ipynb +0 -0
  238. {commkit-3.10.1 → commkit-3.10.2}/examples/29-measurement-template-self-heterodyne.ipynb +0 -0
  239. {commkit-3.10.1 → commkit-3.10.2}/examples/30-measurement-template-self-homodyne-iq.ipynb +0 -0
  240. {commkit-3.10.1 → commkit-3.10.2}/examples/README.md +0 -0
  241. {commkit-3.10.1 → commkit-3.10.2}/scripts/sanitize.sh +0 -0
  242. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_fm_noise.py +0 -0
  243. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_interferometry.py +0 -0
  244. {commkit-3.10.1 → commkit-3.10.2}/tests/analysis/test_linewidth.py +0 -0
  245. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_algebraic.py +0 -0
  246. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_convolutional.py +0 -0
  247. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_crc.py +0 -0
  248. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_gf2.py +0 -0
  249. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_interleaving.py +0 -0
  250. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_ldpc.py +0 -0
  251. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_ldpc_exit.py +0 -0
  252. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_ldpc_kernel.py +0 -0
  253. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_ldpc_tables.py +0 -0
  254. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_linear_codes.py +0 -0
  255. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_polar.py +0 -0
  256. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_product.py +0 -0
  257. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_ratematch.py +0 -0
  258. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_shaping.py +0 -0
  259. {commkit-3.10.1 → commkit-3.10.2}/tests/coding/test_turbo.py +0 -0
  260. {commkit-3.10.1 → commkit-3.10.2}/tests/common/__init__.py +0 -0
  261. {commkit-3.10.1 → commkit-3.10.2}/tests/common/coding.py +0 -0
  262. {commkit-3.10.1 → commkit-3.10.2}/tests/common/conversions.py +0 -0
  263. {commkit-3.10.1 → commkit-3.10.2}/tests/common/kernel_utils.py +0 -0
  264. {commkit-3.10.1 → commkit-3.10.2}/tests/common/memory.py +0 -0
  265. {commkit-3.10.1 → commkit-3.10.2}/tests/common/metrics.py +0 -0
  266. {commkit-3.10.1 → commkit-3.10.2}/tests/common/periodic.py +0 -0
  267. {commkit-3.10.1 → commkit-3.10.2}/tests/common/reference_impl.py +0 -0
  268. {commkit-3.10.1 → commkit-3.10.2}/tests/common/scoring.py +0 -0
  269. {commkit-3.10.1 → commkit-3.10.2}/tests/common/signals.py +0 -0
  270. {commkit-3.10.1 → commkit-3.10.2}/tests/common/theory.py +0 -0
  271. {commkit-3.10.1 → commkit-3.10.2}/tests/common/user_block.py +0 -0
  272. {commkit-3.10.1 → commkit-3.10.2}/tests/conftest.py +0 -0
  273. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_generation.py +0 -0
  274. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_preamble.py +0 -0
  275. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_psqam.py +0 -0
  276. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_signal_input.py +0 -0
  277. {commkit-3.10.1 → commkit-3.10.2}/tests/core/test_signal_mimo.py +0 -0
  278. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_blind.py +0 -0
  279. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_bps_kernel.py +0 -0
  280. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_cold_start.py +0 -0
  281. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_cpr.py +0 -0
  282. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_cs_kernel.py +0 -0
  283. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_equalizer_oracles.py +0 -0
  284. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_mimo.py +0 -0
  285. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_polarization.py +0 -0
  286. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_result.py +0 -0
  287. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_sequential.py +0 -0
  288. {commkit-3.10.1 → commkit-3.10.2}/tests/equalization/test_winit.py +0 -0
  289. {commkit-3.10.1 → commkit-3.10.2}/tests/impairments/test_fiber_channel_linear.py +0 -0
  290. {commkit-3.10.1 → commkit-3.10.2}/tests/impairments/test_fiber_channel_nonlinear.py +0 -0
  291. {commkit-3.10.1 → commkit-3.10.2}/tests/impairments/test_frontend.py +0 -0
  292. {commkit-3.10.1 → commkit-3.10.2}/tests/impairments/test_noise.py +0 -0
  293. {commkit-3.10.1 → commkit-3.10.2}/tests/impairments/test_source.py +0 -0
  294. {commkit-3.10.1 → commkit-3.10.2}/tests/mapping/test_bits.py +0 -0
  295. {commkit-3.10.1 → commkit-3.10.2}/tests/mapping/test_constellation.py +0 -0
  296. {commkit-3.10.1 → commkit-3.10.2}/tests/mapping/test_gray.py +0 -0
  297. {commkit-3.10.1 → commkit-3.10.2}/tests/mapping/test_lattice.py +0 -0
  298. {commkit-3.10.1 → commkit-3.10.2}/tests/mapping/test_llr.py +0 -0
  299. {commkit-3.10.1 → commkit-3.10.2}/tests/metrics/test_awgn.py +0 -0
  300. {commkit-3.10.1 → commkit-3.10.2}/tests/metrics/test_common.py +0 -0
  301. {commkit-3.10.1 → commkit-3.10.2}/tests/metrics/test_error_rates.py +0 -0
  302. {commkit-3.10.1 → commkit-3.10.2}/tests/metrics/test_information.py +0 -0
  303. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_analysis.py +0 -0
  304. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_coding.py +0 -0
  305. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_constellation.py +0 -0
  306. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_equalizer.py +0 -0
  307. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_eye.py +0 -0
  308. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_filter_response.py +0 -0
  309. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_frequency.py +0 -0
  310. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_recovery.py +0 -0
  311. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_spectral.py +0 -0
  312. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_timing.py +0 -0
  313. {commkit-3.10.1 → commkit-3.10.2}/tests/plotting/test_plot_waveform.py +0 -0
  314. {commkit-3.10.1 → commkit-3.10.2}/tests/plugins/__init__.py +0 -0
  315. {commkit-3.10.1 → commkit-3.10.2}/tests/plugins/precision_trace.py +0 -0
  316. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_bps.py +0 -0
  317. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_carrier_phase.py +0 -0
  318. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_joint.py +0 -0
  319. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_pilots.py +0 -0
  320. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_recovery_oracles.py +0 -0
  321. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_tikhonov.py +0 -0
  322. {commkit-3.10.1 → commkit-3.10.2}/tests/recovery/test_viterbi_viterbi.py +0 -0
  323. {commkit-3.10.1 → commkit-3.10.2}/tests/test_array.py +0 -0
  324. {commkit-3.10.1 → commkit-3.10.2}/tests/test_backend.py +0 -0
  325. {commkit-3.10.1 → commkit-3.10.2}/tests/test_bit_packing.py +0 -0
  326. {commkit-3.10.1 → commkit-3.10.2}/tests/test_cuda_infra.py +0 -0
  327. {commkit-3.10.1 → commkit-3.10.2}/tests/test_examples.py +0 -0
  328. {commkit-3.10.1 → commkit-3.10.2}/tests/test_fiber.py +0 -0
  329. {commkit-3.10.1 → commkit-3.10.2}/tests/test_filter_response.py +0 -0
  330. {commkit-3.10.1 → commkit-3.10.2}/tests/test_interpolation.py +0 -0
  331. {commkit-3.10.1 → commkit-3.10.2}/tests/test_io.py +0 -0
  332. {commkit-3.10.1 → commkit-3.10.2}/tests/test_logger.py +0 -0
  333. {commkit-3.10.1 → commkit-3.10.2}/tests/test_math.py +0 -0
  334. {commkit-3.10.1 → commkit-3.10.2}/tests/test_multirate.py +0 -0
  335. {commkit-3.10.1 → commkit-3.10.2}/tests/test_peaks.py +0 -0
  336. {commkit-3.10.1 → commkit-3.10.2}/tests/test_pulse_shaping.py +0 -0
  337. {commkit-3.10.1 → commkit-3.10.2}/tests/test_receiver_chain.py +0 -0
  338. {commkit-3.10.1 → commkit-3.10.2}/tests/test_signal_pipeline.py +0 -0
  339. {commkit-3.10.1 → commkit-3.10.2}/tests/test_smoothing.py +0 -0
  340. {commkit-3.10.1 → commkit-3.10.2}/tests/test_working_memory.py +0 -0
  341. {commkit-3.10.1 → commkit-3.10.2}/tests/timing/test_clock_recovery.py +0 -0
@@ -4,6 +4,36 @@ Notable changes to CommKit, newest first. Performance figures are from the refer
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [3.10.2] - 2026-11-24
8
+
9
+ Follow-up polish and fixes from the alignment review: unified value-object host copying and equality semantics, persistent BPS anchor state across sequential equalizer resumes, upfront composite-code validation, GPU IIR support beyond 16 sections, consistent real-input optical transforms, zero-copy frequency-offset framing, unbiased quality metrics, and stricter contract/theme/transfer audits. No public signatures changed.
10
+
11
+ ### Fixed
12
+
13
+ - **Core, backend and value objects**:
14
+ - Routed `freeze_host` and validation-time host reads across value objects (`Constellation`, `EqualizerPilots`, `LinearBlockCode`, `LDPCCode`, `PolarCode`, `Interleaver`, `Punctured`, `ExitCurve`, `ErrorRateCurve`) through `_array.host_array`, consolidating device-to-host copies to one documented audit site.
15
+ - Added `eq=False` to array-holding estimate and result dataclasses (`EqualizerPilots`, `ChannelEstimate`, `PolarizationEstimate`, `PolarizationTonesEstimate`, `CarrierPhaseEstimate` and subclasses, `DecodeResult`, `FrameStructure`, `FilterResponse`, `ChromaticDispersionEstimate` and subclasses, `FrequencyOffsetEstimate` and subclasses, `IQImbalanceEstimate`, `Spectrogram`, `SamplingClockOffsetEstimate`, `TimingEstimate`) so `==` no longer raises NumPy's ambiguous truth-value `ValueError`; `ExitCurve`, `ExitChart` and `ErrorRateCurve` now inherit `_Value` for value equality and hashing.
16
+ - Unified invalid-type checks in `Signal`, `Reference` and `SingleCarrierFrame` to raise `TypeError` (matching `SignalInput` and `generate`), moved `require_device` into `commkit.backend` (removing `coding/exit.py::_check_device`), and aligned `commkit.__all__` with all public top-level submodules.
17
+ - **Equalization and carrier recovery**:
18
+ - Persisted the data-aided BPS anchor buffer (`bps_da_buf`, `bps_da_sum`, `bps_da_ptr`) in `EqualizerState` across `resume` in sequential equalizers so `n_train > resume` no longer resets the anchor window.
19
+ - Unified `_resolve_pll_gains` to return plain `float` tuples in both branches (avoiding duplicate Numba specializations), allowed `constellation=None` in fully trained `block_lms` runs without CPR (matching `lms`), and vectorized `Tikhonov` smoothing across channels (`axis=-1`).
20
+ - **Channel coding**:
21
+ - Added recursive upfront method validation on composite codes (`PAS`, `Concatenated`, `Punctured`, `Shortened`, `_Repeat`) so invalid inner decoder methods fail immediately on empty inputs and before Monte Carlo batches in `error_rate_curve` and `decoder_exit_curve`.
22
+ - Avoided GPU upload/download round trips for host-side codes (`CCDM`, `PAS`, `TurboCode`) in `error_rate_curve` and `decoder_exit_curve`, eliminated double GF(2) row reduction in `LDPCCode._build_encoder`, and skipped unused soft-output buffers and kernel compilation when `MaximumLikelihood(soft=False)`.
23
+ - Tightened strict integer (rejecting `bool`/`float`) and construction-time validation in `ReedSolomonCode`, `BCHCode`, `PolarCode.nr`, `LDPCCode.quasi_cyclic`, `LDPCCode.from_parity_check`, `CRC`, `ConvolutionalCode` and `PAS`.
24
+ - **Front-end DSP, filtering, metrics and analysis**:
25
+ - Routed `iir_filter` with more than 16 second-order sections on the GPU to the CPU Numba kernel instead of raising `ValueError`, avoided double `_zero_phase_padding` in zero-phase IIR filtering, deferred unit-circle phasor evaluation in `filter_response`, and removed `DEBUG` logging from `Pulse.taps()` helpers while validating `sps`.
26
+ - Made real-input behaviour consistent across optical linear transforms: `apply_chromatic_dispersion`, `correct_chromatic_dispersion` (`"whole_record"` and `"fir"`) and `apply_pmd` now return complex output without `ComplexWarning` (matching `apply_fiber_propagation`).
27
+ - Switched block framing in `estimate_frequency_offset` to zero-copy `as_strided`, deferred unused host frequency arrays in `_mth_power`, and anchored blockwise frequency-offset correction at `theta[0] = 0` (matching static correction).
28
+ - Used `rfft`/`irfft` for real inputs and validated `delay` shapes in `apply_delay`, and used the winning transmit stream's energy in MIMO `estimate_timing` coherence.
29
+ - Cached Gauss-Hermite nodes in `metrics.awgn` and divided by `ref_pwr` across data-aided `evm`, `snr` and `noise_variance` so all three stay unbiased and mutually consistent when `|pwr - 1| <= 1e-3`.
30
+ - Closed remaining parameter-validation gaps in `smooth_phase`, `resolve_phase_ambiguity`, `correct_channel`, `carrier_phase_trajectory`, `frequency_drift`, `allan_deviation` and `welch_psd` (empty input).
31
+
32
+ ### Development
33
+
34
+ - Broadened `tests/test_api_contracts.py` with `conflict=` checks for `correct_polarization`, `apply_polarization_mixing`, `correct_carrier_phase` and `estimate_timing`, and `call=` builders for `dsh_phase`, `estimate_linewidth`, `carrier_phase_trajectory`, `estimate_channel`, `estimate_polarization` and `estimate_iq_imbalance`.
35
+ - Tightened `tests/plotting/test_plot_theme.py` to catch dict-literal style kwargs, reversed format strings, `ms=` and leading-dot floats, expanded `TestDeviceReduction` across all sample-rate plots, and replaced `tests/plugins/transfer_trace.py`'s blanket `plotting/` exemption with a plot-sized D2H ceiling (`_PLOT_MAX = 300_000`) and peak-size reporting.
36
+
7
37
  ## [3.10.1] - 2026-11-23
8
38
 
9
39
  Bug fixes and alignment cleanups across the library from a full audit: stricter precision and host-sync hygiene, staircase and EXIT-chart correctness fixes, SI tick formatting, lazy `filtering` import, and tightened input validation. No public signatures changed.
@@ -708,7 +738,8 @@ See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.1.0)
708
738
 
709
739
  First release. See the [GitHub release](https://github.com/lokgar/commkit/releases/tag/v1.0.0).
710
740
 
711
- [Unreleased]: https://github.com/lokgar/commkit/compare/v3.10.1...HEAD
741
+ [Unreleased]: https://github.com/lokgar/commkit/compare/v3.10.2...HEAD
742
+ [3.10.2]: https://github.com/lokgar/commkit/compare/v3.10.1...v3.10.2
712
743
  [3.10.1]: https://github.com/lokgar/commkit/compare/v3.10.0...v3.10.1
713
744
  [3.10.0]: https://github.com/lokgar/commkit/compare/v3.9.0...v3.10.0
714
745
  [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.10.1
3
+ Version: 3.10.2
4
4
  Summary: A Python library for high-performance digital communications research.
5
5
  Project-URL: Homepage, https://github.com/lokgar/commkit
6
6
  Project-URL: Repository, https://github.com/lokgar/commkit
@@ -31,7 +31,7 @@ Matplotlib, change warning filters, or touch the GPU.
31
31
  import importlib as _importlib
32
32
  from typing import Any as _Any
33
33
 
34
- __version__ = "3.10.1"
34
+ __version__ = "3.10.2"
35
35
 
36
36
  from .backend import PrecisionWarning
37
37
  from .core import (
@@ -95,27 +95,37 @@ def __dir__() -> list[str]:
95
95
  __all__ = [
96
96
  "Constellation",
97
97
  "Gaussian",
98
+ "Preamble",
99
+ "PrecisionWarning",
98
100
  "RC",
99
101
  "RRC",
100
- "Reference",
101
102
  "Rect",
102
- "SmoothRect",
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 read-only host fields of
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.
@@ -87,6 +87,16 @@ def validate_array(
87
87
  return v
88
88
 
89
89
 
90
+ def host_array(value: Any, dtype: Any = None) -> np.ndarray:
91
+ """Return ``value`` as a host NumPy array for value-object construction.
92
+
93
+ One transfer for device input (documented in ``transfer_trace``), used by
94
+ :func:`freeze_host` and by value objects or constructors that inspect or
95
+ transform an array before freezing it.
96
+ """
97
+ return _to_host(value, dtype)
98
+
99
+
90
100
  def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarray:
91
101
  """Store ``value`` as field ``name`` of the frozen dataclass ``obj``.
92
102
 
@@ -94,7 +104,7 @@ def freeze_host(obj: Any, name: str, value: Any, dtype: Any = None) -> np.ndarra
94
104
  so the caller's array stays writable and a value object never holds
95
105
  device memory. Returns the stored array.
96
106
  """
97
- arr = np.array(_to_host(value), dtype=dtype)
107
+ arr = np.array(host_array(value), dtype=dtype)
98
108
  arr.setflags(write=False)
99
109
  object.__setattr__(obj, name, arr)
100
110
  return arr
@@ -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=np.result_type(samples.dtype, np.complex64),
189
+ dtype=out_dtype,
189
190
  )
190
191
  result = _fft.ifft(_fft.fft(samples, axis=-1) * h[None, :], axis=-1)
191
- if result.dtype != samples.dtype:
192
- result = result.astype(samples.dtype)
192
+ if result.dtype != out_dtype:
193
+ result = result.astype(out_dtype)
193
194
  return restore_1d(was_1d, result)
@@ -82,10 +82,26 @@ def allan_deviation(
82
82
  scalloped ADEV with nulls at ``τ = k·T_m``; those dips are not a lower
83
83
  noise floor.
84
84
  """
85
+ fs = float(sampling_rate)
86
+ if not (np.isfinite(fs) and fs > 0.0):
87
+ raise ValueError(
88
+ f"allan_deviation(): sampling_rate must be finite and > 0, got {sampling_rate!r}."
89
+ )
90
+ if (
91
+ isinstance(num_taus, bool)
92
+ or not isinstance(num_taus, int | np.integer)
93
+ or int(num_taus) < 1
94
+ ):
95
+ raise ValueError(
96
+ f"allan_deviation(): num_taus must be an integer >= 1, got {num_taus!r}."
97
+ )
98
+ num_taus = int(num_taus)
85
99
  df_arr, xp, _ = dispatch(df)
86
100
  y2, was_1d = as_2d(df_arr, name="df")
87
101
  c, n = y2.shape
88
- tau0 = 1.0 / float(sampling_rate)
102
+ if n < 2:
103
+ raise ValueError(f"allan_deviation(): df needs at least 2 samples, got {n}.")
104
+ tau0 = 1.0 / fs
89
105
 
90
106
  # Cumulative phase (time error) x_i = Σ y · τ0, in one float64 buffer.
91
107
  x = xp.empty((c, n + 1), dtype=xp.float64)
@@ -98,6 +114,15 @@ def allan_deviation(
98
114
  ms = np.unique(np.round(np.geomspace(1, m_max, num_taus)).astype(int))
99
115
  else:
100
116
  taus_cpu = _to_host(taus, np.float64)
117
+ if (
118
+ taus_cpu.ndim != 1
119
+ or taus_cpu.size == 0
120
+ or not np.all(np.isfinite(taus_cpu) & (taus_cpu > 0.0))
121
+ ):
122
+ raise ValueError(
123
+ "allan_deviation(): taus must be a non-empty 1-D array of finite "
124
+ "values > 0."
125
+ )
101
126
  ms = np.unique(np.maximum(1, np.round(taus_cpu / tau0).astype(int)))
102
127
  ms = ms[ms <= max(1, (x.shape[-1] - 1) // 2)]
103
128
 
@@ -161,12 +161,31 @@ def frequency_drift(
161
161
  matters only for band-limited content near Nyquist (see the Notes of
162
162
  :func:`fm_noise_psd`; broadband white FM is not affected).
163
163
  """
164
+ fs = float(sampling_rate)
165
+ if not (np.isfinite(fs) and fs > 0.0):
166
+ raise ValueError(
167
+ f"frequency_drift(): sampling_rate must be finite and > 0, got {sampling_rate!r}."
168
+ )
169
+ if (
170
+ isinstance(edge_trim, bool)
171
+ or not isinstance(edge_trim, int | np.integer)
172
+ or int(edge_trim) < 0
173
+ ):
174
+ raise ValueError(
175
+ f"frequency_drift(): edge_trim must be an integer >= 0, got {edge_trim!r}."
176
+ )
177
+ edge_trim = int(edge_trim)
164
178
  d, xp, _ = dispatch(drift_phase)
165
179
  d2, was_1d = as_2d(d, name="drift_phase")
166
180
  if edge_trim > 0:
167
181
  d2 = d2[:, edge_trim:-edge_trim]
182
+ if d2.shape[-1] < 2:
183
+ raise ValueError(
184
+ f"frequency_drift(): need at least 2 samples after edge_trim={edge_trim}, "
185
+ f"got {d2.shape[-1]}."
186
+ )
168
187
 
169
- dt = 1.0 / float(sampling_rate)
188
+ dt = 1.0 / fs
170
189
  df = xp.diff(d2.astype(xp.float64), axis=-1) / (2.0 * np.pi * dt)
171
190
 
172
191
  # One D2H transfer for all three summaries instead of three syncs.
@@ -79,17 +79,28 @@ def carrier_phase_trajectory(
79
79
  explicit noise estimate.
80
80
  """
81
81
  name = "carrier_phase_trajectory()"
82
+ if channel_pairing not in ("auto", "identity", "swap"):
83
+ raise ValueError(
84
+ f"{name}: channel_pairing must be 'auto', 'identity' or 'swap', "
85
+ f"got {channel_pairing!r}."
86
+ )
82
87
  inp = SignalInput(symbols, name)
83
88
  y, xp, _ = dispatch(inp.symbols())
84
89
  reference = inp.reference_symbols(reference, required=True)
85
90
 
86
91
  y2, was_1d = as_2d(y, name="symbols")
87
92
  c = y2.shape[0]
93
+ if channel_pairing == "swap" and c > 2:
94
+ raise ValueError(
95
+ f"{name}: channel_pairing='swap' is only defined for 2 channels, got {c}."
96
+ )
88
97
  d2 = broadcast_channels(
89
98
  to_device(reference, "cpu" if xp is np else "gpu"), c, xp, name="reference"
90
99
  )
91
100
 
92
101
  n = min(y2.shape[-1], d2.shape[-1])
102
+ if n == 0:
103
+ raise ValueError(f"{name}: symbols and reference must be non-empty.")
93
104
  y2, d2 = y2[:, :n], d2[:, :n]
94
105
 
95
106
  if c > 1 and channel_pairing == "auto":
@@ -108,6 +108,19 @@ def _module_for(device: str) -> types.ModuleType:
108
108
  return _cupy()
109
109
 
110
110
 
111
+ def require_device(device: str, function_name: str) -> str:
112
+ """Validate a factory's ``device`` and return it lower-cased.
113
+
114
+ Factories have no input data whose device they could follow, so they are
115
+ the only functions that take ``device=``.
116
+ """
117
+ if isinstance(device, str) and device.lower() in ("cpu", "gpu"):
118
+ return device.lower()
119
+ raise ValueError(
120
+ f'{function_name} requires device to be "cpu" or "gpu"; got {device!r}.'
121
+ )
122
+
123
+
111
124
  def get_array_module(data: Any) -> types.ModuleType:
112
125
  """Return the array module (NumPy or CuPy) of the data.
113
126
 
@@ -136,6 +136,19 @@ class ReedSolomonCode(_Algebraic):
136
136
  first_root: int = 0
137
137
 
138
138
  def __post_init__(self) -> None:
139
+ for name in ("symbols", "info_symbols", "m", "first_root"):
140
+ v = getattr(self, name)
141
+ if isinstance(v, bool) or not isinstance(v, int | np.integer):
142
+ raise ValueError(f"{name} must be an integer, got {v!r}.")
143
+ object.__setattr__(self, name, int(v))
144
+ if self.primitive is not None:
145
+ if isinstance(self.primitive, bool) or not isinstance(
146
+ self.primitive, int | np.integer
147
+ ):
148
+ raise ValueError(
149
+ f"primitive must be an integer, got {self.primitive!r}."
150
+ )
151
+ object.__setattr__(self, "primitive", int(self.primitive))
139
152
  n, k, m = self.symbols, self.info_symbols, self.m
140
153
  prim = PRIMITIVE.get(m) if self.primitive is None else self.primitive
141
154
  if prim is None:
@@ -145,6 +158,7 @@ class ReedSolomonCode(_Algebraic):
145
158
  raise ValueError(
146
159
  f"need 1 <= k < n <= 2^m - 1 with n - k even, got n={n}, k={k}, m={m}."
147
160
  )
161
+ _ = self.field
148
162
 
149
163
  @property
150
164
  def n(self) -> int:
@@ -278,12 +292,23 @@ class BCHCode(_Algebraic):
278
292
  primitive: int | None = None
279
293
 
280
294
  def __post_init__(self) -> None:
295
+ for name in ("m", "t"):
296
+ v = getattr(self, name)
297
+ if isinstance(v, bool) or not isinstance(v, int | np.integer):
298
+ raise ValueError(f"{name} must be an integer, got {v!r}.")
299
+ object.__setattr__(self, name, int(v))
300
+ for name in ("length", "primitive"):
301
+ v = getattr(self, name)
302
+ if v is not None:
303
+ if isinstance(v, bool) or not isinstance(v, int | np.integer):
304
+ raise ValueError(f"{name} must be an integer, got {v!r}.")
305
+ object.__setattr__(self, name, int(v))
281
306
  prim = PRIMITIVE.get(self.m) if self.primitive is None else self.primitive
282
307
  if prim is None:
283
308
  raise ValueError(f"no default primitive polynomial for m = {self.m}.")
284
309
  object.__setattr__(self, "primitive", prim)
285
310
  full = (1 << self.m) - 1
286
- if not isinstance(self.t, int) or self.t < 1:
311
+ if self.t < 1:
287
312
  raise ValueError(f"t must be an integer >= 1, got {self.t!r}.")
288
313
  if self.length is None:
289
314
  object.__setattr__(self, "length", full)
@@ -43,7 +43,7 @@ __all__ = ["DecodeResult", "decode", "encode"]
43
43
  _HARD_LLR = 1.0
44
44
 
45
45
 
46
- @dataclass(frozen=True)
46
+ @dataclass(frozen=True, eq=False)
47
47
  class DecodeResult:
48
48
  """Output of :func:`decode`, arrays on the input's device.
49
49
 
@@ -184,6 +184,8 @@ class _Codec:
184
184
  # Sequential on the host (distribution matchers): GPU input round-trips,
185
185
  # and generate() encodes before moving the payload.
186
186
  host: bool = False
187
+ # Custom recursive method validator/resolver for composite codes.
188
+ resolve_method: Callable[[Any, Any, str], Any] | None = None
187
189
 
188
190
 
189
191
  #: Codec per code class, filled by each code module as ``_CODECS[cls] = ...``.
@@ -202,6 +204,8 @@ def _codec(code: Any, function_name: str) -> _Codec:
202
204
 
203
205
  def _resolve_method(code: Any, method: Any, function_name: str) -> Any:
204
206
  codec = _codec(code, function_name)
207
+ if codec.resolve_method is not None:
208
+ return codec.resolve_method(code, method, function_name)
205
209
  if method is None:
206
210
  return codec.default_method(code)
207
211
  if not isinstance(method, codec.methods):
@@ -127,7 +127,12 @@ class ConvolutionalCode(_Code):
127
127
  raise ValueError(
128
128
  f"constraint_length must be an integer in [2, 16], got {k!r}."
129
129
  )
130
- gens = tuple(int(g) for g in self.generators)
130
+ raw_gens = list(self.generators)
131
+ if any(
132
+ isinstance(g, bool) or not isinstance(g, int | np.integer) for g in raw_gens
133
+ ):
134
+ raise ValueError("generators must be integers.")
135
+ gens = tuple(int(g) for g in raw_gens)
131
136
  if len(gens) < 2 or any(not 0 < g < (1 << k) for g in gens):
132
137
  raise ValueError(
133
138
  f"need two or more generators of at most {k} bits, nonzero."
@@ -88,7 +88,11 @@ class CRC(_Code):
88
88
  raise ValueError(f"info_bits must be an integer >= 1, got {k!r}.")
89
89
  for name in ("polynomial", "init", "xor_out"):
90
90
  value = getattr(self, name)
91
- if not isinstance(value, int) or not 0 <= value < (1 << r):
91
+ if (
92
+ isinstance(value, bool)
93
+ or not isinstance(value, int)
94
+ or not 0 <= value < (1 << r)
95
+ ):
92
96
  raise ValueError(f"{name} must be an integer in [0, 2^{r}).")
93
97
  if self.reflect_in and k % 8:
94
98
  raise ValueError("reflect_in needs info_bits that is a multiple of 8.")
@@ -62,11 +62,17 @@ from typing import Any
62
62
  import numpy as np
63
63
 
64
64
  from .. import _random
65
- from .._array import freeze_host
66
- from ..backend import ArrayType, _module_for, _to_host, dispatch, to_device
65
+ from .._array import freeze_host, host_array
66
+ from ..backend import (
67
+ ArrayType,
68
+ _module_for,
69
+ dispatch,
70
+ require_device,
71
+ to_device,
72
+ )
67
73
  from ..logger import logger
68
74
  from ..mapping import Constellation
69
- from .base import _decode_blocks, _encode_blocks, _resolve_method
75
+ from .base import _codec, _decode_blocks, _encode_blocks, _resolve_method, _Value
70
76
  from .ldpc import LDPCCode
71
77
 
72
78
  __all__ = [
@@ -103,7 +109,7 @@ _DEMAP_CHUNK = 1 << 22
103
109
 
104
110
 
105
111
  @dataclass(frozen=True, eq=False)
106
- class ExitCurve:
112
+ class ExitCurve(_Value):
107
113
  """The transfer curve of one soft-in soft-out component.
108
114
 
109
115
  Returned by the curve sources of this module; the constructor takes the
@@ -133,7 +139,7 @@ class ExitCurve:
133
139
 
134
140
  def __post_init__(self) -> None:
135
141
  a = freeze_host(self, "a_priori", self.a_priori, np.float64)
136
- e = _to_host(self.extrinsic, np.float64)
142
+ e = host_array(self.extrinsic, np.float64)
137
143
  if a.ndim != 1 or a.shape != e.shape or a.size < 2:
138
144
  raise ValueError(
139
145
  "ExitCurve: a_priori and extrinsic must be 1-D of one length >= 2, "
@@ -149,7 +155,7 @@ class ExitCurve:
149
155
 
150
156
 
151
157
  @dataclass(frozen=True, eq=False)
152
- class ExitChart:
158
+ class ExitChart(_Value):
153
159
  """Two EXIT curves and the decoding trajectory between them.
154
160
 
155
161
  Attributes
@@ -371,7 +377,8 @@ def decoder_exit_curve(
371
377
  """
372
378
  method = _resolve_method(code, method, "decoder_exit_curve()")
373
379
  _check_points(num_points, "decoder_exit_curve()")
374
- xp = _module_for(_check_device(device, "decoder_exit_curve()"))
380
+ device = require_device(device, "decoder_exit_curve()")
381
+ xp = _module_for(device)
375
382
  blocks = (
376
383
  max(1, math.ceil(_DEFAULT_BITS / code.n)) if num_blocks is None else num_blocks
377
384
  )
@@ -381,7 +388,10 @@ def decoder_exit_curve(
381
388
  )
382
389
  gen = _random.as_generator(rng)
383
390
  info = gen.integers(0, 2, (blocks, code.k), dtype=np.int8)
384
- bits = _encode_blocks(code, to_device(info, device))
391
+ if _codec(code, "decoder_exit_curve()").host:
392
+ bits = to_device(_encode_blocks(code, info), device)
393
+ else:
394
+ bits = _encode_blocks(code, to_device(info, device))
385
395
  sign = (1 - 2 * bits).astype(np.float32)
386
396
  grid = np.linspace(0.0, 1.0, num_points)
387
397
  label = f"{method!r} on {code!r}"
@@ -554,7 +564,7 @@ def demapper_exit_curve(
554
564
  )
555
565
  if method not in ("exact", "maxlog"):
556
566
  raise ValueError(f'{name}: method must be "exact" or "maxlog", got {method!r}.')
557
- xp = _module_for(_check_device(device, name))
567
+ xp = _module_for(require_device(device, name))
558
568
 
559
569
  gen = _random.as_generator(rng)
560
570
  index = to_device(gen.integers(0, constellation.order, num_symbols), device)
@@ -980,10 +990,3 @@ def _check_points(num_points: Any, name: str) -> None:
980
990
  raise ValueError(
981
991
  f"{name}: num_points must be an integer >= 2, got {num_points}."
982
992
  )
983
-
984
-
985
- def _check_device(device: Any, name: str) -> str:
986
- """Validate ``device`` as the factories do (``core`` is above this layer)."""
987
- if isinstance(device, str) and device.lower() in ("cpu", "gpu"):
988
- return device.lower()
989
- raise ValueError(f'{name} requires device to be "cpu" or "gpu"; got {device!r}.')
@@ -19,8 +19,8 @@ from typing import Any
19
19
 
20
20
  import numpy as np
21
21
 
22
- from .._array import freeze_host, validate_array
23
- from ..backend import ArrayType, _device_tables, _to_host, get_array_module
22
+ from .._array import freeze_host, host_array, validate_array
23
+ from ..backend import ArrayType, _device_tables, get_array_module
24
24
  from .base import _Value
25
25
 
26
26
  __all__ = ["Interleaver", "deinterleave", "interleave"]
@@ -40,7 +40,7 @@ class Interleaver(_Value):
40
40
  permutation: np.ndarray
41
41
 
42
42
  def __post_init__(self) -> None:
43
- p = _to_host(self.permutation)
43
+ p = host_array(self.permutation)
44
44
  if p.ndim != 1 or p.size == 0 or p.dtype.kind not in "iu":
45
45
  raise ValueError("permutation must be a non-empty 1-D integer array.")
46
46
  if not np.array_equal(np.sort(p), np.arange(p.size)):
@@ -33,10 +33,10 @@ from typing import Any, NamedTuple
33
33
  import numpy as np
34
34
 
35
35
  from .. import _cuda
36
- from .._array import freeze_host
37
- from ..backend import ArrayType, _device_tables, _to_host, dispatch
36
+ from .._array import freeze_host, host_array
37
+ from ..backend import ArrayType, _device_tables, dispatch
38
38
  from ..logger import logger
39
- from ._gf2 import inverse, matmul_mod2, rank, row_reduce
39
+ from ._gf2 import inverse, matmul_mod2, row_reduce
40
40
  from ._ldpc_tables import DVBS2, PON_BASE
41
41
  from .base import _CODECS, _Code, _Codec, _Decoded, _numba
42
42
 
@@ -81,8 +81,8 @@ class LDPCCode(_Code):
81
81
  punctured: int = 0
82
82
 
83
83
  def __post_init__(self) -> None:
84
- rows = _to_host(self.checks)
85
- cols = _to_host(self.variables)
84
+ rows = host_array(self.checks)
85
+ cols = host_array(self.variables)
86
86
  for name in ("num_checks", "num_variables", "punctured"):
87
87
  v = getattr(self, name)
88
88
  if isinstance(v, bool) or not isinstance(v, int | np.integer):
@@ -167,6 +167,12 @@ class LDPCCode(_Code):
167
167
  """
168
168
  import scipy.sparse
169
169
 
170
+ if not scipy.sparse.issparse(parity_check):
171
+ parity_check = host_array(parity_check)
172
+ if getattr(parity_check, "ndim", None) != 2:
173
+ raise ValueError(
174
+ f"parity_check must be 2-D, got {getattr(parity_check, 'ndim', None)}-D."
175
+ )
170
176
  h = scipy.sparse.coo_array(parity_check)
171
177
  h.sum_duplicates()
172
178
  h.eliminate_zeros()
@@ -196,10 +202,16 @@ class LDPCCode(_Code):
196
202
  LDPCCode
197
203
  Logs a warning on 4-cycles, as :meth:`from_parity_check`.
198
204
  """
199
- b = np.asarray(base)
205
+ b = host_array(base)
206
+ if (
207
+ isinstance(lifting, bool)
208
+ or not isinstance(lifting, int | np.integer)
209
+ or int(lifting) < 1
210
+ ):
211
+ raise ValueError(f"lifting must be an integer >= 1, got {lifting!r}.")
200
212
  z = int(lifting)
201
- if b.ndim != 2 or z < 1:
202
- raise ValueError("base must be a matrix and lifting >= 1.")
213
+ if b.ndim != 2 or b.size == 0 or b.dtype.kind not in "iu":
214
+ raise ValueError("base must be a non-empty 2-D integer matrix.")
203
215
  if b.min() < -1:
204
216
  raise ValueError("base entries must be shifts >= 0 or -1.")
205
217
  bi, bj = np.nonzero(b >= 0)
@@ -459,8 +471,11 @@ def _build_encoder(code: LDPCCode) -> _Encoder:
459
471
  if m <= _MAX_INVERSE:
460
472
  hp = np.zeros((m, m), dtype=np.int8)
461
473
  hp[p_rows, p_cols] = 1
462
- if rank(hp) == m:
474
+ try:
463
475
  inv_t = inverse(hp).T.astype(np.float32)
476
+ except ValueError:
477
+ pass
478
+ else:
464
479
  return _Encoder(
465
480
  "inverse", np.arange(k), np.arange(k, n), (*info_csr, inv_t)
466
481
  )