pub struct MDCTViaDCT4<T> { /* fields omitted */ }
MDCT implementation that converts the problem to a DCT Type 4 of the same size.
It is much easier to express a MDCT as a DCT Type 4 than it is to express it as a FFT, so converting the MDCT
to a DCT4 before converting it to a FFT results in greatly simplified code
use rustdct::mdct::{MDCT, MDCTViaDCT4, window_fn};
use rustdct::DCTplanner;
let len = 1234;
let input: Vec<f32> = vec![0f32; len * 2];
let mut output: Vec<f32> = vec![0f32; len];
let mut planner = DCTplanner::new();
let inner_dct4 = planner.plan_dct4(len);
let dct = MDCTViaDCT4::new(inner_dct4, window_fn::mp3);
dct.process_mdct(&input, &mut output);
Creates a new MDCT context that will process signals of length inner_dct.len() * 2
, with an output of length inner_dct.len()
inner_dct.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.
Computes the MDCT on the input
buffer and places the result in the output
buffer. Uses input_a
for the first half of the input, and input_b
for the second half of the input Read more
Computes the IMDCT on the input
buffer and places the result in the output
buffer. Puts the first half of the output in output_a
, and puts the first half of the output in output_b
. Read more
Computes the MDCT on the input
buffer and places the result in the output
buffer. Read more
Computes the IMDCT on the input
buffer and places the result in the output
buffer. Read more
The FFT size that this algorithm can process
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static