Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 07 Jan 2021 11:47:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-06 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 5:

> Patch Set 5:
>
> iiuc the issue was still not fixed in latest version?

No, it wasn't fixed yet. I don't see how this problem is related to this patch 
though...


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 07 Jan 2021 00:33:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-06 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 5:

iiuc the issue was still not fixed in latest version?


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 06 Jan 2021 22:00:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-06 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 06 Jan 2021 12:31:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 4:

(1 comment)

Thank you!

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c@76
PS4, Line 76:   if (*Avg100 == 0) {
> Agree with the first run, but you seem to have overlooked my comment 
> regarding this patch being hit  […]
Oh, damn, you're right. We currently feed it with dBm values where value 0 is 
very unlikely. However, for RxLev (0..63) and RxQual (0..7) it will likely 
become a problem. We can add a boolean flag to the state to avoid this.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 04 Jan 2021 11:24:23 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-04 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c@76
PS4, Line 76:   if (*Avg100 == 0) {
> Agree with the first run, but you seem to have overlooked my comment 
> regarding this patch being hit  […]
s/patch/path/



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 04 Jan 2021 11:22:27 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-04 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c@76
PS4, Line 76:   if (*Avg100 == 0) {
> The point of weighting is that you take a part of the recent measurement 
> value, and a part of the pr […]
Agree with the first run, but you seem to have overlooked my comment regarding 
this patch being hit to on other than first runs.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 04 Jan 2021 11:19:47 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-04 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c@76
PS4, Line 76:   if (*Avg100 == 0) {
> iiuc Avg100 can also be 0 after first run. […]
The point of weighting is that you take a part of the recent measurement value, 
and a part of the previous one. So their sum matters. During the first run, 
outputting the value as-is seems reasonable to me, otherwise if e.g. A=50 
(default) and Val=-80 you would get Avg=-40, so the power will be increased or 
decreased for no reason.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 04 Jan 2021 10:43:22 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2021-01-04 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c
File src/common/power_control.c:

https://gerrit.osmocom.org/c/osmo-bts/+/21907/4/src/common/power_control.c@76
PS4, Line 76:   if (*Avg100 == 0) {
iiuc Avg100 can also be 0 after first run. In that case you are applying 
non-smoothed value (without weight)?
You probably need to multiply by A?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 04 Jan 2021 10:34:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2020-12-30 Thread fixeria
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bts/+/21907

to look at the new patch set (#4).

Change subject: power_control: generalize the arguments of do_pf_ewma()
..

power_control: generalize the arguments of do_pf_ewma()

This way EWMA based filtering can also be applied to RxQual.

Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Related: SYS#4918, SYS#4917
---
M src/common/power_control.c
1 file changed, 15 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/21907/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2020-12-30 Thread fixeria
fixeria has uploaded a new patch set (#3). ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )

Change subject: power_control: generalize the arguments of do_pf_ewma()
..

power_control: generalize the arguments of do_pf_ewma()

This way EWMA based filtering can also be applied to RxQual.

Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Related: SYS#4918, SYS#4917
---
M src/common/power_control.c
1 file changed, 13 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/21907/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: power_control: generalize the arguments of do_pf_ewma()

2020-12-30 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/21907 )


Change subject: power_control: generalize the arguments of do_pf_ewma()
..

power_control: generalize the arguments of do_pf_ewma()

This way EWMA based filtering can also be applied to RxQual.

Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Related: SYS#4918, SYS#4917
---
M src/common/power_control.c
1 file changed, 13 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/21907/1

diff --git a/src/common/power_control.c b/src/common/power_control.c
index a616f18..9e6fb45 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -38,29 +38,29 @@

 /* Base Low-Pass Single-Pole IIR Filter (EWMA) formula:
  *
- *   Avg[n] = a * Pwr[n] + (1 - a) * Avg[n - 1]
+ *   Avg[n] = a * Val[n] + (1 - a) * Avg[n - 1]
  *
  * where parameter 'a' determines how much weight of the latest UL RSSI 
measurement
- * result 'Pwr[n]' carries vs the weight of the average 'Avg[n - 1]'.  The 
value of
+ * result 'Val[n]' carries vs the weight of the average 'Avg[n - 1]'.  The 
value of
  * 'a' is usually a float in range 0 .. 1, so:
  *
- *  - value 0.5 gives equal weight to both 'Pwr[n]' and 'Avg[n - 1]';
+ *  - value 0.5 gives equal weight to both 'Val[n]' and 'Avg[n - 1]';
  *  - value 1.0 means no filtering at all (pass through);
  *  - value 0.0 makes no sense.
  *
  * Further optimization:
  *
- *   Avg[n] = a * Pwr[n] + Avg[n - 1] - a * Avg[n - 1]
+ *   Avg[n] = a * Val[n] + Avg[n - 1] - a * Avg[n - 1]
  *   ^^^^
  *
  * a) this can be implemented in C using '+=' operator:
  *
- *   Avg += a * Pwr - a * Avg
- *   Avg += a * (Pwr - Avg)
+ *   Avg += a * Val - a * Avg
+ *   Avg += a * (Val - Avg)
  *
  * b) everything is scaled up by 100 to avoid floating point stuff:
  *
- *   Avg100 += A * (Pwr - Avg)
+ *   Avg100 += A * (Val - Avg)
  *
  * where 'Avg100' is 'Avg * 100' and 'A' is 'a * 100'.
  *
@@ -70,20 +70,15 @@
  *   
https://en.wikipedia.org/wiki/Low-pass_filter#Simple_infinite_impulse_response_filter
  *   https://tomroelandts.com/articles/low-pass-single-pole-iir-filter
  */
-static int8_t do_pf_ewma(const struct bts_power_ctrl_params *params,
-struct lchan_power_ctrl_state *state,
-const int8_t Pwr)
+static int do_pf_ewma(int *Avg100, const int Val, const uint8_t A)
 {
-   const uint8_t A = params->pf.ewma.alpha;
-   int *Avg100 = >avg100_rxlev_dbm;
-
/* We don't have 'Avg[n - 1]' if this is the first run */
if (*Avg100 == 0) {
-   *Avg100 = Pwr * EWMA_SCALE_FACTOR;
-   return Pwr;
+   *Avg100 = Val * EWMA_SCALE_FACTOR;
+   return Val;
}

-   *Avg100 += A * (Pwr - *Avg100 / EWMA_SCALE_FACTOR);
+   *Avg100 += A * (Val - *Avg100 / EWMA_SCALE_FACTOR);
return *Avg100 / EWMA_SCALE_FACTOR;
 }

@@ -99,7 +94,8 @@
/* Filter input value(s) to reduce unnecessary Tx power oscillations */
switch (params->pf_algo) {
case BTS_PF_ALGO_EWMA:
-   rxlev_dbm_avg = do_pf_ewma(params, state, rxlev_dbm);
+   rxlev_dbm_avg = do_pf_ewma(>avg100_rxlev_dbm, rxlev_dbm,
+  params->pf.ewma.alpha);
break;
case BTS_PF_ALGO_NONE:
default:

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/21907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Gerrit-Change-Number: 21907
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange