next up previous
Next: NFFT - Parameter Up: NFFT - General procedure Previous: Finalisation

Example

Thus, the following code computes a univariate nfft with 12 Fourier coefficients and 19 knots.
void simple_test_nfft_1d()
{
  int j,k;
  nfft_plan my_plan;

  nfft_init_1d(&my_plan,12,19);
  
  for(j=0;j<my_plan.M;j++)
    my_plan.x[j]=((double)rand())/RAND_MAX-0.5;

  if(my_plan.nfft_flags & PRE_PSI)
    nfft_precompute_psi(&my_plan);

  for(k=0;k<my_plan.N_L;k++)
    {
      my_plan.f_hat[k][0]=((double)rand())/RAND_MAX;
      my_plan.f_hat[k][1]=((double)rand())/RAND_MAX;
    }
  
  nfft_trafo(&my_plan);

  nfft_finalize(&my_plan);
}



Stefan Kunis 2004-09-03