private void updateFilter1() { if (_ff1==null) { KaiserWindow kw = KaiserWindow.fromErrorAndWidth(_aerror,_kwidth); int nh = ((int)kw.getLength()+1)/2*2+1; int nh1 = nh; int kh1 = (nh1-1)/2; _h1 = new float[nh1]; double kus = 2.0*_kupper; double kls = 2.0*_klower; for (int i1=0; i1<nh1; ++i1) { double x1 = i1-kh1; double w1 = kw.evaluate(x1); double r = x1; double kur = 2.0*_kupper*r; double klr = 2.0*_klower*r; _h1[i1] = (float)(w1*(kus*h1(kur)-kls*h1(klr))); } _ff1 = new FftFilter(_h1); _ff1.setExtrapolation(ffExtrap(_extrapolation)); _ff1.setFilterCaching(_filterCaching); } }
private void updateFilter2() { if (_ff2==null) { KaiserWindow kw = KaiserWindow.fromErrorAndWidth(_aerror,_kwidth); int nh = ((int)kw.getLength()+1)/2*2+1; int nh1 = nh; int nh2 = nh; int kh1 = (nh1-1)/2; int kh2 = (nh2-1)/2; _h2 = new float[nh2][nh1]; double kus = 4.0*_kupper*_kupper; double kls = 4.0*_klower*_klower; for (int i2=0; i2<nh2; ++i2) { double x2 = i2-kh2; double w2 = kw.evaluate(x2); for (int i1=0; i1<nh1; ++i1) { double x1 = i1-kh1; double w1 = kw.evaluate(x1); double r = sqrt(x1*x1+x2*x2); double kur = 2.0*_kupper*r; double klr = 2.0*_klower*r; _h2[i2][i1] = (float)(w1*w2*(kus*h2(kur)-kls*h2(klr))); } } _ff2 = new FftFilter(_h2); _ff2.setExtrapolation(ffExtrap(_extrapolation)); _ff2.setFilterCaching(_filterCaching); } }
_ff3.setExtrapolation(ffExtrap(_extrapolation)); _ff3.setFilterCaching(_filterCaching);