[][src]Struct rustdct::mdct::MDCTNaive

pub struct MDCTNaive<T> { /* fields omitted */ }

Naive O(n^2 ) MDCT implementation

This implementation is primarily used to test other MDCT algorithms.

// Computes a naive MDCT of output size 124, using the MP3 window function
use rustdct::mdct::{MDCT, MDCTNaive, window_fn};

let len = 124;
let mut input:  Vec<f32> = vec![0f32; len * 2];
let mut output: Vec<f32> = vec![0f32; len];

let dct = MDCTNaive::new(len, window_fn::mp3);
dct.process_mdct(&input, &mut output);

Methods

impl<T: DCTnum> MDCTNaive<T>
[src]

pub fn new<F>(output_len: usize, window_fn: F) -> Self where
    F: FnOnce(usize) -> Vec<T>, 
[src]

Creates a new MDCT context that will process inputs of length output_len * 2 and produce outputs of length output_len

output_len must be even.

window_fn is a function that takes a size and returns a Vec containing size window values. See the window_fn module for provided window functions.

Trait Implementations

impl<T: DCTnum> MDCT<T> for MDCTNaive<T>
[src]

fn process_mdct(&self, input: &[T], output: &mut [T])
[src]

Computes the MDCT on the input buffer and places the result in the output buffer. Read more

fn process_imdct(&self, input: &[T], output: &mut [T])
[src]

Computes the IMDCT on the input buffer and places the result in the output buffer. Read more

impl<T> Length for MDCTNaive<T>
[src]

Auto Trait Implementations

impl<T> Send for MDCTNaive<T> where
    T: Send

impl<T> Sync for MDCTNaive<T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]