summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c')
-rw-r--r--2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
index 6e7a6f93..35b49281 100644
--- a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
+++ b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
@@ -14,6 +14,9 @@
#include "modsn.h"
#include "ell1mag.h"
#include "doubleComplex.h"
+#include "multiplication.h"
+#include "addition.h"
+#include "division.h"
void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
{
@@ -31,9 +34,15 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
}
doubleComplex v;
int k;
+ double ml;
+ ml=eps*eps;
+ doubleComplex tp1,tp2,tp3;
for(k=0;k<size;k++)
{
- v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ tp1=zmuls(s[k],s[k]);
+ tp2=DoubleComplex(ml,0);
+ tp3=DoubleComplex(un[k],0);
+ v=zrdivs(tp3,zadds(tp3,(zmuls(tp2,tp1))));
oup[k]=zreals(v);
}
}