GeopsyCore/DFFTPack.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyCore.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2009-04-09
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef GP_DFFTPACK_H
00029 #define GP_DFFTPACK_H
00030 
00031 #include "FastFourierTransform.h"
00032 
00033 namespace GeopsyCore {
00034 
00035 #ifndef NO_FFT
00036 
00037 // libDFFTPack interface
00038 
00039 // Simplest interface: wsave must be a vector of 2*n+15 elements
00040 extern "C" void dffti_(long * n, double * wsave);
00041 extern "C" void dfftf_(long * n, double * r, double * wsave);
00042 extern "C" void dfftb_(long * n, double * r, double * wsave);
00043 
00044 // Lower level interface, where const and non const parts of wsave can be separated
00045 // ch and wa have n elements, ifa has 15 elements
00046 extern "C" void rffti1_(long * n, const double * wa, const double * ifac);
00047 extern "C" void rfftf1_(long * n, double * r, double * ch, const double * wa, const double * ifac);
00048 extern "C" void rfftb1_(long * n, double * r, double * ch, const double * wa, const double * ifac);
00049 
00050 // Simplest interface: wsave must be a vector of 4*n+15 elements
00051 extern "C" void zffti_(long * n, double * wsave);
00052 extern "C" void zfftf_(long * n, QGpCoreTools::Complex * c, double * wsave);
00053 extern "C" void zfftb_(long * n, QGpCoreTools::Complex * c, double * wsave);
00054 
00055 // Lower level interface, where const and non const parts of wsave can be separated
00056 // ch and wa have 2*n elements, ifa has 15 elements
00057 extern "C" void cffti1_(long * n, const double * wa, const double * ifac);
00058 extern "C" void cfftf1_(long * n, QGpCoreTools::Complex * r, double * ch, const double * wa, const double * ifac);
00059 extern "C" void cfftb1_(long * n, QGpCoreTools::Complex * r, double * ch, const double * wa, const double * ifac);
00060 
00061 class DFFTPack : public FastFourierTransform
00062 {
00063 public:
00064   virtual void forward(int nSamples, double * samples);
00065   virtual void backward(int nSamples, double * samples);
00066 
00067   virtual void forward(int nSamples, Complex * samples);
00068   virtual void backward(int nSamples, Complex * samples);
00069 
00070   virtual void manyForward(int howmany, int nSamples, Complex * samples);
00071   virtual void manyBackward(int howmany, int nSamples, Complex * samples);
00072 };
00073 
00074 #endif // NO_FFT
00075 
00076 } // namespace GeopsyCore
00077 
00078 #endif // DFFTPACK_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines