fix(indoor): sample d_2D-in as min(U1,U2) per TR 38.901 §7.4.3.1#1156
Open
Vinu2111 wants to merge 1 commit intoNVlabs:mainfrom
Open
fix(indoor): sample d_2D-in as min(U1,U2) per TR 38.901 §7.4.3.1#1156Vinu2111 wants to merge 1 commit intoNVlabs:mainfrom
Vinu2111 wants to merge 1 commit intoNVlabs:mainfrom
Conversation
Per TR 38.901 §7.4.3.1, the indoor 2D distance d_2D-in must be computed as min(d_2D-in-1, d_2D-in-2) where both are independent uniform samples over [min_2d_in, max_2d_in]. The previous implementation sampled a single uniform value, producing a flat U(min, max) distribution instead of the correct triangular-like distribution skewed toward the lower bound. This materially affects pathloss and O2I penetration loss calculations for indoor UTs. Fix: draw two independent rand() samples u1 and u2 and take torch.minimum(u1, u2) before applying the indoor_mask. Adds two new tests to TestRMaScenario: - test_d2d_in_range_and_outdoor_zero: verifies d_2D-in is within [0, max_2d_in] for all-indoor topology - test_d2d_in_outdoor_uts_are_zero: verifies d_2D-in is exactly 0 for all-outdoor topology Fixes NVlabs#1108
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1108
The indoor 2D distance
d_2D-inin_sample_indoor_distance()was computed from a single uniform sampleU(min_2d_in, max_2d_in). Per TR 38.901 §7.4.3.1, it must bemin(d_2D-in-1, d_2D-in-2)where both are independent uniform samples over the same range.Root Cause
The previous implementation produced a flat uniform distribution. The correct
min(U1, U2)of two i.i.d. uniforms follows a distribution skewed toward the lower bound — meaning indoor UTs are statistically placed closer to the building wall, which materially affects pathloss and O2I penetration loss calculations.Fix
Draw two independent
rand()samples and taketorch.minimum(u1, u2)before applyingindoor_mask:The fix applies to all three subclasses (UMa, UMi, RMa) since
_sample_indoor_distance()lives in the base classSystemLevelScenario.Changes
src/sionna/phy/channel/tr38901/system_level_scenario.py— replace single uniform sample withmin(U1, U2)test/unit/channel/test_3gpp_channel_scenario.py— two new tests added toTestRMaScenario:test_d2d_in_range_and_outdoor_zero— verifiesd_2D-inis within[0, max_2d_in]for all-indoor topologytest_d2d_in_outdoor_uts_are_zero— verifiesd_2D-inis exactly0for all-outdoor topologyTesting
New tests cover range bounds and the
indoor_maskzeroing logic. The existingtest_distance_calculationcontinues to verify additive consistency (d_2D-in + d_2D-out == d_2D).