summaryrefslogtreecommitdiff
path: root/src/c/signalProcessing/transforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/signalProcessing/transforms')
-rw-r--r--src/c/signalProcessing/transforms/dct/cdcta.c8
-rw-r--r--src/c/signalProcessing/transforms/idct/cidcta.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/c/signalProcessing/transforms/dct/cdcta.c b/src/c/signalProcessing/transforms/dct/cdcta.c
index 5bc2792..7a006a0 100644
--- a/src/c/signalProcessing/transforms/dct/cdcta.c
+++ b/src/c/signalProcessing/transforms/dct/cdcta.c
@@ -15,6 +15,7 @@
#include "addition.h"
#include "types.h"
#include "floatComplex.h"
+#include "multiplication.h"
/*#include "matrixMultiplication"*/
/*#include <fftw3.h>*/
#include <math.h>
@@ -26,7 +27,7 @@ void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out)
int x,y;
float res,ress;
float re,z,q,m;
- floatComplex accu = DoubleComplex(0, 0);
+ floatComplex accu = FloatComplex(0, 0);
floatComplex temp,mm;
if(sign==-1)
{
@@ -44,7 +45,10 @@ void cdcta(floatComplex *in,int row,int col,int sign,floatComplex *out)
for(j=0;j<col;j++)
{
y=row*j+i;
- temp=in[y]*(cos(((M_PI)*(y+1-1./2.)*(x))/n));
+ float a;
+ a=(cos(((M_PI)*(y+1-1./2.)*(x))/n));
+ floatComplex b=FloatComplex(a,0);
+ temp=cmuls(in[y],b);
out[x]=cadds(out[x],temp);
}
}
diff --git a/src/c/signalProcessing/transforms/idct/cidcta.c b/src/c/signalProcessing/transforms/idct/cidcta.c
index ec0df0c..e6c746c 100644
--- a/src/c/signalProcessing/transforms/idct/cidcta.c
+++ b/src/c/signalProcessing/transforms/idct/cidcta.c
@@ -26,7 +26,7 @@ void cidcta(floatComplex *in,int row,int col,floatComplex *out)
int x,y;
float res,ress;
float re,z,q,m;
- floatComplex accu = DoubleComplex(0, 0);
+ floatComplex accu = FloatComplex(0, 0);
floatComplex temp,mm;
if(row==1)
{