PVoc

Struct PVoc 

Source
pub struct PVoc { /* private fields */ }
Expand description

Phase vocoder object

Implementations§

Source§

impl PVoc

Source

pub fn new(win_size: usize, hop_size: usize) -> Result<Self>

Create phase vocoder object

  • win_size Size of analysis buffer (and length the FFT transform)
  • hop_size Step size between two consecutive analysis
Source

pub fn with_window(self, window_type: WindowType) -> Result<Self>

Select window type

Source

pub fn get_hop(&self) -> usize

Get hop size

Source

pub fn get_win(&self) -> usize

Get window size

Source

pub fn do_<'i, 'o, I, O>(&mut self, input: I, fftgrain: O) -> Status
where I: Into<FVec<'i>>, O: Into<CVecMut<'o>>,

Compute spectral frame

This function accepts an input vector of size hop_size. The analysis buffer is rotated and filled with the new data. After windowing of this signal window, the Fourier transform is computed and returned in fftgrain as two vectors, magnitude and phase.

  • input New input signal (hop_size long)
  • fftgrain Output spectral frame (win_size long)
Source

pub fn rdo<'i, 'o, I, O>(&mut self, fftgrain: I, output: O) -> Status
where I: Into<CVec<'i>>, O: Into<FVecMut<'o>>,

Compute signal from spectral frame

This function takes an input spectral frame fftgrain of size win_size and computes its inverse Fourier transform. Overlap-add synthesis is then computed using the previously synthetised frames, and the output stored in out.

  • fftgrain Input spectral frame (win_size long)
  • output Output signal (hop_size long)
Source

pub fn set_window(&mut self, window_type: WindowType) -> Status

Set window type

Trait Implementations§

Source§

impl Drop for PVoc

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for PVoc

§

impl RefUnwindSafe for PVoc

§

impl !Send for PVoc

§

impl !Sync for PVoc

§

impl Unpin for PVoc

§

impl UnwindSafe for PVoc

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<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> 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.