From: DL1YCF Date: Sat, 8 May 2021 10:55:35 +0000 (+0200) Subject: Limit swr so that it does not become infinity X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20//%22%22?a=commitdiff_plain;h=8d337f6b222b1cbac08de06e8fa3831cec820233;p=pihpsdr.git Limit swr so that it does not become infinity --- diff --git a/transmitter.c b/transmitter.c index 015f46e..ec74483 100644 --- 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 { //