Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

polar_fft_test.c File Reference

NFFT-based polar FFT and inverse. More...

#include <math.h>
#include <stdlib.h>
#include "util.h"
#include "nfft3.h"

Functions

int polar_grid (int T, int R, double *x, double *w)
 Generates the points $x_{t,j}$ with weights $w_{t,j}$ for the polar grid with $T$ angles and $R$ offsets.
int polar_dft (fftw_complex *f_hat, int NN, fftw_complex *f, int T, int R, int m)
 discrete polar FFT
int polar_fft (fftw_complex *f_hat, int NN, fftw_complex *f, int T, int R, int m)
 NFFT-based polar FFT.
int inverse_polar_fft (fftw_complex *f, int T, int R, fftw_complex *f_hat, int NN, int max_i, int m)
 inverse NFFT-based polar FFT
int main (int argc, char **argv)
 test program for various parameters


Detailed Description

NFFT-based polar FFT and inverse.

Computes the NFFT-based polar FFT and its inverse for various parameters.

Author:
Markus Fenn
Date:
2006

Function Documentation

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

inverse NFFT-based polar 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

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

generate knots of mpolar grid

load data

direct polar FFT

Test of the polar FFT with different m

fast polar FFT

compute error of fast polar FFT

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

inverse polar FFT

compute maximum relative error

free the variables

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

discrete polar FFT

< index for nodes and frequencies

< 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 polar grid

init Fourier coefficients from given image

NDFT-2D

copy result

finalise the plans and free the variables

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

NFFT-based polar 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 polar 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

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

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

The nodes of the polar grid lie on concentric circles around the origin. They are given for $(j,t)^{\top}\in I_R\times I_T$ by a signed radius $r_j := \frac{j}{R} \in [-\frac{1}{2},\frac{1}{2})$ and an angle $\theta_t := \frac{\pi t}{T} \in [-\frac{\pi}{2},\frac{\pi}{2})$ as

\[ x_{t,j} := r_j\left(\cos\theta_t, \sin\theta_t\right)^{\top}\,. \]

The total number of nodes is $M=TR$ , whereas the origin is included multiple times.

Weights are introduced to compensate for local sampling density variations. For every point in the sampling set, we associate a small surrounding area. In case of the polar grid, we choose small ring segments. The area of such a ring segment around $x_{t,j}$ ($j \ne 0$ ) is

\[ w_{t,j} = \frac{\pi}{2TR^2}\left(\left(|j|+\frac{1}{2}\right)^2- \left(|j|-\frac{1}{2}\right)^2\right) = \frac{\pi |j| }{TR^2}\, . \]

The area of the small circle of radius $\frac{1}{2R}$ around the origin is $\frac{\pi}{4R^2}$ . Divided by the multiplicity of the origin in the sampling set, we get $w_{t,0} := \frac{\pi}{4TR^2}$ . Thus, the sum of all weights is $\frac{\pi}{4}(1+\frac{1}{R^2})$ and we divide by this value for normalization.

return the number of knots


Generated on Wed May 10 20:39:39 2006 for NFFT by  doxygen 1.4.4