/** * Constructs a recursive filter with specified poles, zeros, and gain. * Any poles or zeros at zero (the origin of the complex z-plane) are * ignored. The number of non-zero zeros cannot exceed the number of * non-zero poles, and all poles must be unique. * @param poles array of complex poles. * @param zeros array of complex poles. * @param gain the filter gain. */ public RecursiveParallelFilter( Cdouble[] poles, Cdouble[] zeros, double gain) { init(poles,zeros,gain); }
/** * Applies this filter along the 2nd dimension in the forward direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2Forward(float[][] x, float[][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate2Forward(x,y); }
protected void init(Cdouble[] poles, Cdouble[] zeros, double gain) { poles = nonZero(poles); zeros = nonZero(zeros); Check.argument(polesUnique(poles),"all poles are unique"); poles = sort(poles); zeros = sort(zeros); for (int i1=0,i2=0,jp=0; i1<_n1; ++jp) { Cdouble pj = poles[jp]; Cdouble hi = hi(pj,poles,zeros,gain); Cdouble hj = hr(pj,poles,zeros,gain); Cdouble hihj = hi.times(hj); double fb0,fb1,fb2,rb0,rb1,rb2,b0,b1,b2,a1,a2; rb2 = -fb0*a2; _f1[i1++] = makeFilter(b0,b1,b2,a1,a2); _f2[i2++] = makeFilter(fb0,fb1,fb2,a1,a2); _f2[i2++] = makeFilter(rb0,rb1,rb2,a1,a2); if (_nz==_np) c -= b0;
/** * For experimental use only. * @param x array of x-coordinates. * @param y array of y-coordinates. */ public void applyFrr(float[] x, float[] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { //_f2[i2 ].accumulateForward(x,y); _f2[i2+1].accumulateReverse(x,y); } }
/** * Applies this filter along the 1st dimension in the forward direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1Forward(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate1Forward(x,y); }
/** * Applies this filter along the 1st dimension in the reverse direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1Reverse(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate1Reverse(x,y); }
/** * Applies this filter along the 3rd dimension in the forward direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply3Forward(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate3Forward(x,y); }
/** * For experimental use only. * @param x array of x-coordinates. * @param y array of y-coordinates. */ public void applyFrf(float[] x, float[] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { _f2[i2 ].accumulateForward(x,y); //_f2[i2+1].accumulateReverse(x,y); } }
/** * Applies this filter along the 1st dimension in the forward direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1Forward(float[][] x, float[][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate1Forward(x,y); }
/** * Applies this filter along the 2nd dimension in the reverse direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2Reverse(float[][] x, float[][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate2Reverse(x,y); }
/** * Applies this filter along the 2nd dimension in the forward direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2Forward(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate2Forward(x,y); }
/** * Applies this filter along the 2nd dimension in the reverse direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2Reverse(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate2Reverse(x,y); }
/** * Applies this filter in the forward direction. * Input and output arrays must be distinct arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void applyForward(float[] x, float[] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulateForward(x,y); }
/** * Applies this filter in the reverse direction. * Input and output arrays must be distinct arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void applyReverse(float[] x, float[] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulateReverse(x,y); }
/** * Applies this filter along the 1st dimension in the reverse direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1Reverse(float[][] x, float[][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate1Reverse(x,y); }
/** * Applies this filter along the 3rd dimension in the reverse direction. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply3Reverse(float[][][] x, float[][][] y) { scale(_c,x,y); for (int i1=0; i1<_n1; ++i1) _f1[i1].accumulate3Reverse(x,y); }
/** * Applies this filter along the 2nd dimension in the forward and * reverse directions. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2ForwardReverse(float[][] x, float[][] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { _f2[i2 ].accumulate2Forward(x,y); _f2[i2+1].accumulate2Reverse(x,y); } }
/** * Applies this filter along the 1st dimension in the forward and * reverse directions. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1ForwardReverse(float[][][] x, float[][][] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { _f2[i2 ].accumulate1Forward(x,y); _f2[i2+1].accumulate1Reverse(x,y); } }
/** * Applies this filter along the 1st dimension in the forward and * reverse directions. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply1ForwardReverse(float[][] x, float[][] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { _f2[i2 ].accumulate1Forward(x,y); _f2[i2+1].accumulate1Reverse(x,y); } }
/** * Applies this filter along the 2nd dimension in the forward and * reverse directions. * Input and output arrays must be distinct regular arrays. * Lengths of the input and output arrays must be equal. * @param x the input array. * @param y the output array. */ public void apply2ForwardReverse(float[][][] x, float[][][] y) { scale(_c*_g,x,y); for (int i2=0; i2<_n2; i2+=2) { _f2[i2 ].accumulate2Forward(x,y); _f2[i2+1].accumulate2Reverse(x,y); } }