コード例 #1
0
        public static FrequencyBandType GetBandFromFcn(this int fcn)
        {
            FrequencyBandDef def = frequencyBands.FirstOrDefault(
                x => fcn >= x.FcnStart && fcn <= x.FcnEnd);

            return((def != null) ? def.FrequencyBandType : FrequencyBandType.Undefined);
        }
コード例 #2
0
        public static FrequencyBandType GetBandFromFrequency(this double frequency)
        {
            FrequencyBandDef def = frequencyBands.FirstOrDefault(
                x => frequency >= x.FrequencyStart && frequency <= x.FrequencyEnd);

            return((def != null) ? def.FrequencyBandType : FrequencyBandType.Undefined);
        }
コード例 #3
0
        public static double GetFrequency(this int fcn)
        {
            FrequencyBandDef def = frequencyBands.FirstOrDefault(
                x => x.FrequencyBandType == fcn.GetBandFromFcn());

            return((def != null) ?
                   def.FrequencyStart + 0.1 * (fcn - def.FcnStart) :
                   double.MinValue);
        }
コード例 #4
0
        public static int GetEarfcn(this double frequency)
        {
            FrequencyBandDef def = frequencyBands.FirstOrDefault(
                x => x.FrequencyBandType == frequency.GetBandFromFrequency());

            return((def != null) ?
                   (int)(def.FcnStart + 10 * (frequency - def.FrequencyStart)) :
                   int.MinValue);
        }