Repository navigation
Conversation
… decay of a plane wave DielectricObstacleLoss::computeDielectricLoss() returns the power factor that computeObjectLoss() multiplies into the obstacle loss and that the analog models multiply into the reception power. Before this commit the factor was exp(-2 atan(tan(delta)) k z). The page that the code cites, Wikipedia on dielectric loss, gives the power decay as P = P0 exp(-k z tan(delta)), and for a small loss tangent atan(tan(delta)) is tan(delta), so the code applied the decay constant of the field twice: a 0.2 m concrete wall (resistivity 100 Ohm m, relative permittivity 4.5) lost 3.085 dB at 2.4 GHz instead of 1.542 dB. After this commit the factor is exp(-2 alpha z), where alpha = k sqrt((sqrt(1 + tan(delta)^2) - 1) / 2) is the attenuation constant of a plane wave in a material with the loss tangent tan(delta), and k is the wave number of the lossless material, as before. For a small loss tangent this is the exp(-k z tan(delta)) of the cited page, 0.0005 dB apart at 2.4 GHz. It was chosen over that formula because it also holds for a large loss tangent, which Material produces at a low frequency: k tan(delta) does not depend on the frequency for a material with a constant resistivity, so the cited formula gives 1.54 dB for the 0.2 m wall at every frequency, while a conductor attenuates as the square root of tan(delta). A material with resistivity 0 (infinite loss tangent) gives the factor 0. The loss of an obstacle is thus smaller than before for a loss tangent below about 4.6, which includes the INET materials at microwave frequencies, and larger above it. The new tests/unit/ObstacleLoss_Dielectric.test sends one transmission through a single concrete slab at 2.4 GHz and at 10 MHz and compares the printed loss with the analytic value; ObstacleLossTest, the module that prints the loss, is new in the test library. The fingerprints of 21 runs move. In examples/wireless/obstacle Indoor and Outdoor, showcases/wireless/ratecontrol NoRateControl and AarfRateControl, showcases/visualizer/canvas/ieee80211 SignalLevels and showcases/visualizer/canvas/spectrum PowerDensityMap the walls take less power from the frames, so the SNIR and with it the receptions, the retries and the rate adaptation change: tplx, ~tNl and ~tND move. In the three configs of examples/objectcache only tplx moves: a few more frames now arrive above the sensitivity of a receiver, so the radio hands them to the MAC (9 more events in WithoutCache, 20880 to 20889), and nothing on the air changes, so ~tNl and ~tND stay. The tyf entries of these runs also move; they are not regenerated here because they do not reproduce on the build that produced the other values. Change: src.physicallayer.wireless.common.obstacleloss.DielectricObstacleLoss | behavior.change.fix | test fingerprint whatsnew
This branch has not been deployed
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.
Fixes #1437. On master 7ec0d4d, one commit.
DielectricObstacleLoss::computeDielectricLoss()returnedexp(-2 atan(tan(delta)) k z)as the power factor of an obstacle. The page that it cites gives the power decay of a plane wave asexp(-k z tan(delta)), so every wall took twice as many dB as it should: 3.085 dB instead of 1.542 dB for a 0.2 m concrete wall at 2.4 GHz. The factor is now the exact power decay of a plane wave in a material with the loss tangenttan(delta):that is
exp(-2 alpha z)withalpha = k sqrt((sqrt(1 + tan²(delta)) - 1) / 2), the attenuation constant of a plane wave in a medium with the complex permittivityeps (1 - j tan(delta)).kstays the wave number of the lossless material (2 pi f / getPropagationSpeed()), as before.sqrt(1 + t²) - 1is written ast² / (sqrt(1 + t²) + 1)for a small loss tangent to keep the precision; the plain form for a large one also gives the factor 0 for a material with resistivity 0 (infinite loss tangent).Why the exact attenuation constant and not exp(-k z tan(delta))
Both agree for a small loss tangent (0.0005 dB apart for the wall above). They differ for a large one, which
Materialproduces at a low frequency:tan(delta) = 1 / (2 pi f rho eps_r eps_0)is 4.0 for concrete at 10 MHz and 40 at 1 MHz. In the cited formulak tan(delta) = sqrt(eps_r) / (rho eps_r eps_0 c)does not depend on the frequency, so it gives 1.54 dB for the 0.2 m wall at every frequency from 1 MHz to 5 GHz. A conductor attenuates assqrt(tan(delta)), and the exact expression has that limit: 0.964 dB at 10 MHz and 0.341 dB at 1 MHz. It costs one moresqrtand no new parameter.What changes for a user
The dielectric loss in dB is half of the former value for a loss tangent below 0.1 (ratio 0.50 at 0.01, 0.52 at 0.5), lower than before up to a loss tangent of about 4.6, and higher above it (ratio 1.45 at 10, 2.86 at 40). The INET materials at 2.4 GHz have
tan(delta)0.017 (concrete), 5.5e-4 (brick) and 1e-12 (glass), so walls become more transparent. A material with resistivity 0 blocked a signal byexp(-pi k z)before and blocks it completely now. Reflection loss and everything else are unchanged. Release note:doc/whatsnew/fixes/dielectricobstacleloss-loss-exponent.txt.Commit
DielectricObstacleLoss: fix: compute the dielectric loss as the power decay of a plane wave: the formula, the unit testtests/unit/ObstacleLoss_Dielectric.testwith its helper moduleObstacleLossTestintests/unit/lib, the release note, and the 21 fingerprints that move. This commit changes behavior.The change touches
computeDielectricLoss()only. No contract, packet content, parameter or feature descriptor changes.Evidence
Needs a maintainer: 8
tyfrows. Thetyfentries of the 8 moved runs (objectcache x3, obstacle Indoor, ieee80211 SignalLevels, spectrum PowerDensityMap, showcases ratecontrol x2) also move, andtests/fingerprint/store.jsonstill holds their old values. None of the 16tyfentries of these directories reproduces on this build even on master 7ec0d4d (macOS arm64; the other 51 entries do), so I could not record correct values. They needopp_update_fingerprint_test_resultson the CI platform before the merge; until then the fingerprint test of these 8 rows is red. Calculated here, before -> after: NoRateControl c4af-9f29 -> 2d18-a7da, AarfRateControl edbe-d46f -> a848-e8b4, Indoor ae40-be2e -> 8dc2-9deb, SignalLevels 4cb5-a82b -> 2a31-6482, PowerDensityMap fcb6-60c1 -> a29f-2728, objectcache f857-fb4b -> 9a7e-e0c4 (Bvh, Grid) and 94b2-b17a -> 88d3-a361 (WithoutCache). The 8 unchanged runs give the sametyfvalue before and after.Unit test, release build (
make MODE=releaseinsrcand intests/unit/lib), fromtests/unitwithopp_test genandopp_test run -p <runner>, the runner beingopp_run -u Cmdenv -l src/INET -l tests/unit/lib/test -n src:tests/unit/lib:.(opp_run_unit_testsof the CI workflow is not installed here):ObstacleLoss_Dielectric.testA slab of a material with
resistivity="0"in the same test network givesinf dBwith the fix; master givesexp(-pi k z), 291 dB for this slab at 2.4 GHz, and the precision form alone would give NaN.Fingerprints: the 67 entries of the 17 configs that use
DielectricObstacleLoss(examples/geometry, objectcache, wireless/obstacle, wireless/ratecontrol, showcases/wireless/ratecontrol, visualizer/canvas/ieee80211, visualizer/canvas/spectrum), each run withopp_run -u Cmdenvand the options of theopp_replfingerprint task for its ingredients (opp_replis not installed here). On master all 51tplx/~tNl/~tNDentries pass. With the fix 21 of them move and are updated in the commit; the other 30 pass unchanged, and all 51 pass against the updated store.~tNland~tNDstay;xadds nothing in this run (tandtxgive the same value)Unchanged, and reproduced before and after: examples/geometry General (intersection computation only), examples/wireless/obstacle Orbit (satellite path), examples/wireless/ratecontrol Mac, showcases/visualizer/canvas/ieee80211 OneNetwork, MultipleNetworks, VisualizingHandover, spectrum Spectrogram and SpectrumFigure.
Gates:
check-commits.sh,check-classification.sh,check-whatsnew.sh,check-includes.shandcheck-ned-params.shpass on7ec0d4d3f3..HEAD(two notes: a body of 432 words, and fingerprint rows that move in two ways, explained above). The patch applies on 7ec0d4d withgit am.Release build, macOS arm64, OMNeT++ 6.5.0, clang; the OSG feature is off and the fingerprint runs use
-xwith.nedexclusions.Not run: the
tyfrows on the CI platform; the fulltests/unit,tests/moduleand fingerprint suites; debug build; Linux and Windows; the Qt and OSG visualizer builds.