#include "PmeKSpace.h"#include <math.h>#include <stdlib.h>Go to the source code of this file.
Functions | |
| void | dftmod (double *bsp_mod, double *bsp_arr, int nfft) |
| void | compute_b_moduli (double *bm, int K, int order) |
|
||||||||||||||||
|
Definition at line 31 of file PmeKSpace.C. References compute_b_spline(), dftmod(), and order. Referenced by PmeKSpace::PmeKSpace(). 00031 {
00032 int i;
00033 double fr[3];
00034
00035 double *M = new double[3*order];
00036 double *dM = new double[3*order];
00037 double *scratch = new double[K];
00038
00039 fr[0]=fr[1]=fr[2]=0.0;
00040 compute_b_spline(fr,M,dM,order);
00041 for (i=0; i<order; i++) bm[i] = M[i];
00042 for (i=order; i<K; i++) bm[i] = 0.0;
00043 dftmod(scratch, bm, K);
00044 for (i=0; i<K; i++) bm[i] = 1.0/scratch[i];
00045
00046 delete [] scratch;
00047 delete [] dM;
00048 delete [] M;
00049 }
|
|
||||||||||||||||
|
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved. Definition at line 11 of file PmeKSpace.C. Referenced by compute_b_moduli(). 00011 {
00012 int j, k;
00013 double twopi, arg, sum1, sum2;
00014 double infft = 1.0/nfft;
00015 /* Computes the modulus of the discrete fourier transform of bsp_arr, */
00016 /* storing it into bsp_mod */
00017 twopi = 2.0 * M_PI;
00018
00019 for (k = 0; k <nfft; ++k) {
00020 sum1 = 0.;
00021 sum2 = 0.;
00022 for (j = 0; j < nfft; ++j) {
00023 arg = twopi * k * j * infft;
00024 sum1 += bsp_arr[j] * cos(arg);
00025 sum2 += bsp_arr[j] * sin(arg);
00026 }
00027 bsp_mod[k] = sum1*sum1 + sum2*sum2;
00028 }
00029 }
|
1.3.9.1