Ejemplo n.º 1
0
        public static List <Complex> Transform(List <double> points)
        {
            List <Complex> transformed = new List <Complex>();
            List <double>  xh          = SignalFiltering.CalculateConvolution(points, H).Take(points.Count).ToList();
            List <double>  xg          = SignalFiltering.CalculateConvolution(points, G).Take(points.Count).ToList();
            List <double>  xhHalf      = new List <double>();
            List <double>  xgHalf      = new List <double>();

            for (int i = 0; i < xh.Count; i++)
            {
                if (i % 2 == 0)
                {
                    xhHalf.Add(xh[i]);
                }
                else
                {
                    xgHalf.Add(xg[i]);
                }
            }
            for (int i = 0; i < xgHalf.Count; i++)
            {
                transformed.Add(new Complex(xhHalf[i], xgHalf[i]));
            }
            return(transformed);
        }
Ejemplo n.º 2
0
        public static List <double> ReverseTransform(List <Complex> points)
        {
            List <double> xh = new List <double>();
            List <double> xg = new List <double>();

            for (int i = 0; i < points.Count; i++)
            {
                xh.Add(points[i].Real);
                xh.Add(0);
                xg.Add(0);

                xg.Add(points[i].Imaginary);
            }
            List <double> xhC = SignalFiltering.CalculateConvolution(xh, HO).Take(xh.Count).ToList();
            List <double> xgC = SignalFiltering.CalculateConvolution(xg, GO).Take(xg.Count).ToList();

            return(SignalOperations.AddSignals(xhC, xgC));
        }