pub struct PolyphaseResamplingFirKernel<InputType, OutputType, TA, TT> where
    TA: TapsAccessor<TapType = TT>, 
{ /* private fields */ }
Expand description

A rational resampling polyphase FIR filter. For every input value, this filter produces interp/decim output samples. The length of taps must be divisible by interp. For the best performance, interp and decim should be relatively prime.

If decim=1, then the filter is a pure interpolator. If interp=1, then the filter is a pure decimator.

The specified FIR filter H(z) is split into interp polyphase components E_0(z), E_1(z), ..., E_(interp-1)(z), such that H(z) = E_0(z^interp) + z^(-1)E_1(z^interp) + ... + z^(-(interp-1))E_(interp-1)(z^interp) The taps for each polyphase component are given by e_l(n) = h(l*n+l) for 0 <= l <= interp-1.

Implementations of this core exist for the following combinations:

  • f32 samples, f32 taps.
  • Complex<f32> samples, f32 taps.

Example usage:

use futuredsp::UnaryKernel;
use futuredsp::fir::PolyphaseResamplingFirKernel;

let decim = 2;
let interp = 3;
let taps = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0];
let fir = PolyphaseResamplingFirKernel::<f32, f32, _, _>::new(interp, decim, taps);

let input = [1.0, 2.0, 3.0];
let mut output = [0.0; 3];
fir.work(&input, &mut output);

Implementations

Create a new resampling FIR filter using the given filter bank taps.

Trait Implementations

Computes the kernel on the given input, outputting into the given output. For a UnaryKernel, kernels will not have internal memory - in particular, this means that a single instantiated kernel does not need to be reserved for a single stream of data. Read more

Computes the kernel on the given input, outputting into the given output. For a UnaryKernel, kernels will not have internal memory - in particular, this means that a single instantiated kernel does not need to be reserved for a single stream of data. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.