Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

static double Impala::Core::Array::ComputeStDev ( int  nn,
complex *  pp,
double  q 
) [inline, static]

Definition at line 59 of file MakeGaussIIR1d.h.

Referenced by MakeGaussIIR1d().

00060 {
00061     double    var, re, im;
00062     double    modulus, phase;
00063     int        mm;
00064 
00065    /*
00066     * Compute the variance
00067     */
00068    var = 0.0;
00069    for (mm = 1; mm <= (nn - (nn % 2)); mm += 2)
00070    {
00071             modulus = sqrt(pp[mm].re * pp[mm].re + pp[mm].im * pp[mm].im);
00072             phase   = atan(pp[mm].im / pp[mm].re);
00073                 modulus = exp( log( modulus ) / q );
00074                 phase   = phase / q;
00075             re = modulus * cos(phase);
00076             im = modulus * sin(phase);
00077 
00078       var += ((4 * (re + (re - 2) * (re*re + im*im))) /
00079                 pow(1 - 2*re + re*re + im*im, 2.0));
00080    }
00081    if ( (nn % 2) == 1 )
00082    {
00083             modulus = sqrt(pp[mm].re * pp[mm].re + pp[mm].im * pp[mm].im);
00084             phase   = atan(pp[mm].im / pp[mm].re);
00085                 modulus = exp( log( modulus ) / q );
00086                 phase   = phase / q;
00087             re = modulus * cos(phase);
00088             im = modulus * sin(phase);
00089       var += (2 * re) / pow(re - 1, 2.0);
00090    }
00091 
00092    return( (double) sqrt( var ) );
00093 }


Generated on Fri Mar 19 10:57:39 2010 for ImpalaSrc by  doxygen 1.5.1