diff options
author | Jorawar Singh | 2017-07-07 13:00:37 +0530 |
---|---|---|
committer | Jorawar Singh | 2017-07-07 13:00:37 +0530 |
commit | de14a5628ad439e20770d10733ebdac46562a860 (patch) | |
tree | 32373efacf2a4a6eb5a04cd222339905b077830e /src/c/signalProcessing/ell1mag | |
parent | 87823db220f4c3b8bee16c0b2e08027704de1efe (diff) | |
download | Scilab2C_fossee_old-de14a5628ad439e20770d10733ebdac46562a860.tar.gz Scilab2C_fossee_old-de14a5628ad439e20770d10733ebdac46562a860.tar.bz2 Scilab2C_fossee_old-de14a5628ad439e20770d10733ebdac46562a860.zip |
Raspberry Pi function changes and minor gui changes
Diffstat (limited to 'src/c/signalProcessing/ell1mag')
-rw-r--r-- | src/c/signalProcessing/ell1mag/dell1maga.c | 4 | ||||
-rw-r--r-- | src/c/signalProcessing/ell1mag/zell1maga.c | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c index 9af0c8e..4cc80ef 100644 --- a/src/c/signalProcessing/ell1mag/dell1maga.c +++ b/src/c/signalProcessing/ell1mag/dell1maga.c @@ -19,9 +19,11 @@ void dell1maga(double eps,double m1,double* z,int size,double* oup ) { double s[size]; int i; + doubleComplex tp; for(i=0;i<size;i++) { - s[i]=zmodsns(z[i],m1); + tp=DoubleComplex(z[i],0); + s[i]=zmodsns(tp,m1); } double un[size]; int j; diff --git a/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c index 6e7a6f9..529cecb 100644 --- a/src/c/signalProcessing/ell1mag/zell1maga.c +++ b/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,16 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup ) } doubleComplex v; int k; + double ml; + ml=eps*eps; + doubleComplex t1,t2,t3; + t2=DoubleComplex(ml,0); for(k=0;k<size;k++) { - v=un[k]/(un[k]+(eps*eps*s[k]*s[k])); + t1=zmuls(s[k],s[k]); + t2=zmuls(t2,t1); + t3=DoubleComplex(un[k],0); + v=zrdivs(t3,(zadds(t3,t2))); oup[k]=zreals(v); } } |