00001 // $Id: mmdb_math_fft.h $ 00002 // ================================================================= 00003 // 00004 // CCP4 Coordinate Library: support of coordinate-related 00005 // functionality in protein crystallography applications. 00006 // 00007 // Copyright (C) Eugene Krissinel 2005-2013. 00008 // 00009 // This library is free software: you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License version 3, modified in accordance with the provisions 00012 // of the license to address the requirements of UK law. 00013 // 00014 // You should have received a copy of the modified GNU Lesser 00015 // General Public License along with this library. If not, copies 00016 // may be downloaded from http://www.ccp4.ac.uk/ccp4license.php 00017 // 00018 // This program is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU Lesser General Public License for more details. 00022 // 00023 // ================================================================= 00024 // 00025 // 12.09.13 <-- Date of Last Modification. 00026 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00027 // ----------------------------------------------------------------- 00028 // 00029 // **** Module : FFT <interface> 00030 // ~~~~~~~~~ 00031 // **** Functions: mmdb::math::FFT 00032 // ~~~~~~~~~ mmdb::math::RealFFT 00033 // mmdb::math::TwoFFT 00034 // mmdb::math::Convolve 00035 // mmdb::math::mConvolve 00036 // 00037 // (C) E.Krissinel 2005-2013 00038 // 00039 // ================================================================= 00040 // 00041 00042 #ifndef __FFT__ 00043 #define __FFT__ 00044 00045 #include "mmdb_mattype.h" 00046 00047 namespace mmdb { 00048 00049 namespace math { 00050 00051 extern void FFT ( rvector data, int nn, bool Forward=true ); 00052 00053 extern void RealFFT ( rvector data, int n, bool Forward=true ); 00054 00055 extern void TwoFFT ( rvector data1, rvector data2, 00056 rvector fft1, rvector fft2, int n ); 00057 00058 extern void Convolve ( rvector data, int n, rvector respns, int m, 00059 rvector ans, bool Conv=true ); 00060 00061 00062 // mConvolve ( data,n,m ) replaces array data[0..n-1] with the result 00063 // of m recursive convolutions (m>1) defined as 00064 // 00065 // data_m = data (*) data_{m-1} 00066 // 00067 // where data_m is the result of mth convolution, data_0=data. 00068 // The definition of the convolution is 00069 // 00070 // [a (*) b]_i = Sum_j { a_j * b_{i-j} } 00071 // 00072 // On input, data[] is considered as containing the signal 00073 // sampled at both positive and negative times in the wrap-around 00074 // order, that is 00075 // 00076 // data[i], 0<=i<n/2 signal sampled at times dt*i 00077 // data[i], n/2<=i<n signal sampled at times -dt*(n-i) 00078 // 00079 // and the same wrap-around order is used to interprete the output 00080 // data. This means that if only m positive sampling times are 00081 // used, the length of data must be at least n=2*m, the rest being 00082 // padded with zeroes. 00083 // 00084 // The number of sampling nodes n *must* be an integer power of 00085 // two, i.e. 2,4,8,16 ... . 00086 // 00087 extern void mConvolve ( rvector data, int n, int m ); 00088 00089 } // namespace math 00090 00091 } // namespace mmdb 00092 00093 #endif
1.7.2