hanaml.FFT is a R wrapper for SAP HANA PAL fast-Fourier-transform.

hanaml.FFT(
  data,
  key,
  num.type = NULL,
  inverse = NULL,
  window = NULL,
  window.start = NULL,
  window.length = NULL,
  alpha = NULL,
  beta = NULL,
  attenuation = NULL,
  flattop.mode = NULL,
  flattop.precision = NULL,
  tukey.r = NULL
)

Arguments

data

DataFrame
DataFrame containting the data.

key

character
Name of the ID column.

num.type

list of characters, optional
Specify the number types(i.e. real or imaginary) of columns in data,
e.g. num.type <- list(real = "COL1", imag = "COL2"),
where "COL1" and "COL2" are assumed to be column names in data.
If only one column is specified in num.type, only that column will be applied FFT.
If not provided, then data must contain exactly 3 columns, and the two non-ID columns will be treated as real, imaginary part of data respectively.

inverse

logical, optional
If FALSE, forward FFT is applied; otherwise inverse FFT is applied.
Defaults to FALSE.

window

character, optional
Specifies the type of tapering window function.

  • "none"

  • "hamming"

  • "hann"

  • "hanning"

  • "bartlett"

  • "triangular"

  • "bartlett_hann"

  • "blackman"

  • "blackman_harris"

  • "blackman_nuttall"

  • "bohman"

  • "cauchy"

  • "cheb"

  • "chebwin"

  • "cosine"

  • "sine"

  • "flattop"

  • "gaussian"

  • "kaiser"

  • "lanczos"

  • "sinc"

  • "nuttall"

  • "parzen"

  • "poisson"

  • "poisson_hann"

  • "poisson_hanning"

  • "rectangle"

  • "riemann"

  • "riesz"

  • "tukey"

Valid only when the input sequence is pure real and inverse is not TRUE.
Defaults to "none", i.e. no tapering window applied to the input time-series.

window.start

integer, optional
Specifies the starting point of tapering window.
Valid only when window is specified.
Defaults to 0.

window.length

integer, optional
Specifies the length of tapering window.
Valid only when window is specified. Defaults to the length from window.start to the end of input.

alpha

numeric, optional
Specifies the value of \(\alpha\) parameter for the following tapering window functions:

  • "blackman"

  • "cauchy"

  • "gaussian"

  • "poisson"

  • "poisson_hann"

  • "poisson_hanning"

Default value is tapering window dependent, specified as follows:

  • "blackman": 0.16

  • "cauchy": 3.0

  • "gaussian": 2.5

  • "poisson": 2.0

  • "poisson_hann": 2.0

  • "poisson_hanning": 2.0

beta

numeric, optional
Specifies the value of \(\beta\)(shape) parameter for the Kaiser window.
Valid only when window is "kaiser".
Defaults to 8.6.

attenuation

numeric, optional
Specifies the sidelobe attenuation for Chebyshev window.
Valid only when window takes the value of "cheb" or "chebwin".
Defaults to 50.

flattop.mode

character, optional
Specifies the mode of flattop window, either "symmetric" or "periodic".
Valid only when window is "flattop".
Defaults to "symmetric".

flattop.precision

character, optional
Specifies the precision of flat top window, either "none" or "octave".

tukey.r

numeric, optional
Specifies the value of shape parameter of the Tukey window, equivalent to the fraction of the window inside the cosine tapered region.
Defaults to 0.5.

Value

DataFrame

  • ID: with same name and type as input data.

  • REAL: type DOUBLE, representing real part of the transformed sequence.

  • IMAG: type DOUBLE, representing imaginary part of the transformed sequence.

Examples

Input DataFrame data:


> data$Collect()
   ID   RE   IM
1   1  2.0  9.0
2   2  3.0 -3.0
3   3  5.0  0.0
4   4  0.0  0.0
5   5 -2.0 -2.0
6   6 -9.0 -7.0
7   7  7.0  0.0

Call the function:


> result <-  hanaml.FFT(data, key = "ID")

Output:


> result$Collect()
   ID       REAL        IMAG
1   1   6.000000   -3.000000
2   2  16.273688   -0.900317
3   3  -5.393946    26.26511
4   4  -13.88322   18.514840
5   5  -4.233990   -2.947800
6   6   9.657319    3.189618
7   7   5.580151    21.87854