예제 #1
0
파일: Kaiser.cs 프로젝트: asiryan/UMapx
        /// <summary>
        /// Returns the value of a window function.
        /// </summary>
        /// <param name="x">Argument</param>
        /// <param name="frameSize">Window size</param>
        /// <returns>float precision floating point number</returns>
        public override float Function(float x, int frameSize)
        {
            // Kaiser window:
            float u = 2 * x / (frameSize - 1);
            float r = 1 - u * u;
            float v = r >= 0 ? (float)Math.Sqrt(1 - u * u) : 0;
            float z = Maths.Pi * this.a;
            float q = Special.I(z * v, 0);

            return(q / Special.I(z, 0));
        }