Commit e2213814 authored by Tyson Littenberg's avatar Tyson Littenberg

fix to tukey window indexing

parent 7f5444f2
......@@ -1771,11 +1771,13 @@ static void tukey(double *data, double alpha, int N)
imin = (int)(alpha*(double)(N-1)/2.0);
imax = (int)((double)(N-1)*(1.0-alpha/2.0));
for(i=0; i< N; i++)
int Nwin = N-imax;
for(i=0; i< N; i++)
{
filter = 1.0;
if(i < imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-2.0/alpha+1.0 )));
if(i<imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i-imax)/(double)(Nwin))));
data[i] *= filter;
}
......@@ -2432,12 +2434,6 @@ void blstart(double *data, double *residual, int N, double dt, double fmin, int
// Tukey window parameter. Flat for (1-alpha) of data
//TODO: NEED TO MAKE THIS A PARAMETER WE CAN CONTROL AT THE COMMAND LINE
t_rise = 0.4; // Standard LAL setting
/*
t_rise increased because 0.4 was found to be insufficient.
Perhaps there is an additional data conditioning step in
LALInferenceReadData?
*/
//t_rise = 1.0;
alpha = (2.0*t_rise/Tobs);
df = 1.0/Tobs; // frequency resolution
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment