コード例 #1
0
        /// <summary>
        /// Backward Weyl-Heisenberg transform.
        /// </summary>
        /// <param name="B">Array</param>
        /// <returns>Array</returns>
        public Complex32[] Backward(Complex32[] B)
        {
            int N = B.Length;

            Complex32[,] U = WeylHeisenbergTransform.Matrix(this.window, N, this.m, true);
            Complex32[] A = Matrice.Dot(B, U);
            return(A);
        }
コード例 #2
0
        /// <summary>
        /// Forward Weyl-Heisenberg transform.
        /// </summary>
        /// <param name="A">Array</param>
        /// <returns>Array</returns>
        public Complex32[] Forward(Complex32[] A)
        {
            int N = A.Length;

            Complex32[,] U = WeylHeisenbergTransform.Matrix(this.window, N, this.m, true);
            Complex32[] B = Matrice.Dot(A, U.Hermitian());
            return(B);
        }
コード例 #3
0
        /// <summary>
        /// Returns the complex Weyl-Heisenberg basis matrix.
        /// <remarks>
        /// Matrix dimension[N, N], where N = M * L.
        /// </remarks>
        /// </summary>
        /// <param name="g0">Function</param>
        /// <param name="M">Number of frequency shifts</param>
        /// <param name="orthogonalize">Orthogonalized matrix or not</param>
        /// <returns>Matrix</returns>
        public static Complex32[,] Matrix(float[] g0, int M, bool orthogonalize = true)
        {
            if (orthogonalize)
            {
                ZakTransform zakTransform = new ZakTransform(M);

                return(WeylHeisenbergTransform.Matrix(zakTransform.Forward(g0), M));
            }

            return(WeylHeisenbergTransform.Matrix(g0, M));
        }
コード例 #4
0
        /// <summary>
        /// Backward Weyl-Heisenberg transform.
        /// </summary>
        /// <param name="B">Matrix</param>
        /// <returns>Matrix</returns>
        public Complex32[,] Backward(Complex32[,] B)
        {
            int N = B.GetLength(0), M = B.GetLength(1);

            Complex32[,] U = WeylHeisenbergTransform.Matrix(this.window, N, this.m, true);
            Complex32[,] V = WeylHeisenbergTransform.Matrix(this.window, M, this.m, true);
            Complex32[,] A;

            if (direction == Direction.Both)
            {
                A = U.Dot(B).Dot(V.Hermitian());
            }
            else if (direction == Direction.Vertical)
            {
                A = U.Dot(B);
            }
            else
            {
                A = B.Dot(V.Hermitian());
            }
            return(A);
        }
コード例 #5
0
        /// <summary>
        /// Forward Weyl-Heisenberg transform.
        /// </summary>
        /// <param name="A">Matrix</param>
        /// <returns>Matrix</returns>
        public Complex32[,] Forward(Complex32[,] A)
        {
            int N = A.GetLength(0), M = A.GetLength(1);

            Complex32[,] U = WeylHeisenbergTransform.Matrix(this.window, N, this.m, true);
            Complex32[,] V = WeylHeisenbergTransform.Matrix(this.window, M, this.m, true);
            Complex32[,] B;

            if (direction == Direction.Both)
            {
                B = U.Hermitian().Dot(A).Dot(V);
            }
            else if (direction == Direction.Vertical)
            {
                B = U.Hermitian().Dot(A);
            }
            else
            {
                B = A.Dot(V);
            }
            return(B);
        }
コード例 #6
0
 /// <summary>
 /// Returns the complex Weyl-Heisenberg basis matrix.
 /// <remarks>
 /// Matrix dimension[N, N], where N = M * L.
 /// </remarks>
 /// </summary>
 /// <param name="window">Windows function</param>
 /// <param name="N">Number of samples</param>
 /// <param name="M">Number of frequency shifts</param>
 /// <param name="orthogonalize">Orthogonalized matrix or not</param>
 /// <returns>Matrix</returns>
 public static Complex32[,] Matrix(IWindow window, int N, int M, bool orthogonalize = true)
 {
     return(WeylHeisenbergTransform.Matrix(WeylHeisenbergTransform.GetPacket(window, N), M, orthogonalize));
 }