Struct Sinc

Source
pub struct Sinc<S> { /* private fields */ }
Expand description

Interpolator for sinc interpolation.

Generally accepted as one of the better sample rate converters, although it uses significantly more computation.

Implementations§

Source§

impl<S> Sinc<S>

Source

pub fn new(frames: Fixed<S>) -> Self
where S: SliceMut, S::Element: Frame,

Create a new Sinc interpolator with the given ring buffer.

The given ring buffer should have a length twice that of the desired sinc interpolation depth.

The initial contents of the ring_buffer will act as padding for the interpolated signal.

**panic!**s if the given ring buffer’s length is not a multiple of 2.

Trait Implementations§

Source§

impl<S> Interpolator for Sinc<S>
where S: SliceMut, S::Element: Frame, <S::Element as Frame>::Sample: Duplex<f64>,

Source§

fn interpolate(&self, x: f64) -> Self::Frame

Sinc interpolation

Source§

type Frame = <S as Slice>::Element

Source§

fn next_source_frame(&mut self, source_frame: Self::Frame)

Called whenever the Interpolator value steps passed 1.0.

Auto Trait Implementations§

§

impl<S> Freeze for Sinc<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Sinc<S>
where S: RefUnwindSafe,

§

impl<S> Send for Sinc<S>
where S: Send,

§

impl<S> Sync for Sinc<S>
where S: Sync,

§

impl<S> Unpin for Sinc<S>
where S: Unpin,

§

impl<S> UnwindSafe for Sinc<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

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

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, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,