private void SelectDataChanged(List <Complex> selectedData, int start) { FFTLine.Points.Clear(); FFTcom = FFT2Helper.fft(selectedData.ToArray()).ToList(); int x = 0; FFTcom.ForEach(comp => { FFTLine.Points.Add(new DataPoint(x, comp.Magnitude)); x++; } ); FFTModel.InvalidatePlot(true); }
private void SelectDataChanged(List <Complex> selectedData, int start) { FFTLine.Points.Clear(); FFTcom = FFT2Helper.fft(selectedData.ToArray()).ToList(); int x = 0; FFTcom.ForEach(comp => { //FFTLine.Points.Add(new DataPoint(x++, 10 * Math.Log10(GetYPos(comp) / FFTcom.Count()))); //FFTLine.Points.Add(new DataPoint(x++, Math.Abs(GetYPosLog(comp)))); FFTLine.Points.Add(new DataPoint(x, !IsMagnitude ? comp.Magnitude:GetYPosLog(comp))); x++; } ); FFTModel.InvalidatePlot(true); // IFFT(start); }
private void Process(int start, int end) { FFTLine.Points.Clear(); int err = (SelectedData.Count() % 2); SelectedData.RemoveRange((SelectedData.Count() - 1 - err), err); Val[] temp = new Val[SelectedData.Count]; int i1 = 0; FFT2Helper.fft(SelectedData.ToArray()).ToList().ForEach(p => { temp[i1] = new Val(); temp[i1].Magnitude += p.Magnitude; temp[i1].Rep++; i1++; }); for (int i = 0; i < SelectedData.Count / 2; i++) { temp[i].Magnitude = (temp[i].Magnitude / SelectedData.Count); FFTLine.Points.Add(new DataPoint(i, temp[i].Magnitude)); } FFTModel.Axes[0].AbsoluteMaximum = temp.Count() / 2; //FFTModel.Axes[0].MaximumRange = temp.Count() / 2; //FFTModel.Axes[0].MinimumRange = temp.Count() / 2; FFTModel.Axes[1].Maximum = FFTLine.Points.Select(p => p.Y).Max(); FFTModel.Axes[0].MajorStep = (FFTModel.Axes[0].MaximumRange / 100) * 10; MaxFFTWidth = temp.Count() / 2; // FFTWidth = MaxFFTWidth - 1; FFTModel.InvalidatePlot(true); }