public void PrepareProcessing() { _buffer = new TimeLocatedBufferFFT( 1, //DefaultParameters.DefaultBufferMilliseconds.ToFrames(ParentMetric.Samplerate, ParentMetric.FFTSize / 2), ParentMetric.FFTSize, ParentMetric.Samplerate ); _line = new DataLine1D("", ParentMetric.FFTSize / 2, ParentMetric.Samplerate); _set.Data.Clear(); _set.Data.Add(_line); _set.SamplesPerSecond = ParentMetric.Samplerate /* * 2*/; _set.Milliseconds = new NodeSystemLib2.TimeStamp((long)(ParentMetric.FFTSize), ParentMetric.Samplerate /* * 2*/).AsSeconds() * 1000; _set.AxisX.VisibleMinimum = 0; _set.AxisX.VisibleMaximum = ParentMetric.FFTSize; _set.AxisY.VisibleMinimum = -0.1; _set.AxisY.VisibleMaximum = 1.5; _set.AxisX.LabelProvider = x => { return($"{(Math.Round(x * (ParentMetric.Samplerate / (double)ParentMetric.FFTSize /*/ 2*/), 1)).ToString(System.Globalization.CultureInfo.InvariantCulture)} Hz"); }; _set.Update(); _plotCtrl.CreateLegend(); }
private void AddRenderer(InputPortData1D p, int samples) { var colors = new [] { Color.Red, Color.Blue, Color.Green, Color.Orange, Color.Navy, Color.Black }; var data = new DataLine1D(p.Connection.Parent.Description, samples, p.Samplerate) { LineColor = colors[_renderers.Count % colors.Length] }; _renderers.Add(p, data); _set?.Data.Add(data); }