mvdtt: 2D Discrete Trigonometric Transforms

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Performs multivariate (2D) discrete sine, cosine or Hartley transform.

Usage

1
2
3
4
mvdtt(x, type = c("dct", "dst", "dht"), variant = 2, inverted = FALSE)
mvdct(x, variant = 2, inverted = FALSE)
mvdst(x, variant = 2, inverted = FALSE)
mvdht(x, inverted = FALSE)

Arguments

x

a matrix to be transformed

type

type of transform. Default "dct" is discrete cosine, "dst" is discrete sine and "dht" is discrete Hartley

variant

a transformation variant - 1...4 for DCT-I...DCT-IV or DST-I...DST-IV. Default is DCT-II or DST-II. Ignored when type = "dht"

inverted

if the inverted transform should be performed?

Details

This function transforms a matrix of real numbers into a matrix of its DCT, DST or DHT components, of the same dimensions. It is done by so-called row-matrix algorithm.

The mvdct, mvdst and mvdht functions are simple wrappers for choosing the type by function name.

Value

A transformed matrix.

Author(s)

Lukasz Komsta

References

1. N. Ahmed, T. Natarajan, and K. R. Rao, "Discrete Cosine Transform", IEEE Trans. Computers, 90-93, Jan 1974. 2. S. A. Martucci, "Symmetric convolution and the discrete sine and cosine transforms", IEEE Trans. Sig. Processing SP-42, 1038-1051 (1994). 3. R. V. L. Hartley, "A more symmetrical Fourier analysis applied to transmission problems," Proc. IRE 30, 144-150 (1942).

See Also

dtt, fft, mvfft

Examples

1
2
3
4
5
x = rnorm(100);
dim(x) = c(10,10);
x
mvdct(x)
mvdct(mvdct(x),inverted=TRUE)

Example output

             [,1]        [,2]        [,3]       [,4]        [,5]       [,6]
 [1,] -0.83435434  0.82067970 -0.29617291  0.1950239  0.89431296  0.7622126
 [2,] -0.52529644  1.45330426 -0.08856930 -0.4718567 -0.47458432 -0.1058936
 [3,]  0.80157579 -1.47200607  0.67409271  1.4652882 -0.57834529  0.2110338
 [4,]  0.48046951  0.32650159 -0.09948033 -1.2034158  1.13795116  1.0710951
 [5,]  0.09044257  0.51223265 -0.18945849  2.0571793 -1.58445504  0.2674178
 [6,]  1.49500255 -0.03923694 -0.33540054  0.7347212  0.40483616  0.5338339
 [7,] -0.74972503  0.26757036  1.17219739  0.1553559 -0.01680746  1.8444171
 [8,] -0.83669145  0.41198384  0.44776902  1.0247725 -1.45042082  0.4189664
 [9,]  2.16277907  0.74529331 -1.46518965 -0.8990002  1.41179711  2.5414586
[10,]  1.15133719  1.00937796 -1.12978668 -0.8080430 -0.99768677  1.7732002
            [,7]       [,8]        [,9]       [,10]
 [1,] -1.5699659 -0.2168169  0.04651863  0.47442617
 [2,]  1.8122003  0.1681372  1.14700373 -0.09404155
 [3,]  0.3926172  0.9566820 -1.02993072  1.19831464
 [4,]  0.1021555  0.7841419 -0.25349654  0.29871452
 [5,] -0.4492624 -0.1635509  1.28224751  2.34615612
 [6,] -1.4146031  1.3980581 -0.41167112 -2.43118386
 [7,] -0.9530774 -1.0263581  0.31921965 -0.61114832
 [8,] -0.2925277  0.2614398 -1.60414581 -1.46851180
 [9,]  0.2647187 -0.7709605  1.23582046 -0.02544666
[10,]  0.5534381  0.1599079 -0.07782561  1.15742685
             [,1]       [,2]       [,3]       [,4]      [,5]       [,6]
 [1,]  17.7704264  3.4253806 -1.4416476   5.723814  7.920388 -3.4628860
 [2,]   1.1100914 -4.9485082  1.0476697  -7.981539 -6.379701  1.2231191
 [3,]   1.9390772 -3.7216633  1.5474927   5.404183  6.463550 -6.3691475
 [4,] -10.7868410  7.9948165 -7.7003121  -6.267203 -7.160238  1.5882425
 [5,]   2.8489266 -1.4657089  6.2892310  -1.492105  4.884892  3.7532960
 [6,]   0.4499189 -1.0727879  0.8465121  -4.163351  4.946189 -0.2595477
 [7,]  -5.3408819  0.2942101 -3.5151654  -4.669504  1.192781 -5.5512374
 [8,]   1.8226184  5.0405567 -5.2019978   4.333961  9.893688 10.9028974
 [9,]  -7.2063957  2.4108890  0.3754218  -5.928338 -7.518986  2.8127454
[10,]   6.9065577 -5.4731720  4.4820354 -11.089685  5.428430 -3.9624636
           [,7]       [,8]       [,9]       [,10]
 [1,] -6.140047  5.7363741 -0.3631205 -17.0148555
 [2,]  3.261579 -5.2886948  1.0387296   3.9084842
 [3,] -3.826664 -3.7482304 -4.1084160   3.1085823
 [4,] -8.278662  1.9896549 -1.1962809  -1.4141683
 [5,] -5.846584 -1.0426540 -2.9289473  -4.2360297
 [6,] -3.746532 -2.3092474 -1.7439184  -1.3730935
 [7,] -2.854249 -1.1433285  7.7436106  -0.9415263
 [8,] -3.347673  0.5002182  8.7761787   1.8548797
 [9,] 13.771919 -0.8437522  4.0188814  -9.4821256
[10,]  3.816420  6.6921908 -3.5411667  -1.8041133
             [,1]        [,2]        [,3]       [,4]        [,5]       [,6]
 [1,] -0.83435434  0.82067970 -0.29617291  0.1950239  0.89431296  0.7622126
 [2,] -0.52529644  1.45330426 -0.08856930 -0.4718567 -0.47458432 -0.1058936
 [3,]  0.80157579 -1.47200607  0.67409271  1.4652882 -0.57834529  0.2110338
 [4,]  0.48046951  0.32650159 -0.09948033 -1.2034158  1.13795116  1.0710951
 [5,]  0.09044257  0.51223265 -0.18945849  2.0571793 -1.58445504  0.2674178
 [6,]  1.49500255 -0.03923694 -0.33540054  0.7347212  0.40483616  0.5338339
 [7,] -0.74972503  0.26757036  1.17219739  0.1553559 -0.01680746  1.8444171
 [8,] -0.83669145  0.41198384  0.44776902  1.0247725 -1.45042082  0.4189664
 [9,]  2.16277907  0.74529331 -1.46518965 -0.8990002  1.41179711  2.5414586
[10,]  1.15133719  1.00937796 -1.12978668 -0.8080430 -0.99768677  1.7732002
            [,7]       [,8]        [,9]       [,10]
 [1,] -1.5699659 -0.2168169  0.04651863  0.47442617
 [2,]  1.8122003  0.1681372  1.14700373 -0.09404155
 [3,]  0.3926172  0.9566820 -1.02993072  1.19831464
 [4,]  0.1021555  0.7841419 -0.25349654  0.29871452
 [5,] -0.4492624 -0.1635509  1.28224751  2.34615612
 [6,] -1.4146031  1.3980581 -0.41167112 -2.43118386
 [7,] -0.9530774 -1.0263581  0.31921965 -0.61114832
 [8,] -0.2925277  0.2614398 -1.60414581 -1.46851180
 [9,]  0.2647187 -0.7709605  1.23582046 -0.02544666
[10,]  0.5534381  0.1599079 -0.07782561  1.15742685

dtt documentation built on May 2, 2019, 4:01 p.m.