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

hanaml.FFT(data, key, num.type = NULL, inverse = NULL)

Arguments

data

DataFrame
DataFrame containting the data.

key

character
Name of the ID column.

num.type

list of character, 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.

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.265112
4   4  -13.883222   18.514840
5   5  -4.233990   -2.947800
6   6   9.657319    3.189618
7   7   5.580151    21.878547