![]() |
Object-oriented Scientific Computing Library: Version 0.910
|
00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006-2012, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_GSL_FFT_H 00024 #define O2SCL_GSL_FFT_H 00025 00026 #include <iostream> 00027 #include <gsl/gsl_errno.h> 00028 #include <gsl/gsl_fft_real.h> 00029 #include <gsl/gsl_fft_halfcomplex.h> 00030 00031 #ifndef DOXYGENP 00032 namespace o2scl { 00033 #endif 00034 00035 /** \brief Real mixed-radix fast Fourier transform 00036 00037 This is a simple wrapper for the GSL FFT functions which 00038 automatically allocates the necessary memory. 00039 */ 00040 class gsl_fft { 00041 public: 00042 00043 gsl_fft(); 00044 00045 virtual ~gsl_fft(); 00046 00047 /** \brief Perform the FFT transform 00048 */ 00049 int transform(int n, double *x); 00050 00051 /** \brief Perform the inverse FFT transform 00052 */ 00053 int inverse_transform(int n, double *x); 00054 00055 #ifndef DOXYGEN_INTERNAL 00056 00057 protected: 00058 00059 /// The current memory size 00060 int mem_size; 00061 00062 /// Reallocate memory 00063 int mem_resize(int new_size); 00064 00065 /// The GSL workspace 00066 gsl_fft_real_workspace *work; 00067 00068 /// The table for the forward transform 00069 gsl_fft_real_wavetable *real; 00070 00071 /// The table for the inverse transform 00072 gsl_fft_halfcomplex_wavetable *hc; 00073 00074 #endif 00075 00076 }; 00077 00078 #ifndef DOXYGENP 00079 } 00080 #endif 00081 00082 #endif
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).