powered by
The Inverse DCT
idct(y, n)# S3 method for numeric idct(y, n = length(y))# S3 method for matrix idct(y, n = nrow(y))
# S3 method for numeric idct(y, n = length(y))
# S3 method for matrix idct(y, n = nrow(y))
The returned value depends on the values in y.
y
When passed a numeric vector, returns numeric vector of length n.
n
When passed a matrix, returns a matrix with n rows and the same number of columns as y.
A vector or matrix of DCT coefficients
The desired length of the idct
Applies the Inverse DCT (see dct for more details).
$$ x_j = \sqrt{2}y_0 + 2\sum_{k=1}^{N-1} y_k \cos\left(\frac{\pi k(2j+1)}{2J}\right) $$
x <- seq(0, 1, length = 10) y <- 5 + x + (2 * (x^2)) + (-2 * (x^4)) dct_coefs <- dct(y) recovered_y <- idct(dct_coefs) plot(y, recovered_y)
Run the code above in your browser using DataLab