From 1c9f8b6345569e8cabfe8eeeedb2dbcec2f8d207 Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 12 Feb 2024 11:08:35 +0100 Subject: [PATCH] two corrections in Ycor and NF formulae --- src/spicelib/analysis/span.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spicelib/analysis/span.c b/src/spicelib/analysis/span.c index 86e59daa0..f4bdcbefa 100644 --- a/src/spicelib/analysis/span.c +++ b/src/spicelib/analysis/span.c @@ -126,7 +126,7 @@ CKTspnoise(CKTcircuit* ckt, int mode, int operation, Ndata* data, NOISEAN* noise cplx Ycor = csubco(ckt->CKTYmat->d[0][0], cmultco( cdivco(tempCy->d[0][1], tempCy->d[1][1]), - tempCy->d[1][0] + ckt->CKTYmat->d[1][0] )); double Y11_Ycor = cmodsqr(csubco(ckt->CKTYmat->d[0][0], Ycor)); @@ -138,7 +138,7 @@ CKTspnoise(CKTcircuit* ckt, int mode, int operation, Ndata* data, NOISEAN* noise caddco(Y0, Ysopt)); Fmin = 1.0 + 2.0 * Rn * (Ycor.re + Ysopt.re); double Ysoptmod = cmodu(csubco(Y0, Ysopt)); - NF = Fmin + (Rn / Ysopt.re) * SQR(Ysoptmod); + NF = Fmin + (Rn / Y0.re) * SQR(Ysoptmod); Fmin = 10.0 * log10(Fmin); NF = 10.0 * log10(NF); }