projects
/
pihpsdr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0c30e2
)
Limit swr so that it does not become infinity
author
DL1YCF
<dl1ycf@darc.de>
Sat, 8 May 2021 10:55:35 +0000
(12:55 +0200)
committer
DL1YCF
<dl1ycf@darc.de>
Sat, 8 May 2021 10:55:35 +0000
(12:55 +0200)
transmitter.c
patch
|
blob
|
history
diff --git
a/transmitter.c
b/transmitter.c
index 015f46e839df65ddde03c9c47f72b7b69b536d47..ec7448370e2f8610ec852827ba4f335370b26a49 100644
(file)
--- a/
transmitter.c
+++ b/
transmitter.c
@@
-670,6
+670,11
@@
static gboolean update_display(gpointer data) {
// reflected power, so correct for that
//
double gamma=(double) rev_average / (double) fwd_average;
+ //
+ // this prevents SWR going to infinity, from which the
+ // moving average cannot recover
+ //
+ if (gamma > 0.95) gamma=0.95;
tx->swr=0.7*(1+gamma)/(1-gamma) + 0.3*tx->swr;
} else {
//