Expand description
Discrete cosine and sine transforms of types I-IV, computed through complex FFTs.
Unnormalized definitions follow the common (SciPy / FFTW REDFT-RODFT) convention, for a
length-N input x:
| Type | Cosine transform y_k | Sine transform y_k |
|---|---|---|
| I | x₀ + (−1)ᵏx_{N−1} + 2Σ_{n=1}^{N−2} x_n cos(πkn/(N−1)) | 2Σ x_n sin(π(k+1)(n+1)/(N+1)) |
| II | 2Σ x_n cos(πk(2n+1)/(2N)) | 2Σ x_n sin(π(k+1)(2n+1)/(2N)) |
| III | x₀ + 2Σ_{n≥1} x_n cos(πn(2k+1)/(2N)) | (−1)ᵏx_{N−1} + 2Σ_{n<N−1} x_n sin(π(n+1)(2k+1)/(2N)) |
| IV | 2Σ x_n cos(π(2n+1)(2k+1)/(4N)) | 2Σ x_n sin(π(2n+1)(2k+1)/(4N)) |
Types II and III are mutual inverses up to 2N, types I and IV are their own inverses up to
2(N∓1) and 2N. TrigNormalization::Ortho scales each transform to an orthogonal matrix,
so the inverse is the transpose (type II ↔ III, types I and IV self-inverse). Every transform
is an O(N log N) FFT of a symmetric extension or twiddled zero-padding of length about 2N.
See the book entry Discrete cosine and sine transforms.
Enums§
- Trig
Normalization - Scaling of the forward transform.
- Trig
Transform Type - The transform type.