CrossCorrelation() public static method

public static CrossCorrelation ( MatrixValue M, MatrixValue N, int n ) : MatrixValue
M MatrixValue
N MatrixValue
n int
return MatrixValue
Exemplo n.º 1
0
        public MatrixValue Function(MatrixValue M, ScalarValue nLag)
        {
            if (M.Length <= 1)
            {
                return(new MatrixValue());
            }

            var nOffset = nLag.GetIntegerOrThrowException("nLag", Name);

            if (nOffset < 0)
            {
                nOffset = 0;
            }
            else if (nOffset >= M.Length)
            {
                nOffset = M.Length - 1;
            }

            return(YMath.CrossCorrelation(M, M, nOffset));
        }
Exemplo n.º 2
0
        public MatrixValue Function(MatrixValue M, MatrixValue N, ScalarValue lag)
        {
            if (M.Length != N.Length || M.Length <= 1)
            {
                return(new MatrixValue());
            }

            int nOffset = lag.GetIntegerOrThrowException("lag", Name);

            if (nOffset < 0)
            {
                nOffset = 0;
            }
            else if (nOffset >= M.Length)
            {
                nOffset = M.Length - 1;
            }

            return(YMath.CrossCorrelation(M, N, nOffset));
        }
Exemplo n.º 3
0
 public MatrixValue Function(MatrixValue M)
 {
     if (M.Length <= 1)
     {
         return(new MatrixValue());
     }
     else
     {
         int nOffset = (int)(10 * Math.Log10(M.Length));
         if (nOffset < 0)
         {
             nOffset = 0;
         }
         else if (nOffset >= M.Length)
         {
             nOffset = M.Length - 1;
         }
         return(YMath.CrossCorrelation(M, M, nOffset));
     }
 }
        public MatrixValue Function(MatrixValue M, MatrixValue N)
        {
            if (M.Length == N.Length && M.Length > 1)
            {
                var nOffset = (Int32)(10 * Math.Log10(M.Length));

                if (nOffset < 0)
                {
                    nOffset = 0;
                }
                else if (nOffset >= M.Length)
                {
                    nOffset = M.Length - 1;
                }

                return(YMath.CrossCorrelation(M, N, nOffset));
            }

            return(new MatrixValue());
        }