private void LoadPulseModulationChart() { double[] xAxisValues = new double[arraySize]; double[] yAxisValues = new double[arraySize]; for (int i = 0; i < plottableData.Length; i++) { xAxisValues[i] = i; yAxisValues[i] = plottableData[i]; } PulseModulationChart = new ScottPlotUC { Xs = xAxisValues, Ys = yAxisValues }; }
private void LoadFastFourierTransformationChart() { double[] xAxisValues = new double[arraySize]; double[] yAxisValues = new double[arraySize]; for (int i = 0; i < plottableData.Length; i++) { xAxisValues[i] = (double)i / plottableData.Length * sampleRate / 1000.0; // units are in kHz; } var fft = new FastFourierTransform(PulseModulationChart.Ys); yAxisValues = fft.Get(); FastFourierTransformChart = new ScottPlotUC { Xs = xAxisValues.Take(xAxisValues.Length / 2).ToArray(), Ys = yAxisValues.Take(yAxisValues.Length / 2).ToArray() }; }