コード例 #1
0
        private void UpdateMeterView(FrequencyBins detailedBin)
        {
            _updateMeterStep++;
            _updateMeterStep %= _model.Settings.MeterUpdateSpeed; //5;
            if (_updateMeterStep != 0)
            {
                return;
            }

            MeterView.PeakFrequencyValue  = (detailedBin.MaxIntensityAt() / 1000000);
            MeterView.FrequencyErrorValue = (detailedBin.MaxIntensityAt() - FrequencyValue) / 1000000;
            MeterView.PowerDbmValue       = _model.Radio.Demodulator().SignalStrength();
            MeterView.PowerUVoltsValue    = RfMath.DbmToMicroVolts(_model.Radio.Demodulator().SignalStrength());
            MeterView.PowerWattsValue     = RfMath.DbmToMicroWatts(_model.Radio.Demodulator().SignalStrength());
            MeterView.SMeterValue         = RfMath.DbmToSUnit(_model.Radio.Demodulator().SignalStrength());
        }
コード例 #2
0
        private void UpdateMeterView(FastFrequencyBins detailedBin)
        {
            _updateMeterStep++;
            _updateMeterStep %= _model.Settings.MeterUpdateSpeed; //5;
            if (_updateMeterStep != 0)
            {
                return;
            }

            Signal = _model.Ddc2[_channel].Signal;

            PeakFrequency = detailedBin.FrequencyAt(detailedBin.MaxIntensityAt()) / 1000000.0;
            PeakPower     = detailedBin.MaxIntensity();

            FrequencyErrorValue = detailedBin.MaxIntensityAt() / 1000000;
            PowerDbmValue       = PeakDbm;
            PowerUVoltsValue    = RfMath.DbmToMicroVolts(PeakDbm);
            PowerWattsValue     = RfMath.DbmToMicroWatts(PeakDbm);
            SMeterValue         = RfMath.DbmToSUnit(PeakDbm);
        }
コード例 #3
0
        private void FftAnalyzer_FftCalculated(object sender, FftEventArgs e)
        {
            FrequencyBins bin;

            spectrumAnalyzer.Clear();
            if (!_model.VideoFilter)
            {
                bin = new FrequencyBins(e, _model.Radio.BinParametersDefault());
            }
            else
            {
                bin = new FrequencyBins(e,
                                        _model.Radio.BinParametersVideoFilter(_model.FftAnalyzer.FftLength, _model.VideoPoints));
            }
            Debug.Print("peak at:{0}: {1}", bin.MaxIntensityAt(), bin.MaxIntensity());

            spectrumAnalyzer.Update(bin);

            TaskUtility.Run(() =>
            {
                Invoke(new Action(() =>
                {
                    try
                    {
                        labelPeakFrequency.Text   = (bin.MaxIntensityAt() / 1000000).ToString();
                        labelFrequenccyError.Text =
                            ((bin.MaxIntensityAt() - (double)numericUpDownFrequency.Value) / 1000000).ToString();
                        labelPowerDbm.Text   = _model.Radio.Demodulator().SignalStrength().ToString();
                        labelPowerUVolt.Text =
                            RfMath.DbmToMicroVolts(_model.Radio.Demodulator().SignalStrength()).ToString();
                    }
                    catch
                    {
                    }
                }));
            });
        }