Skip to main content

dct_ii

Function dct_ii 

Source
pub fn dct_ii(xs: &[f64]) -> Vec<f64>
Expand description

Compute the DCT-II of a real signal (the “standard” DCT used in JPEG/MP3).

X[k] = 2 Σ_{n=0}^{N-1} x[n] cos(π(2n+1)k / (2N))

Uses a naive O(N²) implementation.