#include #include #include "nr.h" using namespace std; namespace { inline DP window(const int j, const DP a, const DP b) { return 1.0-fabs((j-a)*b); // Bartlett // return 1.0; // Square // return 1.0-SQR((j-a)*b); // Welch } } void NR::spctrm(ifstream &fp, Vec_O_DP &p, const int k, const bool ovrlap) { int mm,m4,kk,joffn,joff,j2,j; DP w,facp,facm,sumw=0.0,den=0.0; int m=p.size(); mm=m << 1; m4=mm << 1; Vec_DP w1(m4),w2(m); facm=m; facp=1.0/m; for (j=0;j> w2[j]; for (kk=0;kk> w2[j]; joffn=joff+mm-1; for (j=0;j> w1[j]; } } for (j=0;j