Repository navigation
beamsim v0.3.1
Patch release: a single physics fix to the knife-edge-diffraction (KED) blockage attenuation, plus a follow-up to the MATLAB-parity audit that resolves the W_HIGH and MCMD slot-7 questions.
Fixed: KED attenuation now uses the physical Fresnel-zone scale
The previous KED attenuation formula in channel._ked_attenuation_db hardcoded lambda_eff = 0.4 — a magic constant with no physical motivation — and used the wrong algebraic form (π/λ_eff − 1)/cos. TR 38.901 §7.6.4.1 and Eq 3.17 of the predecessor MSc report specify π·r/λ · (1/cos − 1) inside the square root, where r is the blocker depth and λ is the carrier wavelength.
The corrected formula:
- Threads the carrier frequency through
BlockageState.wavelength_m(computed asc / fc_hzfromChannelParams.fc_hz). - Adds
BlockageState.blocker_radius_m, defaulting to 10 m to match the predecessor'sblockage.m. - Computes
scale = π · r / λ(≈ 2940 at 28 GHz with a 10 m blocker, three orders of magnitude larger than the previous 6.85), so KED attenuation depth at oblique incidence is now physically meaningful and scales correctly with both wavelength and blocker depth.
Audit follow-up: W_HIGH and MCMD slot-7 resolved as already-thesis-faithful
The MATLAB-parity audit had flagged Python's W_HIGH = (0.16, 0.36, 0.49) and Python's three-criterion MCMD as divergences from the MATLAB code. After reading the predecessor MSc thesis (Fig 5.26 pie charts and the surrounding text), both turn out to be cases where Python is faithful to the published thesis and the MATLAB code is from a later un-published re-fit — the evolutionary search (Algorithm 7) uses random initialisation, so re-runs produce different terminal weights. No code change to MCMD was needed; the audit's Bugs in Python (MATLAB is the correct reference) category is now empty.
Test count
248 → 250 passing.
Engineering log: CHANGELOG.md. Audit: docs/MATLAB_PARITY.md. Deferred work: docs/ROADMAP.md.