summaryrefslogtreecommitdiff
path: root/src/c/signalProcessing
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/signalProcessing')
-rw-r--r--src/c/signalProcessing/%k/dmodka.c97
-rw-r--r--src/c/signalProcessing/%k/int_modk.h18
-rw-r--r--src/c/signalProcessing/%k/modk.h29
-rw-r--r--src/c/signalProcessing/%sn/dmodsna.c24
-rw-r--r--src/c/signalProcessing/%sn/dmodsns.c93
-rw-r--r--src/c/signalProcessing/%sn/int_modsn.h18
-rw-r--r--src/c/signalProcessing/%sn/modsn.h27
-rw-r--r--src/c/signalProcessing/%sn/zmodsna.c165
-rw-r--r--src/c/signalProcessing/%sn/zmodsns.c161
-rw-r--r--src/c/signalProcessing/amell/amell.h27
-rw-r--r--src/c/signalProcessing/amell/damella.c23
-rw-r--r--src/c/signalProcessing/amell/damells.c57
-rw-r--r--src/c/signalProcessing/amell/int_amell.h18
-rw-r--r--src/c/signalProcessing/buttmag/buttmag.h28
-rw-r--r--src/c/signalProcessing/buttmag/dbuttmags.c33
-rw-r--r--src/c/signalProcessing/buttmag/int_buttmag.h18
-rw-r--r--src/c/signalProcessing/buttmag/u8buttmags.c33
-rw-r--r--src/c/signalProcessing/cheb1mag/cheb1mag.h27
-rw-r--r--src/c/signalProcessing/cheb1mag/dcheb1mags.c35
-rw-r--r--src/c/signalProcessing/cheb1mag/int_cheb1mag.h18
-rw-r--r--src/c/signalProcessing/cheb2mag/cheb2mag.h27
-rw-r--r--src/c/signalProcessing/cheb2mag/dcheb2mags.c49
-rw-r--r--src/c/signalProcessing/cheb2mag/int_cheb2mag.h18
-rw-r--r--src/c/signalProcessing/ell1mag/dell1maga.c40
-rw-r--r--src/c/signalProcessing/ell1mag/ell1mag.h28
-rw-r--r--src/c/signalProcessing/ell1mag/int_ell1mag.h18
-rw-r--r--src/c/signalProcessing/ell1mag/zell1maga.c40
-rw-r--r--src/c/signalProcessing/ffilt/ffilt.h27
-rw-r--r--src/c/signalProcessing/ffilt/gffilts.c90
-rw-r--r--src/c/signalProcessing/ffilt/int_ffilt.h18
-rw-r--r--src/c/signalProcessing/filt_sinc/dfilt_sincs.c49
-rw-r--r--src/c/signalProcessing/filt_sinc/filt_sinc.h28
-rw-r--r--src/c/signalProcessing/filt_sinc/int_filt_sinc.h18
-rw-r--r--src/c/signalProcessing/fsfirlin/dfsfirlina.c144
-rw-r--r--src/c/signalProcessing/fsfirlin/fsfirlin.h26
-rw-r--r--src/c/signalProcessing/fsfirlin/int_fsfirlin.h18
-rw-r--r--src/c/signalProcessing/includes/amell.h28
-rw-r--r--src/c/signalProcessing/includes/buttmag.h29
-rw-r--r--src/c/signalProcessing/includes/cheb1mag.h27
-rw-r--r--src/c/signalProcessing/includes/cheb2mag.h27
-rw-r--r--src/c/signalProcessing/includes/dct.h38
-rw-r--r--src/c/signalProcessing/includes/ell1mag.h29
-rw-r--r--src/c/signalProcessing/includes/ffilt.h27
-rw-r--r--src/c/signalProcessing/includes/filt_sinc.h28
-rw-r--r--src/c/signalProcessing/includes/fsfirlin.h28
-rw-r--r--src/c/signalProcessing/includes/idct.h38
-rw-r--r--src/c/signalProcessing/includes/modk.h28
-rw-r--r--src/c/signalProcessing/includes/modsn.h31
-rw-r--r--src/c/signalProcessing/includes/sincd.h29
-rw-r--r--src/c/signalProcessing/includes/zpbutt.h29
-rw-r--r--src/c/signalProcessing/includes/zpch1.h28
-rw-r--r--src/c/signalProcessing/includes/zpch2.h28
-rw-r--r--src/c/signalProcessing/interfaces/int_amell.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_buttmag.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_cheb1mag.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_cheb2mag.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_dct.h36
-rw-r--r--src/c/signalProcessing/interfaces/int_ell1mag.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_ffilt.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_filt_sinc.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_fsfirlin.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_idct.h28
-rw-r--r--src/c/signalProcessing/interfaces/int_modk.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_modsn.h21
-rw-r--r--src/c/signalProcessing/interfaces/int_sincd.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_zpbutt.h19
-rw-r--r--src/c/signalProcessing/interfaces/int_zpch1.h18
-rw-r--r--src/c/signalProcessing/interfaces/int_zpch2.h18
-rw-r--r--src/c/signalProcessing/modk/dmodka.c97
-rw-r--r--src/c/signalProcessing/sincd/dsincds.c99
-rw-r--r--src/c/signalProcessing/sincd/int_sincd.h18
-rw-r--r--src/c/signalProcessing/sincd/sincd.h28
-rw-r--r--src/c/signalProcessing/sincd/u8sincds.c98
-rw-r--r--src/c/signalProcessing/transforms/dct/cdcta.c230
-rw-r--r--src/c/signalProcessing/transforms/dct/ddcta.c160
-rw-r--r--src/c/signalProcessing/transforms/dct/sdcta.c160
-rw-r--r--src/c/signalProcessing/transforms/dct/zdcta.c230
-rw-r--r--src/c/signalProcessing/transforms/idct/cidcta.c118
-rw-r--r--src/c/signalProcessing/transforms/idct/didcta.c83
-rw-r--r--src/c/signalProcessing/transforms/idct/sidcta.c83
-rw-r--r--src/c/signalProcessing/transforms/idct/zidcta.c118
-rw-r--r--src/c/signalProcessing/zpbutt/dzpbutts.c33
-rw-r--r--src/c/signalProcessing/zpbutt/int_zpbutt.h19
-rw-r--r--src/c/signalProcessing/zpbutt/zpbutt.h27
-rw-r--r--src/c/signalProcessing/zpch1/dzpch1s.c53
-rw-r--r--src/c/signalProcessing/zpch1/int_zpch1.h18
-rw-r--r--src/c/signalProcessing/zpch1/zpch1.h28
-rw-r--r--src/c/signalProcessing/zpch2/dzpch2s.c63
-rw-r--r--src/c/signalProcessing/zpch2/int_zpch2.h18
-rw-r--r--src/c/signalProcessing/zpch2/zpch2.h28
90 files changed, 4192 insertions, 0 deletions
diff --git a/src/c/signalProcessing/%k/dmodka.c b/src/c/signalProcessing/%k/dmodka.c
new file mode 100644
index 0000000..c0630ec
--- /dev/null
+++ b/src/c/signalProcessing/%k/dmodka.c
@@ -0,0 +1,97 @@
+#include<stdio.h>
+#include<math.h>
+#include "modk.h"
+double max_calc(double* ptr,int sz)
+{
+ int i=0;
+ double mx;
+ if(ptr[0]<0)
+ {
+ ptr[0]=-1*ptr[0];
+ }
+ mx=(ptr[0]);
+ //printf("%lf\n",mx);
+ for(i=1;i<sz;i++)
+ {
+ if(ptr[i]<0)
+ {
+ ptr[i]=-1*ptr[i];
+ }
+ if(mx<(ptr[i]))
+ mx=(ptr[i]);
+ }
+ return mx;
+}
+void dmodka(double* inp,int size,double* oup)
+{
+ double ones[size],PI=M_PI;
+ double eps=pow(2,-52);
+ int i;
+ for(i=0;i<size;i++)
+ {
+ ones[i]=1;
+ }
+ double a[size],b[size],c[size],an[size],bn[size],cn[size],kans[size];
+
+ int j,kk,l,m;
+ for(j=0;j<size;j++)
+ {
+ a[j]=1;
+ }
+ for(kk=0;kk<size;kk++)
+ {
+ b[kk]=sqrt(ones[kk]-inp[kk]);
+ }
+ for(l=0;l<size;l++)
+ {
+ c[l]=sqrt(inp[l]);
+
+ }
+ int x=0;
+ //double maxi;
+ //maxi=max_calc(c,size);
+ //printf("%lf",maxi);
+
+ while(max_calc(c,size)>eps)
+ {
+ int q,w,r;
+ for(q=0;q<size;q++)
+ {
+ an[q]=0.5*(a[q]+b[q]);
+ }
+ for(w=0;w<size;w++)
+ {
+ bn[w]=sqrt(a[w]*b[w]);
+ }
+ for(r=0;r<size;r++)
+ {
+ cn[r]=0.5*(a[r]-b[r]);
+ }
+ int x,y,z;
+ for(x=0;x<size;x++)
+ {
+ a[x]=an[x];
+ }
+ for(y=0;y<size;y++)
+ {
+ b[y]=bn[y];
+ }
+ for(z=0;z<size;z++)
+ {
+ c[z]=cn[z];
+ }
+ }
+ int q,w;
+ for(q=0;q<size;q++)
+ {
+ oup[q]=PI*(ones[q]/(2*a[q]));
+ }
+
+}
+/*
+int main()
+{
+ double m[3]={0.1,0.2,0.3};
+ dka(m,3);
+}
+*/
diff --git a/src/c/signalProcessing/%k/int_modk.h b/src/c/signalProcessing/%k/int_modk.h
new file mode 100644
index 0000000..ae09c50
--- /dev/null
+++ b/src/c/signalProcessing/%k/int_modk.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_%K_H__
+#define __INT_%K_H__
+
+#define d2modkz2(inp,size,oup) dmodka(inp,size,oup)
+
+#endif /* !INT_%K_H__! */
diff --git a/src/c/signalProcessing/%k/modk.h b/src/c/signalProcessing/%k/modk.h
new file mode 100644
index 0000000..6b4a7e0
--- /dev/null
+++ b/src/c/signalProcessing/%k/modk.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __%K_H__
+#define __%K_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dmodka(double* inp,int size,doubleComplex* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __%K_H__ */
+
diff --git a/src/c/signalProcessing/%sn/dmodsna.c b/src/c/signalProcessing/%sn/dmodsna.c
new file mode 100644
index 0000000..7e1e81c
--- /dev/null
+++ b/src/c/signalProcessing/%sn/dmodsna.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "modsn.h"
+
+void dmodsna(double* uu,int size,double emmc,double* sn)
+{
+ int i;
+ for(i=0;i<size;i++)
+ {
+ sn[i]=dmodsns(uu[i],emmc);
+ }
+}
+
diff --git a/src/c/signalProcessing/%sn/dmodsns.c b/src/c/signalProcessing/%sn/dmodsns.c
new file mode 100644
index 0000000..06d0a6f
--- /dev/null
+++ b/src/c/signalProcessing/%sn/dmodsns.c
@@ -0,0 +1,93 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ Reference:- Abramowitz, Milton and Stegun, Irene A
+ Handbook of Mathematical Functions, Dover, 1965
+ Chapter 16 (Sections 16.4, 16.13 and 16.15)
+ Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf
+*/
+
+#include<stdio.h>
+#include<math.h>
+#define CA 0.0003
+#include "modsn.h"
+double dmodsns(double uu, double emmc)
+{
+ double a,b,c,d,emc,u;
+ double em[14],en[14];
+ int i,ii,l,bo;
+ double sn,cn,dn;
+ emc=1-emmc;
+ u=uu;
+ if(emc)
+ {
+ bo=(emc<0.0);
+ if(bo)
+ {
+ d=1.0-emc;
+ emc/=-1.0/d;
+ u*=(d=sqrt(d));
+ }
+ a=1.0;
+ dn=1.0;
+ for(i=1;i<=13;i++)
+ {
+ l=i;
+ em[i]=a;
+ en[i]=(emc=sqrt(emc));
+ c=0.5*(a+emc);
+ if(fabs(a-emc)<=CA*a)break;
+ emc*=a;
+ a=c;
+ }
+ u*=c;
+ sn=sin(u);
+ cn=cos(u);
+ if(sn)
+ {
+ a=cn/sn;
+ c*=a;
+ for(ii=l;ii>=1;ii--)
+ {
+ b=em[ii];
+ a*=c;
+ c*=dn;
+ dn=(en[ii]+a)/(b+a);
+ a=c/b;
+ }
+ a=1.0/sqrt(c*c+1.0);
+ sn=(sn>=0.0?a:-a);
+ cn=c*(sn);
+ }
+ if(bo)
+ {
+ a=dn;
+ dn=cn;
+ cn=a;
+ sn/=d;
+ }
+ }
+ else
+ {
+ cn=1.0/cosh(u);
+ dn=cn;
+ sn=tanh(u);
+ }
+ return sn;
+}
+/*
+int main()
+{
+ double u,k;
+ u=4;
+ k=0.7;
+ sn(u,k);
+}
+*/
diff --git a/src/c/signalProcessing/%sn/int_modsn.h b/src/c/signalProcessing/%sn/int_modsn.h
new file mode 100644
index 0000000..179fb61
--- /dev/null
+++ b/src/c/signalProcessing/%sn/int_modsn.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_MODSN_H__
+#define __INT_MODSN_H__
+
+#define d0d0modsnd0(uu,emmc) dmodsns(uu,emmc)
+
+#endif /* !INT_MODSN_H__! */
diff --git a/src/c/signalProcessing/%sn/modsn.h b/src/c/signalProcessing/%sn/modsn.h
new file mode 100644
index 0000000..c589656
--- /dev/null
+++ b/src/c/signalProcessing/%sn/modsn.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __MODSN_H__
+#define __MODSN_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "c" {
+#endif
+
+double dmodsns(double uu, double emmc);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __MODSN_H__ */
diff --git a/src/c/signalProcessing/%sn/zmodsna.c b/src/c/signalProcessing/%sn/zmodsna.c
new file mode 100644
index 0000000..85bc0c1
--- /dev/null
+++ b/src/c/signalProcessing/%sn/zmodsna.c
@@ -0,0 +1,165 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "modsn.h"
+#include "doubleComplex.h"
+#define CA 0.0003
+
+
+doubleComplex zmodsnsproto(doubleComplex uu,double emmc,doubleComplex* sni)
+{
+ doubleComplex ans;
+ double uur,uui;
+ uur=zreals(uu);
+ uui=zimags(uu);
+ double sr,cr,dr;
+ //Performing Elliptic Function operation for the real values
+ double a1,b1,c1,d1,emc1,u1;
+ double em1[14],en1[14];
+ int i1,ii1,l1,bo1;
+ emc1=1-emmc;
+ u1=uur;
+ if(emc1)
+ {
+ bo1=(emc1<0.0);
+ if(bo1)
+ {
+ d1=1.0-emc1;
+ emc1/=-1.0/d1;
+ u1*=(d1=sqrt(d1));
+ }
+ a1=1.0;
+ dr=1.0;
+ for(i1=1;i1<=13;i1++)
+ {
+ l1=i1;
+ em1[i1]=a1;
+ en1[i1]=(emc1=sqrt(emc1));
+ c1=0.5*(a1+emc1);
+ if(fabs(a1-emc1)<=CA*a1)break;
+ emc1*=a1;
+ a1=c1;
+ }
+ u1*=c1;
+ sr=sin(u1);
+ cr=cos(u1);
+ if(sr)
+ {
+ a1=cr/sr;
+ c1*=a1;
+ for(ii1=l1;ii1>=1;ii1--)
+ {
+ b1=em1[ii1];
+ a1*=c1;
+ c1*=dr;
+ dr=(en1[ii1]+a1)/(b1+a1);
+ a1=c1/b1;
+ }
+ a1=1.0/sqrt(c1*c1+1.0);
+ sr=(sr>=0.0?a1:-a1);
+ cr=c1*(sr);
+ }
+ if(bo1)
+ {
+ a1=dr;
+ dr=cr;
+ cr=a1;
+ sr/=d1;
+ }
+ }
+ else
+ {
+ cr=1.0/cosh(u1);
+ dr=cr;
+ sr=tanh(u1);
+ }
+ ////////////////////////////////////////////////////////////////
+ double si,ci,di;
+ //Performing Elleptic Function operation for the imaginary values
+ double a,b,c,d,emc,u;
+ double em[14],en[14];
+ int i,ii,l,bo;
+ //double s1,c1,d1;
+ emc=emmc;
+ u=uui;
+ if(emc)
+ {
+ bo=(emc<0.0);
+ if(bo)
+ {
+ d=1.0-emc;
+ emc/=-1.0/d;
+ u*=(d=sqrt(d));
+ }
+ a=1.0;
+ di=1.0;
+ for(i=1;i<=13;i++)
+ {
+ l=i;
+ em[i]=a;
+ en[i]=(emc=sqrt(emc));
+ c=0.5*(a+emc);
+ if(fabs(a-emc)<=CA*a)break;
+ emc*=a;
+ a=c;
+ }
+ u*=c;
+ si=sin(u);
+ ci=cos(u);
+ if(si)
+ {
+ a=ci/si;
+ c*=a;
+ for(ii=l;ii>=1;ii--)
+ {
+ b=em[ii];
+ a*=c;
+ c*=di;
+ di=(en[ii]+a)/(b+a);
+ a=c/b;
+ }
+ a=1.0/sqrt(c*c+1.0);
+ si=(si>=0.0?a:-a);
+ ci=c*(si);
+ }
+ if(bo)
+ {
+ a=di;
+ di=ci;
+ ci=a;
+ si/=d;
+ }
+ }
+ else
+ {
+ ci=1.0/cosh(u);
+ di=ci;
+ si=tanh(u);
+ }
+ /////////////////////////////////////////////////////////
+ double delta;
+ delta=ci*ci + emmc*sr*sr*si*si;
+ double snir,snii;
+ snir=(sr*di)/delta;
+ snii=(cr*dr*si*ci)/delta;
+ *sni=DoubleComplex(snir,snii);
+}
+
+void zmodsna(doubleComplex* uu,int size,double emmc,doubleComplex* sn)
+{
+ int i;
+ for(i=0;i<size;i++)
+ {
+ zmodsnsproto(uu[i],emmc,&sn[i]);
+ }
+}
diff --git a/src/c/signalProcessing/%sn/zmodsns.c b/src/c/signalProcessing/%sn/zmodsns.c
new file mode 100644
index 0000000..5f35059
--- /dev/null
+++ b/src/c/signalProcessing/%sn/zmodsns.c
@@ -0,0 +1,161 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ Reference:- Abramowitz, Milton and Stegun, Irene A
+ Handbook of Mathematical Functions, Dover, 1965
+ Chapter 16 (Sections 16.4, 16.13 and 16.15)
+ Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf
+*/
+
+#include<stdio.h>
+#include<math.h>
+#include "modsn.h"
+#include "doubleComplex.h"
+#define CA 0.0003
+
+doubleComplex zmodsns(doubleComplex uu,double emmc)
+{
+ doubleComplex ans;
+ double uur,uui;
+ uur=zreals(uu);
+ uui=zimags(uu);
+ double sr,cr,dr;
+ //Performing Elliptic Function operation for the real values
+ double a1,b1,c1,d1,emc1,u1;
+ double em1[14],en1[14];
+ int i1,ii1,l1,bo1;
+ emc1=1-emmc;
+ u1=uur;
+ if(emc1)
+ {
+ bo1=(emc1<0.0);
+ if(bo1)
+ {
+ d1=1.0-emc1;
+ emc1/=-1.0/d1;
+ u1*=(d1=sqrt(d1));
+ }
+ a1=1.0;
+ dr=1.0;
+ for(i1=1;i1<=13;i1++)
+ {
+ l1=i1;
+ em1[i1]=a1;
+ en1[i1]=(emc1=sqrt(emc1));
+ c1=0.5*(a1+emc1);
+ if(fabs(a1-emc1)<=CA*a1)break;
+ emc1*=a1;
+ a1=c1;
+ }
+ u1*=c1;
+ sr=sin(u1);
+ cr=cos(u1);
+ if(sr)
+ {
+ a1=cr/sr;
+ c1*=a1;
+ for(ii1=l1;ii1>=1;ii1--)
+ {
+ b1=em1[ii1];
+ a1*=c1;
+ c1*=dr;
+ dr=(en1[ii1]+a1)/(b1+a1);
+ a1=c1/b1;
+ }
+ a1=1.0/sqrt(c1*c1+1.0);
+ sr=(sr>=0.0?a1:-a1);
+ cr=c1*(sr);
+ }
+ if(bo1)
+ {
+ a1=dr;
+ dr=cr;
+ cr=a1;
+ sr/=d1;
+ }
+ }
+ else
+ {
+ cr=1.0/cosh(u1);
+ dr=cr;
+ sr=tanh(u1);
+ }
+ ////////////////////////////////////////////////////////////////
+ double si,ci,di;
+ //Performing Elleptic Function operation for the imaginary values
+ double a,b,c,d,emc,u;
+ double em[14],en[14];
+ int i,ii,l,bo;
+ //double s1,c1,d1;
+ emc=emmc;
+ u=uui;
+ if(emc)
+ {
+ bo=(emc<0.0);
+ if(bo)
+ {
+ d=1.0-emc;
+ emc/=-1.0/d;
+ u*=(d=sqrt(d));
+ }
+ a=1.0;
+ di=1.0;
+ for(i=1;i<=13;i++)
+ {
+ l=i;
+ em[i]=a;
+ en[i]=(emc=sqrt(emc));
+ c=0.5*(a+emc);
+ if(fabs(a-emc)<=CA*a)break;
+ emc*=a;
+ a=c;
+ }
+ u*=c;
+ si=sin(u);
+ ci=cos(u);
+ if(si)
+ {
+ a=ci/si;
+ c*=a;
+ for(ii=l;ii>=1;ii--)
+ {
+ b=em[ii];
+ a*=c;
+ c*=di;
+ di=(en[ii]+a)/(b+a);
+ a=c/b;
+ }
+ a=1.0/sqrt(c*c+1.0);
+ si=(si>=0.0?a:-a);
+ ci=c*(si);
+ }
+ if(bo)
+ {
+ a=di;
+ di=ci;
+ ci=a;
+ si/=d;
+ }
+ }
+ else
+ {
+ ci=1.0/cosh(u);
+ di=ci;
+ si=tanh(u);
+ }
+ /////////////////////////////////////////////////////////
+ double delta;
+ delta=ci*ci + emmc*sr*sr*si*si;
+ double snir,snii;
+ snir=(sr*di)/delta;
+ snii=(cr*dr*si*ci)/delta;
+ ans=DoubleComplex(snir,snii);
+ return ans;
+}
diff --git a/src/c/signalProcessing/amell/amell.h b/src/c/signalProcessing/amell/amell.h
new file mode 100644
index 0000000..30bd6c8
--- /dev/null
+++ b/src/c/signalProcessing/amell/amell.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __AMELL_H__
+#define __AMELL_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double damells(double u,double x);
+
+#ifdef __cplusplus
+} /* extern "c" */
+#endif
+
+#endif /*__AMELL_H__*/
diff --git a/src/c/signalProcessing/amell/damella.c b/src/c/signalProcessing/amell/damella.c
new file mode 100644
index 0000000..5c37e2a
--- /dev/null
+++ b/src/c/signalProcessing/amell/damella.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "amell.h"
+
+void damella(double* u,int size,double x,double* oup)
+{
+ int i;
+ for(i=0;i<size;i++)
+ {
+ oup[i]=damells(u[i],x);
+ }
+}
diff --git a/src/c/signalProcessing/amell/damells.c b/src/c/signalProcessing/amell/damells.c
new file mode 100644
index 0000000..90c2053
--- /dev/null
+++ b/src/c/signalProcessing/amell/damells.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include<math.h>
+#include "amell.h"
+#define N 30
+#define DBL_EPSILON 2.2204460492503131E-16
+
+
+double damells(double u,double x)
+{
+ double a[N+1];
+ double g[N+1];
+ double c[N+1];
+ double two_n;
+ double phi;
+ double k;
+ int n;
+ k=(long double)fabs(x);
+ if(k==1.0)
+ return 0;
+ if(k>1.0)
+ printf("Wrong type of input argument type #2");
+
+ a[0]=1.0;
+ g[0]=sqrt(1.0-k*k);
+ c[0]=k;
+ two_n=1.0;
+ for(n=0;n<N;n++)
+ {
+ if(fabs(a[n]-g[n])<(a[n]*DBL_EPSILON))
+ {
+ break;
+ }
+ two_n+=two_n;
+ a[n+1]=0.5*(a[n]+g[n]);
+ g[n+1]=sqrt(a[n]*g[n]);
+ c[n+1]=0.5*(a[n]-g[n]);
+ }
+ phi=two_n*a[n]*u;
+ for(;n>0;n--)
+ {
+ phi=0.5*(phi+asin(c[n]*sin(phi)/a[n]));
+ }
+ return (double)phi;
+}
+
diff --git a/src/c/signalProcessing/amell/int_amell.h b/src/c/signalProcessing/amell/int_amell.h
new file mode 100644
index 0000000..5d0c86f
--- /dev/null
+++ b/src/c/signalProcessing/amell/int_amell.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_AMELL_H__
+#define __INT_AMELL_H__
+
+#define d0d0amelld0(u,x) damells(u,x)
+
+#endif /* !__INT_AMELL_H__! */
diff --git a/src/c/signalProcessing/buttmag/buttmag.h b/src/c/signalProcessing/buttmag/buttmag.h
new file mode 100644
index 0000000..47e64af
--- /dev/null
+++ b/src/c/signalProcessing/buttmag/buttmag.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __BUTTMAG_H__
+#define __BUTTMAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dbuttmags(double order, double omegac, int size, double* sample,double* out);
+
+#ifdef __cplusplus
+} /* extern "C"*/
+#endif
+
+#endif /* __BUTTMAG_H__ */
+
diff --git a/src/c/signalProcessing/buttmag/dbuttmags.c b/src/c/signalProcessing/buttmag/dbuttmags.c
new file mode 100644
index 0000000..dc40e81
--- /dev/null
+++ b/src/c/signalProcessing/buttmag/dbuttmags.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include<stdio.h>
+#include<math.h>
+#include "buttmag.h"
+void dbuttmags(double order, double omegac,double* sample,int size,double* out)
+{
+ double ones[size];
+ int j,k;
+ for(j=0;j<size;j++)
+ {
+ ones[j]=1.0;
+ }
+ //double h[size];
+ for(k=0;k<size;k++)
+ {
+ double x=ones[k]/(ones[k]+pow((sample[k]/omegac),(2*order)));
+ out[k]=x;
+ //printf("%lf\n",h[k]);
+ }
+
+}
+
diff --git a/src/c/signalProcessing/buttmag/int_buttmag.h b/src/c/signalProcessing/buttmag/int_buttmag.h
new file mode 100644
index 0000000..9867438
--- /dev/null
+++ b/src/c/signalProcessing/buttmag/int_buttmag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_BUTTMAG_H__
+#define __INT_BUTTMAG_H__
+
+#define d0d0d2buttmagd2(order,omegac,size,sample,out) dbuttmags(order,omegac,size,sample,out)
+
+#endif /* !INT_BUTTMAG_H__! */
diff --git a/src/c/signalProcessing/buttmag/u8buttmags.c b/src/c/signalProcessing/buttmag/u8buttmags.c
new file mode 100644
index 0000000..e7b52c2
--- /dev/null
+++ b/src/c/signalProcessing/buttmag/u8buttmags.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include<stdio.h>
+#include<math.h>
+#include "buttmag.h"
+void dbuttmags(int order, int omegac,double* sample,int size,double* out)
+{
+ double ones[size];
+ int j,k;
+ for(j=0;j<size;j++)
+ {
+ ones[j]=1.0;
+ }
+ //double h[size];
+ for(k=0;k<size;k++)
+ {
+ double x=ones[k]/(ones[k]+pow((sample[k]/omegac),(2*order)));
+ out[k]=x;
+ //printf("%lf\n",h[k]);
+ }
+
+}
+
diff --git a/src/c/signalProcessing/cheb1mag/cheb1mag.h b/src/c/signalProcessing/cheb1mag/cheb1mag.h
new file mode 100644
index 0000000..369ee4c
--- /dev/null
+++ b/src/c/signalProcessing/cheb1mag/cheb1mag.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __CHEB1MAG_H__
+#define __CHEB1MAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CHEB1MAG_H__ */
diff --git a/src/c/signalProcessing/cheb1mag/dcheb1mags.c b/src/c/signalProcessing/cheb1mag/dcheb1mags.c
new file mode 100644
index 0000000..a4a459d
--- /dev/null
+++ b/src/c/signalProcessing/cheb1mag/dcheb1mags.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "cheb1mag.h"
+void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out)
+{
+ double x;
+ int j;
+ double tn;
+ for(j=0;j<size;j++)
+ {
+ x=sample[j]/omegac;
+ if(x<=1)
+ {
+ tn=cos(n*acos(x));
+ out[j]=1/(1+(epsilon*epsilon)*(tn*tn));
+ }
+ else
+ {
+ tn=cosh(n*acosh(x));
+ out[j]=1/(1+(epsilon*epsilon)*(tn*tn));
+ }
+ }
+}
+
diff --git a/src/c/signalProcessing/cheb1mag/int_cheb1mag.h b/src/c/signalProcessing/cheb1mag/int_cheb1mag.h
new file mode 100644
index 0000000..fa0ff83
--- /dev/null
+++ b/src/c/signalProcessing/cheb1mag/int_cheb1mag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_CHEB1MAG_H__
+#define __INT_CHEB1MAG_H__
+
+#define d0d0d2cheb1magd2(n,omegac,epsilon,sample,size,out) dcheb1mags(n,omegac,epsilon,sample,size,out)
+
+#endif /* !__INT_CHEB1MAG_H__! */
diff --git a/src/c/signalProcessing/cheb2mag/cheb2mag.h b/src/c/signalProcessing/cheb2mag/cheb2mag.h
new file mode 100644
index 0000000..0516ca5
--- /dev/null
+++ b/src/c/signalProcessing/cheb2mag/cheb2mag.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __CHEB2MAG_H__
+#define __CHEB2MAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CHEB2MAG_H__ */
diff --git a/src/c/signalProcessing/cheb2mag/dcheb2mags.c b/src/c/signalProcessing/cheb2mag/dcheb2mags.c
new file mode 100644
index 0000000..006c591
--- /dev/null
+++ b/src/c/signalProcessing/cheb2mag/dcheb2mags.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "cheb2mag.h"
+void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup)
+{
+ double e;
+ //e=sqrt(A*A-1);
+ e=1/(pow(10,A/10)-1);
+ double x,k,cn,h,tp;
+ int i;
+ for(i=0;i<size;i++)
+ {
+ x=omegar/sample[i];
+ if(x<=1)
+ {
+ tp=acos(x);
+ cn=cos(n*tp);
+ if(x==1)
+ {
+ h=1/(1+A*A-1);
+ }
+ else
+ {
+ h=1/(1+((A*A-1)/(cn*cn)));
+ }
+
+ }
+ else
+ {
+ tp=acosh(x);
+ cn=cosh(n*tp);
+ h=e*(cn*cn)/(1+e*(cn*cn));
+
+ }
+ oup[i]=h;
+ }
+}
+
diff --git a/src/c/signalProcessing/cheb2mag/int_cheb2mag.h b/src/c/signalProcessing/cheb2mag/int_cheb2mag.h
new file mode 100644
index 0000000..05b77c2
--- /dev/null
+++ b/src/c/signalProcessing/cheb2mag/int_cheb2mag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_CHEB2MAG_H__
+#define __INT_CHEB2MAG_H__
+
+#define d0d0d0d2cheb2magd2(n,omegar,A,sample,size,oup) dcheb2mag(n,omegar,A,sample,size,oup)
+
+#endif /* !__INT_CHEB2MAG_H__! */
diff --git a/src/c/signalProcessing/ell1mag/dell1maga.c b/src/c/signalProcessing/ell1mag/dell1maga.c
new file mode 100644
index 0000000..9af0c8e
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/dell1maga.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include "modsn.h"
+#include "ell1mag.h"
+#include "doubleComplex.h"
+
+void dell1maga(double eps,double m1,double* z,int size,double* oup )
+{
+ double s[size];
+ int i;
+ for(i=0;i<size;i++)
+ {
+ s[i]=zmodsns(z[i],m1);
+ }
+ double un[size];
+ int j;
+ for(j=0;j<size;j++)
+ {
+ un[j]=1;
+ }
+ double v;
+ int k;
+ for(k=0;k<size;k++)
+ {
+ v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ oup[k]=v;
+ }
+}
+
diff --git a/src/c/signalProcessing/ell1mag/ell1mag.h b/src/c/signalProcessing/ell1mag/ell1mag.h
new file mode 100644
index 0000000..8fffc0c
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/ell1mag.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ELL1MAG_H__
+#define __ELL1MAG_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dell1mags(double eps,double m1,doubleComplex* z,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__ELL1MAG_H__*/
diff --git a/src/c/signalProcessing/ell1mag/int_ell1mag.h b/src/c/signalProcessing/ell1mag/int_ell1mag.h
new file mode 100644
index 0000000..590a0ab
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/int_ell1mag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ELL1MAG_H__
+#define __INT_ELL1MAG_H__
+
+#define d0d0z2ell1magd2(eps,m1,z,size,oup) dell1mags(eps,m1,z,size,oup)
+
+#endif /* !__INT_ELL1MAG_H__! */
diff --git a/src/c/signalProcessing/ell1mag/zell1maga.c b/src/c/signalProcessing/ell1mag/zell1maga.c
new file mode 100644
index 0000000..6e7a6f9
--- /dev/null
+++ b/src/c/signalProcessing/ell1mag/zell1maga.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include "modsn.h"
+#include "ell1mag.h"
+#include "doubleComplex.h"
+
+void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
+{
+ doubleComplex s[size];
+ int i;
+ for(i=0;i<size;i++)
+ {
+ s[i]=zmodsns(z[i],m1);
+ }
+ double un[size];
+ int j;
+ for(j=0;j<size;j++)
+ {
+ un[j]=1;
+ }
+ doubleComplex v;
+ int k;
+ for(k=0;k<size;k++)
+ {
+ v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ oup[k]=zreals(v);
+ }
+}
+
diff --git a/src/c/signalProcessing/ffilt/ffilt.h b/src/c/signalProcessing/ffilt/ffilt.h
new file mode 100644
index 0000000..9b98f34
--- /dev/null
+++ b/src/c/signalProcessing/ffilt/ffilt.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FFILT_H__
+#define __FFILT_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gffilts(char* ft,double N,double fc,double fh,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __FFILT_H__ */
diff --git a/src/c/signalProcessing/ffilt/gffilts.c b/src/c/signalProcessing/ffilt/gffilts.c
new file mode 100644
index 0000000..538daf3
--- /dev/null
+++ b/src/c/signalProcessing/ffilt/gffilts.c
@@ -0,0 +1,90 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "filt_sinc.h"
+#include "ffilt.h"
+void gffilts(char* ft,int size,double N,double fc,double fh,double* oup)
+{
+ int sz=N;
+ double X[sz];
+ double no22=(N-1)/2;
+ int ino22=(int)no22;
+ if(ft[0]=='l')
+ {
+ dfilt_sincs(N,fc,X);
+ int k=0;
+ for(k=0;k<sz;k++)
+ {
+ oup[k]=X[k];
+ }
+ }
+ else if(ft[0]=='h')
+ {
+ int k=0;
+ dfilt_sincs(N,fc,X);
+ for(k=0;k<sz;k++)
+ {
+ oup[k]=-1*X[k];
+ }
+ int id=no22;
+ oup[id]=1+oup[id];
+ }
+ else if(ft[0]=='b')
+ {
+ double wc=M_PI*(fh+fc);
+ fc=(fh-fc)/2;
+ dfilt_sincs(N,fc,X);
+ double Y[sz];
+ double k=0;
+ for(k=-no22;k<=no22;k++)
+ {
+ int ind;
+ ind=k+no22;
+ Y[ind]=2*cos(wc*k);
+ }
+ int j=0;
+ for(j=0;j<sz;j++)
+ {
+ oup[j]=X[j]*Y[j];
+ }
+ }
+ else if(ft[0]=='s')
+ {
+ double wc=M_PI*(fh+fc);
+ fc=(fh-fc)/2;
+ dfilt_sincs(N,fc,X);
+ double Y[sz];
+ double k=0;
+ for(k=-no22;k<=no22;k++)
+ {
+ int ind;
+ ind=k+no22;
+ Y[ind]=2*cos(wc*k);
+ }
+ int j=0;
+ for(j=0;j<sz;j++)
+ {
+ oup[j]=-1*X[j]*Y[j];
+ }
+ int id=no22;
+ oup[id]=1+oup[id];
+ }
+}
+/*
+int main()
+{
+ string s;
+ int n;
+ double fl,fh;
+}
+*/
diff --git a/src/c/signalProcessing/ffilt/int_ffilt.h b/src/c/signalProcessing/ffilt/int_ffilt.h
new file mode 100644
index 0000000..83f4482
--- /dev/null
+++ b/src/c/signalProcessing/ffilt/int_ffilt.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FFILT_H__
+#define __INT_FFILT_H__
+
+#define g0d0d0d0ffiltd2(ft,N,fc,fh,oup) gffilts(ft,N,fc,fh,oup)
+
+#endif /* !__INT_FFILT_H__! */
diff --git a/src/c/signalProcessing/filt_sinc/dfilt_sincs.c b/src/c/signalProcessing/filt_sinc/dfilt_sincs.c
new file mode 100644
index 0000000..1b7d1b1
--- /dev/null
+++ b/src/c/signalProcessing/filt_sinc/dfilt_sincs.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "filt_sinc.h"
+void dfilt_sincs(double N,double fc,double* oup)
+{
+ double no2=(N-1)/2;
+ int ino2=(int)no2;
+ double wl=fc*2*M_PI;
+ int sz=N;
+ double xn[sz];
+ double i;
+ int l,m;
+ for(i=-no2;i<=no2;i++)
+ {
+ l=i+no2;
+ xn[l]=sin(wl*i);
+ }
+ double xd[sz];
+ double j;
+ printf("\n");
+ for(j=-no2;j<=no2;j++)
+ {
+ m=j+no2;
+ xd[m]=M_PI*j;
+ }
+ if(ino2==no2)
+ {
+ xn[(int)no2]=2*fc;
+ xd[(int)no2]=1;
+ }
+ double x[sz];
+ int k;
+ for(k=0;k<N;k++)
+ {
+ oup[k]=xn[k]/xd[k];
+ }
+}
+
diff --git a/src/c/signalProcessing/filt_sinc/filt_sinc.h b/src/c/signalProcessing/filt_sinc/filt_sinc.h
new file mode 100644
index 0000000..43b2415
--- /dev/null
+++ b/src/c/signalProcessing/filt_sinc/filt_sinc.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FILT_SINC_H__
+#define __FILT_SINC_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void u8filt_sincs(int N,double fc,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __FILT_SINC_H */
+
diff --git a/src/c/signalProcessing/filt_sinc/int_filt_sinc.h b/src/c/signalProcessing/filt_sinc/int_filt_sinc.h
new file mode 100644
index 0000000..5b7b07a
--- /dev/null
+++ b/src/c/signalProcessing/filt_sinc/int_filt_sinc.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FILT_SINC_H__
+#define __INT_FILT_SINC_H__
+
+#define u80d0filt_sincd2(N,fc,oup) u8filt_sincs(N,fc,oup)
+
+#endif /* !__INT_FILT_SINC_H__! */
diff --git a/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/src/c/signalProcessing/fsfirlin/dfsfirlina.c
new file mode 100644
index 0000000..d2079f4
--- /dev/null
+++ b/src/c/signalProcessing/fsfirlin/dfsfirlina.c
@@ -0,0 +1,144 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+
+#include<math.h>
+#include "sincd.h"
+#include "fsfirlin.h"
+//#define PI 3.14159265358979
+
+void dfsfirlina(double* hd,int size,double flag,double* hst)
+{
+ int n1=size,n;
+ if( n1%2==0)
+ {
+ n=2*n1;
+ }
+ else
+ {
+ n=2*n1+1;
+ }
+ double scd[8*n+1];
+ //STRAT SINCD
+ double npt=4*n;
+ int sz=4*n;
+ double PI=M_PI;
+ double pas=PI/npt;
+ double om[sz+1];
+ int i;
+ for(i=0;i<=sz;i++)
+ {
+ om[i]=i*pas;
+ }
+ double eps=pow(-1,(n-1));
+ double s1[sz+1],s2[sz+1];
+ double s[2*(sz)+1];
+ double sr[2*(sz)+1];
+ if(flag==1)
+ {
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[0]=n;
+ s2[0]=1;
+ s1[sz]=n*eps;
+ s2[sz]=1;
+
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+
+ int x;
+ for(x=0;x<=4*n;x++)
+ {
+ scd[sz-x]=s[x];
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ scd[l]=s[l-(sz)];
+ }
+ int m;
+ for(m=0;m<=8*n;m++)
+ {
+ scd[m]=scd[m]/n;
+ }
+ }
+ else
+ {
+ int a;
+ for(a=0;a<=4*n;a++)
+ {
+ om[a]=om[a]-(PI/(2*n));
+ }
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[2]=n;
+ s2[2]=1;
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+ int m;
+ for(m=0;m<=4*n;m++)
+ {
+ scd[m]=(eps*s[m])/n;
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ scd[l]=s[l-(sz)]/n;
+ }
+ }
+ //END SINCD
+ int ii;
+ for(ii=4*n;ii<=6*n;ii++)
+ {
+ hst[ii-(4*n)]=hd[0]*scd[ii];
+ }
+
+ int epsi;
+ epsi=pow(-1,n-1);
+ int jj;
+ for(jj=1;jj<=(n1-1);jj++)
+ {
+ double tp1[2*n+1];
+ double tp2[2*n+1];
+ int k,l;
+ for(k=(-4*jj+4*n);k<=(-4*jj+6*n);k++)
+ {
+ tp1[k-(-4*jj+4*n)]=hd[jj]*scd[k];
+ }
+
+ for(l=(4*jj);l<=(4*jj+2*n);l++)
+ {
+ tp2[l-(4*jj)]=hd[jj]*(epsi*scd[l]);
+ }
+ int m;
+ for(m=0;m<=2*n;m++)
+ {
+ hst[m]=hst[m]+(tp1[m]+tp2[m]);
+ }
+
+ }
+
+
+}
diff --git a/src/c/signalProcessing/fsfirlin/fsfirlin.h b/src/c/signalProcessing/fsfirlin/fsfirlin.h
new file mode 100644
index 0000000..7337cbf
--- /dev/null
+++ b/src/c/signalProcessing/fsfirlin/fsfirlin.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FSFIRLIN_H__
+#define __FSFIRLIN_H__
+#include "types.h"
+#include "sincd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dfsfirlina(double* hd,int size,int flag,double* hst);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
diff --git a/src/c/signalProcessing/fsfirlin/int_fsfirlin.h b/src/c/signalProcessing/fsfirlin/int_fsfirlin.h
new file mode 100644
index 0000000..857dae8
--- /dev/null
+++ b/src/c/signalProcessing/fsfirlin/int_fsfirlin.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FSFIRLIN_H__
+#define __INT_FSFIRLIN_H__
+
+#define d2u80fsfirlind2(hd,size,flag,hst) dfsfirlina(hd,size[1],flag,hst)
+
+#endif /* !__INT_FSFIRLIN_H__! */
diff --git a/src/c/signalProcessing/includes/amell.h b/src/c/signalProcessing/includes/amell.h
new file mode 100644
index 0000000..2336d3c
--- /dev/null
+++ b/src/c/signalProcessing/includes/amell.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __AMELL_H__
+#define __AMELL_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double damells(double u,double x);
+void damella(double* u,int size,double x,double* oup);
+
+#ifdef __cplusplus
+} /* extern "c" */
+#endif
+
+#endif /*__AMELL_H__*/
diff --git a/src/c/signalProcessing/includes/buttmag.h b/src/c/signalProcessing/includes/buttmag.h
new file mode 100644
index 0000000..ef17b7e
--- /dev/null
+++ b/src/c/signalProcessing/includes/buttmag.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __BUTTMAG_H__
+#define __BUTTMAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dbuttmags(double order, double omegac, double* sample, int size,double* out);
+void u8buttmags(int order, int omegac, double* sample, int size,double* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __BUTTMAG_H__ */
+
diff --git a/src/c/signalProcessing/includes/cheb1mag.h b/src/c/signalProcessing/includes/cheb1mag.h
new file mode 100644
index 0000000..369ee4c
--- /dev/null
+++ b/src/c/signalProcessing/includes/cheb1mag.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __CHEB1MAG_H__
+#define __CHEB1MAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dcheb1mags(double n, double omegac, double epsilon, double* sample,int size,double* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CHEB1MAG_H__ */
diff --git a/src/c/signalProcessing/includes/cheb2mag.h b/src/c/signalProcessing/includes/cheb2mag.h
new file mode 100644
index 0000000..0516ca5
--- /dev/null
+++ b/src/c/signalProcessing/includes/cheb2mag.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __CHEB2MAG_H__
+#define __CHEB2MAG_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dcheb2mags(double n,double omegar, double A, double* sample,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __CHEB2MAG_H__ */
diff --git a/src/c/signalProcessing/includes/dct.h b/src/c/signalProcessing/includes/dct.h
new file mode 100644
index 0000000..db95274
--- /dev/null
+++ b/src/c/signalProcessing/includes/dct.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#ifndef __DCT_H__
+#define __DCT_H__
+
+#include <math.h>
+#include "types.h"
+#include "doubleComplex.h"
+#include "addition.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void ddcta(double *in,int row,int col,int sign,double *out);
+
+void sdcta(float *in,int row,int col,int sign,float *out);
+
+void zdcta(doubleComplex *in,int row,int col,int sign,doubleComplex *out);
+
+//void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
diff --git a/src/c/signalProcessing/includes/ell1mag.h b/src/c/signalProcessing/includes/ell1mag.h
new file mode 100644
index 0000000..e881cca
--- /dev/null
+++ b/src/c/signalProcessing/includes/ell1mag.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ELL1MAG_H__
+#define __ELL1MAG_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup);
+void dell1maga(double eps,double m1,double* z,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__ELL1MAG_H__*/
diff --git a/src/c/signalProcessing/includes/ffilt.h b/src/c/signalProcessing/includes/ffilt.h
new file mode 100644
index 0000000..f38df6e
--- /dev/null
+++ b/src/c/signalProcessing/includes/ffilt.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FFILT_H__
+#define __FFILT_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gffilts(char* ft,int size,double N,double fc,double fh,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __FFILT_H__ */
diff --git a/src/c/signalProcessing/includes/filt_sinc.h b/src/c/signalProcessing/includes/filt_sinc.h
new file mode 100644
index 0000000..095ca91
--- /dev/null
+++ b/src/c/signalProcessing/includes/filt_sinc.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FILT_SINC_H__
+#define __FILT_SINC_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dfilt_sincs(double N,double fc,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __FILT_SINC_H */
+
diff --git a/src/c/signalProcessing/includes/fsfirlin.h b/src/c/signalProcessing/includes/fsfirlin.h
new file mode 100644
index 0000000..cf5fbbd
--- /dev/null
+++ b/src/c/signalProcessing/includes/fsfirlin.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __FSFIRLIN_H__
+#define __FSFIRLIN_H__
+#include "types.h"
+#include "sincd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dfsfirlina(double* hd,int size,double flag,double* hst);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__FSFIRLIN_H__*/
diff --git a/src/c/signalProcessing/includes/idct.h b/src/c/signalProcessing/includes/idct.h
new file mode 100644
index 0000000..1e7b85b
--- /dev/null
+++ b/src/c/signalProcessing/includes/idct.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#ifndef __IDCT_H__
+#define __IDCT_H__
+
+#include <math.h>
+#include "types.h"
+#include "doubleComplex.h"
+#include "addition.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void didcta(double *in,int row,int col,double *out);
+
+void sidcta(float *in,int row,int col,float *out);
+
+void zidcta(doubleComplex *in,int row,int col,doubleComplex *out);
+
+void cidcta(floatComplex *in,int row,int col,floatComplex *out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
diff --git a/src/c/signalProcessing/includes/modk.h b/src/c/signalProcessing/includes/modk.h
new file mode 100644
index 0000000..5040eb7
--- /dev/null
+++ b/src/c/signalProcessing/includes/modk.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __MODK_H__
+#define __MODK_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dmodka(double* inp,int size,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __MODK_H__ */
+
diff --git a/src/c/signalProcessing/includes/modsn.h b/src/c/signalProcessing/includes/modsn.h
new file mode 100644
index 0000000..d91dd9d
--- /dev/null
+++ b/src/c/signalProcessing/includes/modsn.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __MODSN_H__
+#define __MODSN_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dmodsns(double uu, double emmc);
+doubleComplex zmodsns(doubleComplex uu,double emmc);
+void dmodsna(double* uu,int size,double emmc,double* sn);
+void zmodsna(doubleComplex* uu,int size,double emmc,doubleComplex* sn);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __MODSN_H__ */
diff --git a/src/c/signalProcessing/includes/sincd.h b/src/c/signalProcessing/includes/sincd.h
new file mode 100644
index 0000000..9b7a360
--- /dev/null
+++ b/src/c/signalProcessing/includes/sincd.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __SINCD_H__
+#define __SINCD_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dsincds(double n,double flg,double* oup);
+void u8sincds(int n,int flg,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __SINCD_H__ */
+
diff --git a/src/c/signalProcessing/includes/zpbutt.h b/src/c/signalProcessing/includes/zpbutt.h
new file mode 100644
index 0000000..9eb88ad
--- /dev/null
+++ b/src/c/signalProcessing/includes/zpbutt.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPBUTT_H__
+#define __ZPBUTT_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dzpbutts(double n,double fl,doubleComplex* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZPBUTT_H__ */
+
diff --git a/src/c/signalProcessing/includes/zpch1.h b/src/c/signalProcessing/includes/zpch1.h
new file mode 100644
index 0000000..fbe850c
--- /dev/null
+++ b/src/c/signalProcessing/includes/zpch1.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPCH1_H__
+#define __ZPCH1_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dzpch1s(double N,double e,double wc,doubleComplex* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZPCH1_H__ */
diff --git a/src/c/signalProcessing/includes/zpch2.h b/src/c/signalProcessing/includes/zpch2.h
new file mode 100644
index 0000000..d7c1c64
--- /dev/null
+++ b/src/c/signalProcessing/includes/zpch2.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPCH2_H__
+#define __ZPCH2_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZPCH2_H__ */
diff --git a/src/c/signalProcessing/interfaces/int_amell.h b/src/c/signalProcessing/interfaces/int_amell.h
new file mode 100644
index 0000000..10719ac
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_amell.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_AMELL_H__
+#define __INT_AMELL_H__
+
+#define d0d0amelld0(u,x) damells(u,x)
+#define d2d0amelld2(u,size,x,oup) damella(u,size[1],x,oup)
+
+#endif /* !__INT_AMELL_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_buttmag.h b/src/c/signalProcessing/interfaces/int_buttmag.h
new file mode 100644
index 0000000..4a33faf
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_buttmag.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_BUTTMAG_H__
+#define __INT_BUTTMAG_H__
+
+#define d0d0d2buttmagd2(order,omegac,sample,size,out) dbuttmags(order,omegac,sample,size[1],out)
+#define u80u80d2buttmagd2(order,omegac,sample,size,out) u8buttmags(order,omegac,sample,size[1],out)
+
+#endif /* !INT_BUTTMAG_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_cheb1mag.h b/src/c/signalProcessing/interfaces/int_cheb1mag.h
new file mode 100644
index 0000000..764e8c7
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_cheb1mag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_CHEB1MAG_H__
+#define __INT_CHEB1MAG_H__
+
+#define d0d0d0d2cheb1magd2(n,omegac,epsilon,sample,size,out) dcheb1mags(n,omegac,epsilon,sample,size[1],out)
+
+#endif /* !__INT_CHEB1MAG_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_cheb2mag.h b/src/c/signalProcessing/interfaces/int_cheb2mag.h
new file mode 100644
index 0000000..b63db04
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_cheb2mag.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_CHEB2MAG_H__
+#define __INT_CHEB2MAG_H__
+
+#define d0d0d0d2cheb2magd2(n,omegar,A,sample,size,oup) dcheb2mags(n,omegar,A,sample,size[1],oup)
+
+#endif /* !__INT_CHEB2MAG_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_dct.h b/src/c/signalProcessing/interfaces/int_dct.h
new file mode 100644
index 0000000..ef58b48
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_dct.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+
+#ifndef __INT_DCT_H__
+#define __INT_DCT_H__
+
+
+
+#define d2dctd2(in,size,out) ddcta(in,size[0],size[1],-1,out)
+
+#define d2d0dctd2(in,size,sign,out) ddcta(in,size[0],size[1],sign,out)
+
+#define s2dcts2(in,size,out) sdcta(in,size[0],size[1],-1,out)
+
+#define s2s0dcts2(in,size,sign,out) sdcta(in,size[0],size[1],sign,out)
+
+#define z2dctz2(in,size,out) zdcta(in,size[0],size[1],-1,out)
+
+#define z2d0dctz2(in,size,sign,out) zdcta(in,size[0],size[1],sign,out)
+
+//#define c2dctc2(in,size,out) cdcta(in,size[0],size[1],-1,out)
+
+//#define c2s0dctc2(in,size,sign,out) cdcta(in,size[0],size[1],sign,out)
+
+#endif
diff --git a/src/c/signalProcessing/interfaces/int_ell1mag.h b/src/c/signalProcessing/interfaces/int_ell1mag.h
new file mode 100644
index 0000000..c30ffef
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_ell1mag.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ELL1MAG_H__
+#define __INT_ELL1MAG_H__
+
+#define d0d0z2ell1magd2(eps,m1,z,size,oup) zell1maga(eps,m1,z,size[1],oup)
+#define d0d0d2ell1magd2(eps,m1,z,size,oup) dell1maga(eps,m1,z,size[1],oup)
+
+#endif /* !__INT_ELL1MAG_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_ffilt.h b/src/c/signalProcessing/interfaces/int_ffilt.h
new file mode 100644
index 0000000..273b98f
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_ffilt.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FFILT_H__
+#define __INT_FFILT_H__
+
+#define g2d0d0d0ffiltd2(ft,size,N,fc,fh,oup) gffilts(ft,size[1],N,fc,fh,oup)
+
+#endif /* !__INT_FFILT_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_filt_sinc.h b/src/c/signalProcessing/interfaces/int_filt_sinc.h
new file mode 100644
index 0000000..f90d0a6
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_filt_sinc.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FILT_SINC_H__
+#define __INT_FILT_SINC_H__
+
+#define d0d0filt_sincd2(N,fc,oup) dfilt_sincs(N,fc,oup)
+
+#endif /* !__INT_FILT_SINC_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_fsfirlin.h b/src/c/signalProcessing/interfaces/int_fsfirlin.h
new file mode 100644
index 0000000..3f6fb6e
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_fsfirlin.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_FSFIRLIN_H__
+#define __INT_FSFIRLIN_H__
+
+#define d2d0fsfirlind2(hd,size,flag,hst) dfsfirlina(hd,size[1],flag,hst)
+
+#endif /* !__INT_FSFIRLIN_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_idct.h b/src/c/signalProcessing/interfaces/int_idct.h
new file mode 100644
index 0000000..f705fe2
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_idct.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+
+#ifndef __INT_IDCT_H__
+#define __INT_IDCT_H__
+
+
+
+#define d2idctd2(in,size,out) didcta(in,size[0],size[1],out)
+
+#define s2idcts2(in,size,out) sidcta(in,size[0],size[1],out)
+
+#define z2idctz2(in,size,out) zidcta(in,size[0],size[1],out)
+
+#define c2idctc2(in,size,out) cidcta(in,size[0],size[1],out)
+
+#endif
diff --git a/src/c/signalProcessing/interfaces/int_modk.h b/src/c/signalProcessing/interfaces/int_modk.h
new file mode 100644
index 0000000..441b9b1
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_modk.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_MODK_H__
+#define __INT_MODK_H__
+
+#define d2modkd2(inp,size,oup) dmodka(inp,size[1],oup)
+
+#endif /* !INT_MODK_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_modsn.h b/src/c/signalProcessing/interfaces/int_modsn.h
new file mode 100644
index 0000000..56c8f8c
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_modsn.h
@@ -0,0 +1,21 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_MODSN_H__
+#define __INT_MODSN_H__
+
+#define d0d0modsnd0(uu,emmc) dmodsns(uu,emmc)
+#define z0d0modsnz0(uu,emmc) zmodsns(uu,emmc)
+#define d2d0modsnd2(uu,size,emmc,sn) dmodsna(uu,size[1],emmc,sn)
+#define z2d0modsnz2(uu,size,emmc,sn) zmodsna(uu,size[1],emmc,sn)
+
+#endif /* !__INT_MODSN_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_sincd.h b/src/c/signalProcessing/interfaces/int_sincd.h
new file mode 100644
index 0000000..7313673
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_sincd.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_SINCD_H__
+#define __INT_SINCD_H__
+
+#define d0d0sincdd2(n,flg,oup) dsincds(n,flg,oup)
+#define u80u80sincdd2(n,flg,oup) u8sincds(n,flg,oup)
+
+#endif /* !__INT_SINCD_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_zpbutt.h b/src/c/signalProcessing/interfaces/int_zpbutt.h
new file mode 100644
index 0000000..775c102
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_zpbutt.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPBUTT_H__
+#define __INT_ZPBUTT_H__
+
+#define d0d0zpbuttz2d0(n,fl,out) dzpbutts(n,fl,out)
+
+#endif /* !INT_ZPBUTT_H__! */
+
diff --git a/src/c/signalProcessing/interfaces/int_zpch1.h b/src/c/signalProcessing/interfaces/int_zpch1.h
new file mode 100644
index 0000000..429e7c3
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_zpch1.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPCH1_H__
+#define __INT_ZPCH1_H__
+
+#define d0d0d0zpch1z2d0(N,e,wc,out) dzpch1s(N,e,wc,out)
+
+#endif /* !INT_ZPCH1_H__! */
diff --git a/src/c/signalProcessing/interfaces/int_zpch2.h b/src/c/signalProcessing/interfaces/int_zpch2.h
new file mode 100644
index 0000000..fcb12a7
--- /dev/null
+++ b/src/c/signalProcessing/interfaces/int_zpch2.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPCH2_H__
+#define __INT_ZPCH2_H__
+
+#define d0d0d0zpch2z2z2d0(N,A,omegar,zeros,poles) dzpch2s(N,A,omegar,zeros,poles)
+
+#endif /* !INT_ZPCH2_H__! */
diff --git a/src/c/signalProcessing/modk/dmodka.c b/src/c/signalProcessing/modk/dmodka.c
new file mode 100644
index 0000000..c0630ec
--- /dev/null
+++ b/src/c/signalProcessing/modk/dmodka.c
@@ -0,0 +1,97 @@
+#include<stdio.h>
+#include<math.h>
+#include "modk.h"
+double max_calc(double* ptr,int sz)
+{
+ int i=0;
+ double mx;
+ if(ptr[0]<0)
+ {
+ ptr[0]=-1*ptr[0];
+ }
+ mx=(ptr[0]);
+ //printf("%lf\n",mx);
+ for(i=1;i<sz;i++)
+ {
+ if(ptr[i]<0)
+ {
+ ptr[i]=-1*ptr[i];
+ }
+ if(mx<(ptr[i]))
+ mx=(ptr[i]);
+ }
+ return mx;
+}
+void dmodka(double* inp,int size,double* oup)
+{
+ double ones[size],PI=M_PI;
+ double eps=pow(2,-52);
+ int i;
+ for(i=0;i<size;i++)
+ {
+ ones[i]=1;
+ }
+ double a[size],b[size],c[size],an[size],bn[size],cn[size],kans[size];
+
+ int j,kk,l,m;
+ for(j=0;j<size;j++)
+ {
+ a[j]=1;
+ }
+ for(kk=0;kk<size;kk++)
+ {
+ b[kk]=sqrt(ones[kk]-inp[kk]);
+ }
+ for(l=0;l<size;l++)
+ {
+ c[l]=sqrt(inp[l]);
+
+ }
+ int x=0;
+ //double maxi;
+ //maxi=max_calc(c,size);
+ //printf("%lf",maxi);
+
+ while(max_calc(c,size)>eps)
+ {
+ int q,w,r;
+ for(q=0;q<size;q++)
+ {
+ an[q]=0.5*(a[q]+b[q]);
+ }
+ for(w=0;w<size;w++)
+ {
+ bn[w]=sqrt(a[w]*b[w]);
+ }
+ for(r=0;r<size;r++)
+ {
+ cn[r]=0.5*(a[r]-b[r]);
+ }
+ int x,y,z;
+ for(x=0;x<size;x++)
+ {
+ a[x]=an[x];
+ }
+ for(y=0;y<size;y++)
+ {
+ b[y]=bn[y];
+ }
+ for(z=0;z<size;z++)
+ {
+ c[z]=cn[z];
+ }
+ }
+ int q,w;
+ for(q=0;q<size;q++)
+ {
+ oup[q]=PI*(ones[q]/(2*a[q]));
+ }
+
+}
+/*
+int main()
+{
+ double m[3]={0.1,0.2,0.3};
+ dka(m,3);
+}
+*/
diff --git a/src/c/signalProcessing/sincd/dsincds.c b/src/c/signalProcessing/sincd/dsincds.c
new file mode 100644
index 0000000..1475d8d
--- /dev/null
+++ b/src/c/signalProcessing/sincd/dsincds.c
@@ -0,0 +1,99 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include<math.h>
+#include "sincd.h"
+//#define PI 3.14159265358979
+void dsincds(double n,double flg,double* oup)
+{
+ double npt=4*n;
+ int sz=4*n;
+ double PI=M_PI;
+ double pas=PI/npt;
+ double om[sz+1];
+ int i;
+ for(i=0;i<=sz;i++)
+ {
+ om[i]=i*pas;
+ }
+ double eps=pow(-1,(n-1));
+ double s1[sz+1],s2[sz+1];
+ double s[2*(sz)+1];
+ double sr[2*(sz)+1];
+ if(flg==1)
+ {
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[0]=n;
+ s2[0]=1;
+ s1[sz]=n*eps;
+ s2[sz]=1;
+
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+
+ int x;
+ for(x=0;x<=4*n;x++)
+ {
+ oup[sz-x]=s[x];
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ oup[l]=s[l-(sz)];
+ }
+ int m;
+ for(m=0;m<=8*n;m++)
+ {
+ oup[m]=oup[m]/n;
+ }
+ }
+ else
+ {
+ int a;
+ for(a=0;a<=4*n;a++)
+ {
+ om[a]=om[a]-(PI/(2*n));
+ }
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[2]=n;
+ s2[2]=1;
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+ int m;
+ for(m=0;m<=4*n;m++)
+ {
+ oup[m]=(eps*s[m])/n;
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ oup[l]=s[l-(sz)]/n;
+ }
+
+ }
+}
+
diff --git a/src/c/signalProcessing/sincd/int_sincd.h b/src/c/signalProcessing/sincd/int_sincd.h
new file mode 100644
index 0000000..a404978
--- /dev/null
+++ b/src/c/signalProcessing/sincd/int_sincd.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_SINCD_H__
+#define __INT_SINCD_H__
+
+#define u80sincdd2(n,flg,oup) u8sincds(n,flg,oup)
+
+#endif /* !__INT_SINCD_H__! */
diff --git a/src/c/signalProcessing/sincd/sincd.h b/src/c/signalProcessing/sincd/sincd.h
new file mode 100644
index 0000000..2df85a8
--- /dev/null
+++ b/src/c/signalProcessing/sincd/sincd.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __SINCD_H__
+#define __SINCD_H__
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void u8sincds(int n,int flg,double* oup);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __SINCD_H__ */
+
diff --git a/src/c/signalProcessing/sincd/u8sincds.c b/src/c/signalProcessing/sincd/u8sincds.c
new file mode 100644
index 0000000..d03f48a
--- /dev/null
+++ b/src/c/signalProcessing/sincd/u8sincds.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#include<stdio.h>
+#include<math.h>
+#include "sincd.h"
+#define PI 3.14159265358979
+void u8sincds(int n,int flg,double* oup)
+{
+ double npt=4*n;
+ int sz=4*n;
+ double pas=PI/npt;
+ double om[sz+1];
+ int i;
+ //om[0]=0;
+ for(i=0;i<=sz;i++)
+ {
+ om[i]=i*pas;
+ }
+ double eps=pow(-1,(n-1));
+ double s1[sz+1],s2[sz+1];
+ double s[2*(sz)+1];
+ double sr[2*(sz)+1];
+ if(flg==1)
+ {
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[0]=n;
+ s2[0]=1;
+ s1[sz]=n*eps;
+ s2[sz]=1;
+
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+
+ int x;
+ for(x=0;x<=4*n;x++)
+ {
+ oup[sz-x]=s[x];
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ oup[l]=s[l-(sz)];
+ }
+ int m;
+ for(m=0;m<=8*n;m++)
+ {
+ oup[m]=oup[m]/n;
+ }
+ }
+ else
+ {
+ int a;
+ for(a=0;a<=4*n;a++)
+ {
+ om[a]=om[a]-(PI/(2*n));
+ }
+ int j,k;
+ for(j=0;j<=4*n;j++)
+ {
+ s1[j]=sin(n*om[j]);
+ s2[j]=sin(om[j]);
+ }
+ s1[2]=n;
+ s2[2]=1;
+ for(k=0;k<=4*n;k++)
+ {
+ s[k]=s1[k]/s2[k];
+ }
+ int m;
+ for(m=0;m<=4*n;m++)
+ {
+ oup[m]=(eps*s[m])/n;
+ }
+ int l;
+ for(l=4*n+1;l<=8*n;l++)
+ {
+ oup[l]=s[l-(sz)]/n;
+ }
+
+ }
+}
diff --git a/src/c/signalProcessing/transforms/dct/cdcta.c b/src/c/signalProcessing/transforms/dct/cdcta.c
new file mode 100644
index 0000000..7ff8364
--- /dev/null
+++ b/src/c/signalProcessing/transforms/dct/cdcta.c
@@ -0,0 +1,230 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "dct.h"
+#include "addition.h"
+#include "types.h"
+#include "floatComplex.h"
+#include "multiplication.h"
+/*#include "matrixMultiplication"*/
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out)
+{
+ int i,j,k,u,v;
+ int n;
+ int x,y;
+ float res,ress,vv,ff;
+ float re,z,q,m;
+ floatComplex accu = FloatComplex(0, 0);
+ floatComplex temp,mm,aa,bb,cc;
+ if(sign==-1)
+ {
+ if(row==1)
+ {
+ n=col;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ vv = cos(((M_PI)*(y+1-1./2.)*(x))/n);
+ aa = FloatComplex(vv,0);
+ temp=cmuls(in[y],aa);
+ out[x]=cadds(out[x],temp);
+ }
+ }
+ if(x==0)
+ {
+ vv = 1./(sqrt(n));
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ else
+ {
+ float res=2./n;
+ res = sqrt(res);
+ aa = FloatComplex(res,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ }
+ }
+ }
+ else
+ {
+ n=col*row;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ temp=FloatComplex(0,0);
+ mm=FloatComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=j*row+i;
+ z=(float)(((float)j+1.0/2.0)*(float)v);
+ q=(float)(M_PI/(float)col);
+ vv = cos(q*z);
+ aa = FloatComplex(vv,0);
+ mm=cmuls(in[y],aa);
+ temp=cadds(temp,mm);
+ }
+ z=(float)(((float)i+1.0/2.0)*(float)u);
+ q=(float)(M_PI/(float)row);
+ ff = cos(q*z);
+ bb = FloatComplex(ff,0);
+ temp=cmuls(temp,bb);
+ out[x]=cadds(out[x],temp);
+ }
+ if(u==0)
+ {
+ vv = 1./sqrt((float)row);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ if(v==0)
+ {
+ vv = 1./sqrt((float)col);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ }
+ else
+ {
+ vv = sqrt(2./row);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ if(v==0)
+ {
+ vv = 1./sqrt((float)col);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = FloatComplex(vv,0);
+ out[x]=cmuls(out[x],aa);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if(sign==1)
+ {
+ n=col;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ {
+ q=res*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa = FloatComplex(q,0);
+ out[x]=cadds(out[x],cmuls(in[y],aa));
+ }
+ else
+ {
+ q=ress*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa = FloatComplex(q,0);
+ out[x]=cadds(out[x],cmuls(in[y],aa));
+ }
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ mm=FloatComplex(0,0);
+ temp=FloatComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ mm=in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ vv = cos(q*z);
+ aa = FloatComplex(vv,0);
+ mm=cmuls(mm,aa);
+ if(j==0)
+ {
+ vv = 1./sqrt((float)col);
+ aa = FloatComplex(vv,0);
+ temp=cadds(temp,cmuls(mm,aa));
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = FloatComplex(vv,0);
+ temp=cadds(temp,cmuls(mm,aa));
+ }
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ {
+ vv = (cos(z*q))*(1./sqrt(row));
+ aa = FloatComplex(vv,0);
+ out[x]=cadds(out[x],cmuls(temp,aa));
+ }
+ else
+ {
+ vv = (cos(z*q))*sqrt(2./row);
+ aa = FloatComplex(vv,0);
+ out[x]=cadds(out[x],cmuls(temp,aa));
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/dct/ddcta.c b/src/c/signalProcessing/transforms/dct/ddcta.c
new file mode 100644
index 0000000..3802c81
--- /dev/null
+++ b/src/c/signalProcessing/transforms/dct/ddcta.c
@@ -0,0 +1,160 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "dct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void ddcta(double *in,int row,int col,int sign,double *out)
+{
+ int i,j,k,u,v;
+ int n;
+ int x,y;
+ double res,ress;
+ double re,z,q,m;
+ if(sign==-1)
+ {
+ if(row==1)
+ {
+ n=col;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ out[x]+=in[y]*(cos(((M_PI)*(y+1-1./2.)*(x))/n));
+ }
+ }
+ if(x==0)
+ out[x]*=1./(sqrt(n));
+ else
+ {
+ double res=2./n;
+ out[x]*=sqrt(res);
+ }
+ }
+ }
+ }
+ else
+ {
+ n=col*row;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ m=(double)in[j*row+i];
+ z=(double)(((double)j+1.0/2.0)*(double)v);
+ q=(double)(M_PI/(double)col);
+ re+=m*(cos(q*z));
+ }
+ z=(double)(((double)i+1.0/2.0)*(double)u);
+ q=(double)(M_PI/(double)row);
+ out[x]+=re*(cos(q*z));
+ }
+ if(u==0)
+ {
+ out[x]/=sqrt((double)row);
+ if(v==0)
+ out[x]/=sqrt((double)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ else
+ {
+ out[x]*=sqrt(2./row);
+ if(v==0)
+ out[x]/=sqrt((double)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ }
+ }
+
+ }
+ }
+ else if(sign==1)
+ {
+ n=col;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(double)in[j*row+i];
+ z=(double)(((double)v+1.0/2.0)*(double)j);
+ q=(double)(M_PI/(double)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((double)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(double)(((double)u+1.0/2.0)*(double)i);
+ q=(double)(M_PI/(double)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((double)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/dct/sdcta.c b/src/c/signalProcessing/transforms/dct/sdcta.c
new file mode 100644
index 0000000..9f380e8
--- /dev/null
+++ b/src/c/signalProcessing/transforms/dct/sdcta.c
@@ -0,0 +1,160 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "dct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void sdcta(float *in,int row,int col,int sign,float *out)
+{
+ int i,j,k,u,v;
+ int n;
+ int x,y;
+ float res,ress;
+ float re,z,q,m;
+ if(sign==-1)
+ {
+ if(row==1)
+ {
+ n=col;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ out[x]+=in[y]*(cos(((M_PI)*(y+1-1./2.)*(x))/n));
+ }
+ }
+ if(x==0)
+ out[x]*=1./(sqrt(n));
+ else
+ {
+ float res=2./n;
+ out[x]*=sqrt(res);
+ }
+ }
+ }
+ }
+ else
+ {
+ n=col*row;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ m=(float)in[j*row+i];
+ z=(float)(((float)j+1.0/2.0)*(float)v);
+ q=(float)(M_PI/(float)col);
+ re+=m*(cos(q*z));
+ }
+ z=(float)(((float)i+1.0/2.0)*(float)u);
+ q=(float)(M_PI/(float)row);
+ out[x]+=re*(cos(q*z));
+ }
+ if(u==0)
+ {
+ out[x]/=sqrt((float)row);
+ if(v==0)
+ out[x]/=sqrt((float)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ else
+ {
+ out[x]*=sqrt(2./row);
+ if(v==0)
+ out[x]/=sqrt((float)col);
+ else
+ out[x]*=sqrt(2./col);
+ }
+ }
+ }
+
+ }
+ }
+ else if(sign==1)
+ {
+ n=col;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(float)in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((float)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((float)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/dct/zdcta.c b/src/c/signalProcessing/transforms/dct/zdcta.c
new file mode 100644
index 0000000..3ae2e33
--- /dev/null
+++ b/src/c/signalProcessing/transforms/dct/zdcta.c
@@ -0,0 +1,230 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "dct.h"
+#include "addition.h"
+#include "types.h"
+#include "doubleComplex.h"
+#include "multiplication.h"
+/*#include "matrixMultiplication"*/
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void zdcta(doubleComplex *in,int row,int col,int sign,doubleComplex *out)
+{
+ int i,j,k,u,v;
+ int n;
+ int x,y;
+ double res,ress,vv,ff;
+ double re,z,q,m;
+ doubleComplex accu = DoubleComplex(0, 0);
+ doubleComplex temp,mm,aa,bb,cc;
+ if(sign==-1)
+ {
+ if(row==1)
+ {
+ n=col;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ vv = cos(((M_PI)*(y+1-1./2.)*(x))/n);
+ aa = DoubleComplex(vv,0);
+ temp=zmuls(in[y],aa);
+ out[x]=zadds(out[x],temp);
+ }
+ }
+ if(x==0)
+ {
+ vv = 1./(sqrt(n));
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ else
+ {
+ double res=2./n;
+ res = sqrt(res);
+ aa = DoubleComplex(res,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ }
+ }
+ }
+ else
+ {
+ n=col*row;
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ temp=DoubleComplex(0,0);
+ mm=DoubleComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=j*row+i;
+ z=(double )(((double )j+1.0/2.0)*(double )v);
+ q=(double )(M_PI/(double )col);
+ vv = cos(q*z);
+ aa = DoubleComplex(vv,0);
+ mm=zmuls(in[y],aa);
+ temp=zadds(temp,mm);
+ }
+ z=(double )(((double )i+1.0/2.0)*(double )u);
+ q=(double )(M_PI/(double )row);
+ ff = cos(q*z);
+ bb = DoubleComplex(ff,0);
+ temp=zmuls(temp,bb);
+ out[x]=zadds(out[x],temp);
+ }
+ if(u==0)
+ {
+ vv = 1./sqrt((double )row);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ if(v==0)
+ {
+ vv = 1./sqrt((double )col);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ }
+ else
+ {
+ vv = sqrt(2./row);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ if(v==0)
+ {
+ vv = 1./sqrt((double )col);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = DoubleComplex(vv,0);
+ out[x]=zmuls(out[x],aa);
+ }
+ }
+ }
+ }
+ }
+ }
+ else if(sign==1)
+ {
+ n=col;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ {
+ q=res*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa = DoubleComplex(q,0);
+ out[x]=zadds(out[x],zmuls(in[y],aa));
+ }
+ else
+ {
+ q=ress*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa = DoubleComplex(q,0);
+ out[x]=zadds(out[x],zmuls(in[y],aa));
+ }
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ mm=DoubleComplex(0,0);
+ temp=DoubleComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ mm=in[j*row+i];
+ z=(double )(((double )v+1.0/2.0)*(double )j);
+ q=(double )(M_PI/(double )col);
+ vv = cos(q*z);
+ aa = DoubleComplex(vv,0);
+ mm=zmuls(mm,aa);
+ if(j==0)
+ {
+ vv = 1./sqrt((double )col);
+ aa = DoubleComplex(vv,0);
+ temp=zadds(temp,zmuls(mm,aa));
+ }
+ else
+ {
+ vv = sqrt(2./col);
+ aa = DoubleComplex(vv,0);
+ temp=zadds(temp,zmuls(mm,aa));
+ }
+ }
+ z=(double )(((double )u+1.0/2.0)*(double )i);
+ q=(double )(M_PI/(double )row);
+ if(i==0)
+ {
+ vv = (cos(z*q))*(1./sqrt(row));
+ aa = DoubleComplex(vv,0);
+ out[x]=zadds(out[x],zmuls(temp,aa));
+ }
+ else
+ {
+ vv = (cos(z*q))*sqrt(2./row);
+ aa = DoubleComplex(vv,0);
+ out[x]=zadds(out[x],zmuls(temp,aa));
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/idct/cidcta.c b/src/c/signalProcessing/transforms/idct/cidcta.c
new file mode 100644
index 0000000..ae98ba1
--- /dev/null
+++ b/src/c/signalProcessing/transforms/idct/cidcta.c
@@ -0,0 +1,118 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "idct.h"
+#include "addition.h"
+#include "types.h"
+#include "floatComplex.h"
+#include "multiplication.h"
+/*#include "matrixMultiplication"*/
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void cidcta(floatComplex *in,int row,int col,floatComplex *out)
+{
+ int i,j,k,u,v;
+ int n=col;
+ int x,y;
+ float res,ress,vv,ff;
+ float re,z,q,m;
+ floatComplex accu = FloatComplex(0, 0);
+ floatComplex temp,mm,aa,bb;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ {
+ q=res*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa=FloatComplex(q,0);
+ out[x]=cadds(out[x],cmuls(in[y],aa));
+ }
+ else
+ {
+ q=ress*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa=FloatComplex(q,0);
+ out[x]=cadds(out[x],cmuls(in[y],aa));
+ }
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=FloatComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ mm=FloatComplex(0,0);
+ temp=FloatComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ mm=in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ vv=cos(q*z);
+ aa=FloatComplex(vv,0);
+ mm=cmuls(mm,aa);
+ if(j==0)
+ {
+ vv=1./sqrt((float)col);
+ aa=FloatComplex(vv,0);
+ temp=cadds(temp,cmuls(mm,aa));
+ }
+ else
+ {
+ vv=sqrt(2./col);
+ aa=FloatComplex(vv,0);
+ temp=cadds(temp,cmuls(mm,aa));
+ }
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ {
+ vv=(cos(z*q))*(1./sqrt(row));
+ aa=FloatComplex(vv,0);
+ out[x]=cadds(out[x],cmuls(temp,aa));
+ }
+ else
+ {
+ vv=(cos(z*q))*sqrt(2./row);
+ aa=FloatComplex(vv,0);
+ out[x]=cadds(out[x],cmuls(temp,aa));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/idct/didcta.c b/src/c/signalProcessing/transforms/idct/didcta.c
new file mode 100644
index 0000000..5f47516
--- /dev/null
+++ b/src/c/signalProcessing/transforms/idct/didcta.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "idct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void didcta(double *in,int row,int col,double *out)
+{
+ int i,j,k,u,v;
+ int n=col;
+ int x,y;
+ double res,ress;
+ double re,z,q,m;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(double)in[j*row+i];
+ z=(double)(((double)v+1.0/2.0)*(double)j);
+ q=(double)(M_PI/(double)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((double)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(double)(((double)u+1.0/2.0)*(double)i);
+ q=(double)(M_PI/(double)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((double)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/idct/sidcta.c b/src/c/signalProcessing/transforms/idct/sidcta.c
new file mode 100644
index 0000000..62f85da
--- /dev/null
+++ b/src/c/signalProcessing/transforms/idct/sidcta.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "idct.h"
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void sidcta(float *in,int row,int col,float *out)
+{
+ int i,j,k,u,v;
+ int n=col;
+ int x,y;
+ float res,ress;
+ float re,z,q,m;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ out[x]+=res*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ else
+ out[x]+=ress*in[y]*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=0;
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ m=(float)in[j*row+i];
+ z=(float)(((float)v+1.0/2.0)*(float)j);
+ q=(float)(M_PI/(float)col);
+ m=m*(cos(q*z));
+ if(j==0)
+ re+=m/sqrt((float)col);
+ else
+ re+=m*sqrt(2./col);
+ }
+ z=(float)(((float)u+1.0/2.0)*(float)i);
+ q=(float)(M_PI/(float)row);
+ if(i==0)
+ out[x]+=(re*(cos(z*q)))/sqrt((float)row);
+ else
+ out[x]+=(re*(cos(z*q))*sqrt(2./row));
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/transforms/idct/zidcta.c b/src/c/signalProcessing/transforms/idct/zidcta.c
new file mode 100644
index 0000000..cc01c96
--- /dev/null
+++ b/src/c/signalProcessing/transforms/idct/zidcta.c
@@ -0,0 +1,118 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ukasha Noor
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "idct.h"
+#include "addition.h"
+#include "types.h"
+#include "doubleComplex.h"
+#include "multiplication.h"
+/*#include "matrixMultiplication"*/
+/*#include <fftw3.h>*/
+#include <math.h>
+
+void zidcta(doubleComplex *in,int row,int col,doubleComplex *out)
+{
+ int i,j,k,u,v;
+ int n=col;
+ int x,y;
+ double res,ress,vv,ff;
+ double re,z,q,m;
+ doubleComplex accu = DoubleComplex(0, 0);
+ doubleComplex temp,mm,aa,bb;
+ if(row==1)
+ {
+ res=1./sqrt(n);
+ ress=sqrt(2./n);
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ if(y==0)
+ {
+ q=res*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa=DoubleComplex(q,0);
+ out[x]=zadds(out[x],zmuls(in[y],aa));
+ }
+ else
+ {
+ q=ress*(cos(((M_PI)*(j)*(v+1./2.))/n));
+ aa=DoubleComplex(q,0);
+ out[x]=zadds(out[x],zmuls(in[y],aa));
+ }
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ for(u=0;u<row;u++)
+ {
+ for(v=0;v<col;v++)
+ {
+ x=v*row+u;
+ out[x]=DoubleComplex(0,0);
+ for(i=0;i<row;i++)
+ {
+ re=0;
+ mm=DoubleComplex(0,0);
+ temp=DoubleComplex(0,0);
+ for(j=0;j<col;j++)
+ {
+ y=row*j+i;
+ mm=in[j*row+i];
+ z=(double)(((double)v+1.0/2.0)*(double)j);
+ q=(double)(M_PI/(double)col);
+ vv=cos(q*z);
+ aa=DoubleComplex(vv,0);
+ mm=zmuls(mm,aa);
+ if(j==0)
+ {
+ vv=1./sqrt((double)col);
+ aa=DoubleComplex(vv,0);
+ temp=zadds(temp,zmuls(mm,aa));
+ }
+ else
+ {
+ vv=sqrt(2./col);
+ aa=DoubleComplex(vv,0);
+ temp=zadds(temp,zmuls(mm,aa));
+ }
+ }
+ z=(double)(((double)u+1.0/2.0)*(double)i);
+ q=(double)(M_PI/(double)row);
+ if(i==0)
+ {
+ vv=(cos(z*q))*(1./sqrt(row));
+ aa=DoubleComplex(vv,0);
+ out[x]=zadds(out[x],zmuls(temp,aa));
+ }
+ else
+ {
+ vv=(cos(z*q))*sqrt(2./row);
+ aa=DoubleComplex(vv,0);
+ out[x]=zadds(out[x],zmuls(temp,aa));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/c/signalProcessing/zpbutt/dzpbutts.c b/src/c/signalProcessing/zpbutt/dzpbutts.c
new file mode 100644
index 0000000..33f22af
--- /dev/null
+++ b/src/c/signalProcessing/zpbutt/dzpbutts.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include<stdio.h>
+#include<math.h>
+#include "zpbutt.h"
+#define PI 3.14159265
+double dzpbutts(double n,double fl,doubleComplex* out)
+{
+ double e= PI/(2.0*(n));
+ int k;
+ double rl,cpx,gain;
+ for(k=1;k<=n;k++)
+ {
+ double v=2.0*(double)k+(n)-1.0;
+ rl=(fl)*cos(e*v);
+ cpx=(fl)*sin(e*v);
+ out[k-1]=DoubleComplex(rl,cpx);
+ }
+ gain=pow(fl,n);
+
+return gain;
+
+}
+
diff --git a/src/c/signalProcessing/zpbutt/int_zpbutt.h b/src/c/signalProcessing/zpbutt/int_zpbutt.h
new file mode 100644
index 0000000..72eae8a
--- /dev/null
+++ b/src/c/signalProcessing/zpbutt/int_zpbutt.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPBUTT_H__
+#define __INT_ZPBUTT_H__
+
+#define d0d0zpbuttzada(n,fl,out,gain) dzpbutts(n,fl,out,gain)
+
+#endif /* !INT_ZPBUTT_H__ */
+
diff --git a/src/c/signalProcessing/zpbutt/zpbutt.h b/src/c/signalProcessing/zpbutt/zpbutt.h
new file mode 100644
index 0000000..6883942
--- /dev/null
+++ b/src/c/signalProcessing/zpbutt/zpbutt.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPBUTT_H__
+#define __ZPBUTT_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dzpbutts(double* n,double* fl,doublecomplex* out,double* gain);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
diff --git a/src/c/signalProcessing/zpch1/dzpch1s.c b/src/c/signalProcessing/zpch1/dzpch1s.c
new file mode 100644
index 0000000..ab7b633
--- /dev/null
+++ b/src/c/signalProcessing/zpch1/dzpch1s.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "zpch1.h"
+#include "multiplication.h"
+#include "conj.h"
+#include "abs.h"
+#define PI 3.14159265
+double dzpch1s(double N,double e,double wc,doubleComplex* out)
+{
+ doubleComplex accumulate,tp;
+ double B,r,R,gain,realVal;
+ double temp=sqrt(1+e*e);
+
+ B=pow((temp+1)/e,1/N);
+
+ r=wc*((B*B-1)/(2*B));
+ R=wc*((B*B+1)/(2*B));
+
+ int k;
+ double t1=1;
+ double t2=0;
+ accumulate=DoubleComplex(t1,t2);
+ for(k=0;k<N;k++)
+ {
+ double theta;
+ theta=(PI/2)+((2*k+1)*PI)/(2*N);
+ double xk,yk;
+ xk=r*cos(theta);
+ yk=R*sin(theta);
+ out[k]=DoubleComplex(xk,yk);
+ tp=DoubleComplex(xk,yk);
+ accumulate=zmuls(accumulate,tp);
+ }
+
+ realVal=zreals(accumulate);
+ gain=dabss(realVal);
+ if (N==2*(int)(N/2))
+ gain=gain/sqrt(1+e*e);
+return gain;
+
+}
+
diff --git a/src/c/signalProcessing/zpch1/int_zpch1.h b/src/c/signalProcessing/zpch1/int_zpch1.h
new file mode 100644
index 0000000..8933d1a
--- /dev/null
+++ b/src/c/signalProcessing/zpch1/int_zpch1.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPCH1_H__
+#define __INT_ZPCH1_H__
+
+#define d0d0d0zpch1z2d0(N,e,wc) dzpch1s(N,e,wc)
+
+#endif /* !INT_ZPCH1_H__! */
diff --git a/src/c/signalProcessing/zpch1/zpch1.h b/src/c/signalProcessing/zpch1/zpch1.h
new file mode 100644
index 0000000..fbe850c
--- /dev/null
+++ b/src/c/signalProcessing/zpch1/zpch1.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPCH1_H__
+#define __ZPCH1_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dzpch1s(double N,double e,double wc,doubleComplex* out);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZPCH1_H__ */
diff --git a/src/c/signalProcessing/zpch2/dzpch2s.c b/src/c/signalProcessing/zpch2/dzpch2s.c
new file mode 100644
index 0000000..22a46a6
--- /dev/null
+++ b/src/c/signalProcessing/zpch2/dzpch2s.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#include<stdio.h>
+#include<math.h>
+#include "zpch2.h"
+#include "multiplication.h"
+#include "abs.h"
+#include "division.h"
+#define PI 3.14159265
+double dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles)
+{
+ int k,j;
+ double e,xk,realVal,gain;
+ doubleComplex accumulate1,accumulate2,tp1,tp2;
+ accumulate1=DoubleComplex(1,0);
+ accumulate2=DoubleComplex(1,0);
+ int ct=0;
+ for(k=1;k<=N;k++)
+ {
+ if(k!=((N+1)/2))
+ {
+ ct++;
+ double num=PI*(2*k-1);
+ double den=2*N;
+ xk=cos(num/den);
+ double sk=omegar/xk;
+ zeros[k-1]=DoubleComplex(0,sk);
+ tp1=DoubleComplex(0,sk);
+ accumulate1=zmuls(accumulate1,tp1);
+ }
+ }
+ for(j=1;j<=N;j++)
+ {
+ double num=PI*(2*j-1);
+ double den=2*N;
+ double xk1=num/den;
+ double Gamma=pow((A+sqrt(A*A-1)),(1/N));
+ double alpha=-((Gamma-1/Gamma)/2)*sin(xk1);
+ double Beta=((Gamma+1/Gamma)/2)*cos(xk1);
+ double normal=alpha*alpha+Beta*Beta;
+ poles[j-1]=DoubleComplex((omegar*alpha)/normal,(omegar*Beta)/normal);
+ tp2=DoubleComplex((omegar*alpha)/normal,(omegar*Beta)/normal);
+ accumulate2=zmuls(accumulate2,tp2);
+ }
+ double qt;
+ double ra2=zreals(accumulate2);
+ double ra1=zreals(accumulate1);
+ qt=dldivs(ra1,ra2);
+ gain=dabss(qt);
+
+ return gain;
+
+}
+
diff --git a/src/c/signalProcessing/zpch2/int_zpch2.h b/src/c/signalProcessing/zpch2/int_zpch2.h
new file mode 100644
index 0000000..683a761
--- /dev/null
+++ b/src/c/signalProcessing/zpch2/int_zpch2.h
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ZPCH2_H__
+#define __INT_ZPCH2_H__
+
+#define d0d0d0zpch2z2z2(N,A,omegar,zeros,poles) dzpch2s(N,A,omegar,zeros,poles)
+
+#endif /* !INT_ZPCH2_H__! */
diff --git a/src/c/signalProcessing/zpch2/zpch2.h b/src/c/signalProcessing/zpch2/zpch2.h
new file mode 100644
index 0000000..0d191d5
--- /dev/null
+++ b/src/c/signalProcessing/zpch2/zpch2.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ZPCH2_H__
+#define __ZPCH2_H__
+#include "types.h"
+#include "doubleComplex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dzpch2s(double N, double A, double omegar,doubleComplex* zeros,doubleComplex* poles);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __ZPCH2_H__ */