View source: R/kernel_regression_estimator.R
idct_1d | R Documentation |
This function computes the inverse of the Type-II discrete cosine transform.
idct_1d(X)
X |
A vector of values for which the discrete cosine transform is being computed. |
The Type-II inverse discrete cosine transform is computed using stats::fft.
For autocovariance function estimation, the spectrum is given in the input X
and then an inverse FFT is applied.
The original spectrum, dct_full
, from X
is obtained as follows.
First, the original sample Fourier spectrum is reconstructed using dct_full <- c(X, 0, -X[-1], 0, rev(X[-1]))
. After this, an inverse FFT is applied,
idct <- Re(stats::fft(dct_full, inverse = TRUE)) * (2 / length(dct_full))
, which gives the original function with additional zero-values at even indices.
The zeroes are dropped, which gives the untransformed X.
A vector with the inverse transform values.
Ochoa-Dominguez, H. & Rao, K.R. (2019). Discrete Cosine Transform, Second Edition. CRC Press. https://doi.org/10.1201/9780203729854
endolith (2013). Fast Cosine Transform via FFT. Signal Processing Stack Exchange. https://dsp.stackexchange.com/a/10606
X <- dct_1d(c(1, 2, 3))
idct_1d(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.