private void Execute() { var fftLength = FftLength(); var garbage = 0; var fft = new LiveFftAnalyzer(new G313IfProvider(_radio), fftLength); fft.FftCalculated += (s, e) => { garbage++; if (garbage < _sweepParameters.FftWarmup) { return; } fft.Stop(); fft.Reset(); SweepBins(e); garbage = 0; _fftLock.Set(); }; var start = _sweepParameters.From + _sweepParameters.SweepSpan; var end = _sweepParameters.To - _sweepParameters.SweepSpan; for (var i = start; i < end; i += _sweepParameters.SweepSpan) { if (_stop) { //OnSweepFinished(); fft.Stop(); return; } _fftLock.Reset(); _radio.Frequency((uint)i); fft.Start(); _fftLock.WaitOne(); } //OnSweepFinished(); }
/// <summary> /// Gets BinPrameters with high resolution FFT settings. /// </summary> /// <param name="radio">Radio context.</param> /// <returns>Returns <see cref="BinParameters"/> specified parameters.</returns> public static BinParameters BinParametersDetailed(this G313Radio radio) { var parameters = new BinParameters { BinsPerPoint = 1, CalibrationAmplitude = 1.0,//1.0 in sweeper is better CarrierFrequency = radio.Frequency(), MinimumIntensityDb = -100, Relative = true, SamplingRate = radio.Demodulator().IfSamplingRate() }; return(parameters); }