dftMatrix | R Documentation |
The discrete Fourier transform (DFT) matrix for a given dimension n is calculated.
dftMatrix(n)
n |
Dimension for the DFT matrix. |
The DFT matrix can be used for computing the discrete Fourier transform of
a matrix or vector. dftMatrix(n) %*% testMatrix
is the same as
apply(testMatrix, MARGIN = 2, FUN = fft)
.
The n-by-n DFT matrix.
set.seed(987)
testMatrix <- matrix(sample(1:10, size = 25, replace = TRUE), nrow = 5)
D <- dftMatrix(5)
# Discrete Fourier transform with matrix multiplication:
D %*% testMatrix
# Discrete Fourier transform with function fft:
apply(testMatrix, MARGIN = 2, FUN = fft)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.