00001
00002 #ifdef DIRAC_DELTA
00003 #define PHI_HUT(k,d) 1.0
00004 #define PHI(x,d) (fabs((x))<10e-8)? 1.0 : 0.0
00005 #define WINDOW_HELP_INIT(d)
00006 #define WINDOW_HELP_FINALIZE
00007 #define WINDOW_HELP_ESTIMATE_m {ths->m = 0;}
00008 #endif
00009
00010 #ifdef GAUSSIAN
00011 #define PHI_HUT(k,d) ((double)exp(-(pow(PI*(k)/ths->n[d],2.0)* \
00012 ths->b[d])))
00013 #define PHI(x,d) ((double)exp(-pow((x)*ths->n[d],2.0)/ \
00014 ths->b[d])/sqrt(PI*ths->b[d]))
00015 #define WINDOW_HELP_INIT { \
00016 int idx; \
00017 ths->b = (double*) fftw_malloc(ths->d*sizeof(double)); \
00018 for(idx=0; idx<ths->d; idx++) \
00019 ths->b[idx]=((double)2*ths->sigma[idx])/ \
00020 (2*ths->sigma[idx]-1)*(((double)ths->m) / PI); \
00021 }
00022 #define WINDOW_HELP_FINALIZE {fftw_free(ths->b);}
00023 #define WINDOW_HELP_ESTIMATE_m {ths->m =12;}
00024 #endif
00025
00026 #ifdef KAISER_BESSEL
00027 #define PHI_HUT(k,d) ((double)nfft_i0( ths->m*sqrt( pow(ths->b[d],2) - \
00028 pow(2*PI*(k)/ths->n[d],2))))
00029 #define PHI(x,d) ((double)((pow(ths->m,2)-pow((x)*ths->n[d],2))>0)?\
00030 sinh(ths->b[d]*sqrt(pow(ths->m,2)- \
00031 pow((x)*ths->n[d],2)))/(PI*sqrt(pow(ths->m,2)- \
00032 pow((x)*ths->n[d],2))): (((pow(ths->m,2)- \
00033 pow((x)*ths->n[d],2))<0)? sin(ths->b[d]* \
00034 sqrt(pow(ths->n[d]*(x),2)-pow(ths->m,2)))/ \
00035 (PI*sqrt(pow(ths->n[d]*(x),2)-pow(ths->m,2))): \
00036 1.0))
00037 #define WINDOW_HELP_INIT { \
00038 int idx; \
00039 ths->b = (double*) fftw_malloc(ths->d*sizeof(double)); \
00040 for(idx=0; idx<ths->d; idx++) \
00041 ths->b[idx] = ((double)PI*(2.0-1.0/ths->sigma[idx])); \
00042 }
00043 #define WINDOW_HELP_FINALIZE {fftw_free(ths->b);}
00044 #define WINDOW_HELP_ESTIMATE_m {ths->m = 6;}
00045 #endif
00046
00047 #ifdef B_SPLINE
00048 #define PHI_HUT(k,d) ((double)(((k)==0)? 1.0/ths->n[(d)] : \
00049 pow(sin((k)*PI/ths->n[(d)])/((k)*PI/ths->n[(d)])\
00050 ,2*ths->m)/ths->n[(d)]))
00051 #define PHI(x,d) (nfft_bspline(2*ths->m,((x)*ths->n[(d)])+ \
00052 (double)ths->m,ths->spline_coeffs)/ths->n[(d)])
00053
00054 #define WINDOW_HELP_INIT { \
00055 ths->spline_coeffs= (double*)fftw_malloc(2*ths->m*sizeof(double));\
00056 }
00057 #define WINDOW_HELP_FINALIZE {fftw_free(ths->spline_coeffs);}
00058 #define WINDOW_HELP_ESTIMATE_m {ths->m =11;}
00059 #endif
00060
00061 #ifdef SINC_POWER
00062 #define PHI_HUT(k,d) (nfft_bspline(2*ths->m,((double)2*ths->m*(k))/ \
00063 ((2*ths->sigma[(d)]-1)*ths->n[(d)]/ths->sigma[(d)])+ \
00064 (double)ths->m,ths->spline_coeffs))
00065 #define PHI(x,d) ((double)(ths->n[(d)]/ths->sigma[(d)]*(2*ths->sigma[(d)]-1)/ \
00066 (2*ths->m)*pow(nfft_sinc(PI*ths->n[(d)]/ths->sigma[(d)]*(x)* \
00067 (2*ths->sigma[(d)]-1)/(2*ths->m)), \
00068 2*ths->m)/ths->n[(d)]))
00069 #define WINDOW_HELP_INIT { \
00070 ths->spline_coeffs= (double*)fftw_malloc(2*ths->m*sizeof(double));\
00071 }
00072 #define WINDOW_HELP_FINALIZE {fftw_free(ths->spline_coeffs);}
00073 #define WINDOW_HELP_ESTIMATE_m {ths->m = 9;}
00074 #endif