diff options
author | simon | 2009-08-05 14:25:35 +0000 |
---|---|---|
committer | simon | 2009-08-05 14:25:35 +0000 |
commit | 182249b0376bc5affb742c2c6ba53b78bc75bf70 (patch) | |
tree | 59af8518ae936495639ffa444cc55c71e0c7807d /src/c/signalProcessing/ifft/zifftma.c | |
parent | ef003475b65e632c568a8be9f782d257b341623d (diff) | |
download | scilab2c-182249b0376bc5affb742c2c6ba53b78bc75bf70.tar.gz scilab2c-182249b0376bc5affb742c2c6ba53b78bc75bf70.tar.bz2 scilab2c-182249b0376bc5affb742c2c6ba53b78bc75bf70.zip |
corrected ifft
added sci2c test
updated INIT_FillSCI2LibCDirs
Diffstat (limited to 'src/c/signalProcessing/ifft/zifftma.c')
-rw-r--r-- | src/c/signalProcessing/ifft/zifftma.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/c/signalProcessing/ifft/zifftma.c b/src/c/signalProcessing/ifft/zifftma.c index 63f91a0c..40a7e9ad 100644 --- a/src/c/signalProcessing/ifft/zifftma.c +++ b/src/c/signalProcessing/ifft/zifftma.c @@ -38,9 +38,9 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out) double* realIn = (double*) malloc ( sizeof (double) * (unsigned int) size ); double* imagIn = (double*) malloc ( sizeof (double) * (unsigned int) size ); - doubleComplex* inCopy = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size ); + doubleComplex* inCopy = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size*2 ); - doubleComplex* inTemp = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size ); + doubleComplex* inTemp = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size*2 ); @@ -50,8 +50,8 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out) if ( rows == 1 || cols == 1 ) { - - sizeTemp = (int) pow(2.0 , log(size + 0.5) / log(2.0)) ; + /*test if size is a power of 2*/ + sizeTemp = (int) pow(2.0, (int) (log(size + 0.5) / log(2.0))); if ( size == sizeTemp ) @@ -77,8 +77,10 @@ void zifftma ( doubleComplex* in , int rows, int cols, doubleComplex* out) else { - rowsTemp = (int) pow(2.0, log(rows + 0.5) / log(2.0)); - colsTemp = (int) pow(2.0, log(cols + 0.5) / log(2.0)); + /*test if rows and/or cols is a power of 2*/ + rowsTemp = (int) pow(2.0, (int)(log(rows + 0.5) / log(2.0))) ; + colsTemp = (int) pow(2.0 ,(int)(log(cols + 0.5) / log(2.0))) ; + if (rows == rowsTemp) { |