dct2: 2-D Discrete Cosine Transform

View source: R/dct2.R

dct2R Documentation

2-D Discrete Cosine Transform

Description

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

Usage

dct2(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 is has m rows. Default: NROW(x).

n

Number of columns, specified as a positive integer. dct2 pads or truncates x so that is has n columns. Default: NCOL(x).

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.

Value

m-by-n numeric discrete cosine transformed matrix.

Author(s)

Paul Kienzle, pkienzle@users.sf.net.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

See Also

idct2

Examples

A <- matrix(runif(100), 10, 10)
B <- dct2(A)


gjmvanboxtel/gsignal documentation built on Nov. 22, 2023, 8:19 p.m.