<p>fixeria <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/20657">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">power_control: implement EWMA based Uplink power filtering<br><br>So far the Uplink power control loop did not filter the Uplink RSSI<br>measurements (reported by the BTS) at all.  The lack of filtering<br>makes our implementation too quick on the trigger, so in the real<br>deployments there will be unneeded Tx power oscillations.<br><br>In order to reduce this effect, let's implement a very simple EWMA<br>(also known as Single Pole IIR) filtering that is defined as follows:<br><br>  Avg[n] = a * Pwr[n] + (1 - a) * Avg[n - 1]<br><br>where parameter 'a' determines how much weight of the latest UL RSSI<br>measurement result 'Pwr[n]' carries vs the weight of the average<br>'Avg[n - 1]'.  The value of 'a' is usually a float in range 0 .. 1, so:<br><br>  - value 0.5 gives equal weight to both 'Pwr[n]' and 'Avg[n - 1]';<br>  - value 1.0 means no filtering at all (pass through);<br>  - value 0.0 makes no sense.<br><br>This formula was further optimized with the use of '+=' operator.<br>The floating point math was also eliminated by scaling everything<br>up (by 100).  For more details, see:<br><br>https://en.wikipedia.org/wiki/Moving_average<br>https://en.wikipedia.org/wiki/Low-pass_filter#Simple_infinite_impulse_response_filter<br>https://tomroelandts.com/articles/low-pass-single-pole-iir-filter<br><br>The EWMA filtering is now *enabled by default*, but can be disabled<br>or (re-)configured over the VTY at any time:<br><br>  ! Completely disable filtering<br>  no uplink-power-filtering<br><br>  ! Enable EWMA smoothing with the given parameters<br>  uplink-power-filtering algo ewma beta <1-99><br><br>Note that the VTY command expects 'beta' instead of 'alpha':<br><br>  alpha = (100 - beta)<br><br>and the value must be in %.  This is done for simplicity:<br><br>  1% means lowest smoothing,<br>  99% means highest smoothing.<br><br>Let's say we have EWMA filtering enabled with alpha = 0.4, and get<br>-98 dBm on the input, while the last output value was -60 dBm.<br>The new output would be:<br><br>  Avg[n] = 0.4 * Pwr[n] + 0.6 * Avg[n - 1]<br>  Avg[n] = (0.4 * -98) + (0.6 * -60)<br>  Avg[n] = -75.2 => around -75<br><br>Of course, this is not a silver bullet, but better than nothing.<br><br>Change-Id: Ib6dcadbf14ef59696c6a546bd323bda92d399f17<br>Related: SYS#4916<br>---<br>M include/osmo-bts/bts.h<br>M include/osmo-bts/gsm_data.h<br>M src/common/bts.c<br>M src/common/power_control.c<br>M src/common/vty.c<br>M tests/power/power_test.c<br>M tests/power/power_test.err<br>M tests/power/power_test.ok<br>8 files changed, 238 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/20657/3</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/20657">change 20657</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/20657"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib6dcadbf14ef59696c6a546bd323bda92d399f17 </div>
<div style="display:none"> Gerrit-Change-Number: 20657 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>