Description Usage Arguments Details Functions Examples
The non-equispaced trigonometric transforms (sine and cosine) take non-uniform samples x from the $d$-dimensional torus [0,0.5)^d.
The NDCT functions compute the cosine transform directly. This is slow.
The NFCT functions use the FFT to compute this, which should be faster.
The adjoint, in this case, is not the same as the inverse. Solving the
inverse problem requires approximations. Here we present the 2D NDCT,
NFCT, and their adjoints. You most likely want to use the nfct_2d
and nfct_adjoint_2d
functions rather than the dct
functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | nfct_2d(x, f_hat)
ndct_2d(x, f_hat)
nfct_adjoint_2d(x, f, n0, n1)
ndct_adjoint_2d(x, f, n0, n1)
nfst_2d(x, f_hat)
ndst_2d(x, f_hat)
nfst_adjoint_2d(x, f, n0, n1)
ndst_adjoint_2d(x, f, n0, n1)
|
x |
two dimensional complex vector in [0,0.5)^2 |
f_hat |
set of frequencies |
f |
frequencies for adjoint, same length as |
n0 |
number of frequencies in the first dimension for transform, specified for adjoint. |
n1 |
number of frequencies in the second dimension for transform, specified for adjoint. |
2-D Non-equispaced Trigonometric Tranform
ndct_2d
:
nfct_adjoint_2d
:
ndct_adjoint_2d
:
nfst_2d
:
ndst_2d
:
nfst_adjoint_2d
:
ndst_adjoint_2d
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | set.seed(20190728)
x <- matrix(runif(2*32*14)*.5, ncol=2, byrow = TRUE)
f_hat = 1:(32*14)
for(i in 1:(32*14)) f_hat[i] = runif(1)
f_hatmatrix = matrix(f_hat, nrow = 32)
f_vector <- nfct_2d(x, f_hatmatrix)
fs_vector <- nfst_2d(x, f_hatmatrix)
fd_vector <- ndct_2d(x, f_hatmatrix)
fsd_vector <- ndst_2d(x, f_hatmatrix)
f_vector[1:3]
fd_vector[1:3]
fs_vector[1:3]
fsd_vector[1:3]
newf_hat <- nfct_adjoint_2d(x,f_vector,32,14)
newf_hat[1,1:7]
newdf_hat <- ndct_adjoint_2d(x,f_vector,32,14)
newdf_hat[1,1:7]
newfs_hat <- nfst_adjoint_2d(x,f_vector,32,14)
newfs_hat[1,1:7]
newdsf_hat <- ndst_adjoint_2d(x,f_vector,32,14)
newdsf_hat[1,1:7]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.