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

NFCT/NFST - Nonequispaced fast (co)sine transform

Direct and fast computation of the discrete nonequispaced (co)sine transform. More...

Data Structures

struct  nfct_plan
 Structure for a transform plan. More...
struct  nfst_plan
 Structure for a transform plan. More...

Functions

void nfct_init_1d (nfct_plan *ths_plan, int N0, int M_total)
 Creates a 1-dimensional transform plan.
void nfct_init_2d (nfct_plan *ths_plan, int N0, int N1, int M_total)
 Creates a 3-dimensional transform plan.
void nfct_init_3d (nfct_plan *ths_plan, int N0, int N1, int N2, int M_total)
 Creates a 3-dimensional transform plan.
void nfct_init (nfct_plan *ths_plan, int d, int *N, int M_total)
 Creates a d-dimensional transform plan.
void nfct_init_guru (nfct_plan *ths_plan, int d, int *N, int M_total, int *n, int m, unsigned nfct_flags, unsigned fftw_flags)
 Creates a d-dimensional transform plan.
void nfct_precompute_psi (nfct_plan *ths_plan)
 precomputes the values psi if the PRE_PSI is set the application program has to call this routine after setting the nodes this_plan->x
void nfct_trafo (nfct_plan *ths_plan)
 executes a NFCT (approximate,fast), computes for $j=0,...,M\_total-1$ $f_j^C(x_j) = \sum_{k \in I_0^{N,d}} \hat{f}_k^C * cos(2 \pi k x_j)$
void ndct_trafo (nfct_plan *ths_plan)
 executes a NDCT (exact,slow), computes for $j=0,...,M\_total-1$ $f_j^C(x_j) = \sum_{k \in I_0^{N,d}} \hat{f}_k^C * cos(2 \pi k x_j)$
void nfct_adjoint (nfct_plan *ths_plan)
 executes a transposed NFCT (approximate,fast), computes for $k \in I_0^{N,d}$ $h^C(k) = \sum_{j \in I_0^{(M\_total,1)}} f_j^C * cos(2 \pi k x_j)$
void ndct_adjoint (nfct_plan *ths_plan)
 executes a direct transposed NDCT (exact,slow), computes for $k \in I_0^{N,d}$ $h^C(k) = \sum_{j \in I_0^{(M\_total,1)}} f_j^C * cos(2 \pi k x_j)$
void nfct_finalize (nfct_plan *ths_plan)
 Destroys a plan.
double nfct_phi_hut (nfct_plan *ths_plan, int k, int d)
 do some adjustments (N,n) then compute PHI_HUT
double nfct_phi (nfct_plan *ths_plan, double x, int d)
 do some adjustments (N,n) then compute PHI
int nfct_fftw_2N (int n)
 returns 2(n-1), fftw related issue
int nfct_fftw_2N_rev (int n)
 returns 0.5n+1, fftw related issue
void nfst_init_1d (nfst_plan *ths_plan, int N0, int M_total)
 Creates a 1-dimensional transform plan.
void nfst_init_2d (nfst_plan *ths_plan, int N0, int N1, int M_total)
 Creates a 3-dimensional transform plan.
void nfst_init_3d (nfst_plan *ths_plan, int N0, int N1, int N2, int M_total)
 Creates a 3-dimensional transform plan.
void nfst_init (nfst_plan *ths_plan, int d, int *N, int M_total)
 Creates a d-dimensional transform plan.
void nfst_init_m (nfst_plan *ths_plan, int d, int *N, int M_total, int m)
 Creates a d-dimensional transform plan with pcific m.
void nfst_init_guru (nfst_plan *ths_plan, int d, int *N, int M_total, int *n, int m, unsigned nfst_flags, unsigned fftw_flags)
 Creates a d-dimensional transform plan.
void nfst_precompute_psi (nfst_plan *ths_plan)
 precomputes the values psi if the PRE_PSI is set the application program has to call this routine after setting the nodes this_plan->x
void nfst_trafo (nfst_plan *ths_plan)
 executes a NFST (approximate,fast), computes for $j=0,...,M\_total-1$ $f_j^S(x_j) = \sum_{k \in I_1^{N,d}} \hat{f}_k^S * sin(2 \pi k x_j)$
void ndst_trafo (nfst_plan *ths_plan)
 executes a NDST (exact,slow), computes for $j=0,...,M\_total-1$ $f_j^S(x_j) = \sum_{k \in I_1^{N,d}} \hat{f}_k^S * sin(2 \pi k x_j)$
void nfst_adjoint (nfst_plan *ths_plan)
 executes a transposed NFST (approximate,fast), computes for $k \in I_1^{N,d}$ $h^S(k) = \sum_{j \in I_0^{M\_total,1}} f_j^S * cos(2 \pi k x_j)$
void ndst_adjoint (nfst_plan *ths_plan)
 executes a direct transposed NDST (exact,slow), computes for $k \in I_1^{N,d}$ $h^S(k) = \sum_{j \in I_0^{M\_total,1}} f_j^S * cos(2 \pi k x_j)$
void nfst_finalize (nfst_plan *ths_plan)
 Destroys a plan.
void nfst_full_psi (nfst_plan *ths_plan, double eps)
 more memory usage, a bit faster
double nfst_phi_hut (nfst_plan *ths_plan, int k, int d)
 do some adjustments (N,n) then compute PHI_HUT
double nfst_phi (nfst_plan *ths_plan, double x, int d)
 do some adjustments (N,n) then compute PHI
int nfst_fftw_2N (int n)
 returns 2(n+1), fftw related issue
int nfst_fftw_2N_rev (int n)
 returns 0.5n-1, fftw related issue

Detailed Description

Direct and fast computation of the discrete nonequispaced (co)sine transform.


Function Documentation

void nfct_init_1d nfct_plan ths_plan,
int  N0,
int  M_total
 

Creates a 1-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth $N$
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 996 of file nfct.c.

References nfct_init().

void nfct_init_2d nfct_plan ths_plan,
int  N0,
int  N1,
int  M_total
 

Creates a 3-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth of dimension 1
  • N1 The bandwidth of dimension 2
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 1004 of file nfct.c.

References nfct_init().

void nfct_init_3d nfct_plan ths_plan,
int  N0,
int  N1,
int  N2,
int  M_total
 

Creates a 3-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth of dimension 1
  • N1 The bandwidth of dimension 2
  • N2 The bandwidth of dimension 3
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 1013 of file nfct.c.

References nfct_init().

void nfct_init nfct_plan ths_plan,
int  d,
int *  N,
int  M_total
 

Creates a d-dimensional transform plan.

  • ths_plan The plan for the transform
  • d the dimension
  • N The bandwidths
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 931 of file nfct.c.

References nfct_plan::d, nfct_plan::fftw_flags, nfct_plan::M_total, nfct_plan::N, nfct_plan::n, nfct_fftw_2N(), nfct_plan::nfct_flags, and nfft_next_power_of_2().

Referenced by nfct_init_1d(), nfct_init_2d(), and nfct_init_3d().

void nfct_init_guru nfct_plan ths,
int  d,
int *  N,
int  M_total,
int *  n,
int  m,
unsigned  nfct_flags,
unsigned  fftw_flags
 

Creates a d-dimensional transform plan.

< index over all dimensions

Definition at line 968 of file nfct.c.

References nfct_plan::d, nfct_plan::fftw_flags, nfct_plan::m, nfct_plan::M_total, nfct_plan::N, nfct_plan::n, and nfct_plan::nfct_flags.

void nfct_precompute_psi nfct_plan ths  ) 
 

precomputes the values psi if the PRE_PSI is set the application program has to call this routine after setting the nodes this_plan->x

< index over all dimensions

< index over all nodes

< index 0<=lj<u+o+1

< depends on x_j

Definition at line 838 of file nfct.c.

References nfct_plan::d, nfct_plan::M_total, and nfct_plan::psi.

void nfct_trafo nfct_plan ths  ) 
 

executes a NFCT (approximate,fast), computes for $j=0,...,M\_total-1$ $f_j^C(x_j) = \sum_{k \in I_0^{N,d}} \hat{f}_k^C * cos(2 \pi k x_j)$

use ths->my_fftw_r2r_plan

form $ \hat g_k = \frac{\hat f_k}{c_k\left(\phi\right)} \text{ for } k \in I_N $

compute by d-variate discrete Fourier transform $ g_l = \sum_{k \in I_N} \hat g_k {\rm e}^{-2\pi {\rm i} \frac{kl}{n}} \text{ for } l \in I_n $

set $ f_j = \sum_{l \in I_n,m(x_j)} g_l \psi\left(x_j-\frac{l}{n}\right) \text{ for } j=0,\hdots,M-1 $

Definition at line 711 of file nfct.c.

References PRE_FULL_PSI.

void ndct_trafo nfct_plan ths_plan  ) 
 

executes a NDCT (exact,slow), computes for $j=0,...,M\_total-1$ $f_j^C(x_j) = \sum_{k \in I_0^{N,d}} \hat{f}_k^C * cos(2 \pi k x_j)$

  • ths_plan The plan for the transform
Author:
Steffen Klatt

Definition at line 256 of file nfct.c.

void nfct_adjoint nfct_plan ths  ) 
 

executes a transposed NFCT (approximate,fast), computes for $k \in I_0^{N,d}$ $h^C(k) = \sum_{j \in I_0^{(M\_total,1)}} f_j^C * cos(2 \pi k x_j)$

use ths->my_fftw_plan

set $ g_l = \sum_{j=0}^{M-1} f_j \psi\left(x_j-\frac{l}{n}\right) \text{ for } l \in I_n,m(x_j) $

compute by d-variate discrete cosine transform $ \hat g_k = \sum_{l \in I_n} g_l {\rm e}^{-2\pi {\rm i} \frac{kl}{n}} \text{ for } k \in I_N$

form $ \hat f_k = \frac{\hat g_k}{c_k\left(\phi\right)} \text{ for } k \in I_N $

Definition at line 765 of file nfct.c.

References nfct_plan::g, nfct_plan::g1, nfct_plan::g2, nfct_plan::g_hat, nfct_plan::my_fftw_r2r_plan, nfct_plan::nfct_flags, PRE_FULL_PSI, nfct_plan::psi_index_f, and nfct_plan::psi_index_g.

void ndct_adjoint nfct_plan ths_plan  ) 
 

executes a direct transposed NDCT (exact,slow), computes for $k \in I_0^{N,d}$ $h^C(k) = \sum_{j \in I_0^{(M\_total,1)}} f_j^C * cos(2 \pi k x_j)$

  • ths_plan The plan for the transform
Author:
Steffen Klatt

Definition at line 257 of file nfct.c.

References nfct_fftw_2N().

void nfct_finalize nfct_plan ths  ) 
 

Destroys a plan.

index over dimensions

Definition at line 1027 of file nfct.c.

References nfct_plan::c_phi_inv, nfct_plan::d, nfct_plan::f, nfct_plan::f_hat, FFT_OUT_OF_PLACE, FFTW_INIT, nfct_plan::g1, nfct_plan::g2, MALLOC_F, MALLOC_F_HAT, MALLOC_X, nfct_plan::my_fftw_r2r_plan, nfct_plan::N, nfct_plan::n, nfct_plan::nfct_flags, PRE_PHI_HUT, PRE_PSI, nfct_plan::psi, nfct_plan::sigma, and nfct_plan::x.

double nfct_phi_hut nfct_plan ths_plan,
int  k,
int  d
 

do some adjustments (N,n) then compute PHI_HUT

  • ths_plan the plan for the transform
  • k index of c_phi
  • d dimension
Author:
Steffen Klatt

Definition at line 63 of file nfct.c.

double nfct_phi nfct_plan ths_plan,
double  x,
int  d
 

do some adjustments (N,n) then compute PHI

  • ths_plan the plan for the transform
  • x node $x$
  • d dimension
Author:
Steffen Klatt

Definition at line 72 of file nfct.c.

int nfct_fftw_2N int  n  ) 
 

returns 2(n-1), fftw related issue

  • n i.e. length of dct-1
Author:
Steffen Klatt

Definition at line 81 of file nfct.c.

Referenced by ndct_adjoint(), and nfct_init().

int nfct_fftw_2N_rev int  n  ) 
 

returns 0.5n+1, fftw related issue

  • n i.e. length of dct-1
Author:
Steffen Klatt

Definition at line 86 of file nfct.c.

void nfst_init_1d nfst_plan ths_plan,
int  N0,
int  M_total
 

Creates a 1-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth $N$
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 979 of file nfst.c.

References nfst_init().

void nfst_init_2d nfst_plan ths_plan,
int  N0,
int  N1,
int  M_total
 

Creates a 3-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth of dimension 1
  • N1 The bandwidth of dimension 2
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 987 of file nfst.c.

References nfst_init().

void nfst_init_3d nfst_plan ths_plan,
int  N0,
int  N1,
int  N2,
int  M_total
 

Creates a 3-dimensional transform plan.

  • ths_plan The plan for the transform
  • N0 The bandwidth of dimension 1
  • N1 The bandwidth of dimension 2
  • N2 The bandwidth of dimension 3
  • M_total The number of nodes $x$
Author:
Steffen Klatt

Definition at line 996 of file nfst.c.

References nfst_init().

void nfst_init nfst_plan ths,
int  d,
int *  N,
int  M_total
 

Creates a d-dimensional transform plan.

< index over all dimensions

Definition at line 913 of file nfst.c.

References nfst_plan::d, nfst_plan::fftw_flags, nfst_plan::M_total, nfst_plan::N, nfst_plan::n, nfft_next_power_of_2(), and nfst_plan::nfst_flags.

Referenced by nfst_init_1d(), nfst_init_2d(), and nfst_init_3d().

void nfst_init_m nfst_plan ths_plan,
int  d,
int *  N,
int  M_total,
int  m
 

Creates a d-dimensional transform plan with pcific m.

(just for convenience)

  • ths_plan The plan for the transform
  • d the dimension
  • N The bandwidths
  • M_total The number of nodes $x$
  • m cut-off parameter
Author:
Steffen Klatt

Definition at line 940 of file nfst.c.

References nfft_next_power_of_2(), nfst_fftw_2N(), and nfst_init_guru().

void nfst_init_guru nfst_plan ths,
int  d,
int *  N,
int  M_total,
int *  n,
int  m,
unsigned  nfst_flags,
unsigned  fftw_flags
 

Creates a d-dimensional transform plan.

< index over all dimensions

Definition at line 951 of file nfst.c.

References nfst_plan::d, nfst_plan::fftw_flags, nfst_plan::m, nfst_plan::M_total, nfst_plan::N, nfst_plan::n, and nfst_plan::nfst_flags.

Referenced by nfst_init_m().

void nfst_precompute_psi nfst_plan ths  ) 
 

precomputes the values psi if the PRE_PSI is set the application program has to call this routine after setting the nodes this_plan->x

< index over all dimensions

< index over all nodes

< index 0<=lj<u+o+1

< depends on x_j

Definition at line 743 of file nfst.c.

References nfst_plan::d, nfst_plan::M_total, nfst_plan::nfst_flags, nfst_full_psi(), nfst_plan::nfst_full_psi_eps, PRE_FULL_PSI, and nfst_plan::psi.

void nfst_trafo nfst_plan ths  ) 
 

executes a NFST (approximate,fast), computes for $j=0,...,M\_total-1$ $f_j^S(x_j) = \sum_{k \in I_1^{N,d}} \hat{f}_k^S * sin(2 \pi k x_j)$

use ths->my_fftw_r2r_plan

form $ \hat g_k = \frac{\hat f_k}{c_k\left(\phi\right)} \text{ for } k \in I_N $

compute by d-variate discrete Fourier transform $ g_l = \sum_{k \in I_N} \hat g_k {\rm e}^{-2\pi {\rm i} \frac{kl}{n}} \text{ for } l \in I_n $

set $ f_j = \sum_{l \in I_n,m(x_j)} g_l \psi\left(x_j-\frac{l}{n}\right) \text{ for } j=0,\hdots,M-1 $

Definition at line 630 of file nfst.c.

void ndst_trafo nfst_plan ths_plan  ) 
 

executes a NDST (exact,slow), computes for $j=0,...,M\_total-1$ $f_j^S(x_j) = \sum_{k \in I_1^{N,d}} \hat{f}_k^S * sin(2 \pi k x_j)$

  • ths_plan The plan for the transform
Author:
Steffen Klatt

Definition at line 254 of file nfst.c.

void nfst_adjoint nfst_plan ths  ) 
 

executes a transposed NFST (approximate,fast), computes for $k \in I_1^{N,d}$ $h^S(k) = \sum_{j \in I_0^{M\_total,1}} f_j^S * cos(2 \pi k x_j)$

use ths->my_fftw_plan

set $ g_l = \sum_{j=0}^{M-1} f_j \psi\left(x_j-\frac{l}{n}\right) \text{ for } l \in I_n,m(x_j) $

compute by d-variate discrete cosine transform $ \hat g_k = \sum_{l \in I_n} g_l {\rm e}^{-2\pi {\rm i} \frac{kl}{n}} \text{ for } k \in I_N$

form $ \hat f_k = \frac{\hat g_k}{c_k\left(\phi\right)} \text{ for } k \in I_N $

Definition at line 675 of file nfst.c.

References nfst_plan::g, nfst_plan::g1, nfst_plan::g2, nfst_plan::g_hat, and nfst_plan::my_fftw_r2r_plan.

void ndst_adjoint nfst_plan ths_plan  ) 
 

executes a direct transposed NDST (exact,slow), computes for $k \in I_1^{N,d}$ $h^S(k) = \sum_{j \in I_0^{M\_total,1}} f_j^S * cos(2 \pi k x_j)$

  • ths_plan The plan for the transform
Author:
Steffen Klatt

Definition at line 255 of file nfst.c.

References nfst_fftw_2N().

void nfst_finalize nfst_plan ths_plan  ) 
 

Destroys a plan.

  • ths_plan The plan for the transform
Author:
Steffen Klatt

Definition at line 1006 of file nfst.c.

References nfst_plan::c_phi_inv, nfst_plan::d, nfst_plan::f, nfst_plan::f_hat, FFT_OUT_OF_PLACE, FFTW_INIT, nfst_plan::g1, nfst_plan::g2, MALLOC_F, MALLOC_F_HAT, MALLOC_X, nfst_plan::my_fftw_r2r_plan, nfst_plan::N, nfst_plan::n, nfst_plan::nfst_flags, PRE_FULL_PSI, PRE_PHI_HUT, PRE_PSI, nfst_plan::psi, nfst_plan::psi_index_f, nfst_plan::psi_index_g, nfst_plan::sigma, and nfst_plan::x.

void nfst_full_psi nfst_plan ths,
double  eps
 

more memory usage, a bit faster

< index over all dimensions

< index over all nodes

< plain index 0<=l_L<lprod

< multi index 0<=lj<u+o+1

< postfix plain index

< 'bandwidth' of matrix B

< depends on x_j

Definition at line 771 of file nfst.c.

References nfst_plan::d, nfst_plan::M_total, nfst_plan::nfst_flags, PRE_PSI, nfst_plan::psi, nfst_plan::psi_index_f, nfst_plan::psi_index_g, and nfst_plan::size_psi.

Referenced by nfst_precompute_psi().

double nfst_phi_hut nfst_plan ths_plan,
int  k,
int  d
 

do some adjustments (N,n) then compute PHI_HUT

  • ths_plan the plan for the transform
  • k index of c_phi
  • d dimension
Author:
Steffen Klatt

Definition at line 63 of file nfst.c.

double nfst_phi nfst_plan ths_plan,
double  x,
int  d
 

do some adjustments (N,n) then compute PHI

  • ths_plan the plan for the transform
  • x node $x$
  • d dimension
Author:
Steffen Klatt

Definition at line 72 of file nfst.c.

int nfst_fftw_2N int  n  ) 
 

returns 2(n+1), fftw related issue

  • n i.e. length of dst-1
Author:
Steffen Klatt

Definition at line 81 of file nfst.c.

Referenced by ndst_adjoint(), and nfst_init_m().

int nfst_fftw_2N_rev int  n  ) 
 

returns 0.5n-1, fftw related issue

  • n i.e. length of dct-1
Author:
Steffen Klatt

Definition at line 86 of file nfst.c.


Generated on 1 Nov 2006 by Doxygen 1.4.4