idct2 function

Inverse 2-D Discrete Cosine Transform

Inverse 2-D Discrete Cosine Transform

Compute the inverse two-dimensional discrete cosine transform of a matrix.

idct2(x, m = NROW(x), n = NCOL(x))

Arguments

  • x: 2-D numeric matrix
  • m: Number of rows, specified as a positive integer. dct2 pads or truncates x so that it has m rows. Default: NROW(x).
  • n: Number of columns, specified as a positive integer. dct2 pads or truncates x so that it has n columns. Default: NCOL(x).

Returns

m-by-n numeric discrete cosine transformed matrix.

Details

The discrete cosine transform (DCT) is closely related to the discrete Fourier transform. It is a separable linear transformation; that is, the two-dimensional transform is equivalent to a one-dimensional DCT performed along a single dimension followed by a one-dimensional DCT in the other dimension.

Examples

A <- matrix(50 * runif(100), 10, 10) B <- dct2(A) B[which(B < 1)] <- 0 AA <- idct2(B)

See Also

dct2

Author(s)

Paul Kienzle, pkienzle@users.sf.net .

Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com .

  • Maintainer: Geert van Boxtel
  • License: GPL-3
  • Last published: 2024-09-11