NFFT Logo 3.0 API Reference
Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

mpolar_fft_test
[Polar FFT]


Functions

int mpolar_grid (int T, int R, double *x, double *w)
 Generates the points $x_{t,j}$ with weights $w_{t,j}$ for the modified polar grid with $T$ angles and $R$ offsets.
int mpolar_dft (fftw_complex *f_hat, int NN, fftw_complex *f, int T, int R, int m)
 discrete mpolar FFT
int mpolar_fft (fftw_complex *f_hat, int NN, fftw_complex *f, int T, int R, int m)
 NFFT-based mpolar FFT.
int inverse_mpolar_fft (fftw_complex *f, int T, int R, fftw_complex *f_hat, int NN, int max_i, int m)
 inverse NFFT-based mpolar FFT
int comparison_fft (FILE *fp, int N, int T, int R)
 Comparison of the FFTW, mpolar FFT, and inverse mpolar FFT.
int main (int argc, char **argv)
 test program for various parameters

Variables

double GLOBAL_elapsed_time

Function Documentation

int mpolar_grid int  T,
int  R,
double *  x,
double *  w
 

Generates the points $x_{t,j}$ with weights $w_{t,j}$ for the modified polar grid with $T$ angles and $R$ offsets.

We add more concentric circles to the polar grid and exclude those nodes not located in the unit square, i.e.,

\[ x_{t,j} := r_j\left(\cos\theta_t, \sin\theta_t\right)^{\top}\,,\qquad (j,t)^{\top}\in I_{\sqrt{2}R}\times I_T\,. \]

with $r_j$ and $\theta_t$ as for the polar grid. The number of nodes for the modified polar grid can be estimated as $M \approx \frac{4}{\pi}\log(1+\sqrt{2}) T R$ .

count the knots

normalize the weights

return the number of knots

Definition at line 36 of file mpolar_fft_test.c.

References PI.

Referenced by inverse_mpolar_fft(), main(), mpolar_dft(), and mpolar_fft().

int mpolar_dft fftw_complex *  f_hat,
int  NN,
fftw_complex *  f,
int  T,
int  R,
int  m
 

discrete mpolar FFT

< index for nodes and freqencies

< plan for the nfft-2D

< knots and associated weights

< number of knots

< oversampling factor sigma=2

< oversampling factor sigma=2

init two dimensional NFFT plan

init nodes from mpolar grid

init Fourier coefficients from given image

NDFT-2D

copy result

finalise the plans and free the variables

Definition at line 79 of file mpolar_fft_test.c.

References nfft_plan::f, nfft_plan::f_hat, FFT_OUT_OF_PLACE, FFTW_INIT, GLOBAL_elapsed_time, nfft_plan::M_total, MALLOC_F, MALLOC_F_HAT, MALLOC_X, mpolar_grid(), nfft_plan::N_total, ndft_trafo(), nfft_finalize(), nfft_init_guru(), nfft_second(), PRE_PHI_HUT, PRE_PSI, and nfft_plan::x.

Referenced by comparison_fft(), and main().

int mpolar_fft fftw_complex *  f_hat,
int  NN,
fftw_complex *  f,
int  T,
int  R,
int  m
 

NFFT-based mpolar FFT.

< index for nodes and freqencies

< plan for the nfft-2D

< knots and associated weights

< number of knots

< oversampling factor sigma=2

< oversampling factor sigma=2

init two dimensional NFFT plan

init nodes from mpolar grid

precompute psi, the entries of the matrix B

init Fourier coefficients from given image

NFFT-2D

copy result

finalise the plans and free the variables

Definition at line 137 of file mpolar_fft_test.c.

References nfft_plan::f, nfft_plan::f_hat, FFT_OUT_OF_PLACE, FFTW_INIT, GLOBAL_elapsed_time, nfft_plan::M_total, MALLOC_F, MALLOC_F_HAT, MALLOC_X, mpolar_grid(), nfft_plan::N_total, nfft_finalize(), nfft_plan::nfft_flags, nfft_init_guru(), nfft_precompute_full_psi(), nfft_precompute_lin_psi(), nfft_precompute_psi(), nfft_second(), nfft_trafo(), PRE_FULL_PSI, PRE_LIN_PSI, PRE_PHI_HUT, PRE_PSI, and nfft_plan::x.

Referenced by comparison_fft(), and main().

int inverse_mpolar_fft fftw_complex *  f,
int  T,
int  R,
fftw_complex *  f_hat,
int  NN,
int  max_i,
int  m
 

inverse NFFT-based mpolar FFT

< index for nodes and freqencies

< plan for the nfft-2D

< plan for the inverse nfft

< knots and associated weights

< index for iterations

< number of knots

< oversampling factor sigma=2

< oversampling factor sigma=2

init two dimensional NFFT plan

init two dimensional infft plan

init nodes, given samples and weights

precompute psi, the entries of the matrix B

initialise damping factors

initialise some guess f_hat_0

solve the system

copy result

finalise the plans and free the variables

Definition at line 206 of file mpolar_fft_test.c.

References CGNR, infft_plan::f_hat_iter, FFT_OUT_OF_PLACE, FFTW_INIT, infft_plan::flags, GLOBAL_elapsed_time, infft_before_loop(), infft_finalize(), infft_init_advanced(), infft_loop_one_step(), nfft_plan::M_total, MALLOC_F, MALLOC_F_HAT, MALLOC_X, mpolar_grid(), infft_plan::mv, nfft_plan::N, nfft_plan::N_total, nfft_finalize(), nfft_plan::nfft_flags, nfft_init_guru(), nfft_precompute_full_psi(), nfft_precompute_lin_psi(), nfft_precompute_psi(), nfft_second(), infft_plan::p_hat_iter, PRE_FULL_PSI, PRE_LIN_PSI, PRE_PHI_HUT, PRE_PSI, PRECOMPUTE_DAMP, PRECOMPUTE_WEIGHT, infft_plan::w, infft_plan::w_hat, nfft_plan::x, and infft_plan::y.

Referenced by comparison_fft(), and main().

int main int  argc,
char **  argv
 

test program for various parameters

< mpolar FFT size NxN

< number of directions/offsets

< number of knots of mpolar grid

< knots and associated weights

< number of iterations

Hence, comparison of the FFTW, mpolar FFT, and inverse mpolar FFT

generate knots of mpolar grid

load data

direct mpolar FFT

Test of the mpolar FFT with different m

fast mpolar FFT

compute error of fast mpolar FFT

Test of the inverse mpolar FFT for different m in dependece of the iteration number

inverse mpolar FFT

compute maximum relativ error

free the variables

Definition at line 369 of file mpolar_fft_test.c.

References comparison_fft(), inverse_mpolar_fft(), mpolar_dft(), mpolar_fft(), mpolar_grid(), and nfft_error_l_infty_complex().


Generated on 1 Nov 2006 by Doxygen 1.4.4