Commit 2370fad2 authored by Tyson Littenberg's avatar Tyson Littenberg

fix to tukey normalization factor

parent e2213814
......@@ -1792,13 +1792,15 @@ static void tukey_scale(double *s1, double *s2, double alpha, int N)
imin = (int)(alpha*(double)(N-1)/2.0);
imax = (int)((double)(N-1)*(1.0-alpha/2.0));
int Nwin = N-imax;
x1 = 0.0;
x2 = 0.0;
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))));
x1 += filter;
x2 += filter*filter;
}
......
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