public Envelope(SignalSamples original, SignalSamples extremas, bool upper) { AddParent(original); AddParent(extremas); _original = original; _extremas = extremas; _sign = upper ? 1 : -1; }
private void InitSignals() { _signalMouse = new SignalSamples(); _signalMouseD = new Derivative(_signalMouse, scale: 0.1); _signalMouseDD = new Derivative(_signalMouseD, scale: 0.1); _signalMouseI = new Integrate(_signalMouse, scale: 1.0); _signalMouseExtrem = new Extremas(_signalMouse); _signalMouseEnvUpper = new Envelope(_signalMouse, _signalMouseExtrem, true); _signalMouseEnvLower = new Envelope(_signalMouse, _signalMouseExtrem, false); }
public void DrawSignal(Image image, double currentTime, double timeSpan, SignalSamples signal, Color color, double scaleY = 1.0) { int segmentLimit = 200; //!!! configure var poses = new List <Point>(); for (int i = 1; i <= segmentLimit; ++i) { var s = signal.GetSample(-i); if (!s.IsValid()) { break; // no more samples } double t = s.time - currentTime; Point pos = new Point((float)t, (float)(s.value * scaleY)); poses.Insert(0, pos); if (t < -timeSpan) { break; // gone out of view } } DrawSignal(image, poses.ToArray(), color); }
public Integrate(SignalSamples original, double scale = 1.0) { AddParent(original); _original = original; _scale = scale; }
public Extremas(SignalSamples original) { AddParent(original); _original = original; }
public Derivative(SignalSamples original, double scale = 1.0) { AddParent(original); _original = original; _scale = scale; }