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

source

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.

source

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.

source

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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more