/** * Designs a Hilbert transform filter that yields less than 1% error * for frequencies between 5% and 95% of the Nyquist frequency. * @return array of filter coefficients. * The length of the array will be odd, and the coefficients will have * odd symmetry about the sample with array index (length-1)/2. */ private static float[] design() { return design(NMAX_DEFAULT,EMAX_DEFAULT,FMIN_DEFAULT,FMAX_DEFAULT); }
float fmax = fmax_test[itest]; HilbertTransformFilter htf = new HilbertTransformFilter(nmax,emax,fmin,fmax); int lhtf = htf.length(); x[(lhtf-1)/2] = 1.0f; float[] y = new float[nxy]; htf.apply(nxy,x,y);
for (int i=0,j=n-1; i<k; ++i,--j) { float x = i-k; float fideal = idealFilter(x); float window = (float)kw.evaluate(x); f[i] = fideal*window;
/** * Constructs a Hilbert transform filter that yields less than 1% error * for frequencies between 5% and 95% of the Nyquist frequency. */ public HilbertTransformFilter() { _filter = design(NMAX_DEFAULT,EMAX_DEFAULT,FMIN_DEFAULT,FMAX_DEFAULT); }
/** * Constructs a Hilbert transform filter that yields less than a specified * maximum error for frequencies between specified lower and upper bounds. * @param nmax maximum number of coefficients in filter. * Must be greater than 0. * @param emax maximum error. * Must be greater than 0.0. * If the computed filter has fewer than nmax coefficients, then for * frequencies between fmin and fmax, the amplitude spectrum of each * filter will be bounded by 1-emax and 1+emax. * The length of the filter grows approximately as the logarithm of 1/emax. * @param fmin minimum frequency (in cycles/sample) * Must be greater than 0.0. * The length of the filter grows approximately as 1/fmin. * @param fmax maximum frequency (in cycles/sample). * Must be less than the 0.5 (the Nyquist frequency). * The length of the filter grows approximately as 1/(0.5-fmax). */ public HilbertTransformFilter(int nmax, float emax, float fmin, float fmax) { _filter = design(nmax,emax,fmin,fmax); }