idct
-
constexpr std::vector<Complex> dct(const std::vector<Complex> &X, int type = 2) noexcept
Calculates the inverse discrete cosine transform [1] of a complex sequence.
Parameters
Returns
The inverse discrete cosine transform returns the corresponding types of DCT for IDCT types 1 and 4, returns DCT type 3 for IDCT type 2, and returns DCT type 2 for IDCT type 3.
Example
std::vector<Complex> X = {1 + 2_j, 2 + 3_j, 3, 4, 5};
std::vector<Complex> Y = idct(X, 2); // it's 2 by default.
for(int i = 0; i < Y.size(); i++){
std::cout << Y[i] << "\n";
}
Output:
17.4508 + 7.70634j
-14.2016 + 5.52671j
5 + 2j
-3.68696 - 1.52671j
0.437764 - 3.70634j
References