Esempio n. 1
0
        /// <summary>
        ///  WFG3 t2 transformation
        /// </summary>
        /// <param name="z"></param>
        /// <param name="k"></param>
        /// <returns></returns>
        public float[] T2(float[] z, int k)
        {
            float[] result = new float[z.Length];

            Array.Copy(z, 0, result, 0, k);

            int l = z.Length - k;

            for (int i = k + 1; i <= k + l / 2; i++)
            {
                int     head = k + 2 * (i - k) - 1;
                int     tail = k + 2 * (i - k);
                float[] subZ = SubVector(z, head - 1, tail - 1);

                result[i - 1] = Transformations.R_nonsep(subZ, 2);
            }
            return(result);
        }
        /// <summary>
        /// WFG9 t3 transformation
        /// </summary>
        /// <param name="z"></param>
        /// <param name="k"></param>
        /// <param name="M"></param>
        /// <returns></returns>
        public float[] T3(float[] z, int k, int M)
        {
            float[] result = new float[M];

            for (int i = 1; i <= M - 1; i++)
            {
                int     head = (i - 1) * k / (M - 1) + 1;
                int     tail = i * k / (M - 1);
                float[] subZ = SubVector(z, head - 1, tail - 1);
                result[i - 1] = Transformations.R_nonsep(subZ, k / (M - 1));
            }

            int h = k + 1;
            int t = z.Length;
            int l = z.Length - k;

            float[] sZ = SubVector(z, h - 1, t - 1);
            result[M - 1] = Transformations.R_nonsep(sZ, l);

            return(result);
        }