Ejemplo n.º 1
0
        public RunningDFT(int size)
        {
            if (size % 2 != 0)
            {
                throw new ArgumentException("Size of a RunningDFT must be even.");
            }
            Size    = size;
            DFTSize = Size / 2 + 1;

            real = new List <float>(DFTSize);
            for (int k = 0; k < DFTSize; ++k)
            {
                real.Add(0);
            }

            realData = new CircularArray <List <float> >(size);
            for (int i = 0; i < Size; ++i)
            {
                realData.Add(new List <float>(DFTSize));
                for (int k = 0; k < DFTSize; ++k)
                {
                    realData.First().Add(0);
                }
            }

            imaginary = new List <float>(DFTSize);
            for (int k = 0; k < DFTSize; ++k)
            {
                imaginary.Add(0);
            }

            imaginaryData = new CircularArray <List <float> >(size);
            for (int i = 0; i < Size; ++i)
            {
                imaginaryData.Add(new List <float>(DFTSize));
                for (int k = 0; k < DFTSize; ++k)
                {
                    imaginaryData.First().Add(0);
                }
            }
            i = -1;
        }