Ejemplo n.º 1
0
        private void CalcConvolutionButton_Click(object sender, RoutedEventArgs e)
        {
            ConvolutionTabItem.IsEnabled  = true;
            ConvolutionTabItem.IsSelected = true;

            _yForwardFourier = _FourierTransform.ForwardTransform(_yFuncResults);
            _zForwardFourier = _FourierTransform.ForwardTransform(_zFuncResults);

            var temp = new Complex[N];

            for (int i = 0; i < N; i++)
            {
                temp[i] = _yForwardFourier[i] * _zForwardFourier[i];
            }

            _convolutionResults = _FourierTransform.BackwardTransform(temp);
            int j = 0;

            foreach (var convolRes in _convolutionResults)
            {
                ConvolutionChartValues.Add(new ChartValue(_args[j], convolRes));
                j++;
            }
        }
Ejemplo n.º 2
0
        private void TransformButton_Click(object sender, RoutedEventArgs e)
        {
            _fourierTransformResults = _FourierTransform.ForwardTransform(_a);

            Complex[] cc = new Complex[N];
            for (int i = 0; i < N; i++)
            {
                cc[i] = new Complex(_a[i], 0);
            }
            _discrRes = _FourierTransform.DiscretFourier(cc, true);

            DirectFourierChartValues.Clear();
            for (int i = 0; i < _fourierTransformResults.Count(); i++)
            {
                //var complexNumberInAmplitudePhaseForm = NumericHelper.GetComplexNumberInAmplitudePhaseForm(_fourierTransformResults.ElementAt(i));
                //DirectFourierChartValues.Add(new ChartValue(complexNumberInAmplitudePhaseForm.Phase, complexNumberInAmplitudePhaseForm.Amplitude));
                DirectFourierChartValues.Add(new ChartValue(_fourierTransformResults.ElementAt(i).Phase, _fourierTransformResults.ElementAt(i).Magnitude));
                DiscrDirectFourierChartValues.Add(new ChartValue(_discrRes.ElementAt(i).Phase, _discrRes.ElementAt(i).Magnitude));
            }

            TransformTabItem.IsEnabled        = true;
            TransformTabItem.IsSelected       = true;
            ReverseTransformTabItem.IsEnabled = false;
        }