From af17abd0538c6db47c9035b2923a2b7ec675f6b6 Mon Sep 17 00:00:00 2001 From: TT Date: Sat, 10 Aug 2019 13:16:17 +0900 Subject: [PATCH] fix: sign failure on impedance calculation --- plot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plot.c b/plot.c index 3ee50fb..b6045c5 100644 --- a/plot.c +++ b/plot.c @@ -571,7 +571,7 @@ gamma2imp(char *buf, int len, const float coeff[2], uint32_t frequency) // z = (gamma+1)/(gamma-1) * z0 float z0 = 50; float d = z0 / ((1-coeff[0])*(1-coeff[0])+coeff[1]*coeff[1]); - float zr = ((1+coeff[0])*(1-coeff[0]) + coeff[1]*coeff[1]) * d; + float zr = ((1+coeff[0])*(1-coeff[0]) - coeff[1]*coeff[1]) * d; float zi = 2*coeff[1] * d; int n;