diff options
author | simon | 2008-10-24 12:09:12 +0000 |
---|---|---|
committer | simon | 2008-10-24 12:09:12 +0000 |
commit | e8373dbc1f6aa6a6b9d19484896ec3ef84674a08 (patch) | |
tree | 6246160bbc75bbf927cd037e342b551a27b010cc /src/signalProcessing | |
parent | 676176a0d24aeb17a25d03606ecabbc20f96e7f3 (diff) | |
download | scilab2c-e8373dbc1f6aa6a6b9d19484896ec3ef84674a08.tar.gz scilab2c-e8373dbc1f6aa6a6b9d19484896ec3ef84674a08.tar.bz2 scilab2c-e8373dbc1f6aa6a6b9d19484896ec3ef84674a08.zip |
added ifft
Diffstat (limited to 'src/signalProcessing')
-rw-r--r-- | src/signalProcessing/Makefile.am | 4 | ||||
-rw-r--r-- | src/signalProcessing/Makefile.in | 4 | ||||
-rw-r--r-- | src/signalProcessing/fft/dfftmx.c | 3 | ||||
-rw-r--r-- | src/signalProcessing/ifft/Makefile.am | 73 | ||||
-rw-r--r-- | src/signalProcessing/ifft/Makefile.in | 732 | ||||
-rw-r--r-- | src/signalProcessing/ifft/cifftma.c | 53 | ||||
-rw-r--r-- | src/signalProcessing/ifft/dffbi_lavraie.c | 243 | ||||
-rw-r--r-- | src/signalProcessing/ifft/dfft2.c | 25 | ||||
-rw-r--r-- | src/signalProcessing/ifft/dfftbi.c | 296 | ||||
-rw-r--r-- | src/signalProcessing/ifft/dfftmx.c | 1340 | ||||
-rw-r--r-- | src/signalProcessing/ifft/fft842.c | 199 | ||||
-rw-r--r-- | src/signalProcessing/ifft/fft_internal.h | 69 | ||||
-rw-r--r-- | src/signalProcessing/ifft/r2tx.c | 47 | ||||
-rw-r--r-- | src/signalProcessing/ifft/r4tx.c | 64 | ||||
-rw-r--r-- | src/signalProcessing/ifft/r8tx.c | 167 | ||||
-rw-r--r-- | src/signalProcessing/ifft/testDoubleIfft.c | 1242 | ||||
-rw-r--r-- | src/signalProcessing/ifft/testFloatIfft.c | 1235 | ||||
-rw-r--r-- | src/signalProcessing/ifft/zfftma.c | 161 | ||||
-rw-r--r-- | src/signalProcessing/ifft/zifftma.c | 161 | ||||
-rw-r--r-- | src/signalProcessing/includes/fft.h | 3 |
20 files changed, 6116 insertions, 5 deletions
diff --git a/src/signalProcessing/Makefile.am b/src/signalProcessing/Makefile.am index eec71e87..a3e6237b 100644 --- a/src/signalProcessing/Makefile.am +++ b/src/signalProcessing/Makefile.am @@ -10,5 +10,5 @@ ## ## -SUBDIRS= fft - +SUBDIRS= fft \ + ifft diff --git a/src/signalProcessing/Makefile.in b/src/signalProcessing/Makefile.in index 3382d530..c5551c64 100644 --- a/src/signalProcessing/Makefile.in +++ b/src/signalProcessing/Makefile.in @@ -165,7 +165,9 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = fft +SUBDIRS = fft \ + ifft + all: all-recursive .SUFFIXES: diff --git a/src/signalProcessing/fft/dfftmx.c b/src/signalProcessing/fft/dfftmx.c index 4ce3c107..cffc383e 100644 --- a/src/signalProcessing/fft/dfftmx.c +++ b/src/signalProcessing/fft/dfftmx.c @@ -193,10 +193,11 @@ void preliminaryWork (void) ak = 1/n ; /*scale by 1/n for isn > 0 */ - for ( j = 1 ; j < nt ; i += inc ) + for ( j = 1 ; j <= nt ; j += inc ) { a[j-1] *= ak ; b[j-1] *= ak ; + printf ("boucle isn\n"); } } kspan = ks ; diff --git a/src/signalProcessing/ifft/Makefile.am b/src/signalProcessing/ifft/Makefile.am new file mode 100644 index 00000000..00a6f061 --- /dev/null +++ b/src/signalProcessing/ifft/Makefile.am @@ -0,0 +1,73 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET +## +## 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 +## +## + + + +libIfft_la_CFLAGS = -I . \ + -I $(top_builddir)/type \ + -I $(top_builddir)/signalProcessing/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes + +instdir = $(top_builddir)/lib + +pkglib_LTLIBRARIES = libIfft.la + +libIfft_la_SOURCES = $(HEAD) $(SRC) + +HEAD = ../includes/ifft.h + +SRC = zifftma.c \ + cifftma.c \ + dfft2.c \ + dfftbi.c \ + dfftmx.c \ + fft842.c \ + r2tx.c \ + r4tx.c \ + r8tx.c + + +#### +# Checking Part +#### + +check_INCLUDES = -I . \ + -I $(top_builddir)/type \ + -I $(top_builddir)/signalProcessing/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes + + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/signalProcessing/ifft/libIfft.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + @LIBMATH@ + +check_PROGRAMS = testFloatIfft testDoubleIfft + +TESTS = testFloatIfft testDoubleIfft + +# +# -*- Fftine Tests -*- +# +testFloatIfft_SOURCES = testFloatIfft.c +testFloatIfft_CFLAGS = $(check_INCLUDES) +testFloatIfft_LDADD = $(check_LDADD) + +testDoubleIfft_SOURCES = testDoubleIfft.c +testDoubleIfft_CFLAGS = $(check_INCLUDES) +testDoubleIfft_LDADD = $(check_LDADD) diff --git a/src/signalProcessing/ifft/Makefile.in b/src/signalProcessing/ifft/Makefile.in new file mode 100644 index 00000000..44718c9b --- /dev/null +++ b/src/signalProcessing/ifft/Makefile.in @@ -0,0 +1,732 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +check_PROGRAMS = testFloatIfft$(EXEEXT) testDoubleIfft$(EXEEXT) +TESTS = testFloatIfft$(EXEEXT) testDoubleIfft$(EXEEXT) +subdir = signalProcessing/ifft +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/includes/machine.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkglibdir)" +pkglibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(pkglib_LTLIBRARIES) +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-r8tx.lo +am_libIfft_la_OBJECTS = $(am__objects_1) $(am__objects_2) +libIfft_la_OBJECTS = $(am_libIfft_la_OBJECTS) +libIfft_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libIfft_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testDoubleIfft_OBJECTS = testDoubleIfft-testDoubleIfft.$(OBJEXT) +testDoubleIfft_OBJECTS = $(am_testDoubleIfft_OBJECTS) +am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/signalProcessing/ifft/libIfft.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la +testDoubleIfft_DEPENDENCIES = $(am__DEPENDENCIES_1) +testDoubleIfft_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleIfft_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testFloatIfft_OBJECTS = testFloatIfft-testFloatIfft.$(OBJEXT) +testFloatIfft_OBJECTS = $(am_testFloatIfft_OBJECTS) +testFloatIfft_DEPENDENCIES = $(am__DEPENDENCIES_1) +testFloatIfft_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatIfft_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libIfft_la_SOURCES) $(testDoubleIfft_SOURCES) \ + $(testFloatIfft_SOURCES) +DIST_SOURCES = $(libIfft_la_SOURCES) $(testDoubleIfft_SOURCES) \ + $(testFloatIfft_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBMATH = @LIBMATH@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +libIfft_la_CFLAGS = -I . \ + -I $(top_builddir)/type \ + -I $(top_builddir)/signalProcessing/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libIfft.la +libIfft_la_SOURCES = $(HEAD) $(SRC) +HEAD = ../includes/ifft.h +SRC = zifftma.c \ + cifftma.c \ + dfft2.c \ + dfftbi.c \ + dfftmx.c \ + fft842.c \ + r2tx.c \ + r4tx.c \ + r8tx.c + + +#### +# Checking Part +#### +check_INCLUDES = -I . \ + -I $(top_builddir)/type \ + -I $(top_builddir)/signalProcessing/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/signalProcessing/ifft/libIfft.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + @LIBMATH@ + + +# +# -*- Fftine Tests -*- +# +testFloatIfft_SOURCES = testFloatIfft.c +testFloatIfft_CFLAGS = $(check_INCLUDES) +testFloatIfft_LDADD = $(check_LDADD) +testDoubleIfft_SOURCES = testDoubleIfft.c +testDoubleIfft_CFLAGS = $(check_INCLUDES) +testDoubleIfft_LDADD = $(check_LDADD) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign signalProcessing/ifft/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign signalProcessing/ifft/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libIfft.la: $(libIfft_la_OBJECTS) $(libIfft_la_DEPENDENCIES) + $(libIfft_la_LINK) -rpath $(pkglibdir) $(libIfft_la_OBJECTS) $(libIfft_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +testDoubleIfft$(EXEEXT): $(testDoubleIfft_OBJECTS) $(testDoubleIfft_DEPENDENCIES) + @rm -f testDoubleIfft$(EXEEXT) + $(testDoubleIfft_LINK) $(testDoubleIfft_OBJECTS) $(testDoubleIfft_LDADD) $(LIBS) +testFloatIfft$(EXEEXT): $(testFloatIfft_OBJECTS) $(testFloatIfft_DEPENDENCIES) + @rm -f testFloatIfft$(EXEEXT) + $(testFloatIfft_LINK) $(testFloatIfft_OBJECTS) $(testFloatIfft_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-cifftma.Plo@am__quote@ +@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-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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIfft_la-zifftma.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleIfft-testDoubleIfft.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatIfft-testFloatIfft.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libIfft_la-zifftma.lo: zifftma.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-zifftma.lo -MD -MP -MF $(DEPDIR)/libIfft_la-zifftma.Tpo -c -o libIfft_la-zifftma.lo `test -f 'zifftma.c' || echo '$(srcdir)/'`zifftma.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-zifftma.Tpo $(DEPDIR)/libIfft_la-zifftma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zifftma.c' object='libIfft_la-zifftma.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-zifftma.lo `test -f 'zifftma.c' || echo '$(srcdir)/'`zifftma.c + +libIfft_la-cifftma.lo: cifftma.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-cifftma.lo -MD -MP -MF $(DEPDIR)/libIfft_la-cifftma.Tpo -c -o libIfft_la-cifftma.lo `test -f 'cifftma.c' || echo '$(srcdir)/'`cifftma.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-cifftma.Tpo $(DEPDIR)/libIfft_la-cifftma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cifftma.c' object='libIfft_la-cifftma.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-cifftma.lo `test -f 'cifftma.c' || echo '$(srcdir)/'`cifftma.c + +libIfft_la-dfft2.lo: dfft2.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-dfft2.lo -MD -MP -MF $(DEPDIR)/libIfft_la-dfft2.Tpo -c -o libIfft_la-dfft2.lo `test -f 'dfft2.c' || echo '$(srcdir)/'`dfft2.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-dfft2.Tpo $(DEPDIR)/libIfft_la-dfft2.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dfft2.c' object='libIfft_la-dfft2.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-dfft2.lo `test -f 'dfft2.c' || echo '$(srcdir)/'`dfft2.c + +libIfft_la-dfftbi.lo: dfftbi.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-dfftbi.lo -MD -MP -MF $(DEPDIR)/libIfft_la-dfftbi.Tpo -c -o libIfft_la-dfftbi.lo `test -f 'dfftbi.c' || echo '$(srcdir)/'`dfftbi.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-dfftbi.Tpo $(DEPDIR)/libIfft_la-dfftbi.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dfftbi.c' object='libIfft_la-dfftbi.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-dfftbi.lo `test -f 'dfftbi.c' || echo '$(srcdir)/'`dfftbi.c + +libIfft_la-dfftmx.lo: dfftmx.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-dfftmx.lo -MD -MP -MF $(DEPDIR)/libIfft_la-dfftmx.Tpo -c -o libIfft_la-dfftmx.lo `test -f 'dfftmx.c' || echo '$(srcdir)/'`dfftmx.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-dfftmx.Tpo $(DEPDIR)/libIfft_la-dfftmx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dfftmx.c' object='libIfft_la-dfftmx.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-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@ +@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 + +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 +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-r2tx.Tpo $(DEPDIR)/libIfft_la-r2tx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='r2tx.c' object='libIfft_la-r2tx.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-r2tx.lo `test -f 'r2tx.c' || echo '$(srcdir)/'`r2tx.c + +libIfft_la-r4tx.lo: r4tx.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-r4tx.lo -MD -MP -MF $(DEPDIR)/libIfft_la-r4tx.Tpo -c -o libIfft_la-r4tx.lo `test -f 'r4tx.c' || echo '$(srcdir)/'`r4tx.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-r4tx.Tpo $(DEPDIR)/libIfft_la-r4tx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='r4tx.c' object='libIfft_la-r4tx.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-r4tx.lo `test -f 'r4tx.c' || echo '$(srcdir)/'`r4tx.c + +libIfft_la-r8tx.lo: r8tx.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-r8tx.lo -MD -MP -MF $(DEPDIR)/libIfft_la-r8tx.Tpo -c -o libIfft_la-r8tx.lo `test -f 'r8tx.c' || echo '$(srcdir)/'`r8tx.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libIfft_la-r8tx.Tpo $(DEPDIR)/libIfft_la-r8tx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='r8tx.c' object='libIfft_la-r8tx.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-r8tx.lo `test -f 'r8tx.c' || echo '$(srcdir)/'`r8tx.c + +testDoubleIfft-testDoubleIfft.o: testDoubleIfft.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleIfft_CFLAGS) $(CFLAGS) -MT testDoubleIfft-testDoubleIfft.o -MD -MP -MF $(DEPDIR)/testDoubleIfft-testDoubleIfft.Tpo -c -o testDoubleIfft-testDoubleIfft.o `test -f 'testDoubleIfft.c' || echo '$(srcdir)/'`testDoubleIfft.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleIfft-testDoubleIfft.Tpo $(DEPDIR)/testDoubleIfft-testDoubleIfft.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleIfft.c' object='testDoubleIfft-testDoubleIfft.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleIfft_CFLAGS) $(CFLAGS) -c -o testDoubleIfft-testDoubleIfft.o `test -f 'testDoubleIfft.c' || echo '$(srcdir)/'`testDoubleIfft.c + +testDoubleIfft-testDoubleIfft.obj: testDoubleIfft.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleIfft_CFLAGS) $(CFLAGS) -MT testDoubleIfft-testDoubleIfft.obj -MD -MP -MF $(DEPDIR)/testDoubleIfft-testDoubleIfft.Tpo -c -o testDoubleIfft-testDoubleIfft.obj `if test -f 'testDoubleIfft.c'; then $(CYGPATH_W) 'testDoubleIfft.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleIfft.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleIfft-testDoubleIfft.Tpo $(DEPDIR)/testDoubleIfft-testDoubleIfft.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleIfft.c' object='testDoubleIfft-testDoubleIfft.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleIfft_CFLAGS) $(CFLAGS) -c -o testDoubleIfft-testDoubleIfft.obj `if test -f 'testDoubleIfft.c'; then $(CYGPATH_W) 'testDoubleIfft.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleIfft.c'; fi` + +testFloatIfft-testFloatIfft.o: testFloatIfft.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatIfft_CFLAGS) $(CFLAGS) -MT testFloatIfft-testFloatIfft.o -MD -MP -MF $(DEPDIR)/testFloatIfft-testFloatIfft.Tpo -c -o testFloatIfft-testFloatIfft.o `test -f 'testFloatIfft.c' || echo '$(srcdir)/'`testFloatIfft.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatIfft-testFloatIfft.Tpo $(DEPDIR)/testFloatIfft-testFloatIfft.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatIfft.c' object='testFloatIfft-testFloatIfft.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatIfft_CFLAGS) $(CFLAGS) -c -o testFloatIfft-testFloatIfft.o `test -f 'testFloatIfft.c' || echo '$(srcdir)/'`testFloatIfft.c + +testFloatIfft-testFloatIfft.obj: testFloatIfft.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatIfft_CFLAGS) $(CFLAGS) -MT testFloatIfft-testFloatIfft.obj -MD -MP -MF $(DEPDIR)/testFloatIfft-testFloatIfft.Tpo -c -o testFloatIfft-testFloatIfft.obj `if test -f 'testFloatIfft.c'; then $(CYGPATH_W) 'testFloatIfft.c'; else $(CYGPATH_W) '$(srcdir)/testFloatIfft.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatIfft-testFloatIfft.Tpo $(DEPDIR)/testFloatIfft-testFloatIfft.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatIfft.c' object='testFloatIfft-testFloatIfft.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatIfft_CFLAGS) $(CFLAGS) -c -o testFloatIfft-testFloatIfft.obj `if test -f 'testFloatIfft.c'; then $(CYGPATH_W) 'testFloatIfft.c'; else $(CYGPATH_W) '$(srcdir)/testFloatIfft.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkglibLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-pkglibLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkglibLTLIBRARIES install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-pkglibLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/signalProcessing/ifft/cifftma.c b/src/signalProcessing/ifft/cifftma.c new file mode 100644 index 00000000..620b1609 --- /dev/null +++ b/src/signalProcessing/ifft/cifftma.c @@ -0,0 +1,53 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + + + +#include "ifft.h" +#include <stdio.h> + +void cifftma ( floatComplex* in , int rows, int cols, floatComplex* out) +{ + int i = 0 ; + /* these 3 variable are created to permit to use the value in the fortran functions + because they need doubleComplex matrix as arguments and we can't cast directly the pointers + without having problems , i know that's ugly */ + doubleComplex *dblin = NULL; + doubleComplex *dblout = NULL; + + + + /* Array allocations*/ + dblin = (doubleComplex*)malloc(sizeof(doubleComplex) * (unsigned int)(rows * cols)); + dblout = (doubleComplex*)malloc(sizeof(doubleComplex) * (unsigned int)(rows * cols)); + + + + /*copy and cast all the floatComplex value into doubleComplex value */ + for ( i = 0 ; i < (rows * cols) ; i ++ ) + { + dblin[i] = DoubleComplex ( (double) creals( in[i]) , (double) cimags ( in[i])) ; + } + + zifftma ( dblin, rows , cols , dblout ); + + + for ( i = 0 ; i < (rows * cols) ; i++ ) + { + out[i] = FloatComplex ((float) zreals ( dblout[i]) , (float) zimags ( dblout[i])) ; + + } + + free ( dblin); + free ( dblout); + +} diff --git a/src/signalProcessing/ifft/dffbi_lavraie.c b/src/signalProcessing/ifft/dffbi_lavraie.c new file mode 100644 index 00000000..f9f7f02d --- /dev/null +++ b/src/signalProcessing/ifft/dffbi_lavraie.c @@ -0,0 +1,243 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include "max.h" +#include "fft_internal.h" + +void dfftbi ( double* a , double* b , int nseg , int n , int nspn , + int isn , int ierr , int lout , int lnow , int lused , + int lmax , int lbook , double* rstak , int* istak ) +{ + + int nfac[15] ; + int i ; + int in ; + int j = 3 ; + int j2 = 3 ; + int j3 = 3 ; + int jj = 9; + int m = 0 ; + int k ; + int kt ; + int kkk ; + int nspan ; + int nitems ; + int ntot ; + int maxp = 0; + int maxf ; + int itype; + int istkgt ; + int isize[] = {1,1,1,2,2} ; + + int nf = abs ( n ) ; + + ierr = 0 ; + printf ( "debut de dfftbi \n" ); + /*determine the factors of n */ + + + if ( nf == 1) + return ; + + k = nf ; + + nspan = abs ( nf*nspn ) ; + ntot = abs ( nspan*nseg) ; + + if ( isn*ntot == 0 ) + { + ierr = 1 ; + return ; + } + +printf ("un petit test kplop %d\n" , k - (int)(k/16)*16 ) ; + + while ( (k- (int)(k/16)*16 ) == 0 ) + { + m++; + printf ("m %d ,k %d ,k2 %d\n" , m , k ,(int) (k/16)*16 ); + nfac[m-1] = 4 ; + k = k >> 4 ; + } + +printf ("avant ploa k %d\n\n" , k ); + do + { + while ( k%jj == 0 ) + { + m++; + nfac[m-1] = j ; + k /= jj ; + printf ("\nm %d ,k %d j %f jj %d\n" , m , k ,j , jj); + } + + j+=2; + jj= j*j ; + + }while ( jj <= k); + + +printf ( "ploa\n" ); + + + if ( k <= 4) + { + kt = m; + nfac[m+1] = k; + if ( k != 1 ) + m++; + } + else + { + if ( (k & 7) != 0 ) + { + m++; + nfac[m-1] = 2 ; + k = k >> 2 ; + } + + /*all square factor out now but k >= 5 still */ + kt = m ; + maxp = max ( (kt+1)*2 , k-1); + j=2; + printf ( "plob\n" ); + do + { + if ( k%j == 0 ) + { + m++; + nfac[m-1] = j ; + k /= j ; + } + + j = (j+1) | 1 ; + + }while ( j <= k ); + + } + + if ( m <= ( kt+1) ) + maxp = m + kt + 1 ; + + if ( m + kt > 15) + { + ierr = 2 ; + printf ( "argh return 5 \n" ); + return ; + } + if ( kt != 0 ) + { + j = kt ; + + do{ + m++; + nfac[m-1] = nfac[j-1]; + j--; + }while ( j != 0) ; + } + + maxf = nfac[m-kt-1] ; + + if ( kt > 0 ) + maxf = max ( nfac[kt-1] , maxf ); + + for ( kkk = 1 ; kkk < m ; kkk++ ) + maxf = max ( maxf , nfac[kkk-1]); + + nitems = maxf * 4 ; + itype = 4 ; + + istkgt = ( lnow*isize[1] -1)/isize[itype-1] + 2; + + i = ( (istkgt - 1 + nitems) * isize[itype-1] -1) / isize[1] + 3 ; + printf ("i %d ,\n lmax %d\n istkgt %d\n lnow %d \n", i , lmax , istkgt , lnow ) ; + + + + if ( i > lmax ) + { + ierr = -i ; + printf ( "argh return 4 -i %d \n" , -i ); + return ; + } + + istak[i-2] = itype ; + istak[i-1] = lnow ; + lout ++ ; + lnow = i ; + lused = max ( lused , lnow ); + + j = istkgt ; + jj = j + maxf ; + j2 = jj+ maxf ; + j3 = j2+ maxf ; + + nitems = maxp ; + itype = 2 ; + + istkgt = ( lnow*isize[1] -1)/isize[itype-1] + 2; + + i = ( (istkgt - 1 + nitems) * isize[itype-1] -1) / isize[1] + 3 ; + + if ( i > lmax ) + { + ierr = -i ; + printf ( "argh return 4 -i %d \n" , -i ); + return ; + } + + istak[i-2] = itype ; + istak[i-1] = lnow ; + lout ++ ; + lnow = i ; + lused = max ( lused , lnow ); + + k = istkgt ; + +/* +c la carte suivante est a supprimer si simple precision +c next instruction commented by FD&MG (simulog residue?) +c ******************************************** +c k=2*k-1 +c ********************************************* +*/ + + printf ( "dfftmx me voilà tayoooooooo \n" ); + dfftmx( a , b , ntot , nf , nspan , isn , m , kt , &rstak[j-1] , &rstak[jj-1] , &rstak[j2-1] , &rstak[j3-1] , &istak[k-1] , nfac); + + k =2 ; + + in = 2 ; + + if (!( lbook <= lnow && lnow <= lused && lused <= lmax )) + { + ierr = 3 ; + printf ( "argh return 6 \n" ); + return ; + } + + while ( in > 0) + { + if ( lbook > istak[lnow-1] || istak[lnow-1] >= lnow-1) + { + ierr = 4 ; + } + + lout-- ; + lnow = istak[lnow-1] ; + in-- ; + } + printf ( "fin de dfftbi \n" ); + return ; +} diff --git a/src/signalProcessing/ifft/dfft2.c b/src/signalProcessing/ifft/dfft2.c new file mode 100644 index 00000000..23ab74e0 --- /dev/null +++ b/src/signalProcessing/ifft/dfft2.c @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "fft_internal.h" +#include <stdlib.h> + +void dfft2 ( double* a , double* b , int nseg , int n , int nspn , int isn , int ierr ) +{ + + + dfftbi ( a , b , nseg , n , nspn , isn , ierr ); + + + + return ; +} diff --git a/src/signalProcessing/ifft/dfftbi.c b/src/signalProcessing/ifft/dfftbi.c new file mode 100644 index 00000000..f22ed995 --- /dev/null +++ b/src/signalProcessing/ifft/dfftbi.c @@ -0,0 +1,296 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include "max.h" +#include "fft_internal.h" + + +/* + iIw[0] = 0 ; + iIw[1] = 10 ; + iIw[2] = 10 ; + iIw[3] = lw ; + iIw[4] = 10 ; + + iw[0] = 0 ; + iw[1] = 10 ; + iw[2] = 10 ; + iw[3] = lw ; + iw[4] = 10 ; + + dfftbi ( a , b , nseg , n , nspn , + isn , ierr , iIw[0], iIw[1] , iIw[2], + iIw[3], iIw[4], iw, iIw ); + void dfftbi ( double* a , double* b , int nseg , int n , int nspn , + int isn , int ierr, int lout , int lnow , + int lused ,int lmax , int lbook , double* rstak , int* istakk ) +*/ + +void dfftbi ( double* a , double* b , int nseg , int n , int nspn , + int isn , int ierr) +{ + + double* rstak ; + int* istak ; + + int lout = 0 ; + int lnow = 10; + int lused= 10; + + int lbook = 10 ; + + + int nfac[15] ; + int i ; + int in ; + int j = 3 ; + int j2 = 3 ; + int j3 = 3 ; + int jj = 9; + int m = 0 ; + int k ; + int kt ; + int kkk ; + int nspan ; + int nitems ; + int ntot ; + int maxp = 0; + int maxf ; + int itype; + int istkgt ; + int isize[] = {1,1,1,2,2} ; + + int nf = abs ( n ) ; + + ierr = 0 ; + + /*determine the factors of n */ + + + if ( nf == 1) + return ; + + k = nf ; + + nspan = abs ( nf*nspn ) ; + ntot = abs ( nspan*nseg) ; + + + if ( isn*ntot == 0 ) + { + ierr = 1 ; + return ; + } + + + + + while ( (k- (int)(k/16)*16 ) == 0 ) + { + m++; + nfac[m-1] = 4 ; + k = k >> 4 ; + } + + + + + do + { + while ( k%jj == 0 ) + { + m++; + nfac[m-1] = j ; + k /= jj ; + + } + + j+=2; + jj= j*j ; + + }while ( jj <= k); + + + + + + if ( k <= 4) + { + + kt = m; + nfac[m] = k; + if ( k != 1 ) + m++; + } + else + { + if ( (k & 3) == 0 ) + { + m++; + nfac[m-1] = 2 ; + k = k >> 2 ; + } + + /*all square factor out now but k >= 5 still */ + kt = m ; + maxp = max ( (kt+1)*2 , k-1); + j=2; + + do + { + if ( k%j == 0 ) + { + + m++; + nfac[m-1] = j ; + k /= j ; + } + + j = (j+1) | 1 ; + + }while ( j <= k ); + + } + + + + if ( m <= ( kt+1) ) + maxp = m + kt + 1 ; + + + + if ( m + kt > 15) + { + ierr = 2 ; + + return ; + } + + + if ( kt != 0 ) + { + j = kt ; + + do{ + m++; + + nfac[m-1] = nfac[j-1]; + j--; + }while ( j != 0) ; + } + + + maxf = nfac[m-kt-1] ; + + if ( kt > 0 ) + maxf = max ( nfac[kt-1] , maxf ); + + + + + for ( kkk = 1 ; kkk <= m ; kkk++ ) + { + maxf = max ( maxf , nfac[kkk-1]); + + } + + + + + + + + nitems = maxf * 4 ; + itype = 4 ; + + + istkgt = 2 + ((lnow-1)/2) ;/*lnow = 10*/ + istkgt = 6; + + /*i = ( (istkgt - 1 + nitems) * isize[3] -1) + 3 ;*/ + i = 12 + nitems*2; + + + + istak = (int*) malloc ( sizeof (int) * (unsigned int) i); + + istak[i-2] = itype ; + istak[i-1] = lnow ; + lout ++ ; + lnow = i ; + lused = max ( lused , lnow ); + + j = istkgt ; + jj = j + maxf ; + j2 = jj+ maxf ; + j3 = j2+ maxf ; + + nitems = maxp ; + itype = 2 ; + + /*istkgt = ( lnow*isize[1] -1)/isize[1] + 2;*/ + istkgt = lnow + 1 ; + /*i = ( (istkgt - 1 + nitems) * isize[1] -1) / isize[1] + 3 ;*/ + i = ( ( lnow + nitems) * isize[1] -1) / isize[1] + 3 ; + istak = (int*) realloc ( istak ,sizeof (int) * (unsigned int) i); + rstak = (double*) malloc ( sizeof (double) * (unsigned int) i); + + + + + + + istak[i-2] = itype ; + istak[i-1] = lnow ; + lout ++ ; + lnow = i ; + lused = max ( lused , lnow ); + + k = istkgt ; + +/* +c la carte suivante est a supprimer si simple precision +c next instruction commented by FD&MG (simulog residue?) +c ******************************************** +c k=2*k-1 +c ********************************************* +*/ + + + + dfftmx( a , b , ntot , nf , nspan , isn , m , kt , &rstak[j-1] , &rstak[jj-1] , &rstak[j2-1] , &rstak[j3-1] , &istak[k-1] , nfac); + + k =2 ; + + in = 2 ; + + if (!( lbook <= lnow && lnow <= lused )) + { + ierr = 3 ; + return ; + } + + while ( in > 0) + { + if ( lbook > istak[lnow-1] || istak[lnow-1] >= lnow-1) + { + ierr = 4 ; + } + + lout-- ; + lnow = istak[lnow-1] ; + in-- ; + } + return ; +} diff --git a/src/signalProcessing/ifft/dfftmx.c b/src/signalProcessing/ifft/dfftmx.c new file mode 100644 index 00000000..06ed1867 --- /dev/null +++ b/src/signalProcessing/ifft/dfftmx.c @@ -0,0 +1,1340 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#include <stdlib.h> +#include <stdio.h> +#include <math.h> +#include "max.h" +#include "min.h" +#include "fft_internal.h" + + +/*c'est moche je sais */ + +static double* a ; +static double* b ; +static int ntot ; +static int n ; +static int nspan ; +static int isn ; +static int m ; +static int kt ; +static double* wt ; +static double* ck ; +static double* bt ; +static double* sk ; +static int* np ; +static int* nfac ; +static int inc ; +static int nt ; +static int ks ; + +static double rad ; +static double c72 ; +static double s72 ; +static double s120 ; + +static double aa ; +static double ak ; +static double akm ; +static double akp ; +static double aj ; +static double ajp ; +static double ajm ; + +static double bb ; +static double bk ; +static double bkm ; +static double bkp ; +static double bj ; +static double bjp ; +static double bjm ; +static double dr ; + +static double cd ; +static double c1 ; +static double c2 ; +static double c3 ; + +static double sd ; +static double s1 ; +static double s2 ; +static double s3 ; + +static int kspan ; +static int nn ; +static int jc ; +static int klim ; +static int jf ; +static int maxf ; +static int kk ; +static int k ; +static int k1 ; +static int k2 ; +static int k3 ; +static int k4 ; +static int mm ; +static int kspnn ; +static int i ; +static int j ; +static int jj; + + + + + +int dfftmx ( double* _pdblA , double* _pdblB , int _iNtot, int _iN, int _iNspan, + int _iIsn, int _iM, int _iKt, double* _pdblWt, double* _pdblCk, + double* _pdblBt, double* _pdblSk, int* _piNp, int* _piNfac) +{ + + int retVal = 0 ; + int iii = 0 ; + a = _pdblA ; + b = _pdblB ; + + ntot = _iNtot ; + n = _iN ; + nspan= _iNspan ; + isn = _iIsn; + m = _iM ; + kt = _iKt ; + wt = _pdblWt ; + ck = _pdblCk; + bt = _pdblBt; + sk = _pdblSk; + np = _piNp; + nfac = _piNfac; + + inc = abs ( isn ) ; + nt = inc*ntot ; + ks = inc*nspan; + rad = atan ( 1 ); + printf ( "rad %f\n" , rad ) ; + c72 = cos (rad/0.6250); + s72 = sin (rad/0.6250); + s120= sqrt(0.750); + + + + + fprintf (stderr , "\n\n" ); + + fprintf (stderr , "preliminary\n" ); + preliminaryWork () ; + + + while ( retVal == 0 ) + { + fprintf (stderr , "factortransform\n" ); + retVal = factorTransform ( ) ; + } + + + np[0] = ks ; + + if ( kt != 0) + { + fprintf (stderr , "permute stage 1\n" ); + permute_stage1 ( ) ; + } + + if ( 2*kt + 1 < m ) + { + fprintf (stderr , "permute stage 2\n" ); + permute_stage2 ( ) ; + } + + +/* lines under are just for my own conveniance */ + for ( iii = 0 ; iii < 3 ; iii++) + { + + fprintf (stderr , "\t\t out %d tot : %f \t %f\n" , iii ,a[iii], b[iii]); + + } + + _pdblA = a ; + _pdblB = b ; + + return 0 ; +} + +/** ************************************** +Sous-Fonctions +******************************************/ + + + + +void preliminaryWork (void) +{ + + int lim ; + + + if ( isn <= 0 ) + { + s72 = -s72 ; + s120= -s120; + rad = -rad ; + } + else + { + ak =(double) 1/n ; + + /*scale by 1/n for isn > 0 */ + for ( j = 1 ; j <= nt ; j += inc ) + { + a[j-1] *= ak ; + b[j-1] *= ak ; + printf ("boucle isn\n ak %f" , ak); + } + } + kspan = ks ; + nn = nt -inc ; + jc = ks/n ; + + /* sin , cos values are re-initialized each lim steps */ + + lim = 32 ; + klim = lim*jc ; + i = 0; + jf = 0 ; + + maxf = m -kt ; + maxf = nfac[maxf-1] ; + + fprintf (stderr , "\tm - kt %d , nfac %d kt %d\n" , m - kt , maxf , kt); + + if ( kt > 0 ) + maxf = max ( nfac[kt-1] , maxf ); + + +} + + +/*40*/ +int factorTransform (void) +{ + + int retVal = 42; + int jjjj = 0 ; + + + dr = 8 * (double)jc/(double)kspan ; + printf ( "dr %f = jc %d kspan %d \n" ,dr, jc , kspan ); + cd = 2 * sin(0.5*dr*rad)*sin(0.5*dr*rad); + sd = sin(dr*rad) ; + printf ("debut cd %f sd %f dr %f\n\n" , cd , sd, dr) ; + kk = 1 ; + i++ ; + + for ( jjjj = 0 ; jjjj < 10 ; jjjj ++ ) + { + printf ( " \t%d a %f b %f \n" ,jjjj, a[jjjj] , b[jjjj] ); + } + + + fprintf (stderr , "avant switch i %d ,nfac[i-1] %d\n" , i , nfac[i-1]); +switch ( nfac[i-1] ) + { + case 2 : + /*transform for factor of 2 (including rotation factor)*/ + fprintf (stderr , "\tpre_fOf2Trans\n" ); + retVal = pre_fOf2Trans( ) ; + if ( retVal == 0 ) + { + fprintf (stderr , "\tfactorOf2Transform\n" ); + factorOf2Transform ( ) ; + + } + break ; + + case 4 : + /*transform for factor of 4 */ + kspnn = kspan ; + kspan = kspan >> 2 ; /*kspan /= 4 */ + + fprintf (stderr , "\tfactorOf4Transform\n" ); + retVal = factorOf4Transform ( ) ; + break ; + + case 3 : + fprintf (stderr , "\tfactorOf3Transform\n" ); + k = nfac[i-1] ; + kspnn = kspan ; + kspan = kspan / k ; + fprintf (stderr , "\t\t k %d i %d\n" , k ,i); + + factorOf3Transform ( ) ; + for ( jjjj = 0 ; jjjj < 9 ; jjjj ++ ) + { + printf ( " \t apres transf%d a %f b %f \n" ,jjjj, a[jjjj] , b[jjjj] ); + } + break ; + + case 5 : + fprintf (stderr , "\tfactorOf5Transform\n" ); + k = nfac[i-1] ; + kspnn = kspan ; + kspan = kspan / k ; + fprintf (stderr , "\t\t k %d\n" , k); + factorOf5Transform ( ) ; + break ; + + default : + + k = nfac[i-1] ; + kspnn = kspan ; + kspan = kspan / k ; + fprintf (stderr , "\t\t k %d kspan %d \n" , k , kspan); + fprintf (stderr , "\t\t nfac[i-1] %d jf %d\n" , nfac[i-1] , jf ) ; + if ( nfac[i-1] != jf) + { + fprintf (stderr , "\tpreFOtherTransform \n" ); + preFOtherTransform ( ) ; + } + fprintf (stderr , "\tfactorOfOtherTransform \n" ); + factorOfOtherTransform ( ) ; + break ; + } + + printf ("\n\n"); + for ( jjjj = 0 ; jjjj < 15; jjjj ++ ) + { + printf ( " \t%d a %f b %f \n" ,jjjj, a[jjjj] , b[jjjj] ); + } + + if ( retVal == 42 ) + { + + fprintf (stderr , "\t\t i %d m %d\n" , i , m ); + if ( i != m) + { + fprintf (stderr , "\tmulByRotationFactor \n" ); + retVal = mulByRotationFactor ( ) ; + } + else + retVal = 1 ; + } + + + if ( retVal == 1 ) + return 1 ; /*goto permute */ + else + return 0 ; /*goto factor_transform => once again*/ + + + +} + + +void permute_stage1 (void) +{ + + int retVal = 1 ; + + printf ("\t pre_sqFactor2NormlOrder\n"); + pre_sqFactor2NormlOrder ( ) ; + + if ( n == ntot ) + /*permutation for single-variate transform (optional code)*/ + while ( retVal == 1) + { + printf ("\tsingle_sqFactor2NormlOrder\n"); + single_sqFactor2NormlOrder ( ) ; + retVal = post_sqFactor2NormlOrder () ; + } + else + /*permutation for multivariate transform*/ + while ( retVal == 1) + { + printf ("\tmulti_sqFactor2NormlOrder\n"); + retVal = multi_sqFactor2NormlOrder ( ); + } + + +} + +void permute_stage2 (void) +{ + + + kspnn = np[kt] ; + fprintf (stderr , "\t kspnn %d , kt %d\n" , kspnn , kt); + + /*permutation for square-free facotrs of n */ + fprintf (stderr , "\tnonSqFactor2NormOrder 2\n" ); + nonSqFactor2NormOrder ( ) ; + + /*determine the permutation cycles of length greater than 1*/ + fprintf (stderr , "\tdetPermutCycles 2\n" ); + detPermutCycles ( ); + + + + j = k3 + 1; + nt -= kspnn ; + i = nt - inc + 1 ; + while ( nt >= 0 ) + { + printf ( "\t\t j %d , k3 %d\n" , j , k3 ) ; + fprintf (stderr , "\treordermatrix \n" ); + + reorderMatrix ( ) ; + j = k3 + 1 ; + nt -= kspnn ; + i = nt - inc + 1 ; + printf ( "\t\t570 nt %d k3 %d j %d\n" , nt, k3 , j) ; + } + + +} + +/** ************************************** +Sous-Sous-Fonctions +******************************************/ + + + + + +int pre_fOf2Trans (void) +{ + int ktemp = 0 ; + + kspan /= 2; + k1 = kspan + 2 ; +/*50*/ + do + { + fprintf (stderr , "\t 50 \n"); + k2 = kk + kspan ; + ak = a[k2-1] ; + bk = b[k2-1] ; + + a[k2-1] = a[kk-1] - ak; + b[k2-1] = b[kk-1] - bk; + + a[kk-1] = a[kk-1] + ak; + b[kk-1] = b[kk-1] + bk; + + kk = k2 + kspan ; + ktemp = kk ; + + if ( kk > nn ) + { + kk -= nn ; + } + }while (ktemp <= nn ||( kk <= jc && ktemp <= nn)); + + + printf ("\t kk %d > kspan %d ?\n" , kk, kspan ); + + + + if ( kk > kspan ) + return 1 ; /*goto350*/ + else + + return 0 ;/*goto60*/ + + + + +} + + + +int factorOf2Transform (void) +{ +int ktemp = 0 ; +printf ( "\t\t fact\n" ) ; + + + + +do /*60*/ + { + c1 = 1 - cd ; + s1 = sd ; + mm = min( k1/2 , klim); + + do/* do 80 */ + { + do + { + k2 = kk + kspan; + printf ("\t\t 80 k2 %d kk %d\n" , k2 , kk); + ak = a[kk-1] - a[k2-1]; + bk = b[kk-1] - b[k2-1]; + + a[kk-1] = a[kk-1] + a[k2-1]; + b[kk-1] = b[kk-1] + b[k2-1]; + + a[k2-1] = c1*ak - s1*bk; + b[k2-1] = s1*ak + c1*bk; + printf ("\t\t k2 %d c1 %f s1 %f ak %f bk %f\n" , k2 , c1,s1,ak,bk); + + kk = k2 + kspan; + ktemp = kk ; + if (kk >= nt) + { + k2 = kk - nt; + c1 = -c1; + kk = k1 - k2; + printf ("\t\t k2 %d kk %d nt %d\n" , k2 , kk , nt); + } + + }while ( ktemp < nt || (kk > k2 && ( ktemp >= nt)) ); + + kk += jc; + + if ( kk <= mm ) /* 70 */ + { + printf ( "\t 70 \n") ; + ak = c1 - ( cd*c1+sd*s1) ; + s1 += (sd*c1-cd*s1) ; + /*c the following three statements compensate for truncation + c error. if rounded arithmetic is used, substitute + c c1=ak*/ + c1 = 0.5/(ak*ak+s1*s1) + 0.5 ; + s1 *= c1 ; + c1 *= ak ; + } + else + { + if ( kk < k2 ) /*90*/ + { + printf ( "\t 90 \n") ; + s1 = dr*rad*((double)(kk-1)/(double)jc); + c1 = cos(s1) ; + s1 = sin(s1) ; + mm = min(k1/2,mm+klim); + } + } + printf ( "\tplop\n") ; + }while ( kk <= mm || ( kk > mm && kk < k2 )); + + k1 += (inc+inc) ; + kk = (k1-kspan)/2 + jc; + + } while ( kk <= jc*2 ); + + printf ("goto40 1\n" ) ; + return 0 ; /*goto40*/ +} + + + +int factorOf4Transform (void) +{ + + int return_value = 0 ; + + /*120*/ + do + { + c1 = 1 ; + s1 = 0 ; + + mm = min ( kspan , klim ) ; + + do + { + f4t_150 () ; + return_value = f4t_170 () ; + } while ( return_value == 0 ); + + kk += ( inc - kspan ) ; + } while ( kk <= jc ) ; + + + + if ( kspan == jc ) + return 1 ; /*goto350*/ + else + return 0 ;/*goto40*/ + + +} + +void f4t_150 (void) +{ + + int sign = 1 ; + + do{ + k1 = kk + kspan ; + k2 = k1 + kspan ; + k3 = k2 + kspan ; + + akp = a[kk-1] + a[k2-1] ; + akm = a[kk-1] - a[k2-1] ; + + ajp = a[k1-1] + a[k3-1] ; + ajm = a[k1-1] - a[k3-1] ; + + a[kk-1] = akp + ajp ; + ajp = akp - ajp ; + + bkp = b[kk-1] + b[k2-1] ; + bkm = b[kk-1] - b[k2-1] ; + + bjp = b[k1-1] + b[k3-1] ; + bjm = b[k1-1] - b[k3-1] ; + + b[kk-1] = bkp + bjp ; + bjp = bkp - bjp ; + + if ( isn < 0 ) + sign = 1 ; + else + sign = -1 ; + + + akp = akm +(sign * bjm ); + akm = akm -(sign * bjm ); + + bkp = bkm +(sign * ajm) ; + bkm = bkm -(sign * ajm) ; + + if ( s1 == 0 )/*190*/ + { + a[k1-1] = akp ; + a[k2-1] = ajp ; + a[k3-1] = akm ; + + b[k1-1] = bkp ; + b[k2-1] = bjp ; + b[k3-1] = bkm ; + + + } + else /*160*/ + { + + a[k1-1] = akp*c1 - bkp*s1 ; + a[k2-1] = ajp*c2 - bjp*s2 ; + a[k3-1] = akm*c3 - bkm*s3 ; + + a[k1-1] = bkp*c1 + akp*s1 ; + a[k2-1] = bjp*c2 + ajp*s2 ; + a[k3-1] = bkm*c3 + akm*s3 ; + } + }while ( kk < nt ) ; + + +} + +int f4t_170 (void) +{ + + kk += ( jc - nt ) ; + + if ( kk <= mm ) + { + c2 = c1 - (cd*c1 + sd*s1); + s1 = s1 + (sd*c1 - cd*s1); + + /* + the following three statements compensate for truncation + error. if rounded arithmetic is used, substitute + c1=c2 + */ + + c1 = 0.5/(c2*c2+s1*s1) + 0.5 ; + s1 *= c1 ; + c2 *= c1 ; + + /*140*/ + + c2 = c1*c1 - s1*s1 ; + s2 = c1*s1*2 ; + s3 = c2*s1 + s2*c1 ; + + + return 0 ; + + } + else + { + if ( kk <= kspan ) + { + s1 = dr*rad * (kk-1)/jc ; + c2 = cos (s1) ; + s1 = sin (s1) ; + mm = min ( kspan , mm + klim ); + + /*140*/ + + c2 = c1*c1 - s1*s1 ; + s2 = c1*s1*2 ; + s3 = c2*s1 + s2*c1 ; + + return 0 ; + } + } + + return 1 ; +} + + + + +void factorOf3Transform (void) +{ +int ktemp = 0 ; +do + { + fprintf (stderr , "\t\t une boucle dans factor of 3\n"); + k1 = kk + kspan ; + k2 = k1 + kspan ; + + ak = a[kk-1] ; + bk = b[kk-1] ; + + aj = a[k1-1] + a[k2-1] ; + bj = b[k1-1] + b[k2-1] ; + + a[kk-1] = ak + aj ; + b[kk-1] = bk + bj ; + + ak = -0.5*aj + ak ; + bk = -0.5*bj + bk ; + + aj = (a[k1-1] - a[k2-1])*s120 ; + bj = (b[k1-1] - b[k2-1])*s120 ; + + a[k1-1] = ak - bj ; + b[k1-1] = bk + aj ; + a[k2-1] = ak + bj ; + b[k2-1] = bk - aj ; + + kk = k2 + kspan ; + ktemp = kk ; + + fprintf (stderr , "\t\t kk %d , nn %d , kspan %d\n" , kk , nn , kspan ); + + if ( kk >= nn ) + kk -= nn ; + fprintf (stderr , "\t\t 2kk %d , nn %d , kspan %d\n" , kk , nn , kspan ); + }while ( ktemp < nn || (kk <= kspan && ( ktemp >= nn)) ); + +} + +void factorOf5Transform (void) +{ + int ktemp ; + + c2 = c72*c72 - s72 *s72 ; + s2 = 2 * c72*s72; + fprintf (stderr , "plop\n" ) ; + do + { + k1 = kk + kspan ; + k2 = k1 + kspan ; + k3 = k2 + kspan ; + k4 = k3 + kspan ; + + fprintf (stderr , "kk %d \t k1 %d \t k2 %d \t k3 %d \t k4 %d\n", kk , k1 , k2 ,k3,k4 ); + + akp = a[k1-1] + a[k4-1] ; + akm = a[k1-1] - a[k4-1] ; + + bkp = b[k1-1] + b[k4-1] ; + bkm = b[k1-1] - b[k4-1] ; + + ajp = a[k2-1] + a[k3-1] ; + ajm = a[k2-1] - a[k3-1] ; + + bjp = b[k2-1] + b[k3-1] ; + bjm = b[k2-1] - b[k3-1] ; + + aa = a[kk-1] ; + bb = b[kk-1] ; + + a[kk-1] = aa + akp + ajp; + b[kk-1] = bb + bkp + bjp; + + ak = akp*c72 + ajp*c2 + aa ; + bk = bkp*c72 + bjp*c2 + bb ; + + aj = akm*s72 + ajm*s2 ; + bj = bkm*s72 + bjm*s2 ; + + a[k1-1] = ak - bj ; + a[k4-1] = ak + bj ; + b[k1-1] = bk + aj ; + b[k4-1] = bk - aj ; + + ak = akp*c2 + ajp*c72 + aa ; + bk = bkp*c2 + bjp*c72 + bb ; + + aj = akm*s2 - ajm*s72 ; + fprintf (stderr , "aj %f \takm %f \tajm %f\n" , aj , akm , ajm ); + bj = bkm*s2 - bjm*s72 ; + + a[k2-1] = ak - bj ; + a[k3-1] = ak + bj ; + b[k2-1] = bk + aj ; + b[k3-1] = bk - aj ; + + kk = k4 + kspan; + ktemp = kk ; + fprintf (stderr , "ak %f \tbk %f\naj %f \tbj %f\n" , ak , bk , aj ,bj ); + fprintf (stderr , "kk %d \t nn %d \t kspan %d\n", kk , nn , kspan ); + if ( kk >= nn ) + kk -= nn ; + + fprintf (stderr , "kk %d \t nn %d \t kspan %d\n", kk , nn , kspan ); + }while (ktemp < nn || ( kk <= kspan && ktemp >= nn)); + +fprintf (stderr , "fin 5\n" ); + +} + + +void preFOtherTransform (void) +{ + + + jf = k ; + s1 = (rad*8)/k ; + c1 = cos (s1) ; + s1 = sin (s1) ; + ck[jf-1] = 1 ; + sk[jf-1] = 0 ; + j = 1 ; + + do + { + ck[j-1] = ck[k-1] * c1 + sk[k-1]*s1 ; + sk[j-1] = ck[k-1] * s1 - sk[k-1]*c1 ; + + k -- ; + + ck[k-1] = ck[j-1] ; + sk[k-1] = - sk[j-1] ; + + j++ ; + fprintf (stderr , "je boucle\n" ); + }while ( j < k ); + +} + +void factorOfOtherTransform (void) +{ +int ktemp = 0 ; + +do + { + k1 = kk ; + k2 = kk + kspnn ; + + aa = a[kk-1] ; + bb = b[kk-1] ; + + ak = aa ; + bk = bb ; + j = 1 ; + k1 += kspan ; + + do + { + k2 -= kspan ; + j++ ; + + wt[j-1] = a[k1-1] + a[k2-1] ; + ak = wt[j-1] + ak ; + + bt[j-1] = b[k1-1] + b[k2-1] ; + bk = bt[j-1] + bk ; + printf ("\t 260 ak %f bk %f\n" , ak , bk ) ; + j++ ; + + wt[j-1] = a[k1-1] - a[k2-1] ; + bt[j-1] = b[k1-1] - b[k2-1] ; + + k1 += kspan; + }while ( k1 < k2 ) ; + + a[kk-1] = ak ; + b[kk-1] = bk ; + + k1 = kk ; + k2 = kk + kspnn ; + j = 1 ; + + do + { + k1 += kspan ; + k2 -= kspan ; + jj = j ; + ak = aa ; + bk = bb ; + aj = 0 ; + bj = 0 ; + k = 1 ; + + do + { + k++ ; + ak += ( wt[k-1] * ck[jj-1] ) ; + bk += ( bt[k-1] * ck[jj-1] ) ; + printf ("\t 280 ak %f bk %f\n" , ak , bk ) ; + + k++ ; + aj += (wt[k-1] * sk[jj-1]) ; + bj += (bt[k-1] * sk[jj-1]) ; + printf ("\t aj %f bj %f\n" , aj , bj ) ; + jj += j ; + + if ( jj > jf ) + jj -= jf ; + } while ( k < jf ) ; + + k = jf - j ; + a[k1-1] = ak - bj ; + b[k1-1] = bk + aj ; + a[k2-1] = ak + bj ; + b[k2-1] = bk - aj ; + + j++ ; + fprintf (stderr , "je boucle3\n" ); + }while ( j < k ) ; + + + + + + kk += kspnn ; + ktemp = kk ; + fprintf (stderr , "kk %d \t nn %d \t kspan %d\n", kk , nn , kspan ); + if ( kk > nn ) + { + kk -= nn; + } + fprintf (stderr , "kk %d \t nn %d \t kspan %d\n", kk , nn , kspan ); +}while ( ktemp <= nn || (kk <= kspan && ( ktemp > nn)) ); +} + + + + +int mulByRotationFactor (void ) +{ + int ktemp = 0 ; + + if ( i != m ) + { + kk = jc + 1 ; + + /*300*/ + do + { + c2 = 1 - cd ; + s1 = sd ; + printf ( "\t 300 c2 %f s1 %f \n" , c2 , s1 ); + mm = min ( kspan , klim ) ; + + /*320 */ + do + { + printf ( "\t 320 \n" ) ; + c1 = c2 ; + s2 = s1 ; + kk += kspan ; + printf ( "\t 320 c2 %f s1 %f \n" , c2 , s1 ); + do + { + printf ( "\t 330 kk %d s2 %f c2 %f\n" , kk , s2 , c2 ) ; + ak = a[kk-1] ; + a[kk-1] = c2*ak - s2*b[kk-1] ; + b[kk-1] = s2*ak + c2*b[kk-1] ; + + kk += kspnn ; + ktemp = kk ; + + printf ("\t\t kk %d nt %d \n" , kk , nt ); + if ( kk > nt ) + { + ak = s1*s2 ; + s2 = s1*c2 + s2*c1 ; + c2 = c1*c2 - ak ; + kk += (kspan - nt ) ; + printf ( "\t\t plop c2 %f s2 %f \n" , c2 , s2 ); + + printf ("\t\t kk %d kspnn %d \n" , kk , kspnn ); + } + + }while (ktemp <= nt || ( kk <= kspnn && ktemp > nt )) ; + + kk += ( jc - kspnn ); + + printf ( "\t avant goto310/340 , kk %d , mm %d , kspan %d \n" , kk , mm , kspan ) ; + if ( kk <= mm ) + { + printf ( "\t 310 \n" ) ; + /* 310*/ + c2 = c1 - ( cd*c1 + sd*s1 ) ; + s1 += (sd*c1 - cd*s1 ) ; + + /* + the following three statements compensate for truncation + error. if rounded arithmetic is used, substitute + c1=c2 + */ + + c1 = 0.5/(c2*c2+s1*s1) + 0.5 ; + s1 *= c1 ; + c2 *= c1 ; + } + else + { + if ( kk <= kspan ) + { + printf ( "\t 340 \n" ) ; + s1 = dr*rad * (kk-1)/jc ; + c2 = cos (s1) ; + s1 = sin (s1) ; + mm = min ( kspan , mm + klim ); + } + } + + }while ( kk <= mm ||( kk <= kspan && kk > mm ) ) ; + + kk += (jc + inc -kspan ); + + printf ( "je boucle 2 \n" ) ; + }while ( kk <= jc+jc); + + printf ("\tje prends le goto40\n" ) ; + return 0 ; /* goto40 */ + } + + return 1 ; /* goto350*/ +} + + + + +void pre_sqFactor2NormlOrder (void) +{ + + k = kt + kt + 1 ; + + if ( m < k ) + k -- ; + + j = 1 ; + np[k] = jc ; + + do + { + np[j] = np[j-1]/nfac[j-1] ; + np[k-1] = np[k]*nfac[j-1] ; + + j++ ; + k-- ; + }while ( j < k ) ; + + k3 = np[k] ; + kspan = np[1] ; + kk = jc + 1 ; + k2 = kspan + 1 ; + j = 1; + + +} + +int post_sqFactor2NormlOrder (void) +{ + printf ("\tpost_sqFactor2NormlOrder\n"); + do + { + do + { + k2 -= np[j-1] ; + j++ ; + k2 += np[j] ; + printf ("\t\t380-k2 %d np[%d] = %d\n" , k2 , j-1 , np[j-1]); + } while ( k2 > np[j-1]); + + j = 1 ; + +/* 390 */ + do + { + if ( kk < k2 ) + { + + printf ( "\t\t return 1\n"); + return 1 ; + } + else + { + kk += inc ; + k2 += kspan ; + } + }while( k2 < ks ); + + }while ( kk < ks ) ; + + jc = k3 ; + printf ( "\t\t return 0\n"); + return 0; +} + + +/* appeler cetter fonction dans un do while valeur_retour != 1)*/ +void single_sqFactor2NormlOrder (void) +{ + + + do + { + printf ("\t\t 370 - kk %d ks %d k2 %d\n", kk , ks , k2 ) ; + ak = a[kk-1] ; + a[kk-1] = a[k2-1] ; + a[k2-1] = ak ; + + bk = b[kk-1] ; + b[kk-1] = b[k2-1] ; + b[k2-1] = bk ; + + kk += inc ; + k2 += kspan ; + } while ( k2 < ks ); + + /*380*/ +} + +/*idem que single_ */ +int multi_sqFactor2NormlOrder (void) +{ + + + + k = kk + jc ; + + do /*410*/ + { + ak = a[kk-1] ; + a[kk-1] = a[k2-1] ; + a[k2-1] = ak ; + bk = b[kk-1] ; + b[kk-1] = b[k2-1] ; + b[k2-1] = bk ; + kk += inc ; + k2 += kspan ; + } while ( kk < k ); + + kk += (ks - jc ) ; + k2 += (ks - jc ) ; + + if ( kk < nt ) + return 1 ; + + k2 += ( kspan - nt ); + kk += ( jc - nt ); + + if ( k2 < ks ) + { + + return 1 ; + } + if( post_sqFactor2NormlOrder ( ) == 1 ) + { + + return 1 ; + } + jc = k3 ; + + return 0; + +} + + + +void nonSqFactor2NormOrder (void) +{ + + j = m - kt ; + nfac[j] = 1 ; + + + + do + { + nfac[j-1] *= nfac[j] ; + fprintf (stderr , "\t\t m %d j %d , nfac[j-1] %d\n", m , j , nfac[j-1] ); + j-- ; + + + }while ( j != kt ) ; + + kt ++ ; + nn = nfac[kt-1] - 1; + fprintf (stderr , "\t\t nn %d \n" , nn ) ; + jj = 0 ; + j = 0; + + /*480*/ + + k2 = nfac[kt-1] ; + k = kt + 1 ; + kk = nfac[k-1] ; + j ++ ; + fprintf (stderr , "\t\tj %d\n" , j ) ; + while ( j <= nn ) + { + jj += kk ; + fprintf (stderr , "\t\t 1jj %d , kk %d\n" , jj , kk ) ; + + while ( jj >= k2 ) + { + jj -= k2 ; + k2 = kk ; + k++ ; + kk = nfac[k-1] ; + + jj += kk ; + fprintf (stderr , "\t\t jj %d , kk %d\n" , jj , kk ) ; + + } + + np[j-1] = jj ; + k2 = nfac[kt-1] ; + k = kt + 1 ; + kk = nfac[k-1] ; + j ++ ; + fprintf (stderr , "\t\t1j %d\n" , j ) ; + } + + j = 0 ; + + return ; +} + + +void detPermutCycles (void) +{ + + do + { + do + { + j++ ; + fprintf (stderr , "\t\t500 j %d \tnp[j-1] %d\n" , j , np[j-1]); + kk = np[j-1] ; + }while ( kk < 0 ) ; + + fprintf (stderr , "\t\t kk %d\t j %d\t\n" , kk , j ); + if ( kk != j ) + { + do + { + fprintf (stderr , "\t\t 490 kk %d\n" , kk ); + k = kk ; + kk = np[k-1] ; + np[k-1] = -kk ; + }while ( kk != j ) ; + k3 = kk ; + } + else + np[j-1] = -j ; + }while ( j != nn ); + + maxf *= inc ; + + return ; +} + +void reorderMatrix (void) +{ +do + { + do + { + j-- ; + printf ( "\t\t\t j %d , %d \n" , j , np[j-1]); + }while (np[j-1] < 0 ) ; + + jj = jc ; + + /*520*/ + do + { + kspan = jj ; + + if ( jj > maxf ) + kspan = maxf ; + + jj -= kspan ; + k = np [j-1]; + kk = jc*k + i + jj ; + k1 = kk + kspan ; + k2 = 0 ; + + do /*530*/ + { + k2 ++ ; + wt[k2-1] = a[k1-1] ; + bt[k2-1] = b[k1-1] ; + k1 -= inc ; + + }while ( k1 != kk ); + + do + { + k1 = kk + kspan ; + k2 = k1 - jc * (k + np[k-1]); + k = -np[k-1]; + + fprintf (stderr , "\t\ttend ploplpop 3\n" ); + do + { + a[k1-1] = a[k2-1] ; + b[k1-1] = b[k2-1] ; + + k1 -= inc ; + k2 -= inc ; + + }while ( k1 != kk ) ; + + kk = k2 ; + printf ( "\t\t k %d j %d\n" , k , j ) ; + }while ( k != j ); + + k1 = kk +kspan ; + k2 = 0 ; + /*560*/ + + do + { + k2 ++ ; + a[k1-1] = wt[k2-1] ; + b[k1-1] = bt[k2-1] ; + k1 -= inc ; + fprintf (stderr , "\t\t560 k1 %d kk %d\n" , k1 , kk ); + + }while ( k1 != kk ) ; + + } while ( jj != 0 ) ; +}while ( j != 1 ) ; + + return ; +} + + diff --git a/src/signalProcessing/ifft/fft842.c b/src/signalProcessing/ifft/fft842.c new file mode 100644 index 00000000..27682ae6 --- /dev/null +++ b/src/signalProcessing/ifft/fft842.c @@ -0,0 +1,199 @@ +/* + * 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 + * + */ + +#include "fft_internal.h" +#include <stdio.h> + + + +/* get binary log of integer argument; exact if n a power of 2 */ +static int fastlog2( int n) +{ + int log = -1; + while(n) { + log++; + n >>= 1; + } + return(log); +} + +/* + int in; FORWARD or INVERSE + int n; length of vector + DPCOMPLEX *b; input vector +*/ +void fft842 (doubleComplex* b, int size , int in) +{ + double fn; + doubleComplex temp ; + + int L[16],L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15; + int j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12,j13,j14; + int i = 0, j, ij, ji, ij1, ji1; + int n2pow, n8pow, nthpo, ipass, nxtlt, lengt; + + n2pow = fastlog2( size ); + nthpo = size ; + fn = nthpo; + + + if(in==FORWARD) + /* take conjugate */ + for(i=0;i< size ;i++) { + b[i] = DoubleComplex ( zreals( b[i]) , - zimags (b[i])); + + /* b[i].im *= -1.0;*/ + } + + if(in==INVERSE) + /*scramble inputs*/ + + for(i=0,j=size/2;j<size;i++,j++) + { + temp = DoubleComplex ( zreals ( b[j] ) , zimags( b[j] )); + b[j] = DoubleComplex ( zreals ( b[i] ) , zimags( b[i] )); + b[i] = DoubleComplex ( zreals ( temp ) , zimags( temp )); + + /* + r = b[j].re; fi = b[j].im; + b[j].re = b[i].re; b[j].im = b[i].im; + b[i].re = r; b[i].im = fi; + */ + } + + n8pow = n2pow/3; + + if(n8pow) + { + /* radix 8 iterations */ + for(ipass=1;ipass<=n8pow;ipass++) + { + nxtlt = 0x1 << (n2pow - 3*ipass); + lengt = 8*nxtlt; + + + + r8tx(nxtlt,nthpo,lengt, + b,b+nxtlt,b+2*nxtlt, + b+3*nxtlt,b+4*nxtlt,b+5*nxtlt, + b+6*nxtlt,b+7*nxtlt); + + + } + } + + if(n2pow%3 == 1) + { + /* radix 2 iteration needed */ + r2tx(nthpo,b,b+1); + + + } + + + if(n2pow%3 == 2) + { + /* radix 4 iteration needed */ + + r4tx(nthpo,b,b+1,b+2,b+3); + } + + + + for(j=1;j<=15;j++) + { + L[j] = 1; + if(j-n2pow <= 0) L[j] = 0x1 << (n2pow + 1 - j); + } + L15=L[1];L14=L[2];L13=L[3];L12=L[4];L11=L[5];L10=L[6];L9=L[7]; + L8=L[8];L7=L[9];L6=L[10];L5=L[11];L4=L[12];L3=L[13];L2=L[14];L1=L[15]; + + ij = 1; + + + for(j1=1;j1<=L1;j1++) + for(j2=j1;j2<=L2;j2+=L1) + for(j3=j2;j3<=L3;j3+=L2) + for(j4=j3;j4<=L4;j4+=L3) + for(j5=j4;j5<=L5;j5+=L4) + for(j6=j5;j6<=L6;j6+=L5) + for(j7=j6;j7<=L7;j7+=L6) + for(j8=j7;j8<=L8;j8+=L7) + for(j9=j8;j9<=L9;j9+=L8) + for(j10=j9;j10<=L10;j10+=L9) + for(j11=j10;j11<=L11;j11+=L10) + for(j12=j11;j12<=L12;j12+=L11) + for(j13=j12;j13<=L13;j13+=L12) + for(j14=j13;j14<=L14;j14+=L13) + for(ji=j14;ji<=L15;ji+=L14) + + { + ij1 = ij-1; + ji1 = ji-1; + + if(ij-ji<0) + { + temp = b[ij1]; + b[ij1] = b[ji1]; + b[ji1] = temp; + + /* + r = b[ij1].re; + b[ij1].re = b[ji1].re; + b[ji1].re = r; + fi = b[ij1].im; + b[ij1].im = b[ji1].im; + b[ji1].im = fi; + */ + } + ij++; + } + + if(in==FORWARD) + { /* take conjugates & unscramble outputs */ + for(i=0,j=size/2;j<size;i++,j++) + { + temp = DoubleComplex ( zreals ( b[j] ) ,- zimags( b[j] )); + b[j] = DoubleComplex ( zreals ( b[i] ) ,- zimags( b[i] )); + b[i] = DoubleComplex ( zreals ( temp ) , zimags( temp )); + + + /* r = b[j].re; fi = b[j].im; + b[j].re = b[i].re; b[j].im = -b[i].im; + b[i].re = r; b[i].im = -fi; + */ + } + } + + if(in==INVERSE) /* scale outputs */ + { + for(i=0;i<nthpo;i++) + { + printf ( "plopl\n"); + b[i] = DoubleComplex ( zreals( b[i] )/fn , zimags(b[i])/fn); + fn *= -1 ; + } + } + +/* + for ( i = 0 ; i < size /2 ; i++) + { + temp = b[i] ; + b[i] = b[i+(size/2)]; + b[i+(size/2)]= temp ; + + + + } + +*/ +} diff --git a/src/signalProcessing/ifft/fft_internal.h b/src/signalProcessing/ifft/fft_internal.h new file mode 100644 index 00000000..2bd5a597 --- /dev/null +++ b/src/signalProcessing/ifft/fft_internal.h @@ -0,0 +1,69 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#ifndef __FFT_INTERNAL_H__ +#define __FFT_INTERNAL_H__ + + +#include "addition.h" +#include "subtraction.h" + +#define FORWARD 0 +#define INVERSE 1 +void dfft2 ( double* a , double* b , int nseg , int n , int nspn , + int isn , int ierr); + + + +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 r2tx(int nthpo, doubleComplex* c0, doubleComplex* c1); +void r4tx( int nthpo, doubleComplex* c0, doubleComplex* c1, doubleComplex* c2, doubleComplex* c3); +void r8tx ( int nxtlt,int nthpo,int lengt, + doubleComplex* cc0,doubleComplex* cc1,doubleComplex* cc2,doubleComplex* cc3, + doubleComplex* cc4,doubleComplex* cc5,doubleComplex* cc6,doubleComplex* cc7); + +int dfftmx ( double* _pdblA , double* _pdblB , int _iNtot, int _iN, int _iNspan, + int _iIsn, int _iM, int _iKt, double* _pdblWt, double* _pdblCk, + double* _pdblBt, double* _pdblSk, int* _piNp, int* _piNfac); + +/* under functions used by dfftmx */ + void preliminaryWork (void); + void preliminaryWork (void); + void permute_stage1 (void); + void permute_stage2 (void); + void f4t_150 (void); + void factorOf3Transform (void) ; + void factorOf5Transform (void) ; + void preFOtherTransform (void); + void factorOfOtherTransform (void); + void pre_sqFactor2NormlOrder (void); + void nonSqFactor2NormOrder (void) ; + void detPermutCycles (void); + void reorderMatrix (void ) ; + + int f4t_170 (void); + int factorTransform (void); + int pre_fOf2Trans (void); + int factorOf2Transform (void); + int factorOf4Transform (void); + int mulByRotationFactor (void ); + int post_sqFactor2NormlOrder (void); + void single_sqFactor2NormlOrder (void); + int preF2transform (void) ; + int multi_sqFactor2NormlOrder (void); +/* int end (void) ;*/ + +#endif /* !__FFT_INTERNAL_H__ */ diff --git a/src/signalProcessing/ifft/r2tx.c b/src/signalProcessing/ifft/r2tx.c new file mode 100644 index 00000000..74039da5 --- /dev/null +++ b/src/signalProcessing/ifft/r2tx.c @@ -0,0 +1,47 @@ +/* + * 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 + * + */ + +#include "fft_internal.h" +#include <stdio.h> +/* +** radix 2 iteration subroutine +*/ +void r2tx(int nthpo, doubleComplex* c0, doubleComplex* c1) +{ + int kk; + /* double *cr0, *ci0, *cr1, *ci1, r1, fi1;*/ + doubleComplex temp ; + +/* cr0 = &(c0[0].re); + ci0 = &(c0[0].im); + cr1 = &(c1[0].re); + ci1 = &(c1[0].im);*/ + + for(kk=0;kk<nthpo;kk+=2) + { + + + temp = zadds ( c0[kk] , c1[kk] ); + c1[kk] = zdiffs( c0[kk] , c1[kk] ); + c0[kk] = DoubleComplex ( zreals ( temp ) , zimags( temp )); +/* + r1 = cr0[kk] + cr1[kk]; + cr1[kk] = cr0[kk] - cr1[kk]; + cr0[kk] = r1; + + + fi1 = ci0[kk] + ci1[kk]; + ci1[kk] = ci0[kk] - ci1[kk]; + ci0[kk] = fi1; +*/ + } +} diff --git a/src/signalProcessing/ifft/r4tx.c b/src/signalProcessing/ifft/r4tx.c new file mode 100644 index 00000000..f7b6400d --- /dev/null +++ b/src/signalProcessing/ifft/r4tx.c @@ -0,0 +1,64 @@ +/* + * 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 + * + */ + +#include "fft_internal.h" + + + +/* +** radix 4 iteration subroutine +*/ +void r4tx( int nthpo, doubleComplex* c0, doubleComplex* c1, doubleComplex* c2, doubleComplex* c3) +{ + int kk; + doubleComplex temp1 , temp2 , temp3 , temp4 ; + + for(kk=0;kk<nthpo;kk+=4) + { + /* real and imag parts alternate */ + + + temp1 = zadds ( c0[kk] , c2[kk] ) ; + temp2 = zdiffs( c0[kk] , c2[kk] ) ; + temp3 = zadds ( c1[kk] , c3[kk] ) ; + temp4 = zdiffs( c1[kk] , c3[kk] ) ; +/* + r1 = cr0[kk] + cr2[kk]; + r2 = cr0[kk] - cr2[kk]; + r3 = cr1[kk] + cr3[kk]; + r4 = cr1[kk] - cr3[kk]; + + + i1 = ci0[kk] + ci2[kk]; + i2 = ci0[kk] - ci2[kk]; + i3 = ci1[kk] + ci3[kk]; + i4 = ci1[kk] - ci3[kk]; +*/ + c0[kk] = zadds ( temp1 , temp3 ); + c1[kk] = zdiffs( temp1 , temp3 ); + +/* + cr0[kk] = r1 + r3; + ci0[kk] = i1 + i3; + cr1[kk] = r1 - r3; + ci1[kk] = i1 - i3; +*/ + c2[kk] = DoubleComplex ( zreals ( temp2 ) - zimags( temp4 ) , zimags ( temp2 ) + zreals( temp4 ) ); + c3[kk] = DoubleComplex ( zreals ( temp2 ) + zimags( temp4 ) , zimags ( temp2 ) - zreals( temp4 ) ); +/* + cr2[kk] = r2 - i4; + ci2[kk] = i2 + r4; + cr3[kk] = r2 + i4; + ci3[kk] = i2 - r4; +*/ + } +} diff --git a/src/signalProcessing/ifft/r8tx.c b/src/signalProcessing/ifft/r8tx.c new file mode 100644 index 00000000..8c44488e --- /dev/null +++ b/src/signalProcessing/ifft/r8tx.c @@ -0,0 +1,167 @@ + +/* + * 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 + * + */ + +#include "fft_internal.h" +#include <math.h> +#include <stdio.h> + + + +/* +** radix 8 iteration subroutine +*/ +void r8tx ( int nxtlt,int nthpo,int lengt, + doubleComplex* cc0,doubleComplex* cc1,doubleComplex* cc2,doubleComplex* cc3, + doubleComplex* cc4,doubleComplex* cc5,doubleComplex* cc6,doubleComplex* cc7) + +{ + + + int j , kk; + double dblP7 = 1 / sqrt (2) ; + double dblPi2 = 8 * atan (1); + + double scale, arg; + double c1,c2,c3,c4,c5,c6,c7; + double s1,s2,s3,s4,s5,s6,s7; + + doubleComplex Atemp0,Atemp1,Atemp2,Atemp3,Atemp4,Atemp5,Atemp6,Atemp7; + doubleComplex Btemp0,Btemp1,Btemp2,Btemp3,Btemp4,Btemp5,Btemp6,Btemp7; + + doubleComplex temp ; + + + scale = dblPi2/lengt; + + + for(j=0;j<nxtlt;j++) + { + + arg = j*scale; + c1 = cos(arg); + s1 = sin(arg); + c2 = c1*c1 - s1*s1; + s2 = c1*s1 + c1*s1; + c3 = c1*c2 - s1*s2; + s3 = c2*s1 + s2*c1; + c4 = c2*c2 - s2*s2; + s4 = c2*s2 + c2*s2; + c5 = c2*c3 - s2*s3; + s5 = c3*s2 + s3*c2; + c6 = c3*c3 - s3*s3; + s6 = c3*s3 + c3*s3; + c7 = c3*c4 - s3*s4; + s7 = c4*s3 + s4*c3; + + for(kk=j;kk<nthpo;kk+=lengt) + { + ;/* (k-1)*2*/ /* index by twos; re & im alternate */ + + + Atemp0 = zadds ( cc0[kk] , cc4[kk] ) ; + Atemp1 = zadds ( cc1[kk] , cc5[kk] ) ; + Atemp2 = zadds ( cc2[kk] , cc6[kk] ) ; + Atemp3 = zadds ( cc3[kk] , cc7[kk] ) ; + + + Atemp4 = zdiffs ( cc0[kk] , cc4[kk] ) ; + Atemp5 = zdiffs ( cc1[kk] , cc5[kk] ) ; + Atemp6 = zdiffs ( cc2[kk] , cc6[kk] ) ; + Atemp7 = zdiffs ( cc3[kk] , cc7[kk] ) ; + + + Btemp0 = zadds ( Atemp0 , Atemp2 ) ; + Btemp1 = zadds ( Atemp1 , Atemp3 ) ; + Btemp2 = zdiffs ( Atemp0 , Atemp2 ) ; + Btemp3 = zdiffs ( Atemp1 , Atemp3 ) ; + + + + + Btemp4 = DoubleComplex ( zreals ( Atemp4 ) - zimags( Atemp6 ) , zimags ( Atemp4 ) + zreals( Atemp6 ) ); + Btemp5 = DoubleComplex ( zreals ( Atemp5 ) - zimags( Atemp7 ) , zimags ( Atemp5 ) + zreals( Atemp7 ) ); + Btemp6 = DoubleComplex ( zreals ( Atemp4 ) + zimags( Atemp6 ) , zimags ( Atemp4 ) - zreals( Atemp6 ) ); + Btemp7 = DoubleComplex ( zreals ( Atemp5 ) + zimags( Atemp7 ) , zimags ( Atemp5 ) - zreals( Atemp7 ) ); + + + cc0[kk] = zadds ( Btemp0 , Btemp1 ); + + + + + + if(j>0) + { + cc1[kk] = DoubleComplex ( (c4 * (zreals(Btemp0) - zreals(Btemp1))) - (s4 * (zimags(Btemp0) - zimags(Btemp1))), + c4 * (zimags(Btemp0) - zimags(Btemp1)) + s4 * (zreals(Btemp0) - zreals(Btemp1))); + + cc2[kk] = DoubleComplex ( c2 * (zreals(Btemp2) - zimags(Btemp3)) - s2 * (zimags(Btemp2) + zreals(Btemp3)) , + c2 * (zimags(Btemp2) + zreals(Btemp3)) + s2 * (zreals(Btemp2) - zimags(Btemp3))); + + cc3[kk] = DoubleComplex ( c6 * (zreals(Btemp2) + zimags(Btemp3)) - s6 * (zimags(Btemp2) - zreals(Btemp3)) , + c6 * (zimags(Btemp2) - zreals(Btemp3)) + s6 * (zreals(Btemp2) + zimags(Btemp3))); + + + temp = DoubleComplex ( dblP7*(zreals ( Btemp5 ) - zimags( Btemp5 )) , + dblP7*(zreals ( Btemp5 ) + zimags( Btemp5 )) ); + + cc4[kk] = DoubleComplex ( c1 * (zreals (Btemp4) + zreals(temp)) - s1 * (zimags (Btemp4) + zimags(temp)) , + c1 * (zimags (Btemp4) + zimags(temp)) + s1 * (zreals (Btemp4) + zreals(temp))); + cc5[kk] = DoubleComplex ( c5 * (zreals (Btemp4) - zreals(temp)) - s5 * (zimags (Btemp4) - zimags(temp)) , + c5 * (zimags (Btemp4) - zimags(temp)) + s5 * (zreals (Btemp4) - zreals(temp))); + + + temp = DoubleComplex ( - dblP7*(zreals ( Btemp7 ) + zimags( Btemp7 )) , + dblP7*(zreals ( Btemp7 ) - zimags( Btemp7 )) ); + + cc6[kk] = DoubleComplex ( c3 * (zreals (Btemp6) + zreals(temp)) - s3 * (zimags (Btemp6) + zimags(temp)) , + c3 * (zimags (Btemp6) + zimags(temp)) + s3 * (zreals (Btemp6) + zreals(temp))); + cc7[kk] = DoubleComplex ( c7 * (zreals (Btemp6) - zreals(temp)) - s7 * (zimags (Btemp6) - zimags(temp)) , + c7 * (zimags (Btemp6) - zimags(temp)) + s7 * (zreals (Btemp6) - zreals(temp))); + + + + + } + else + { + cc1[kk] = zdiffs ( Btemp0 , Btemp1 ); + + cc2[kk] = DoubleComplex ( zreals ( Btemp2 ) - zimags( Btemp3 ) , + zimags ( Btemp2 ) + zreals( Btemp3 ) ); + + + cc3[kk] = DoubleComplex ( zreals ( Btemp2 ) + zimags( Btemp3 ) , + zimags ( Btemp2 ) - zreals( Btemp3 ) ); + + + temp = DoubleComplex ( dblP7*(zreals ( Btemp5 ) - zimags( Btemp5 )) , + dblP7*(zreals ( Btemp5 ) + zimags( Btemp5 )) ); + + cc4[kk] = zadds ( Btemp4 , temp ); + cc5[kk] = zdiffs ( Btemp4 , temp ); + + temp = DoubleComplex ( - dblP7*(zreals ( Btemp7 ) + zimags( Btemp7 )) , + dblP7*(zreals ( Btemp7 ) - zimags( Btemp7 )) ); + + cc6[kk] = zadds ( Btemp6 , temp ); + cc7[kk] = zdiffs ( Btemp6 , temp ); + + + } + + } + } + + +} diff --git a/src/signalProcessing/ifft/testDoubleIfft.c b/src/signalProcessing/ifft/testDoubleIfft.c new file mode 100644 index 00000000..999b7ec1 --- /dev/null +++ b/src/signalProcessing/ifft/testDoubleIfft.c @@ -0,0 +1,1242 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#include <assert.h> +#include <stdio.h> +#include "ifft.h" + + +#define ROW 1 +#define COLS2 2 +#define COLS3 3 +#define COLS4 4 +#define COLS5 5 +#define COLS6 6 +#define COLS7 7 +#define COLS8 8 +#define COLS9 9 +#define COLS10 10 +#define COLS11 11 +#define COLS12 12 +#define COLS13 13 +#define COLS14 14 +#define COLS15 15 +#define COLS16 16 +#define COLS32 32 + +#define ZREAL_IN2 { 0.00022113462910056 , 0.33032709173858166 } +#define ZIMAG_IN2 { 0.66538110421970487 , 0.62839178834110498 } + +#define ZREAL_IN3 { 2.48206677380949259, 0.43537130765616894, 0.97385666053742170} +#define ZIMAG_IN3 { 2.14807060454040766,- 0.78285905346274376, 0.42632796149700880} + + +#define ZREAL_IN4 { 0.84974523587152362, 0.68573101982474327, 0.87821648130193353, 0.06837403681129217} +#define ZIMAG_IN4 { 0.56084860628470778, 0.66235693730413914, 0.72635067673400044, 0.19851438421756029} + +#define ZREAL_IN5 { 0.84974523587152362, 0.68573101982474327, 0.87821648130193353, 0.06837403681129217,\ + 0.65251349471509457} +#define ZIMAG_IN5 { 0.56084860628470778, 0.66235693730413914, 0.72635067673400044, 0.19851438421756029,\ + 0.56642488157376647} + +#define ZREAL_IN6 { 0.54425731627270579, 0.23207478970289230, 0.23122371966019273, 0.21646326314657927,\ + 0.65251349471509457, 0.30760907428339124 } +#define ZIMAG_IN6 { 0.21460078610107303, 0.31264199689030647, 0.36163610080257058, 0.2922266637906432,\ + 0.56642488157376647, 0.59350947011262178 } + +#define ZREAL_IN7 { 0.54425731627270579, 0.23207478970289230, 0.23122371966019273, 0.21646326314657927,\ + 0.65251349471509457, 0.88338878145441413, 0.30760907428339124 } +#define ZIMAG_IN7 { 0.21460078610107303, 0.31264199689030647, 0.36163610080257058, 0.2922266637906432,\ + 0.40948254754766822, 0.56642488157376647, 0.59350947011262178 } + + + +#define ZREAL_IN8 { 0.54425731627270579, 0.23207478970289230, 0.23122371966019273, 0.21646326314657927,\ + 0.88338878145441413, 0.65251349471509457, 0.30760907428339124, 0.93296162132173777 } +#define ZIMAG_IN8 { 0.21460078610107303, 0.31264199689030647, 0.36163610080257058, 0.2922266637906432,\ + 0.56642488157376647, 0.48264719732105732, 0.33217189135029912, 0.59350947011262178} + + +#define ZREAL_IN9 { 0.23122371966019273, 0.21646326314657927, 0.88338878145441413, 0.65251349471509457,\ + 0.30760907428339124, 0.93296162132173777, 0.21460078610107303, 0.31264199689030647,\ + 0.43685875833034515} +#define ZIMAG_IN9 { 0.26931248093023896, 0.63257448654621840, 0.40519540151581168, 0.91847078315913677,\ + 0.28064980218186975, 0.12800584640353918, 0.77831285959109664, 0.21190304495394230,\ + 0.68568959552794695} + + +#define ZREAL_IN10 { 0.21646326314657927, 0.65251349471509457, 0.63257448654621840, 0.31264199689030647,\ + 0.93296162132173777, 0.31264199689030647, 0.48185089323669672, 0.48264719732105732,\ + 0.2922266637906432 , 0.48264719732105732 } +#define ZIMAG_IN10 { 0.23122371966019273, 0.21646326314657927, 0.88338878145441413, 0.65251349471509457,\ + 0.11383596854284406, 0.19983377400785685, 0.56186607433483005, 0.58961773291230202,\ + 0.23122371966019273, 0.21646326314657927} +/* +#define ZREAL_IN10 { 1,2,3,4,5,6,7,8,9,10 } + + +#define ZIMAG_IN10 { 1,2,3,4,5,6,7,8,9,10 } +*/ + + + + +#define ZREAL_IN11 {0.49934938363730907,0.26385784195736051,0.52535630855709314,0.53762298030778766,\ + 0.11999255046248436,0.2256303490139544 ,0.62740930821746588,0.76084325974807143,\ + 0.04855662025511265,0.67239497276023030,0.20171726960688829 } + +#define ZIMAG_IN11 {0.39115739194676280,0.83003165572881699,0.58787201577797532,0.48291792999953032,\ + 0.22328650346025825,0.84008856676518917,0.12059959070757031,0.28553641680628061,\ + 0.86075146449729800,0.84941016510128975,0.52570608118548989} + + +#define ZREAL_IN12 {0.75604385416954756,0.00022113462910056,0.33032709173858166,0.66538110421970487,\ + 0.62839178834110498,0.84974523587152362,0.68573101982474327,0.87821648130193353,\ + 0.06837403681129217,0.56084860628470778,0.66235693730413914,0.72635067673400044} + +#define ZIMAG_IN12 {0.19851438421756029,0.54425731627270579,0.23207478970289230,0.23122371966019273,\ + 0.21646326314657927,0.88338878145441413,0.65251349471509457,0.30760907428339124,\ + 0.93296162132173777,0.21460078610107303,0.31264199689030647,0.36163610080257058} + + +#define ZREAL_IN13 {0.2922266637906432 ,0.56642488157376647,0.48264719732105732,0.33217189135029912,\ + 0.59350947011262178,0.50153415976092219,0.43685875833034515,0.26931248093023896,\ + 0.63257448654621840,0.40519540151581168,0.91847078315913677,0.04373343335464597,\ + 0.48185089323669672} + + + +#define ZIMAG_IN13 {0.26395560009405017,0.41481037065386772,0.28064980218186975,0.12800584640353918,\ + 0.77831285959109664,0.21190304495394230,0.11213546665385365,0.68568959552794695,\ + 0.15312166837975383,0.69708506017923355,0.84155184263363481,0.40620247554033995,\ + 0.40948254754766822} + + + +#define ZREAL_IN14 {0.87841258011758327,0.11383596854284406,0.19983377400785685,0.56186607433483005,\ + 0.58961773291230202,0.68539796629920602,0.89062247332185507,0.50422128057107329,\ + 0.34936154074966908,0.38737787725403905,0.92228986788541079,0.94881842611357570,\ + 0.34353372454643250,0.37601187312975526} + +#define ZIMAG_IN14 {0.73409405630081892,0.26157614728435874,0.49934938363730907,0.26385784195736051,\ + 0.52535630855709314,0.53762298030778766,0.11999255046248436,0.2256303490139544 ,\ + 0.62740930821746588,0.76084325974807143,0.04855662025511265,0.67239497276023030,\ + 0.20171726960688829,0.39115739194676280} + +#define ZREAL_IN15 {0.83003165572881699,0.58787201577797532,0.48291792999953032,0.22328650346025825,\ + 0.84008856676518917,0.12059959070757031,0.28553641680628061,0.86075146449729800,\ + 0.84941016510128975,0.52570608118548989,0.99312098976224661,0.64885628735646605,\ + 0.99231909401714802,0.05004197778180242,0.74855065811425447} + +#define ZIMAG_IN15 {0.41040589986369014,0.60845263302326202,0.85442108893766999,0.06426467280834913,\ + 0.82790829380974174,0.92623437754809856,0.56672112690284848,0.57116389367729425,\ + 0.81601104838773608,0.05689279362559319,0.55959366867318749,0.12493403162807226,\ + 0.72792222863063216,0.26777664758265018,0.54653349192813039} + + + +#define ZREAL_IN16 {0.23122371966019273, 0.21646326314657927, 0.88338878145441413, 0.65251349471509457,\ + 0.30760907428339124, 0.93296162132173777, 0.21460078610107303, 0.31264199689030647,\ + 0.36163610080257058, 0.2922266637906432 , 0.56642488157376647, 0.48264719732105732,\ + 0.33217189135029912, 0.59350947011262178, 0.50153415976092219, 0.43685875833034515} +#define ZIMAG_IN16 {0.26931248093023896, 0.63257448654621840, 0.40519540151581168, 0.91847078315913677,\ + 0.04373343335464597, 0.48185089323669672, 0.26395560009405017, 0.41481037065386772,\ + 0.28064980218186975, 0.12800584640353918, 0.77831285959109664, 0.21190304495394230,\ + 0.11213546665385365, 0.68568959552794695, 0.15312166837975383, 0.69708506017923355} + + +#define ZREAL_IN32 { 0.21132486546412110, 0.75604385416954756, 0.00022113462910056, 0.33032709173858166,\ + 0.66538110421970487, 0.62839178834110498, 0.84974523587152362, 0.68573101982474327,\ + 0.87821648130193353, 0.06837403681129217, 0.56084860628470778, 0.66235693730413914,\ + 0.72635067673400044, 0.19851438421756029, 0.54425731627270579, 0.23207478970289230,\ + 0.23122371966019273, 0.21646326314657927, 0.88338878145441413, 0.65251349471509457,\ + 0.30760907428339124, 0.93296162132173777, 0.21460078610107303, 0.31264199689030647,\ + 0.36163610080257058, 0.2922266637906432 , 0.56642488157376647, 0.48264719732105732,\ + 0.33217189135029912, 0.59350947011262178, 0.50153415976092219, 0.43685875833034515} + +#define ZIMAG_IN32 { 0.26931248093023896, 0.63257448654621840, 0.40519540151581168, 0.91847078315913677,\ + 0.04373343335464597, 0.48185089323669672, 0.26395560009405017, 0.41481037065386772,\ + 0.28064980218186975, 0.12800584640353918, 0.77831285959109664, 0.21190304495394230,\ + 0.11213546665385365, 0.68568959552794695, 0.15312166837975383, 0.69708506017923355,\ + 0.84155184263363481, 0.40620247554033995, 0.40948254754766822, 0.87841258011758327,\ + 0.11383596854284406, 0.19983377400785685, 0.56186607433483005, 0.58961773291230202,\ + 0.68539796629920602, 0.89062247332185507, 0.50422128057107329, 0.34936154074966908,\ + 0.38737787725403905, 0.92228986788541079, 0.94881842611357570, 0.34353372454643250} + + + + +#define ZREAL_RESULT2 { 0.33054822636768222,- 0.33010595710948110} +#define ZIMAG_RESULT2 { 1.29377289256080985, 0.03698931587859988} + + + +#define ZREAL_RESULT3 { 1.29709824733436108, 0.94154648753137238, 0.2434220389437592} + +#define ZIMAG_RESULT3 { +0.59717983752489090,+0.61999805178742728,+0.93089271522808925} + + + + + +#define ZREAL_RESULT4 { 0.62051669345237315,-0.12307844962924719, 0.24346416513435543, 0.10884282691404223} + +#define ZIMAG_RESULT4 { +0.53701765113510191,+0.11296372814103961,+0.10658199037425220,-0.19571476336568594} + + + +#define ZREAL_RESULT5 { 0.62691605370491743, 0.01919730450714778, 0.10104198714906780,-0.07720389203270116,\ + 0.17979378254309186} + +#define ZIMAG_RESULT5 { +0.54289909722283480,+0.13998734162926388,-0.17962778177138733,+0.12064468327985833,\ +-0.06305473407586182} + + + +#define ZREAL_RESULT6 { 0.36402360963014263, 0.09605967189946550, 0.01914935343131208, 0.11197456725252172,\ +-0.00281267335181221,-0.04413721258892397} + +#define ZIMAG_RESULT6 { +0.39017331654516357,-0.08647381537197443,-0.01847428942485585,-0.00928606038602692,\ +-0.11828530217444963,+0.05694693691321624} + + + + + +#define ZREAL_RESULT7 { 0.43821863417646711, 0.04570283341490348, 0.00786143114706625, 0.09081035877037001,\ + 0.06907620238256847,-0.01879476197071369,-0.08861738164795580} + +#define ZIMAG_RESULT7 { +0.39293177811694990,-0.13474546775513907,+0.02350839028687007,-0.01818990984988529,\ +-0.03304492053033681,-0.13370336175502612,+0.11784427758764042} + + + + +#define ZREAL_RESULT8 { 0.50006150756962597, 0.02175013240250377, 0.12240753043442965,-0.02322026233124427,\ +-0.00844178465195000,-0.11389905106099872, 0.09979579551145434,-0.05419655160111495} + +#define ZIMAG_RESULT8 { +0.39448237349279225,-0.14241475898929634,-0.02220236556604505,-0.14652524166940226,\ +-0.02577395853586495,+0.03536239646532335,+0.04400678444653749,+0.07766555645702852} + + + + +#define ZREAL_RESULT9 { 0.4653623884336816 ,-0.10996977634919125,-0.00630644375731721,-0.04060246287025721,\ + 0.05408191850705556, 0.01600258566680582,-0.05864725873797094,-0.05201672319102815,\ +-0.03668050804158550} + +#define ZIMAG_RESULT9 { +0.47890158897886670,+0.08218728720967677,-0.06845717881236174,-0.04807038546781070,\ +-0.08014536882440566,-0.2030002369914648,+0.22453417104910142,-0.06865385510029860, \ +-0.04798354111106445} + + + + +#define ZREAL_RESULT10 { 0.47991688111796976,-0.06991181823164128,-0.08469577602979275, 0.07318652166556244,\ +-0.07052463321312863, 0.03129850449040533,-0.12994121698152189,-0.09609430997689952,\ + 0.06979737512491652, 0.01343173518070941} + +#define ZIMAG_RESULT10 { +0.38964297915808854,+0.03225815718776807,-0.11005045339360417,+0.07000358882571070,\ +-0.03882538926347270,+0.01466467357240619,+0.09131179012889759,-0.02808828423670948,\ +-0.11655017979588442,-0.07314316252300754} + + + + + +#define ZREAL_RESULT11 { 0.40752098586579621, 0.01832270994676578, 0.00727102452352803,-0.13808643998727593,\ + 0.03761367031409660, 0.01913753006534984, 0.14829738766302858,-0.03282455871021355,\ + 0.08531354288243319,-0.01850240581569137,-0.03471406311050802} + +#define ZIMAG_RESULT11 { +0.54521434381604206,+0.04263232089408980,+0.01080182331995891,-0.16507135273435664,\ ++0.08926061372379648,+0.01327764965004020,-0.10524284127370778,-0.02743692407216465,\ ++0.01530157234736101,-0.10904555975048559,+0.08146574602618931} + + + +#define ZREAL_RESULT12 { 0.56766566393586493,-0.02954179400241778, 0.03231997586448970,-0.08061527988562983,\ + 0.12393588887272257,-0.00005011576253769,-0.04579487590429687, 0.18096695473171109,\ +-0.02460040668391173, 0.04301438496137660, 0.06736119091227670,-0.07861773287010031} + +#define ZIMAG_RESULT12 { +0.42399044404737651,-0.08988211863004507,-0.06417895954194777,-0.05903535817439356,\ +-0.03585983457125090,-0.08163805724791348,+0.00020448095165193,-0.00326952155569338,\ +-0.06391751330264545,+0.08415352273732421,+0.16527532188314309,-0.07732802237804590} + +#define ZREAL_RESULT13 { 0.45819311546018493, 0.04715640399909302,-0.02841189190012001, 0.01471405402274759,\ +-0.06955117696838889, 0.08520673650173283,-0.08379007722081511,-0.06164570839841994,\ +-0.07511713555210725, 0.07790018146444697, 0.05666948441941852,-0.04832646187709128,\ +-0.08077086016003779} + +#define ZIMAG_RESULT13 { +0.41406970618006128,-0.00941536236456233,-0.04150925434362464,+0.07093289809698045,\ ++0.05642954059283156,-0.13856574403878158,-0.06657177623345527,+0.08978984633083976,\ +-0.03246486275259956,+0.03475196544714984,-0.02951956674329188,-0.08259093889333179,\ +-0.00138085118416531} + + + + +#define ZREAL_RESULT14 { 0.55365722569903086,-0.03431117289603670,-0.07434176530056802, 0.09479458498406634,\ + 0.04225809799112697, 0.10711066217766220, 0.09039926979534348, 0.04258158766398475,\ +-0.06766097168605688, 0.02983162597647674, 0.16148055537460848, 0.00306446154680962,\ +-0.01447548152915653,-0.05597609967970790} + +#define ZIMAG_RESULT14 { +0.41925417428969269,-0.02346521727072965,-0.07537174377902310,+0.12152793513158673,\ +-0.05435563225189670,+0.05588517124820697,+0.03948028804374615,-0.02547196042723954,\ ++0.04750412291672844,+0.09081187301248270,+0.02410149252380316,-0.00728204510680848,\ ++0.07924950091433607,+0.04222609705593354} + + + + +#define ZREAL_RESULT15 { 0.60260595980410780,-0.09025313009309296, 0.07296362400098141,-0.01312199542974801,\ + 0.05196795946996628, 0.00939805486763355, 0.07359039581140392, 0.07244754050834930,\ +-0.13409874398389474,-0.06419327756841406,-0.04062806443214259, 0.19283708306652805,\ + 0.04903632944886174,-0.00831723960417976, 0.05579715986245712} + +#define ZIMAG_RESULT15 { +0.52861572646846366,-0.09479760020968324,+0.06725385149296267,+0.01462043430946725,\ +-0.00503137552191604,-0.05388544405841567,-0.05301311586381348,-0.11414862867731596,\ ++0.0617906214666224 ,+0.14723827146724461,-0.10948893804382542,+0.00343655851962967,\ +-0.00538333435303664,-0.03924473093854008,+0.06244360380584638} + + + + +#define ZREAL_RESULT16 { 0.45740074128843844,-0.00119937109332679,-0.09568979823192530,-0.01738371075123765,\ +-0.03869746159762144,-0.05391866381953740, 0.12416191581397301,-0.03041585422893309,\ +-0.03257706691510975, 0.07000836728092155,-0.00597921899357861,-0.03766276570110767,\ +-0.07796601625159383,-0.03039291932884991,-0.03422318488120085, 0.03575872707088203} + +#define ZIMAG_RESULT16 { +0.40480042458511889,+0.06953094033520663,+0.02374777548578576,-0.03393710545080092,\ +-0.04651592345908284,+0.02783744013794178,-0.03035825342604098,-0.06447129475682091,\ +-0.11649833549745381,-0.11413977271896644,+0.11722373704793855,+0.08102030470498481,\ +-0.06532836984843016,+0.00779635766618338,-0.01208991333178105,+0.02069446945645629} + + + + + +#define ZREAL_RESULT32 { 0.47864284948445857, 0.05482834035731039,-0.01530773095660632,-0.01750083123738436,\ + -0.05071297103611097, 0.08766815171372286, 0.02106608347521239,-0.05109320958418949,\ + -0.01096817385405302, 0.02416709596518544,-0.05098444057349576,-0.01448958336761648,\ + 0.02532074256370129,-0.09984237842467819,-0.06358972398280244,-0.04611519259707146,\ + 0.01104057650081813,-0.03475148917606731, 0.00813855773340646,-0.00568704237169753,\ + 0.01830285230723486, 0.02749700538425181,-0.04780122330152622, 0.06632936566012661,\ + -0.01447601290419698, 0.03116875276343186, 0.00123360692547217, 0.01833898177168673,\ + -0.03654957125464739, 0.00547684889715929,-0.05208112856470785,-0.05594424285220599} + + + +#define ZIMAG_RESULT32 {+0.48466352955438197,+0.04862008402656083,+0.04890918577469192,-0.07661834259188156,\ + +0.01684868035424048,-0.06277273594077343,-0.03536555772325747,-0.04086803002308132,\ + -0.04373891325667500,+0.03378928555068783,+0.09272389885362962,-0.01252633931303314,\ + +0.04715379187194862,+0.04212975779784539,+0.00924226411866865,-0.06146319342441199,\ + -0.06222798605449498,+0.03846733709242996,-0.06362612522976926,+0.02110331414670667,\ + +0.06568727290671772,-0.09854847704278780,+0.04828755172931871,-0.06711471562709365,\ + -0.03694727551192045,-0.04323841461679329,-0.07059643871085296,-0.01972938456264230,\ + +0.04778892314703904,+0.02763841783182228,+0.00662935995827029,-0.01498824415525237} + +static void zifftmaTest2 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN2; + double tImagIn [] = ZIMAG_IN2 ; + + + + double tRealResult [] = ZREAL_RESULT2 ; + double tImagResult [] = ZIMAG_RESULT2 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS2)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS2 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS2) ; + + + + zifftma ( in , ROW , COLS2 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS2 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + zreals (Result[i]) , + zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + +static void zifftmaTest3 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN3; + double tImagIn [] = ZIMAG_IN3 ; + + + + double tRealResult [] = ZREAL_RESULT3; + double tImagResult [] = ZIMAG_RESULT3 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS3)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS3 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS3) ; + + + + zifftma ( in , ROW , COLS3 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS3 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + zreals (Result[i]) , + zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + + +static void zifftmaTest4 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN4; + double tImagIn [] = ZIMAG_IN4 ; + + + + double tRealResult [] = ZREAL_RESULT4 ; + double tImagResult [] = ZIMAG_RESULT4 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS4)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS4 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS4) ; + + + zifftma ( in , ROW , COLS4 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS4 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,zreals(out[i]) , zimags(out[i]), zreals (Result[i]) , zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); +/* + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; +*/ + } + + +} + + +static void zifftmaTest5 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN5; + double tImagIn [] = ZIMAG_IN5 ; + + + + double tRealResult [] = ZREAL_RESULT5; + double tImagResult [] = ZIMAG_RESULT5 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS5)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS5 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS5) ; + + + + zifftma ( in , ROW , COLS5 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS5 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + zreals (Result[i]) , + zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + + +static void zifftmaTest6 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN6; + double tImagIn [] = ZIMAG_IN6 ; + + + + double tRealResult [] = ZREAL_RESULT6; + double tImagResult [] = ZIMAG_RESULT6; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS6)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS6 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS6) ; + + + + zifftma ( in , ROW , COLS6 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS6 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + zreals (Result[i]) , + zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + + +static void zifftmaTest7 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN7; + double tImagIn [] = ZIMAG_IN7 ; + + + + double tRealResult [] = ZREAL_RESULT7; + double tImagResult [] = ZIMAG_RESULT7; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS7)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS7 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS7) ; + + + + zifftma ( in , ROW , COLS7 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS7 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + zreals (Result[i]) , + zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + +static void zifftmaTest8 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN8; + double tImagIn [] = ZIMAG_IN8 ; + + + + double tRealResult [] = ZREAL_RESULT8 ; + double tImagResult [] = ZIMAG_RESULT8 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS8)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS8 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS8) ; + + + zifftma ( in , ROW , COLS8 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS8 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,zreals(out[i]) , zimags(out[i]), zreals (Result[i]) , zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); +/* + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; +*/ + } + + +} + + +static void zifftmaTest9 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN9; + double tImagIn [] = ZIMAG_IN9 ; + + + + double tRealResult [] = ZREAL_RESULT9 ; + double tImagResult [] = ZIMAG_RESULT9 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS9)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS9 ); + doubleComplex* Result = DoubleComplexMatrix ( tRealResult , tImagResult ,ROW*COLS9) ; + + + zifftma ( in , ROW , COLS9 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS9 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,zreals(out[i]) , zimags(out[i]), zreals (Result[i]) , zimags (Result[i]), + fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i]))); + + if ( zreals(out[i]) < 1e-14 && zreals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - zreals (Result[i]) ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && zimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - zimags (Result[i]) ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + + +} + +static void zifftmaTest10 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN10; + double tImagIn [] = ZIMAG_IN10 ; + + + + double tRealResult [] = ZREAL_RESULT10 ; + double tImagResult [] = ZIMAG_RESULT10 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS10)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS10 ); + + + + zifftma ( in , ROW , COLS10 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS10 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + +static void zifftmaTest11 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN11; + double tImagIn [] = ZIMAG_IN11 ; + + + + double tRealResult [] = ZREAL_RESULT11 ; + double tImagResult [] = ZIMAG_RESULT11 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS11)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS11 ); + + + + zifftma ( in , ROW , COLS11 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS11 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + +static void zifftmaTest12 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN12; + double tImagIn [] = ZIMAG_IN12 ; + + + + double tRealResult [] = ZREAL_RESULT12 ; + double tImagResult [] = ZIMAG_RESULT12 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS12)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS12 ); + + + + zifftma ( in , ROW , COLS12 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS12 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + +static void zifftmaTest13 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN13; + double tImagIn [] = ZIMAG_IN13 ; + + + + double tRealResult [] = ZREAL_RESULT13 ; + double tImagResult [] = ZIMAG_RESULT13 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS13)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS13 ); + + + + zifftma ( in , ROW , COLS13 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS13 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + +static void zifftmaTest14 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN14; + double tImagIn [] = ZIMAG_IN14 ; + + + + double tRealResult [] = ZREAL_RESULT14 ; + double tImagResult [] = ZIMAG_RESULT14 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS14)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS14 ); + + + + zifftma ( in , ROW , COLS14 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS14 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + + +static void zifftmaTest15 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN15; + double tImagIn [] = ZIMAG_IN15 ; + + + + double tRealResult [] = ZREAL_RESULT15 ; + double tImagResult [] = ZIMAG_RESULT15 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS15)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS15 ); + + + + zifftma ( in , ROW , COLS15 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS15 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + + +static void zifftmaTest16 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN16; + double tImagIn [] = ZIMAG_IN16 ; + + + + double tRealResult [] = ZREAL_RESULT16 ; + double tImagResult [] = ZIMAG_RESULT16 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS16)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS16 ); + + + + zifftma ( in , ROW , COLS16 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS16 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + + + +static void zifftmaTest32 (void ) +{ + int i = 0 ; + + double tRealIn [] = ZREAL_IN32; + double tImagIn [] = ZIMAG_IN32 ; + + + + double tRealResult [] = ZREAL_RESULT32 ; + double tImagResult [] = ZIMAG_RESULT32 ; + + + + doubleComplex* out = (doubleComplex*) malloc ( sizeof(doubleComplex) * (unsigned int) (ROW*COLS32)); + doubleComplex* in = DoubleComplexMatrix ( tRealIn , tImagIn , ROW*COLS32 ); + + + + zifftma ( in , ROW , COLS32 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS32 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + zreals(out[i]) , + zimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) , + fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i]))); + + + if ( zreals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zreals(out[i]) - tRealResult[i] ) / fabs (zreals (out[i])) < 1e-12 ); + + + if ( zimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( zimags(out[i]) - tImagResult[i] ) / fabs (zimags (out[i])) < 1e-12 ) ; + + } + +} + +static int testFft(void) { + + printf("\n>>>> FFT Tests\n"); + printf("\t>>>> Matrix Double Realt Tests\n"); + /*dfftmaTest();*/ + + printf("\n\n\n"); +/* + printf("\n\t>>>> Vector 2 Double Complex Tests\n"); + zifftmaTest2(); + printf("\n\t>>>> Vector 3 Double Complex Tests\n"); + zifftmaTest3(); + + printf("\n\t>>>> Vector 4 Double Complex Tests\n"); + zifftmaTest4(); + + + printf("\n\t>>>> Vector 5 Double Complex Tests\n"); + zifftmaTest5(); + printf("\n\t>>>> Vector 6 Double Complex Tests\n"); + zifftmaTest6(); + printf("\n\t>>>> Vector 7 Double Complex Tests\n"); + zifftmaTest7(); + + printf("\n\t>>>> Vector 8 Double Complex Tests\n"); + zifftmaTest8(); + + printf("\n\t>>>> Vector 9 Double Complex Tests\n"); + zifftmaTest9(); + printf("\n\t>>>> Vector 10 Double Complex Tests\n"); + zifftmaTest10(); + printf("\n\t>>>> Vector 11 Double Complex Tests\n"); + zifftmaTest11(); + printf("\n\t>>>> Vector 12 Double Complex Tests\n"); + zifftmaTest12(); + printf("\n\t>>>> Vector 13 Double Complex Tests\n"); + zifftmaTest13(); + printf("\n\t>>>> Vector 14 Double Complex Tests\n"); + zifftmaTest14(); + printf("\n\t>>>> Vector 14 Double Complex Tests\n"); + zifftmaTest15(); + printf("\n\t>>>> Vector 16 Double Complex Tests\n"); + zifftmaTest16(); + printf("\n\t>>>> Vector 32 Double Complex Tests\n"); + zifftmaTest32(); +*/ + return 0; +} + + + +int main(void) { + assert(testFft() == 0); + return 0; +} diff --git a/src/signalProcessing/ifft/testFloatIfft.c b/src/signalProcessing/ifft/testFloatIfft.c new file mode 100644 index 00000000..0c40bb43 --- /dev/null +++ b/src/signalProcessing/ifft/testFloatIfft.c @@ -0,0 +1,1235 @@ + +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-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 + * + */ + +#include <assert.h> +#include <stdio.h> +#include "ifft.h" + +#define ROW 1 +#define COLS2 2 +#define COLS3 3 +#define COLS4 4 +#define COLS5 5 +#define COLS6 6 +#define COLS7 7 +#define COLS8 8 +#define COLS9 9 +#define COLS10 10 +#define COLS11 11 +#define COLS12 12 +#define COLS13 13 +#define COLS14 14 +#define COLS15 15 +#define COLS16 16 +#define COLS32 32 + +#define CREAL_IN2 { 0.00022113462910056f , 0.33032709173858166f } +#define CIMAG_IN2 { 0.66538110421970487f , 0.62839178834110498f } + +#define CREAL_IN3 { 2.48206677380949259f, 0.43537130765616894f, 0.97385666053742170f} +#define CIMAG_IN3 { 2.14807060454040766f,- 0.78285905346274376f, 0.42632796149700880f} + + +#define CREAL_IN4 { 0.84974523587152362f, 0.68573101982474327f, 0.87821648130193353f, 0.06837403681129217f} +#define CIMAG_IN4 { 0.56084860628470778f, 0.66235693730413914f, 0.72635067673400044f, 0.19851438421756029f} + +#define CREAL_IN5 { 0.84974523587152362f, 0.68573101982474327f, 0.87821648130193353f, 0.06837403681129217f,\ + 0.65251349471509457f} +#define CIMAG_IN5 { 0.56084860628470778f, 0.66235693730413914f, 0.72635067673400044f, 0.19851438421756029f,\ + 0.56642488157376647f} + +#define CREAL_IN6 { 0.54425731627270579f, 0.23207478970289230f, 0.23122371966019273f, 0.21646326314657927f,\ + 0.65251349471509457f, 0.30760907428339124f } +#define CIMAG_IN6 { 0.21460078610107303f, 0.31264199689030647f, 0.36163610080257058f, 0.2922266637906432f,\ + 0.56642488157376647f, 0.59350947011262178f } + +#define CREAL_IN7 { 0.54425731627270579f, 0.23207478970289230f, 0.23122371966019273f, 0.21646326314657927f,\ + 0.65251349471509457f, 0.88338878145441413f, 0.30760907428339124f } +#define CIMAG_IN7 { 0.21460078610107303f, 0.31264199689030647f, 0.36163610080257058f, 0.2922266637906432f,\ + 0.40948254754766822f, 0.56642488157376647f, 0.59350947011262178f } + + + +#define CREAL_IN8 { 0.54425731627270579f, 0.23207478970289230f, 0.23122371966019273f, 0.21646326314657927f,\ + 0.88338878145441413f, 0.65251349471509457f, 0.30760907428339124f, 0.93296162132173777f } +#define CIMAG_IN8 { 0.21460078610107303f, 0.31264199689030647f, 0.36163610080257058f, 0.2922266637906432f,\ + 0.56642488157376647f, 0.48264719732105732f, 0.33217189135029912f, 0.59350947011262178f} + + +#define CREAL_IN9 { 0.23122371966019273f, 0.21646326314657927f, 0.88338878145441413f, 0.65251349471509457f,\ + 0.30760907428339124f, 0.93296162132173777f, 0.21460078610107303f, 0.31264199689030647f,\ + 0.43685875833034515f} +#define CIMAG_IN9 { 0.26931248093023896f, 0.63257448654621840f, 0.40519540151581168f, 0.91847078315913677f,\ + 0.28064980218186975f, 0.12800584640353918f, 0.77831285959109664f, 0.21190304495394230f,\ + 0.68568959552794695f} + + +#define CREAL_IN10 { 0.21646326314657927f, 0.65251349471509457f, 0.63257448654621840f, 0.31264199689030647f,\ + 0.93296162132173777f, 0.31264199689030647f, 0.48185089323669672f, 0.48264719732105732f,\ + 0.2922266637906432f , 0.48264719732105732f } +#define CIMAG_IN10 { 0.23122371966019273f, 0.21646326314657927f, 0.88338878145441413f, 0.65251349471509457f,\ + 0.11383596854284406f, 0.19983377400785685f, 0.56186607433483005f, 0.58961773291230202f,\ + 0.23122371966019273f, 0.21646326314657927f} +/* +#define CREAL_IN10 { 1,2,3,4,5,6,7,8,9,10 } + + +#define CIMAG_IN10 { 1,2,3,4,5,6,7,8,9,10 } +*/ + + + + +#define CREAL_IN11 {0.49934938363730907,0.26385784195736051,0.52535630855709314,0.53762298030778766,\ + 0.11999255046248436f,0.2256303490139544 ,0.62740930821746588,0.76084325974807143,\ + 0.04855662025511265f,0.67239497276023030,0.20171726960688829 } + +#define CIMAG_IN11 {0.39115739194676280,0.83003165572881699,0.58787201577797532,0.48291792999953032,\ + 0.22328650346025825f,0.84008856676518917,0.12059959070757031,0.28553641680628061,\ + 0.86075146449729800f,0.84941016510128975,0.52570608118548989} + + +#define CREAL_IN12 {0.75604385416954756,0.00022113462910056,0.33032709173858166,0.66538110421970487,\ + 0.62839178834110498f,0.84974523587152362,0.68573101982474327,0.87821648130193353,\ + 0.06837403681129217f,0.56084860628470778,0.66235693730413914,0.72635067673400044} + +#define CIMAG_IN12 {0.19851438421756029,0.54425731627270579,0.23207478970289230,0.23122371966019273,\ + 0.21646326314657927f,0.88338878145441413,0.65251349471509457,0.30760907428339124,\ + 0.93296162132173777f,0.21460078610107303,0.31264199689030647,0.36163610080257058} + + +#define CREAL_IN13 {0.2922266637906432 ,0.56642488157376647,0.48264719732105732,0.33217189135029912,\ + 0.59350947011262178f,0.50153415976092219,0.43685875833034515,0.26931248093023896,\ + 0.63257448654621840f,0.40519540151581168,0.91847078315913677,0.04373343335464597,\ + 0.48185089323669672f} + + + +#define CIMAG_IN13 {0.26395560009405017,0.41481037065386772,0.28064980218186975,0.12800584640353918,\ + 0.77831285959109664f,0.21190304495394230,0.11213546665385365,0.68568959552794695,\ + 0.15312166837975383f,0.69708506017923355,0.84155184263363481,0.40620247554033995,\ + 0.40948254754766822f} + + + +#define CREAL_IN14 {0.87841258011758327,0.11383596854284406,0.19983377400785685,0.56186607433483005,\ + 0.58961773291230202f,0.68539796629920602,0.89062247332185507,0.50422128057107329,\ + 0.34936154074966908f,0.38737787725403905,0.92228986788541079,0.94881842611357570,\ + 0.34353372454643250f,0.37601187312975526} + +#define CIMAG_IN14 {0.73409405630081892,0.26157614728435874,0.49934938363730907,0.26385784195736051,\ + 0.52535630855709314f,0.53762298030778766,0.11999255046248436,0.2256303490139544 ,\ + 0.62740930821746588f,0.76084325974807143,0.04855662025511265,0.67239497276023030,\ + 0.20171726960688829f,0.39115739194676280} + +#define CREAL_IN15 {0.83003165572881699,0.58787201577797532,0.48291792999953032,0.22328650346025825,\ + 0.84008856676518917f,0.12059959070757031,0.28553641680628061,0.86075146449729800,\ + 0.84941016510128975f,0.52570608118548989,0.99312098976224661,0.64885628735646605,\ + 0.99231909401714802f,0.05004197778180242,0.74855065811425447} + +#define CIMAG_IN15 {0.41040589986369014,0.60845263302326202,0.85442108893766999,0.06426467280834913,\ + 0.82790829380974174f,0.92623437754809856,0.56672112690284848,0.57116389367729425,\ + 0.81601104838773608f,0.05689279362559319,0.55959366867318749,0.12493403162807226,\ + 0.72792222863063216f,0.26777664758265018,0.54653349192813039} + + + +#define CREAL_IN16 {0.23122371966019273, 0.21646326314657927f, 0.88338878145441413f, 0.65251349471509457f,\ + 0.30760907428339124f, 0.93296162132173777f, 0.21460078610107303f, 0.31264199689030647f,\ + 0.36163610080257058f, 0.2922266637906432f , 0.56642488157376647f, 0.48264719732105732f,\ + 0.33217189135029912f, 0.59350947011262178f, 0.50153415976092219f, 0.43685875833034515f} +#define CIMAG_IN16 {0.26931248093023896, 0.63257448654621840f, 0.40519540151581168f, 0.91847078315913677f,\ + 0.04373343335464597f, 0.48185089323669672f, 0.26395560009405017f, 0.41481037065386772f,\ + 0.28064980218186975f, 0.12800584640353918f, 0.77831285959109664f, 0.21190304495394230f,\ + 0.11213546665385365f, 0.68568959552794695f, 0.15312166837975383f, 0.69708506017923355f} + + +#define CREAL_IN32 { 0.21132486546412110f, 0.75604385416954756f, 0.00022113462910056f, 0.33032709173858166f,\ + 0.66538110421970487f, 0.62839178834110498f, 0.84974523587152362f, 0.68573101982474327f,\ + 0.87821648130193353f, 0.06837403681129217f, 0.56084860628470778f, 0.66235693730413914f,\ + 0.72635067673400044f, 0.19851438421756029f, 0.54425731627270579f, 0.23207478970289230f,\ + 0.23122371966019273f, 0.21646326314657927f, 0.88338878145441413f, 0.65251349471509457f,\ + 0.30760907428339124f, 0.93296162132173777f, 0.21460078610107303f, 0.31264199689030647f,\ + 0.36163610080257058f, 0.2922266637906432f , 0.56642488157376647f, 0.48264719732105732f,\ + 0.33217189135029912f, 0.59350947011262178f, 0.50153415976092219f, 0.43685875833034515f} + +#define CIMAG_IN32 { 0.26931248093023896f, 0.63257448654621840f, 0.40519540151581168f, 0.91847078315913677f,\ + 0.04373343335464597f, 0.48185089323669672f, 0.26395560009405017f, 0.41481037065386772f,\ + 0.28064980218186975f, 0.12800584640353918f, 0.77831285959109664f, 0.21190304495394230f,\ + 0.11213546665385365f, 0.68568959552794695f, 0.15312166837975383f, 0.69708506017923355f,\ + 0.84155184263363481f, 0.40620247554033995f, 0.40948254754766822f, 0.87841258011758327f,\ + 0.11383596854284406f, 0.19983377400785685f, 0.56186607433483005f, 0.58961773291230202f,\ + 0.68539796629920602f, 0.89062247332185507f, 0.50422128057107329f, 0.34936154074966908f,\ + 0.38737787725403905f, 0.92228986788541079f, 0.94881842611357570f, 0.34353372454643250f} + + + + +#define CREAL_RESULT2 { 0.33054822636768222f,- 0.33010595710948110f} +#define CIMAG_RESULT2 { 1.29377289256080985f, 0.03698931587859988f} + + + +#define CREAL_RESULT3 { 1.29709824733436108f, 0.94154648753137238f, 0.2434220389437592f} + +#define CIMAG_RESULT3 { +0.59717983752489090f,+0.61999805178742728f,+0.93089271522808925f} + + + + + +#define CREAL_RESULT4 { 0.62051669345237315f,-0.12307844962924719f, 0.24346416513435543f, 0.10884282691404223f} + +#define CIMAG_RESULT4 { +0.53701765113510191f,+0.11296372814103961f,+0.10658199037425220f,-0.19571476336568594f} + + + +#define CREAL_RESULT5 { 0.62691605370491743f, 0.01919730450714778f, 0.10104198714906780f,-0.07720389203270116f,\ + 0.17979378254309186f} + +#define CIMAG_RESULT5 { +0.54289909722283480f,+0.13998734162926388f,-0.17962778177138733f,+0.12064468327985833f,\ +-0.06305473407586182f} + + + +#define CREAL_RESULT6 { 0.36402360963014263f, 0.09605967189946550f, 0.01914935343131208f, 0.11197456725252172f,\ +-0.00281267335181221f,-0.04413721258892397f} + +#define CIMAG_RESULT6 { +0.39017331654516357f,-0.08647381537197443f,-0.01847428942485585f,-0.00928606038602692f,\ +-0.11828530217444963f,+0.05694693691321624f} + + + + + +#define CREAL_RESULT7 { 0.43821863417646711f, 0.04570283341490348f, 0.00786143114706625f, 0.09081035877037001f,\ + 0.06907620238256847f,-0.01879476197071369f,-0.08861738164795580f} + +#define CIMAG_RESULT7 { +0.39293177811694990f,-0.13474546775513907f,+0.02350839028687007f,-0.01818990984988529f,\ +-0.03304492053033681f,-0.13370336175502612f,+0.11784427758764042f} + + + + +#define CREAL_RESULT8 { 0.50006150756962597f, 0.02175013240250377f, 0.12240753043442965f,-0.02322026233124427f,\ +-0.00844178465195000f,-0.11389905106099872f, 0.09979579551145434f,-0.05419655160111495f} + +#define CIMAG_RESULT8 { +0.39448237349279225f,-0.14241475898929634f,-0.02220236556604505f,-0.14652524166940226f,\ +-0.02577395853586495f,+0.03536239646532335f,+0.04400678444653749f,+0.07766555645702852f} + + + + +#define CREAL_RESULT9 { 0.4653623884336816f ,-0.10996977634919125f,-0.00630644375731721f,-0.04060246287025721f,\ + 0.05408191850705556f, 0.01600258566680582f,-0.05864725873797094f,-0.05201672319102815f,\ +-0.03668050804158550f} + +#define CIMAG_RESULT9 { +0.47890158897886670f,+0.08218728720967677f,-0.06845717881236174f,-0.04807038546781070f,\ +-0.08014536882440566f,-0.2030002369914648f,+0.22453417104910142f,-0.06865385510029860f, \ +-0.04798354111106445f} + + + + +#define CREAL_RESULT10 { 0.47991688111796976f,-0.06991181823164128f,-0.08469577602979275f, 0.07318652166556244f,\ +-0.07052463321312863f, 0.03129850449040533f,-0.12994121698152189f,-0.09609430997689952f,\ + 0.06979737512491652f, 0.01343173518070941f} + +#define CIMAG_RESULT10 { +0.38964297915808854f,+0.03225815718776807f,-0.11005045339360417f,+0.07000358882571070f,\ +-0.03882538926347270f,+0.01466467357240619f,+0.09131179012889759f,-0.02808828423670948f,\ +-0.11655017979588442f,-0.07314316252300754f} + + + + + +#define CREAL_RESULT11 { 0.40752098586579621f, 0.01832270994676578f, 0.00727102452352803f,-0.13808643998727593f,\ + 0.03761367031409660f, 0.01913753006534984f, 0.14829738766302858f,-0.03282455871021355f,\ + 0.08531354288243319f,-0.01850240581569137f,-0.03471406311050802f} + +#define CIMAG_RESULT11 { +0.54521434381604206f,+0.04263232089408980f,+0.01080182331995891f,-0.16507135273435664f,\ ++0.08926061372379648f,+0.01327764965004020f,-0.10524284127370778f,-0.02743692407216465f,\ ++0.01530157234736101f,-0.10904555975048559f,+0.08146574602618931f} + + + +#define CREAL_RESULT12 { 0.56766566393586493f,-0.02954179400241778f, 0.03231997586448970f,-0.08061527988562983f,\ + 0.12393588887272257f,-0.00005011576253769f,-0.04579487590429687f, 0.18096695473171109f,\ +-0.02460040668391173f, 0.04301438496137660f, 0.06736119091227670f,-0.07861773287010031f} + +#define CIMAG_RESULT12 { +0.42399044404737651f,-0.08988211863004507f,-0.06417895954194777f,-0.05903535817439356f,\ +-0.03585983457125090f,-0.08163805724791348f,+0.00020448095165193f,-0.00326952155569338f,\ +-0.06391751330264545f,+0.08415352273732421f,+0.16527532188314309f,-0.07732802237804590f} + +#define CREAL_RESULT13 { 0.45819311546018493f, 0.04715640399909302f,-0.02841189190012001f, 0.01471405402274759f,\ +-0.06955117696838889f, 0.08520673650173283f,-0.08379007722081511f,-0.06164570839841994f,\ +-0.07511713555210725f, 0.07790018146444697f, 0.05666948441941852f,-0.04832646187709128f,\ +-0.08077086016003779f} + +#define CIMAG_RESULT13 { +0.41406970618006128f,-0.00941536236456233f,-0.04150925434362464f,+0.07093289809698045f,\ ++0.05642954059283156f,-0.13856574403878158f,-0.06657177623345527f,+0.08978984633083976f,\ +-0.03246486275259956f,+0.03475196544714984f,-0.02951956674329188f,-0.08259093889333179f,\ +-0.00138085118416531f} + + + + +#define CREAL_RESULT14 { 0.55365722569903086f,-0.03431117289603670f,-0.07434176530056802f, 0.09479458498406634f,\ + 0.04225809799112697f, 0.10711066217766220f, 0.09039926979534348f, 0.04258158766398475f,\ +-0.06766097168605688f, 0.02983162597647674f, 0.16148055537460848f, 0.00306446154680962f,\ +-0.01447548152915653f,-0.05597609967970790f} + +#define CIMAG_RESULT14 { +0.41925417428969269f,-0.02346521727072965f,-0.07537174377902310f,+0.12152793513158673f,\ +-0.05435563225189670f,+0.05588517124820697f,+0.03948028804374615f,-0.02547196042723954f,\ ++0.04750412291672844f,+0.09081187301248270f,+0.02410149252380316f,-0.00728204510680848f,\ ++0.07924950091433607f,+0.04222609705593354f} + + + + +#define CREAL_RESULT15 { 0.60260595980410780f,-0.09025313009309296f, 0.07296362400098141f,-0.01312199542974801f,\ + 0.05196795946996628f, 0.00939805486763355f, 0.07359039581140392f, 0.07244754050834930f,\ +-0.13409874398389474f,-0.06419327756841406f,-0.04062806443214259f, 0.19283708306652805f,\ + 0.04903632944886174f,-0.00831723960417976f, 0.05579715986245712f} + +#define CIMAG_RESULT15 { +0.52861572646846366f,-0.09479760020968324f,+0.06725385149296267f,+0.01462043430946725f,\ +-0.00503137552191604f,-0.05388544405841567f,-0.05301311586381348f,-0.11414862867731596f,\ ++0.0617906214666224f ,+0.14723827146724461f,-0.10948893804382542f,+0.00343655851962967f,\ +-0.00538333435303664f,-0.03924473093854008f,+0.06244360380584638f} + + + + +#define CREAL_RESULT16 { 0.45740074128843844f,-0.00119937109332679f,-0.09568979823192530f,-0.01738371075123765f,\ +-0.03869746159762144f,-0.05391866381953740f, 0.12416191581397301f,-0.03041585422893309f,\ +-0.03257706691510975f, 0.07000836728092155f,-0.00597921899357861f,-0.03766276570110767f,\ +-0.07796601625159383f,-0.03039291932884991f,-0.03422318488120085f, 0.03575872707088203f} + +#define CIMAG_RESULT16 { +0.40480042458511889f,+0.06953094033520663f,+0.02374777548578576f,-0.03393710545080092f,\ +-0.04651592345908284f,+0.02783744013794178f,-0.03035825342604098f,-0.06447129475682091f,\ +-0.11649833549745381f,-0.11413977271896644f,+0.11722373704793855f,+0.08102030470498481f,\ +-0.06532836984843016f,+0.00779635766618338f,-0.01208991333178105f,+0.02069446945645629f} + + + + + +#define CREAL_RESULT32 { 0.47864284948445857f, 0.05482834035731039f,-0.01530773095660632f,-0.01750083123738436f,\ + -0.05071297103611097f, 0.08766815171372286f, 0.02106608347521239f,-0.05109320958418949f,\ + -0.01096817385405302f, 0.02416709596518544f,-0.05098444057349576f,-0.01448958336761648f,\ + 0.02532074256370129f,-0.09984237842467819f,-0.06358972398280244f,-0.04611519259707146f,\ + 0.01104057650081813f,-0.03475148917606731f, 0.00813855773340646f,-0.00568704237169753f,\ + 0.01830285230723486f, 0.02749700538425181f,-0.04780122330152622f, 0.06632936566012661f,\ + -0.01447601290419698f, 0.03116875276343186f, 0.00123360692547217f, 0.01833898177168673f,\ + -0.03654957125464739f, 0.00547684889715929f,-0.05208112856470785f,-0.05594424285220599f} + + + +#define CIMAG_RESULT32 {+0.48466352955438197f,+0.04862008402656083f,+0.04890918577469192f,-0.07661834259188156f,\ + +0.01684868035424048f,-0.06277273594077343f,-0.03536555772325747f,-0.04086803002308132f,\ + -0.04373891325667500f,+0.03378928555068783f,+0.09272389885362962f,-0.01252633931303314f,\ + +0.04715379187194862f,+0.04212975779784539f,+0.00924226411866865f,-0.06146319342441199f,\ + -0.06222798605449498f,+0.03846733709242996f,-0.06362612522976926f,+0.02110331414670667f,\ + +0.06568727290671772f,-0.09854847704278780f,+0.04828755172931871f,-0.06711471562709365f,\ + -0.03694727551192045f,-0.04323841461679329f,-0.07059643871085296f,-0.01972938456264230f,\ + +0.04778892314703904f,+0.02763841783182228f,+0.00662935995827029f,-0.01498824415525237f} +static void cifftmaTest2 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN2; + float tImagIn [] = CIMAG_IN2 ; + + + + float tRealResult [] = CREAL_RESULT2 ; + float tImagResult [] = CIMAG_RESULT2 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS2)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS2 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS2) ; + + + + cifftma ( in , ROW , COLS2 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS2 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + creals (Result[i]) , + cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + +static void cifftmaTest3 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN3; + float tImagIn [] = CIMAG_IN3 ; + + + + float tRealResult [] = CREAL_RESULT3; + float tImagResult [] = CIMAG_RESULT3 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS3)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS3 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS3) ; + + + + cifftma ( in , ROW , COLS3 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS3 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + creals (Result[i]) , + cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); +/* + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; +*/ + } + + +} + + +static void cifftmaTest4 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN4; + float tImagIn [] = CIMAG_IN4 ; + + + + float tRealResult [] = CREAL_RESULT4 ; + float tImagResult [] = CIMAG_RESULT4 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS4)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS4 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS4) ; + + + cifftma ( in , ROW , COLS4 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS4 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,creals(out[i]) , cimags(out[i]), creals (Result[i]) , cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); +/* + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; +*/ + } + + +} + + +static void cifftmaTest5 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN5; + float tImagIn [] = CIMAG_IN5 ; + + + + float tRealResult [] = CREAL_RESULT5; + float tImagResult [] = CIMAG_RESULT5 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS5)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS5 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS5) ; + + + + cifftma ( in , ROW , COLS5 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS5 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + creals (Result[i]) , + cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + + +static void cifftmaTest6 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN6; + float tImagIn [] = CIMAG_IN6 ; + + + + float tRealResult [] = CREAL_RESULT6; + float tImagResult [] = CIMAG_RESULT6; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS6)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS6 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS6) ; + + + + cifftma ( in , ROW , COLS6 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS6 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + creals (Result[i]) , + cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + + +static void cifftmaTest7 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN7; + float tImagIn [] = CIMAG_IN7 ; + + + + float tRealResult [] = CREAL_RESULT7; + float tImagResult [] = CIMAG_RESULT7; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS7)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS7 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS7) ; + + + + cifftma ( in , ROW , COLS7 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + + + for ( i = 0 ; i < (ROW*COLS7 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + creals (Result[i]) , + cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + +static void cifftmaTest8 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN8; + float tImagIn [] = CIMAG_IN8 ; + + + + float tRealResult [] = CREAL_RESULT8 ; + float tImagResult [] = CIMAG_RESULT8 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS8)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS8 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS8) ; + + + cifftma ( in , ROW , COLS8 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS8 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,creals(out[i]) , cimags(out[i]), creals (Result[i]) , cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + + +static void cifftmaTest9 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN9; + float tImagIn [] = CIMAG_IN9 ; + + + + float tRealResult [] = CREAL_RESULT9 ; + float tImagResult [] = CIMAG_RESULT9 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS9)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS9 ); + floatComplex* Result = FloatComplexMatrix ( tRealResult , tImagResult ,ROW*COLS9) ; + + + cifftma ( in , ROW , COLS9 , out ) ; + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS9 ) ; i++ ) + { + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i ,creals(out[i]) , cimags(out[i]), creals (Result[i]) , cimags (Result[i]), + fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i]))); + + if ( creals(out[i]) < 1e-14 && creals (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - creals (Result[i]) ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && cimags (Result[i]) < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - cimags (Result[i]) ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + + +} + +static void cifftmaTest10 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN10; + float tImagIn [] = CIMAG_IN10 ; + + + + float tRealResult [] = CREAL_RESULT10 ; + float tImagResult [] = CIMAG_RESULT10 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS10)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS10 ); + + + + cifftma ( in , ROW , COLS10 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS10 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + +static void cifftmaTest11 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN11; + float tImagIn [] = CIMAG_IN11 ; + + + + float tRealResult [] = CREAL_RESULT11 ; + float tImagResult [] = CIMAG_RESULT11 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS11)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS11 ); + + + + cifftma ( in , ROW , COLS11 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS11 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + +static void cifftmaTest12 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN12; + float tImagIn [] = CIMAG_IN12 ; + + + + float tRealResult [] = CREAL_RESULT12 ; + float tImagResult [] = CIMAG_RESULT12 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS12)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS12 ); + + + + cifftma ( in , ROW , COLS12 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS12 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + +static void cifftmaTest13 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN13; + float tImagIn [] = CIMAG_IN13 ; + + + + float tRealResult [] = CREAL_RESULT13 ; + float tImagResult [] = CIMAG_RESULT13 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS13)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS13 ); + + + + cifftma ( in , ROW , COLS13 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS13 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + +static void cifftmaTest14 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN14; + float tImagIn [] = CIMAG_IN14 ; + + + + float tRealResult [] = CREAL_RESULT14 ; + float tImagResult [] = CIMAG_RESULT14 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS14)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS14 ); + + + + cifftma ( in , ROW , COLS14 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS14 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + + +static void cifftmaTest15 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN15; + float tImagIn [] = CIMAG_IN15 ; + + + + float tRealResult [] = CREAL_RESULT15 ; + float tImagResult [] = CIMAG_RESULT15 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS15)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS15 ); + + + + cifftma ( in , ROW , COLS15 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS15 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + + +static void cifftmaTest16 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN16; + float tImagIn [] = CIMAG_IN16 ; + + + + float tRealResult [] = CREAL_RESULT16 ; + float tImagResult [] = CIMAG_RESULT16 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS16)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS16 ); + + + + cifftma ( in , ROW , COLS16 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS16 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + + + +static void cifftmaTest32 (void ) +{ + int i = 0 ; + + float tRealIn [] = CREAL_IN32; + float tImagIn [] = CIMAG_IN32 ; + + + + float tRealResult [] = CREAL_RESULT32 ; + float tImagResult [] = CIMAG_RESULT32 ; + + + + floatComplex* out = (floatComplex*) malloc ( sizeof(floatComplex) * (unsigned int) (ROW*COLS32)); + floatComplex* in = FloatComplexMatrix ( tRealIn , tImagIn , ROW*COLS32 ); + + + + cifftma ( in , ROW , COLS32 , out ); + + + + + /* if we don't add that test assert failed if result = 0 'cause then we have |(out - 0)|/|out| = 1*/ + for ( i = 0 ; i < (ROW*COLS32 ) ; i++ ) + { + + + printf ( "\t\t %d out : %e\t %e\t * i result : %e\t %e\t * i assert : : %e\t %e\t * i \n" , + i , + creals(out[i]) , + cimags(out[i]), + tRealResult[i] , + tImagResult[i], + fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) , + fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i]))); + + + if ( creals(out[i]) < 1e-14 && tRealResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( creals(out[i]) - tRealResult[i] ) / fabs (creals (out[i])) < 1e-4 ); + + + if ( cimags(out[i]) < 1e-14 && tImagResult[i] < 1e-18 ) + assert ( 1 ) ; + else + assert ( fabs( cimags(out[i]) - tImagResult[i] ) / fabs (cimags (out[i])) < 1e-4 ) ; + + } + +} + +static int testFft(void) { + + printf("\n>>>> FFT Tests\n"); + printf("\t>>>> Matrix Float Realt Tests\n"); + /*dfftmaTest();*/ + + printf("\n\n\n"); +/* + printf("\n\t>>>> Vector 2 Float Complex Tests\n"); + cifftmaTest2();*/ + printf("\n\t>>>> Vector 3 Float Complex Tests\n"); + cifftmaTest3(); + printf("\n\t>>>> Vector 4 Float Complex Tests\n"); + cifftmaTest4(); + printf("\n\t>>>> Vector 5 Float Complex Tests\n"); + cifftmaTest5(); + printf("\n\t>>>> Vector 6 Float Complex Tests\n"); + cifftmaTest6(); + printf("\n\t>>>> Vector 7 Float Complex Tests\n"); + cifftmaTest7(); + printf("\n\t>>>> Vector 8 Float Complex Tests\n"); + cifftmaTest8(); + printf("\n\t>>>> Vector 9 Float Complex Tests\n"); + cifftmaTest9(); + printf("\n\t>>>> Vector 10 Float Complex Tests\n"); + cifftmaTest10(); + printf("\n\t>>>> Vector 11 Float Complex Tests\n"); + cifftmaTest11(); + printf("\n\t>>>> Vector 12 Float Complex Tests\n"); + cifftmaTest12(); + printf("\n\t>>>> Vector 13 Float Complex Tests\n"); + cifftmaTest13(); + printf("\n\t>>>> Vector 14 Float Complex Tests\n"); + cifftmaTest14(); + printf("\n\t>>>> Vector 14 Float Complex Tests\n"); + cifftmaTest15(); + printf("\n\t>>>> Vector 16 Float Complex Tests\n"); + cifftmaTest16(); + printf("\n\t>>>> Vector 32 Float Complex Tests\n"); + cifftmaTest32(); + return 0; +} + + + +int main(void) { + assert(testFft() == 0); + return 0; +} diff --git a/src/signalProcessing/ifft/zfftma.c b/src/signalProcessing/ifft/zfftma.c new file mode 100644 index 00000000..f08158d4 --- /dev/null +++ b/src/signalProcessing/ifft/zfftma.c @@ -0,0 +1,161 @@ +/* + * 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 ) +{ + printf ( "it'a vector \n" ) ; + + sizeTemp = (int) pow ( 2 , (int ) (log( size + 0.5 ) /log ( 2 ))) ; + printf ("pow %e , temp %d \n" , pow ( 2 , (int )(log( size +0.5 ) /log ( 2 ))), sizeTemp); + + if ( size == sizeTemp ) + { + if ( size <= pow ( 2 , 15 )) + { + printf ( "we call fft842 \n" ) ; + fft842 ( in , size , 0 ); + choosenAlgo = FFT842 ; + } + else + { + printf ( "we call dfft2 \n" ) ; + dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace*/ ); + } + + + } + else + { + printf ( "we call dfft2 2\n" ) ; + dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace */); + } + +} + +else +{ + printf ( "it'a matrix \n" ) ; + 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*/); + } +} + + + +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 new file mode 100644 index 00000000..4ddac539 --- /dev/null +++ b/src/signalProcessing/ifft/zifftma.c @@ -0,0 +1,161 @@ +/* + * 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 "ifft.h" +#include <stdio.h> + +void zifftma ( 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 ) +{ + printf ( "it'a vector \n" ) ; + + sizeTemp = (int) pow ( 2 , (int ) (log( size + 0.5 ) /log ( 2 ))) ; + printf ("pow %e , temp %d \n" , pow ( 2 , (int )(log( size +0.5 ) /log ( 2 ))), sizeTemp); + + if ( size == sizeTemp ) + { + if ( size <= pow ( 2 , 15 )) + { + printf ( "we call fft842 \n" ) ; + fft842 ( in , size , 1 ); + choosenAlgo = FFT842 ; + } + else + { + printf ( "we call dfft2 \n" ) ; + dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace*/ ); + } + + + } + else + { + printf ( "we call dfft2 2\n" ) ; + dfft2 ( realIn , imagIn , 1 , size , 1 , isn , ierr /*, workSpace , sizeWorkSpace */); + } + +} + +else +{ + printf ( "it'a matrix \n" ) ; + 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 , 1); + 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 , 1); + 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*/); + } +} + + + +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/includes/fft.h b/src/signalProcessing/includes/fft.h index 4c2b3ee1..da88d709 100644 --- a/src/signalProcessing/includes/fft.h +++ b/src/signalProcessing/includes/fft.h @@ -23,5 +23,6 @@ void cfftma ( floatComplex* in , int rows, int cols, floatComplex* out); void zfftma ( doubleComplex* in , int rows, int cols, doubleComplex* out); - +void cfftma ( floatComplex* in , int rows, int cols, floatComplex* out); #endif /* !__FFT_H__ */ + |