Changeset 1405 in Sophya for trunk/SophyaLib/NTools/fftservintf.cc
- Timestamp:
- Feb 15, 2001, 6:58:16 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/fftservintf.cc
r1402 r1405 6 6 \ingroup NTools 7 7 Defines the interface for FFT (Fast Fourier Transform) operations. 8 Definitions : 9 - Sampling period \b T 10 - Sampling frequency \b fs=1/T 11 - Total number of samples \b N 12 - Frequency step in Fourier space \b =fs/N=1/(N*T) 13 - Component frequencies 14 - k=0 -> 0 15 - k=1 -> 1/(N*T) 16 - k -> k/(N*T) 17 - k=N/2 -> 1/(2*T) (Nyquist frequency) 18 - k>N/2 -> k/(N*T) (or negative frequency -(N-k)/(N*T)) 19 20 For a sampling period T=1, the computed Fourier components correspond to : 21 \verbatim 22 0 1/N 2/N ... 1/2 1/2+1/N 1/2+2/N ... 1-2/N 1-1/N 23 0 1/N 2/N ... 1/2 ... -2/N -1/N 24 \endverbatim 25 26 For complex one-dimensional transforms: 27 \f[ 28 out(i) = F_{norm} \Sigma_{j} \ e^{-2 \pi \sqrt{-1} \ i \ j} \ {\rm (forward)} 29 \f] 30 \f[ 31 out(i) = F_{norm} \Sigma_{j} \ e^{2 \pi \sqrt{-1} \ i \ j} \ {\rm (backward)} 32 \f] 33 i,j= 0..N-1 , where N is the input or the output array size. 34 35 For complex multi-dimensional transforms: 36 \f[ 37 out(i1,i2,...,id) = F_{norm} \Sigma_{j1} \Sigma_{j2} ... \Sigma_{jd} \ 38 e^{-2 \pi \sqrt{-1} \ i1 \ j1} ... e^{-2 \pi \sqrt{-1} \ id \ jd} \ {\rm (forward)} 39 \f] 40 \f[ 41 out(i1,i2,...,id) = F_{norm} \Sigma_{j1} \Sigma_{j2} ... \Sigma_{jd} \ 42 e^{2 \pi \sqrt{-1} \ i1 \ j1} ... e^{2 \pi \sqrt{-1} \ id \ jd} \ {\rm (backward)} 43 \f] 44 45 For real forward transforms, the input array is real, and 46 the output array complex, with Fourier components up to k=N/2. 47 For real backward transforms, the input array is complex and 48 the output array is real. 8 49 */ 9 50 … … 23 64 24 65 /* --Methode-- */ 66 //! Forward Fourier transform for double precision complex data 67 /*! 68 \param in : Input complex array 69 \param out : Output complex array 70 */ 25 71 void FFTServerInterface::FFTForward(TArray< complex<r_8> > const &, TArray< complex<r_8> > &) 26 72 { … … 29 75 30 76 /* --Methode-- */ 77 //! Backward (inverse) Fourier transform for double precision complex data 78 /*! 79 \param in : Input complex array 80 \param out : Output complex array 81 */ 31 82 void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< complex<r_8> > &) 32 83 { … … 35 86 36 87 /* --Methode-- */ 88 //! Forward Fourier transform for double precision real input data 89 /*! 90 \param in : Input real array 91 \param out : Output complex array 92 */ 37 93 void FFTServerInterface::FFTForward(TArray< r_8 > const &, TArray< complex<r_8> > &) 38 94 { … … 41 97 42 98 /* --Methode-- */ 99 //! Backward (inverse) Fourier transform for double precision real output data 100 /*! 101 \param in : Input complex array 102 \param out : Output real array 103 \param usoutsz : if true, use the output array size for computing the inverse FFT. 104 */ 43 105 void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< r_8 > &, bool) 44 106 { … … 50 112 51 113 /* --Methode-- */ 114 //! Forward Fourier transform for complex data 115 /*! 116 \param in : Input complex array 117 \param out : Output complex array 118 */ 52 119 void FFTServerInterface::FFTForward(TArray< complex<r_4> > const &, TArray< complex<r_4> > &) 53 120 { … … 56 123 57 124 /* --Methode-- */ 125 //! Backward (inverse) Fourier transform for complex data 126 /*! 127 \param in : Input complex array 128 \param out : Output complex array 129 */ 58 130 void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< complex<r_4> > &) 59 131 { … … 62 134 63 135 /* --Methode-- */ 136 //! Forward Fourier transform for real input data 137 /*! 138 \param in : Input real array 139 \param out : Output complex array 140 */ 64 141 void FFTServerInterface::FFTForward(TArray< r_4 > const &, TArray< complex<r_4> > &) 65 142 { … … 68 145 69 146 /* --Methode-- */ 147 //! Backward (inverse) Fourier transform for real output data 148 /*! 149 \param in : Input complex array 150 \param out : Output real array 151 \param usoutsz : if true, use the output array size for computing the inverse FFT. 152 */ 70 153 void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< r_4 > &, bool) 71 154 { … … 76 159 77 160 /* --Methode-- */ 161 /*! 162 \class SOPHYA::FFTArrayChecker 163 \ingroup NTools 164 Service class for checking array size and resizing output arrays, 165 to be used by FFTServer classes 166 */ 167 78 168 template <class T> 79 169 FFTArrayChecker<T>::FFTArrayChecker(string msg, bool checkpack, bool onedonly)
Note:
See TracChangeset
for help on using the changeset viewer.