The type-I Discrete Non-Uniform Transform (NDFT) is defined as the following operation:
Where
Which can be performed in
Unlike the Fast Fourier Transform and its inverse in the equidistant case, the normalisation for an inverse transform is not known explicitly and relies on the implicit inverse of the self-adjoint product of the forward and adjoint transformation matices:
Formally, this package performs the inverse adjoint non-uniform fast fourier transform as defined by our convention via the minimisation of the cost function:
A basic use case can be found in scripts/basic_usage.py
To use the infft function, requires at minimum 3 inputs:
-
x
as a 1-dimensional numpy array with length$j$ containing discontinuous time series data normalized such that$-0.5 \leq x < 0.5$ -
y
containing the responses at each time point inx
of length$j$ -
N
as an integer value representing the total number of$k$ Fourier coefficients
and the optional inputs:
-
AhA
the self-adjoint product of the non-uniform discrete Fourier transform matrix (see:scripts/basic_usage.py
) -
w
a$k$ dimensional numpy array indicating the weight function.
The return_adjoint
argument will return the calculated values at the points indexed by x
, and will not interpolate missing values.
If approx=True
the inverse transform will assume uniformity in the data, on average.
-
fk
the$N$ weighted Fourier coefficients -
fj
ifreturn_adjoint = True
, then the reconstructed data at the originally measured points -
res_abs
: absolute squared error -
res_rel
: relative squared error
-
ndft_mat(x,N)
: used to generate non-uniform self-adjoint matrix. Inputx
as discontinuous numpy array of length$j$ , andN
as the number of Fourier coefficients. From: dependency1. -
change_last_true_to_false(arr)
: changes the last entry of a 1-dimensional boolean arrayarr
toFalse
. -
fjr(N)
: generates the modified Fejer kernel for use as a weight function forN
input Fourier Coefficients. -
sobg(z,a,b,g)
: subroutine forsobk
-
sobk(N,a,b,g)
: generates the modified Sobolev kernel for user inputsa
,b
, andg
. See: reference2 -
infft(x,y,N,AhA=None,w=None,return_adjoint=None,approx=False)
: the interpolative non-uniform fast fourier transform. See Instructions for interpolation for usage. -
adjoint(x,k)
: equivalent to an un-normalized inverse transform in the equidistant case, although note a reversal in convention from 2. Used to interpolate over the nominal continuous range ofx
similarly normalised to the discontinuous case. From: dependency1.
Michael Sorochan Armstrong ([email protected]) and José Camacho Páez ([email protected]) from the Computational Data Science Lab (CoDaS) at the University of Granada. Please, note that the software is provided "as is" and we do not accept any responsibility or liability. Should you find any bug or have suggestions, please contact the authors. For copyright information, please see the license file.
Footnotes
-
NFFT package written by @jakevdp https://github.com/jakevdp/nfft ↩ ↩2
-
Kunis, Stefan, and Daniel Potts. "Stability results for scattered data interpolation by trigonometric polynomials." SIAM Journal on Scientific Computing 29.4 (2007): 1403-1419. ↩ ↩2