View source: R/kernel_regression_estimator.R
dct_1d | R Documentation |
This function computes the Type-II discrete cosine transform.
dct_1d(X)
X |
A vector of values for which the discrete cosine transform is being computed. |
The Type-II discrete cosine transform is obtained using stats::fft.
If X
is of length N, construct a new signal Y
of length 4N
, with values Y_{2n} = 0, Y_{2n + 1} = x_{n}
for 0 \le n < N
,
and Y_{2N} = 0, Y_{4N - n} = y_{n}
for 0 < n < 2N.
After this, the Type-II discrete cosine transform is computed by 0.5 * Re(stats::fft(Y))[1:(length(Y) / 4)]
.
A vector of discrete cosine transform values.
Ochoa-Dominguez, H. & Rao, K.R. (2019). Discrete Cosine Transform, Second Edition. CRC Press. https://doi.org/10.1201/9780203729854
Makhoul, J. (1980). A Fast Cosine Transform in One and Two Dimensions. IEEE Transactions on Acoustics, Speech, and Signal Processing 28(1), 27-34. https://doi.org/10.1109/TASSP.1980.1163351
StasiĆski, R. (2002). DCT Computation Using Real-Valued DFT Algorithms. Proceedings of the 11th European Signal Processing Conference.
X <- c(1, 2, 3)
dct_1d(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.