Struct futuresdr::blocks::FirBuilder
source · pub struct FirBuilder {}
Expand description
Create a Fir filter.
Uses futuredsp
to pick the optimal FIR implementation for the given
constraints.
Note that there must be an implementation of futuredsp::TapsAccessor for the taps object you pass in, see docs for details.
Additionally, there must be an available core (implementation of
futuredsp::UnaryKernel) available for the specified SampleType
and
TapsType
. See the futuredsp docs for available
implementations.
Inputs
in
: Input
Outputs
out
: Output
Usage
use futuresdr::blocks::FirBuilder;
use futuresdr::runtime::Flowgraph;
use num_complex::Complex;
let mut fg = Flowgraph::new();
let fir = fg.add_block(FirBuilder::new::<f32, f32, f32, [f32; 3]>([1.0, 2.0, 3.0]));
let fir = fg.add_block(FirBuilder::new::<Complex<f32>, Complex<f32>, f32, _>(&[1.0f32, 2.0, 3.0]));
let fir = fg.add_block(FirBuilder::new::<f32, f32, f32, Vec<f32>>(vec![1.0, 2.0, 3.0]));
let fir = fg.add_block(FirBuilder::new_resampling_with_taps::<f32, f32, f32, _>(3, 2, vec![1.0f32, 2.0, 3.0]));
Implementations§
source§impl FirBuilder
impl FirBuilder
sourcepub fn new<InputType, OutputType, TapType, Taps>(taps: Taps) -> Blockwhere
InputType: 'static + Send,
OutputType: 'static + Send,
TapType: 'static + Send,
Taps: 'static + TapsAccessor<TapType = TapType> + Send,
NonResamplingFirKernel<InputType, OutputType, Taps, TapType>: UnaryKernel<InputType, OutputType> + Send,
pub fn new<InputType, OutputType, TapType, Taps>(taps: Taps) -> Blockwhere InputType: 'static + Send, OutputType: 'static + Send, TapType: 'static + Send, Taps: 'static + TapsAccessor<TapType = TapType> + Send, NonResamplingFirKernel<InputType, OutputType, Taps, TapType>: UnaryKernel<InputType, OutputType> + Send,
Create a new non-resampling FIR filter with the specified taps.
sourcepub fn new_resampling<InputType, OutputType>(
interp: usize,
decim: usize
) -> Blockwhere
InputType: 'static + Send,
OutputType: 'static + Send,
PolyphaseResamplingFirKernel<InputType, OutputType, Vec<f32>, f32>: UnaryKernel<InputType, OutputType>,
pub fn new_resampling<InputType, OutputType>( interp: usize, decim: usize ) -> Blockwhere InputType: 'static + Send, OutputType: 'static + Send, PolyphaseResamplingFirKernel<InputType, OutputType, Vec<f32>, f32>: UnaryKernel<InputType, OutputType>,
Create a new rationally resampling FIR filter that changes the sampling
rate by a factor interp/decim
. The interpolation filter is constructed
using default parameters.
sourcepub fn new_resampling_with_taps<InputType, OutputType, TapType, Taps>(
interp: usize,
decim: usize,
taps: Taps
) -> Blockwhere
InputType: 'static + Send,
OutputType: 'static + Send,
TapType: 'static + Send,
Taps: 'static + TapsAccessor<TapType = TapType> + Send,
PolyphaseResamplingFirKernel<InputType, OutputType, Taps, TapType>: UnaryKernel<InputType, OutputType> + Send,
pub fn new_resampling_with_taps<InputType, OutputType, TapType, Taps>( interp: usize, decim: usize, taps: Taps ) -> Blockwhere InputType: 'static + Send, OutputType: 'static + Send, TapType: 'static + Send, Taps: 'static + TapsAccessor<TapType = TapType> + Send, PolyphaseResamplingFirKernel<InputType, OutputType, Taps, TapType>: UnaryKernel<InputType, OutputType> + Send,
Create a new rationally resampling FIR filter that changes the sampling
rate by a factor interp/decim
and uses taps
as the interpolation/decimation filter.
The length of taps
must be divisible by interp
.