/** * Creates a resampler using a FIR low pass filter and the given up- and down-sample factors. * The filter must be appropriate for the given factors. Internally the up- and down-factors are * divided by their greatest common divisor to increase efficiency. * * @param filter FIR filter * @param upFactor upsample factor * @param downFactor downsample factor */ public Resampler(final Filters.FIRFilter filter, final int upFactor, final int downFactor) { this(filter.getCoefficients(), upFactor, downFactor); }
/** * Creates a decimator with the given FIR (low pass) filter. * * @param filter FIR filter * @param factor nth frame to keep (factor) */ public Decimator(final Filters.FIRFilter filter, final int factor) { super(filter.getCoefficients()); this.factor = factor; }
/** * Creates an interpolator with the given FIR filter for filtering after upsampling to avoid * aliasing. It's recommended to use a filter with a multiple of the upsample factor as the * number of coefficients (taps). If that's not the case, zeros are added to the filter's * coefficients. * * @param filter FIR filter * @param factor upsample factor */ public Interpolator(final Filters.FIRFilter filter, final int factor) { this(filter.getCoefficients(), factor); }