/** * Constructs a sequence view with specified values f(x). * Uses default sampling of x = 0, 1, 2, .... * @param f array of sampled function values f(x). */ public SequenceView(float[] f) { set(f); }
/** * Constructs a sequence view with specified sampling and values f(x). * @param sx the sampling of the variable x. * @param f array of sampled function values f(x). */ public SequenceView(Sampling sx, float[] f) { set(sx,f); }
/** * Sets default sampling and specified function values f(x). * The default sampling is x = 0, 1, 2, .... * @param f array of sampled function values f(x). */ public void set(float[] f) { set(new Sampling(f.length),f); }
private void updateViews() { Real1 h = computeImpulseResponse(); Real1[] ap = computeAmplitudeAndPhaseResponses(); Real1 a = ap[0]; Real1 p = ap[1]; if (_hView==null) { _hView = _plotPanelH.addSequence(h.getSampling(),h.getValues()); _aView = _plotPanelAP.addPoints(0,0,a.getSampling(),a.getValues()); _pView = _plotPanelAP.addPoints(1,0,p.getSampling(),p.getValues()); } else { _hView.set(h.getSampling(),h.getValues()); _aView.set(a.getSampling(),a.getValues()); _pView.set(p.getSampling(),p.getValues()); } }