Struct rustdct::algorithm::Type2And3ConvertToFFT[][src]

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

DCT2, DST2, DCT3, and DST3 implementation that converts the problem into a FFT of the same size

// Computes a O(NlogN) DCT2, DST2, DCT3, and DST3 of size 1234 by converting them to FFTs
use rustdct::{DCT2, DST2, DCT3, DST3};
use rustdct::algorithm::Type2And3ConvertToFFT;
use rustdct::rustfft::FFTplanner;

let len = 1234;
let mut planner = FFTplanner::new(false);
let fft = planner.plan_fft(len);

let dct = Type2And3ConvertToFFT::new(fft);
 
let mut dct2_input:  Vec<f32> = vec![0f32; len];
let mut dct2_output: Vec<f32> = vec![0f32; len];
dct.process_dct2(&mut dct2_input, &mut dct2_output);
 
let mut dst2_input:  Vec<f32> = vec![0f32; len];
let mut dst2_output: Vec<f32> = vec![0f32; len];
dct.process_dst2(&mut dst2_input, &mut dst2_output);
 
let mut dct3_input:  Vec<f32> = vec![0f32; len];
let mut dct3_output: Vec<f32> = vec![0f32; len];
dct.process_dct3(&mut dct3_input, &mut dct3_output);
 
let mut dst3_input:  Vec<f32> = vec![0f32; len];
let mut dst3_output: Vec<f32> = vec![0f32; len];
dct.process_dst3(&mut dst3_input, &mut dst3_output);

Methods

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

Creates a new DCT2, DST2, DCT3, and DST3 context that will process signals of length inner_fft.len().

Trait Implementations

impl<T: DCTnum> DCT2<T> for Type2And3ConvertToFFT<T>
[src]

Computes the DCT Type 2 on the input buffer and places the result in the output buffer. Read more

impl<T: DCTnum> DST2<T> for Type2And3ConvertToFFT<T>
[src]

Computes the DST Type 2 on the input buffer and places the result in the output buffer. Read more

impl<T: DCTnum> DCT3<T> for Type2And3ConvertToFFT<T>
[src]

Computes the DCT Type 3 on the input buffer and places the result in the output buffer. Read more

impl<T: DCTnum> DST3<T> for Type2And3ConvertToFFT<T>
[src]

Computes the DST Type 3 on the input buffer and places the result in the output buffer. Read more

impl<T: DCTnum> Type2And3<T> for Type2And3ConvertToFFT<T>
[src]

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

The FFT size that this algorithm can process

Auto Trait Implementations

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

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