Exemplo n.º 1
0
 /// <summary>
 /// 三峰绕射损耗
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <returns></returns>
 public override float TriplePeakLoss(MultiPeakCalcParam calcuParam)
 {
     float firstToThirdPeakDistance = calcuParam.DisThirdPeakToTx - calcuParam.DisFirstPeakToTx;
     float secondToThirdPeakDistance = calcuParam.DisThirdPeakToTx - calcuParam.DisSecondPeakToTx;
     MultiPeakCalcParam param = new MultiPeakCalcParam();
     param.TxAbs = calcuParam.TxAbs;
     param.FirstPeakAbs = calcuParam.FirstPeakAbs;
     param.SecondPeakAbs = calcuParam.SecondPeakAbs;
     param.RxAbs = calcuParam.ThirdPeakAbs;
     param.DisFirstPeakToTx = calcuParam.DisFirstPeakToTx;
     param.DisFirstPeakToRx = firstToThirdPeakDistance;
     param.DisSecondPeakToTx = calcuParam.DisSecondPeakToTx;
     param.DisSecondPeakToRx = secondToThirdPeakDistance;
     param.WaveLen = calcuParam.WaveLen;
     float doublePeakLoss = this.DoublePeakLoss(param);
     float thirdPeakHeight = calcuParam.ThirdPeakAbs + 
         (((calcuParam.SecondPeakAbs - calcuParam.ThirdPeakAbs) * calcuParam.DisThirdPeakToTx) / secondToThirdPeakDistance);
     MultiPeakCalcParam param2 = new MultiPeakCalcParam();
     param2.TxAbs = thirdPeakHeight;
     param2.FirstPeakAbs = calcuParam.ThirdPeakAbs;
     param2.RxAbs = calcuParam.RxAbs;
     param2.DisFirstPeakToTx = calcuParam.DisThirdPeakToTx;
     param2.DisFirstPeakToRx = calcuParam.DisThirdPeakToRx;
     param2.WaveLen = calcuParam.WaveLen;
     return (doublePeakLoss + this.SinglePeakLoss(param2));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 三峰损耗计算
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <returns></returns>
 public override float TriplePeakLoss(MultiPeakCalcParam calcuPara)
 {
     float num = calcuPara.DisSecondPeakToTx - calcuPara.DisFirstPeakToTx;
     float num2 = calcuPara.DisThirdPeakToTx - calcuPara.DisSecondPeakToTx;
     float num3 = 0f;
     MultiPeakCalcParam para = new MultiPeakCalcParam();
     para.TxAbs = calcuPara.TxAbs;
     para.FirstPeakAbs = calcuPara.FirstPeakAbs;
     para.RxAbs = calcuPara.SecondPeakAbs;
     para.DisFirstPeakToTx = calcuPara.DisFirstPeakToTx;
     para.DisFirstPeakToRx = num;
     para.WaveLen = calcuPara.WaveLen;
     num3 = this.SinglePeakLoss(para);
     MultiPeakCalcParam para2 = new MultiPeakCalcParam();
     para2.TxAbs = calcuPara.FirstPeakAbs;
     para2.FirstPeakAbs = calcuPara.SecondPeakAbs;
     para2.RxAbs = calcuPara.ThirdPeakAbs;
     para2.DisFirstPeakToTx = num;
     para2.DisFirstPeakToRx = num2;
     para2.WaveLen = calcuPara.WaveLen;
     num3 += this.SinglePeakLoss(para2);
     MultiPeakCalcParam para3 = new MultiPeakCalcParam();
     para3.TxAbs = calcuPara.SecondPeakAbs;
     para3.FirstPeakAbs = calcuPara.ThirdPeakAbs;
     para3.RxAbs = calcuPara.RxAbs;
     para3.DisFirstPeakToTx = num2;
     para3.DisFirstPeakToRx = calcuPara.DisThirdPeakToRx;
     para3.WaveLen = calcuPara.WaveLen;
     return (num3 + this.SinglePeakLoss(para3));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 单峰绕射损耗计算
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <returns></returns>
 public virtual float SinglePeakLoss(MultiPeakCalcParam calcuPara)
 {
     //发射点到第一个山峰的水平距离+第一个山峰到接收点的水平距离=发射点到接收点的水平距离
     float txToRxLevelDis = calcuPara.DisFirstPeakToTx + calcuPara.DisFirstPeakToRx;
     //这个算是一个发射点到接收点的角度的tan值
     float angleInTan = (calcuPara.RxAbs - calcuPara.TxAbs) / txToRxLevelDis;
     //山峰高于收发天线连线顶点连线的高度
     float fHyper = calcuPara.FirstPeakAbs - (calcuPara.TxAbs + (angleInTan * calcuPara.DisFirstPeakToTx));
     //发射点到接收点的直线距离
     double txToRxDis = Math.Sqrt((double) (((calcuPara.TxAbs - calcuPara.RxAbs) * (calcuPara.TxAbs - calcuPara.RxAbs)) + (txToRxLevelDis * txToRxLevelDis)));
     //意义为:发射点为T,接收点为R,第一个山顶为P,链接发射点到接收点的直线与第一个山顶的交点为Q,这段距离即为线段TQ。
     float txToQDis = (((float) txToRxDis) * calcuPara.DisFirstPeakToTx) / txToRxLevelDis;
     
     float qToRxDis = ((float) txToRxDis) - txToQDis;
     return this.EdgeDiff(calcuPara.WaveLen, fHyper, txToQDis, qToRxDis);
 }
Exemplo n.º 4
0
 public AtlasDoublePeakLossFixture()
 {
     MPCP = new MultiPeakCalcParam();
     ADL = new AtlasDiffractionLoss();
     MPCP.DisFirstPeakToRx = 200f;
     MPCP.DisFirstPeakToTx = 200f;
     MPCP.DisSecondPeakToRx = 10f;
     MPCP.DisSecondPeakToTx = 400f;
     MPCP.DisThirdPeakToRx = 200f;
     MPCP.DisThirdPeakToTx = 600f;
     MPCP.FirstPeakAbs = 200f;
     MPCP.RxAbs = 100f;
     MPCP.SecondPeakAbs = 100f;
     MPCP.ThirdPeakAbs = 150f;
     MPCP.TxAbs = 50f;
     // MPCP.TxToRxLineLen = 10000f;
     MPCP.WaveLen = 0.2f;
 }
Exemplo n.º 5
0
 public LSGTest()
 {
     MPCP = new MultiPeakCalcParam();
     ADL = new AtlasDiffractionLoss();
     BDL = new BullingtonDiffractionLoss();
     MPCP.DisFirstPeakToRx = 200f;
     MPCP.DisFirstPeakToTx = 200f;
     MPCP.DisSecondPeakToRx = 10f;
     MPCP.DisSecondPeakToTx = 400f;
     MPCP.DisThirdPeakToRx = 200f;
     MPCP.DisThirdPeakToTx = 600f;
     MPCP.FirstPeakAbs = 200f;
     MPCP.RxAbs = 100f;
     MPCP.SecondPeakAbs = 100f;
     MPCP.ThirdPeakAbs = 150f;
     MPCP.TxAbs = 50f;
     // MPCP.TxToRxLineLen = 10000f;
     MPCP.WaveLen = 0.2f;
 }
Exemplo n.º 6
0
 /// <summary>
 /// 双峰绕射损耗
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <returns></returns>
 public override float DoublePeakLoss(MultiPeakCalcParam calcPara)
 {
     float firstToSecondPeakDistance = calcPara.DisSecondPeakToTx - calcPara.DisFirstPeakToTx;
     MultiPeakCalcParam param = new MultiPeakCalcParam();
     param.TxAbs = calcPara.TxAbs;
     param.FirstPeakAbs = calcPara.FirstPeakAbs;
     param.RxAbs = calcPara.SecondPeakAbs;
     param.DisFirstPeakToTx = calcPara.DisFirstPeakToTx;
     param.DisFirstPeakToRx = firstToSecondPeakDistance;
     param.WaveLen = calcPara.WaveLen;//?
     float siglePeakLoss = this.SinglePeakLoss(param);
     float secondPeakHeight = calcPara.SecondPeakAbs + (((calcPara.FirstPeakAbs - calcPara.SecondPeakAbs) * calcPara.DisSecondPeakToTx) / firstToSecondPeakDistance);
     MultiPeakCalcParam param2 = new MultiPeakCalcParam();
     param2.TxAbs = secondPeakHeight;
     param2.FirstPeakAbs = calcPara.SecondPeakAbs;
     param2.RxAbs = calcPara.RxAbs;
     param2.DisFirstPeakToTx = calcPara.DisSecondPeakToTx;
     param2.DisFirstPeakToRx = calcPara.DisSecondPeakToRx;
     param2.WaveLen = calcPara.WaveLen;
     return (siglePeakLoss + this.SinglePeakLoss(param2));
 }
Exemplo n.º 7
0
 public abstract float TriplePeakLoss(MultiPeakCalcParam calcuPara);
Exemplo n.º 8
0
 public float GetTripleEdgeLoss(MultiPeakCalcParam calcuPara)
 {
     return this.JudgeFres(calcuPara, 3);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 计算三峰损耗
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <param name="altitudes"></param>
 /// <param name="peaks"></param>
 /// <param name="TxToRxLen"></param>
 /// <returns></returns>
 private short CalculateThreePeak(MultiPeakCalcParam calcuPara, short[] altitudes, int[] peaks, float TxToRxLen)
 {
     calcuPara.FirstPeakAbs = altitudes[peaks[0]];
     calcuPara.SecondPeakAbs = altitudes[peaks[1]];
     calcuPara.DisSecondPeakToTx = this.m_DifLossCalcPara.CalcResolution * peaks[1];
     calcuPara.DisSecondPeakToRx = TxToRxLen - calcuPara.DisSecondPeakToTx;
     calcuPara.ThirdPeakAbs = altitudes[peaks[2]];
     calcuPara.DisThirdPeakToTx = this.m_DifLossCalcPara.CalcResolution * peaks[2];
     calcuPara.DisThirdPeakToRx = TxToRxLen - calcuPara.DisThirdPeakToTx;
     return (short)this.GetTripleEdgeLoss(calcuPara);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 根据绕射点的个数 计算单峰、双峰、三峰损耗值
 /// ps:这代码就是个垃圾……by cc
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <param name="InFresPeakNum"></param>
 /// <returns></returns>
 private float JudgeFres(MultiPeakCalcParam calcuPara, int InFresPeakNum)
 {
     float loss = 0f;
     if (InFresPeakNum == 0)
     {
         return 0f;
     }
     if (InFresPeakNum == 1)
     {
         loss = this.m_CalcDifLossMethod.SinglePeakLoss(calcuPara);
     }
     if (InFresPeakNum == 2)
     {
         loss = this.m_CalcDifLossMethod.DoublePeakLoss(calcuPara);
     }
     if (InFresPeakNum == 3)
     {
         loss = this.m_CalcDifLossMethod.TriplePeakLoss(calcuPara);
     }
     return loss;
 }
Exemplo n.º 11
0
 /// <summary>
 /// 计算单峰损耗
 /// </summary>
 /// <param name="calcuPara"></param>
 /// <returns></returns>
 public float GetEdgeLoss(MultiPeakCalcParam calcuPara)
 {
     return this.m_CalcDifLossMethod.SinglePeakLoss(calcuPara);
 }
Exemplo n.º 12
0
 /// <summary>
 /// 计算绕射损耗
 /// </summary>
 /// <param name="altitudes"></param>
 /// <param name="peaks"></param>
 /// <param name="txAbs"></param>
 /// <param name="rxAbs"></param>
 /// <param name="TxToRxLen"></param>
 /// <param name="TxToRxLineLen"></param>
 /// <returns></returns>
 private short EdgeLossSelect(short[] altitudes, int[] peaks, float txAbs, float rxAbs, float TxToRxLen, float TxToRxLineLen)
 {
     MultiPeakCalcParam calcuParam = new MultiPeakCalcParam();
     short edgeLoss = 0;
     calcuParam.WaveLen = 300f / this.m_DifLossCalcPara.Frequency;
     calcuParam.TxToRxLineLen = TxToRxLineLen;
     calcuParam.TxAbs = txAbs;
     calcuParam.RxAbs = rxAbs;
     if (peaks.Length != 0)
     {
         calcuParam.DisFirstPeakToTx = peaks[0] * this.m_DifLossCalcPara.CalcResolution;
         calcuParam.DisFirstPeakToRx = TxToRxLen - calcuParam.DisFirstPeakToTx;
     }
     if (peaks.Length == 0)
     {
         edgeLoss = 0;
     }
     else if (peaks.Length == 1)
     {
         calcuParam.FirstPeakAbs = altitudes[peaks[0]];
         edgeLoss = (short)this.GetEdgeLoss(calcuParam);
     }
     else if (peaks.Length == 2)
     {
         edgeLoss = this.CalculateTwoPeak(calcuParam, altitudes, peaks, TxToRxLen);
     }
     else
     {
         edgeLoss = this.CalculateThreePeak(calcuParam, altitudes, peaks, TxToRxLen);
     }
     if (edgeLoss < 0)
     {
         edgeLoss = 0;
     }
     return edgeLoss;
 }