Example #1
0
        /// <summary>
        /// 根据精度测量噪低
        /// </summary>
        /// <param name="accuracy"></param>
        /// <returns></returns>
        public double MeasureNoiseFloor(double accuracy)
        {
            accuracy = Math.Max(accuracy, 0.01);
            accuracy = Math.Min(accuracy, 10);
            double num       = Math.Pow(10, 0.1 * accuracy);
            double num1      = 1 / (num - 1);
            double num2      = num1 * num1;
            int    num3      = Math.Max(65, (int)(num2 / 10));
            double num4      = 100;
            double num5      = 1 / (6.28318530717959 * num4);
            double sweepTime = this.SweepTime;
            double num6      = 3 * num5 * (double)num3;

            this.RBW             = 1000;
            this.VBW             = num4;
            this.SweepPoints     = num3;
            this.SweepTime       = num6;
            this.Marker1Function = SpectrumAnalyzer.MarkerFunctionType.BandIntervalPower;
            if (SpectrumAnalyzer.IsPSA(this.Model) || SpectrumAnalyzer.IsESA(this.Model))
            {
                this.Marker1Mode = SpectrumAnalyzer.MarkerModeType.Span;
            }
            else
            {
                this.Sweep();
            }
            this.MarkerPositionPoints = (double)((num3 - 1) / 2);
            this.MarkerSpanPoints     = (double)(num3 - 4);
            this.Sweep();
            this.SweepTime = sweepTime;
            return(this.Marker1Value - 30);
        }
Example #2
0
        public static SpectrumAnalyzer CreateDetectedSpectrumAnalyzer(string address)
        {
            SpectrumAnalyzer scpiSpectrumAnalyzer;

            try
            {
                string str = ScpiInstrument.DetermineModel(address);
                if (SpectrumAnalyzer.IsMXA(str) || SpectrumAnalyzer.IsEXA(str) || SpectrumAnalyzer.IsPXA(str))
                {
                    scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzer(address);
                }
                else if (SpectrumAnalyzer.IsFSW(str))
                {
                    scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerFSW(address);
                }
                else if (SpectrumAnalyzer.IsESA(str) || SpectrumAnalyzer.IsPSA(str) || SpectrumAnalyzer.IsE4446A(str))
                {
                    scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerE4446A(address);
                }
                else if (SpectrumAnalyzer.IsAV4003(str))
                {
                    scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerAV4033(address);
                }
                else
                {
                    throw new Exception(string.Concat(str, " 不支持对应型号的频谱仪"));
                }
            }
            catch (Exception exception)
            {
                throw new Exception(string.Concat("连接频谱仪错误: ", exception.Message));
            }
            return(scpiSpectrumAnalyzer);
        }
Example #3
0
 public virtual bool IsPSA()
 {
     return(SpectrumAnalyzer.IsPSA(this.Model));
 }