Exemplo n.º 1
0
        public virtual void pSetObrFurie(double[] tempArr)
        {
            int N = tempArr.Length;

            mArguments = new double[N];
            mValues    = new double[N];
            for (int i = 0; i < mCount; i++)
            {
                mArguments[i] = i;
            }
            mLeftBorder  = 0;
            mRightBorder = N - 1;
            FourierTransfom fs = new FourierTransfom();

            ComplexNum[]       lFurieResult = fs.mObrTransform(ComplexNum.CompArrOfDoble(tempArr));
            Func <int, double> temp         = (k =>
            {
                return(lFurieResult[k].RePlusIm);
            });

            mFunc = temp;
        }
Exemplo n.º 2
0
        public void mLineSpectr(double[] temparr, int imgW, int imgH)
        {
            Random r       = new Random();
            int    lineInd = r.Next(0, imgH);

            double[] line = temparr.Skip(lineInd * imgW).Take(imgW).ToArray <double>();

            FourierTransfom ft     = new FourierTransfom();
            double          Fgr    = 1.0 / (1 * 2);
            double          Fdelta = 2 * Fgr / line.Length;

            mCount       = (int)(Fgr / Fdelta);
            mDelta       = Fdelta;
            mRightBorder = Fgr;
            mLeftBorder  = 0;
            mValues      = new double[mCount];
            ComplexNum[] res = ft.mTransform(ComplexNum.CompArrOfDoble(line), Fgr, Fdelta);
            mArguments = new double[mCount];
            for (int i = 0; i < mCount; i++)
            {
                mArguments[i] = i * Fdelta;
            }
            mFunc = t => res[t].abs;
        }