X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Ffilter.h;h=9ee7390a4acd83c96bd9a72b7f9990fbfe7bede9;hb=dfa390de2efc04d85b03718a6480f735516df0e8;hp=7040a3bcabd2742ca0e94f0cfea2ed18cb6800dd;hpb=a2a9671aff06827cec6d6b80234b90128d337e40;p=ctsim.git diff --git a/include/filter.h b/include/filter.h index 7040a3b..9ee7390 100644 --- a/include/filter.h +++ b/include/filter.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: filter.h,v 1.10 2000/07/06 08:30:30 kevin Exp $ +** $Id: filter.h,v 1.12 2000/07/07 15:30:59 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -28,6 +28,7 @@ #ifndef FILTER_H #define FILTER_H + class SignalFilter { public: @@ -49,8 +50,12 @@ class SignalFilter { FILTER_METHOD_INVALID, FILTER_METHOD_CONVOLUTION, FILTER_METHOD_FOURIER, + FILTER_METHOD_FOURIER_TABLE, FILTER_METHOD_FFT, +#if HAVE_FFTW FILTER_METHOD_FFTW, + FILTER_METHOD_RFFTW, +#endif } FilterMethodID; typedef enum { @@ -72,8 +77,12 @@ class SignalFilter { static const char FILTER_METHOD_CONVOLUTION_STR[]= "convolution"; static const char FILTER_METHOD_FOURIER_STR[]= "fourier"; + static const char FILTER_METHOD_FOURIER_TABLE_STR[]="fourier_table"; static const char FILTER_METHOD_FFT_STR[]= "fft"; +#if HAVE_FFTW static const char FILTER_METHOD_FFTW_STR[]= "fftw"; + static const char FILTER_METHOD_RFFTW_STR[]= "rfftw"; +#endif static const char DOMAIN_FREQUENCY_STR[]="frequency"; static const char DOMAIN_SPATIAL_STR[]="spatial"; @@ -101,12 +110,12 @@ class SignalFilter { void filterSignal (const float input[], double output[]) const; static void finiteFourierTransform (const double input[], complex output[], const int n, const int direction); - static void finiteFourierTransform (const complex input[], complex output[], const int n, const int direction); + static void finiteFourierTransform (const complex input[], double output[], const int n, const int direction); void finiteFourierTransform (const double input[], complex output[], const int direction) const; - void finiteFourierTransform (const complex input[], complex output[], const int direction) const; + void finiteFourierTransform (const complex input[], double output[], const int direction) const; void setTraceLevel (int traceLevel) {m_traceLevel = traceLevel; } @@ -131,8 +140,6 @@ class SignalFilter { static double spatialResponseAnalytic (FilterID fType, double bw, double x, double param); - static void dotProduct (const double v1[], const complex v2[], complex output[], const int n); - private: double m_bw; int m_nFilterPoints; @@ -146,10 +153,10 @@ class SignalFilter { double* m_vecFourierSinTable; complex* m_complexVecFilter; #ifdef HAVE_FFTW - fftw_plan m_planForward, m_planBackward; - fftw_complex* m_vecFftInput; -#else - complex* m_vecFftInput; + fftw_real* m_vecRealFftInput; + rfftw_plan m_realPlanForward, m_realPlanBackward; + fftw_complex* m_vecComplexFftInput; + fftw_plan m_complexPlanForward, m_complexPlanBackward; #endif bool m_fail;