Exemplo n.º 1
0
        public void Update(FrequencyBins bins)
        {
            var data = bins.Intensities().ToArray();

            try
            {
                Dispatcher.Invoke(new Action(() => _waveform.FeedData(data)));
            }
            catch (TaskCanceledException)
            {
                //closing app
            }
        }
Exemplo n.º 2
0
        public void Update(FrequencyBins bin)
        {
            if (bin.BinsCount != _bins)
            {
                _bins = bin.BinsCount;
                CalculateXScale();
            }

            var intensities = bin.Intensities().ToArray();

            for (int n = 0; n < bin.BinsCount - _binsPerPoint; n += 1)
            {
                // averaging out bins
                double yPos = 0;
                for (int b = 0; b < _binsPerPoint; b++)
                {
                    yPos += GetYPosLog(intensities[n + b], bin.MinimumIntensity);
                }
                AddResult(n / _binsPerPoint, yPos / _binsPerPoint);
            }

            Draw(bin.SpectralWidth);
        }