diff options
author | torset | 2008-12-03 16:06:44 +0000 |
---|---|---|
committer | torset | 2008-12-03 16:06:44 +0000 |
commit | 1b9528344df6c0046826b2758a07d6c68bb0b575 (patch) | |
tree | b36961db334650a020b174b15fca5a1e063f8c9c | |
parent | 9eca5b91903b8c689c86b9e6aa6bfcd35c9655bc (diff) | |
download | scilab2c-1b9528344df6c0046826b2758a07d6c68bb0b575.tar.gz scilab2c-1b9528344df6c0046826b2758a07d6c68bb0b575.tar.bz2 scilab2c-1b9528344df6c0046826b2758a07d6c68bb0b575.zip |
Changes in ifft directory
-rw-r--r-- | src/signalProcessing/ifft/Makefile.am | 2 | ||||
-rw-r--r-- | src/signalProcessing/ifft/Makefile.in | 16 | ||||
-rw-r--r-- | src/signalProcessing/ifft/fft_internal.h | 2 | ||||
-rw-r--r-- | src/signalProcessing/ifft/ifft842.c (renamed from src/signalProcessing/ifft/fft842.c) | 3 | ||||
-rw-r--r-- | src/signalProcessing/ifft/zfftma.c | 164 | ||||
-rw-r--r-- | src/signalProcessing/ifft/zifftma.c | 18 |
6 files changed, 20 insertions, 185 deletions
diff --git a/src/signalProcessing/ifft/Makefile.am b/src/signalProcessing/ifft/Makefile.am index b7dfcbdb..c70f6cd9 100644 --- a/src/signalProcessing/ifft/Makefile.am +++ b/src/signalProcessing/ifft/Makefile.am @@ -32,7 +32,7 @@ SRC = zifftma.c \ dfft2.c \ dfftbi.c \ dfftmx.c \ - fft842.c \ + ifft842.c \ r2tx.c \ r4tx.c \ r8tx.c diff --git a/src/signalProcessing/ifft/Makefile.in b/src/signalProcessing/ifft/Makefile.in index ec2602ab..79b80e66 100644 --- a/src/signalProcessing/ifft/Makefile.in +++ b/src/signalProcessing/ifft/Makefile.in @@ -56,7 +56,7 @@ libIfft_la_LIBADD = am__objects_1 = am__objects_2 = libIfft_la-zifftma.lo libIfft_la-cifftma.lo \ libIfft_la-dfft2.lo libIfft_la-dfftbi.lo libIfft_la-dfftmx.lo \ - libIfft_la-fft842.lo libIfft_la-r2tx.lo libIfft_la-r4tx.lo \ + libIfft_la-ifft842.lo libIfft_la-r2tx.lo libIfft_la-r4tx.lo \ libIfft_la-r8tx.lo am_libIfft_la_OBJECTS = $(am__objects_1) $(am__objects_2) libIfft_la_OBJECTS = $(am_libIfft_la_OBJECTS) @@ -228,7 +228,7 @@ SRC = zifftma.c \ dfft2.c \ dfftbi.c \ dfftmx.c \ - fft842.c \ + ifft842.c \ r2tx.c \ r4tx.c \ r8tx.c @@ -348,7 +348,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-dfft2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-dfftbi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-dfftmx.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-fft842.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-ifft842.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-r2tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-r4tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-r8tx.Plo@am__quote@ @@ -412,12 +412,12 @@ libIfft_la-dfftmx.lo: dfftmx.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -c -o libIfft_la-dfftmx.lo `test -f 'dfftmx.c' || echo '$(srcdir)/'`dfftmx.c -libIfft_la-fft842.lo: fft842.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -MT libIfft_la-fft842.lo -MD -MP -MF $(DEPDIR)/libIfft_la-fft842.Tpo -c -o libIfft_la-fft842.lo `test -f 'fft842.c' || echo '$(srcdir)/'`fft842.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-fft842.Tpo $(DEPDIR)/libIfft_la-fft842.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fft842.c' object='libIfft_la-fft842.lo' libtool=yes @AMDEPBACKSLASH@ +libIfft_la-ifft842.lo: ifft842.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -MT libIfft_la-ifft842.lo -MD -MP -MF $(DEPDIR)/libIfft_la-ifft842.Tpo -c -o libIfft_la-ifft842.lo `test -f 'ifft842.c' || echo '$(srcdir)/'`ifft842.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-ifft842.Tpo $(DEPDIR)/libIfft_la-ifft842.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ifft842.c' object='libIfft_la-ifft842.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -c -o libIfft_la-fft842.lo `test -f 'fft842.c' || echo '$(srcdir)/'`fft842.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -c -o libIfft_la-ifft842.lo `test -f 'ifft842.c' || echo '$(srcdir)/'`ifft842.c libIfft_la-r2tx.lo: r2tx.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIfft_la_CFLAGS) $(CFLAGS) -MT libIfft_la-r2tx.lo -MD -MP -MF $(DEPDIR)/libIfft_la-r2tx.Tpo -c -o libIfft_la-r2tx.lo `test -f 'r2tx.c' || echo '$(srcdir)/'`r2tx.c diff --git a/src/signalProcessing/ifft/fft_internal.h b/src/signalProcessing/ifft/fft_internal.h index 2bd5a597..c3add187 100644 --- a/src/signalProcessing/ifft/fft_internal.h +++ b/src/signalProcessing/ifft/fft_internal.h @@ -27,7 +27,7 @@ void dfft2 ( double* a , double* b , int nseg , int n , int nspn , void dfftbi ( double* a , double* b , int nseg , int n , int nspn , int isn , int ierr ); -void fft842 (doubleComplex* b, int size , int in); +void ifft842 (doubleComplex* b, int size , int in); void r2tx(int nthpo, doubleComplex* c0, doubleComplex* c1); void r4tx( int nthpo, doubleComplex* c0, doubleComplex* c1, doubleComplex* c2, doubleComplex* c3); diff --git a/src/signalProcessing/ifft/fft842.c b/src/signalProcessing/ifft/ifft842.c index 2742463f..85d6bcd5 100644 --- a/src/signalProcessing/ifft/fft842.c +++ b/src/signalProcessing/ifft/ifft842.c @@ -31,7 +31,7 @@ static int fastlog2( int n) int n; length of vector DPCOMPLEX *b; input vector */ -void fft842 (doubleComplex* b, int size , int in) +void ifft842 (doubleComplex* b, int size , int in) { double fn; doubleComplex temp ; @@ -161,5 +161,4 @@ void fft842 (doubleComplex* b, int size , int in) } } - } diff --git a/src/signalProcessing/ifft/zfftma.c b/src/signalProcessing/ifft/zfftma.c deleted file mode 100644 index d0663122..00000000 --- a/src/signalProcessing/ifft/zfftma.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008 - INRIA - Allan SIMON - * - * 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 - * - */ -#define FFT842 1 -#define DFFT2 0 - -#include "fft.h" -#include <stdio.h> - -void zfftma ( doubleComplex* in , int rows, int cols, doubleComplex* out) -{ - -int choosenAlgo = DFFT2 ; - -int size = rows*cols ; -int sizeTemp = 0; -/* -int sizeWorkSpace = size *2; -*/ -int rowsTemp = 0 ; -int colsTemp = 0 ; - -int ierr = 0 ; -int isn = -1; -int i = 0; - - -double* realIn = (double*) malloc ( sizeof (double) * (unsigned int) size ); -double* imagIn = (double*) malloc ( sizeof (double) * (unsigned int) size ); - - -doubleComplex* inTemp = (doubleComplex*) malloc ( sizeof (doubleComplex) * (unsigned int) size ); - -/* -double* workSpace = (double*) malloc ( sizeof (double) * (unsigned int) sizeWorkSpace ); -*/ - - -zimaga ( in , size , imagIn) ; -zreala ( in , size , realIn) ; - -if ( rows == 1 || cols == 1 ) -{ - - /* vector case */ - sizeTemp = (int) pow ( 2 , (int ) (log( size + 0.5 ) /log ( 2 ))) ; - - - - if ( size == sizeTemp ) - { - if ( size <= pow ( 2 , 15 )) - { - /* if the size is a power of 2 and inferior to 2^15 */ - fft842 ( in , size , 0 ); - choosenAlgo = FFT842 ; - } - else - { - /* if the size is a power of 2 and superior to 2^15 */ - dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace*/ ); - } - - - } - else - { - /* all other case of vector */ - dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace */); - } - -} - -/* matrix case */ -else -{ - - rowsTemp = (int) pow ( 2 , log( rows + 0.5) /log ( 2 )) ; - colsTemp = (int) pow ( 2 , log( cols + 0.5) /log ( 2 )) ; - - if ( cols == colsTemp) - { - if ( cols <= pow ( 2 , 15 )) - { - for ( i = 0 ; i < rows ; i++ ) - { - fft842 ( &in[ cols*i] , cols , 0); - choosenAlgo = FFT842 ; - } - } - else - { - dfft2 ( realIn, imagIn ,rows , cols , 1 , isn , ierr/* ,workSpace , sizeWorkSpace */); - } - } - else - { - dfft2 ( realIn, imagIn ,rows , cols , 1 , isn , ierr/* ,workSpace , sizeWorkSpace*/ ); - } - - /*second call*/ - - if ( 2*rows <= 0 /* sizeWorkSpace*/ ) - { - if ( rowsTemp == rows ) - { - if ( rows <= pow ( 2 ,15) ) - { - /*compute the fft on each line of the matrix */ - for (i = 0 ; i < cols ; i++ ) - { - C2F(zcopy) ( rows, in + i, cols, inTemp , 1 ); - - fft842( inTemp , rows , 0); - choosenAlgo = FFT842 ; - C2F(zcopy) ( rows, inTemp , cols, in + i, 1 ); - - } - } - else - { - dfft2 ( realIn, imagIn, 1, rows, cols, isn, ierr/*, workSpace, sizeWorkSpace*/); - } - } - else - { - dfft2 ( realIn, imagIn, 1, rows, cols, isn, ierr/*, workSpace, sizeWorkSpace*/); - } - } - else - { - dfft2 ( realIn, imagIn, 1, rows, cols, isn, ierr/*, workSpace, sizeWorkSpace*/); - } -} - -/* here we copy the result into the output , there are two cases because fft842 take a the complex matrix in one block - and dfft2 separate real and imaginary part */ - -if ( choosenAlgo == FFT842 ) - { - for ( i = 0 ; i < size ; i++) - { - out[i] = DoubleComplex ( zreals(in[i]) , zimags(in[i]) ); - } - } -else - { - for ( i = 0 ; i < size ; i++) - { - out[i] = DoubleComplex ( realIn[i] , imagIn[i] ); - } - - } - - -} diff --git a/src/signalProcessing/ifft/zifftma.c b/src/signalProcessing/ifft/zifftma.c index 4ddac539..7af615a7 100644 --- a/src/signalProcessing/ifft/zifftma.c +++ b/src/signalProcessing/ifft/zifftma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ -#define FFT842 1 +#define IFFT842 1 #define DFFT2 0 #include "ifft.h" @@ -58,9 +58,9 @@ if ( rows == 1 || cols == 1 ) { if ( size <= pow ( 2 , 15 )) { - printf ( "we call fft842 \n" ) ; - fft842 ( in , size , 1 ); - choosenAlgo = FFT842 ; + printf ( "we call ifft842 \n" ) ; + ifft842 ( in , size , 1 ); + choosenAlgo = IFFT842 ; } else { @@ -90,8 +90,8 @@ else { for ( i = 0 ; i < rows ; i++ ) { - fft842 ( &in[ cols*i] , cols , 1); - choosenAlgo = FFT842 ; + ifft842 ( &in[ cols*i] , cols , 1); + choosenAlgo = IFFT842 ; } } else @@ -117,8 +117,8 @@ else { C2F(zcopy) ( rows, in + i, cols, inTemp , 1 ); - fft842( inTemp , rows , 1); - choosenAlgo = FFT842 ; + ifft842( inTemp , rows , 1); + choosenAlgo = IFFT842 ; C2F(zcopy) ( rows, inTemp , cols, in + i, 1 ); } @@ -141,7 +141,7 @@ else -if ( choosenAlgo == FFT842 ) +if ( choosenAlgo == IFFT842 ) { for ( i = 0 ; i < size ; i++) { |