コード例 #1
0
        public void mLineAutoSpectr(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>();
            double[] dLineDt = new double[imgW];
            for (int i = 0; i < imgW - 2; i++)
            {
                dLineDt[i] = line[i] - line[i + 1];
            }
            ComplexNum[] lineAutocor = new ComplexNum[imgW];
            for (int i = 0; i < imgW; i++)
            {
                lineAutocor[i] = new ComplexNum(Statistics.Crosscorrelation(dLineDt, dLineDt, i));
            }

            FourierTransfom ft     = new FourierTransfom();
            double          Fgr    = 1.0 / 1;
            double          Fdelta = Fgr / lineAutocor.Length;

            ComplexNum[] res = ft.mTransform(lineAutocor);
            for (int i = 0; i < mCount; i++)
            {
                mArguments[i] = i * Fdelta;
            }
            mFunc = t => res[t].abs;
        }
コード例 #2
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;
        }
コード例 #3
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;
        }