Exemplo n.º 1
0
        private BinaryFskAnalyzerSettings ProcessSettings(BinaryFskAnalyzerSettings sourceSettings)
        {
            var updatedSettings = new BinaryFskAnalyzerSettings(sourceSettings);

            var baudRateIncrement = 1.0 / updatedSettings.BaudRate * Math.Pow(10, 6);

            if (updatedSettings.WindowPositionIncrementMicroseconds == null)
            {
                updatedSettings.WindowPositionIncrementMicroseconds = baudRateIncrement;
            }

            if (updatedSettings.WindowLengthStartMicroseconds == null)
            {
                updatedSettings.WindowLengthStartMicroseconds = baudRateIncrement;
            }

            if (updatedSettings.WindowLengthIncrementMicroseconds == null)
            {
                updatedSettings.WindowLengthIncrementMicroseconds = 1.0;
            }

            if (updatedSettings.WindowLengthEndMicroseconds == null)
            {
                updatedSettings.WindowLengthEndMicroseconds = baudRateIncrement;
            }

            return(updatedSettings);
        }
Exemplo n.º 2
0
        public void Initialize(IAudioAnalyzer audioAnalyzer, IFrequencyDetector frequencyDetector,
                               BinaryFskAnalyzerSettings binaryFskAnalzyerSettings)
        {
            if (audioAnalyzer == null)
            {
                throw new ArgumentNullException(nameof(audioAnalyzer));
            }

            if (frequencyDetector == null)
            {
                throw new ArgumentNullException(nameof(frequencyDetector));
            }

            if (binaryFskAnalzyerSettings == null)
            {
                throw new ArgumentNullException(nameof(binaryFskAnalzyerSettings));
            }

            _audioAnalyzer     = audioAnalyzer;
            _frequencyDetector = frequencyDetector;
            _settings          = ProcessSettings(binaryFskAnalzyerSettings);
        }
Exemplo n.º 3
0
 public BinaryFskAnalyzer(IAudioAnalyzer audioAnalyzer, IFrequencyDetector frequencyDetector,
                          BinaryFskAnalyzerSettings binaryFskAnalzyerSettings)
 {
     Initialize(audioAnalyzer, frequencyDetector, binaryFskAnalzyerSettings);
 }