Exemple #1
0
        public UInt32[] TxDelayCalcualtor(int channel, int steerAngle)
        {
            UInt32[] TxDelay     = new UInt32[channel];
            Int32[]  TxDelayTemp = new Int32[channel];

            double ts = 1 / fs;
            double d0 = c0 * ts;

            double[] txPosition = new double[channel];

            for (int i = 0; i < channel; i++)
            {
                txPosition[i] = elementPitch * ((double)(i + 1) / 2.0 - 0.5);
            }

            double angle = steerAngle * Math.PI / 180.0;

            for (int i = 0; i < channel; i++)
            {
                double txDistance = txPosition[i] * Math.Sin(angle);
                double Temp       = txDistance / d0;
                TxDelayTemp[i] = MathMethod.ROUND(Temp);
            }

            int minTxDelay = MathMethod.MIN(TxDelayTemp);

            for (int i = 0; i < TxDelay.Count(); i++)
            {
                TxDelay[i] = (uint)(1024 - (TxDelayTemp[i] - minTxDelay));
            }

            return(TxDelay);
        }