hanaml.Periodogram is a R wrapper for SAP HANA PAL Partition algorithm. Periodogram is an estimate of the spectral density of a signal.

hanaml.Periodogram(
  data,
  key = NULL,
  endog = NULL,
  sampling.rate = NULL,
  num.fft = NULL,
  freq.range = NULL,
  spectrum.type = NULL,
  window = NULL,
  alpha = NULL,
  beta = NULL,
  attenuation = NULL,
  mode = NULL,
  precision = NULL,
  r = NULL
)

Arguments

data

DataFrame
DataFrame containting the data.

key

character
Name of the ID column.

endog

character, optional
The endogenous variable, i.e. time series.
Defaults to the first non-ID column.

sampling.rate

double, optional
Sampling frequency of the sequence. Defaults to 1.0.

num.fft

integer, optional
Number of DFT points. If num.fft is smaller than the length of the input, the input is cropped. If it is larger, the input is padded with zeros.
Defaults to the length of sequence.

freq.range

c("one.sides", "two.sides"), optional
Indicates result frequency range.
Defaults to "one.sides".

spectrum.type

c("density", "spectrum"), optional
Indicates power spectrum scaling type.
Defaults to "density".

window

character, optional
Available input window type:

  • 'none'

  • 'bartlett'

  • 'bartlett.hann'

  • 'blackman'

  • 'blackman.harris'

  • 'bohman'

  • 'chebwin'

  • 'cosine'

  • 'flattop'

  • 'gaussian'

  • 'hamming'

  • 'hann'

  • 'kaiser'

  • 'nuttall'

  • 'parzen'

  • 'tukey'

No default value.

alpha

double, optional
Window parameter. Only valid for Blackman and Gaussian window.
Defaults to "Blackman":0.16, "Gaussian":2.5.

beta

double, optional
Parameter for Kaiser Window. Only valid for Kaiser window.
Defaults to 8.6.

attenuation

double, optional
Parameter for Chebwin. Only valid for Chebwin window.
Defaults to 50.0.

mode

c('symmetric', 'periodic'), optional
Parameter for Flattop Window. Only valid for Flattop window.
Defaults to 'symmetric'.

precision

c('none', 'octave'), optional
Parameter for Flattop Window. Only valid for Flattop window.
Defaults to 'none'.

r

double, optional
Parameter for Tukey Window. Only valid for Tukey window.
Defaults to 0.5.

Value

DataFrames
Result, structured as follows:

  • ID: ID column.

  • FREQ: Value of sample frequencies.

  • PXX: Power spectral density or power spectrum of input data.

Examples

Time series data:


> data$collect()
   ID    X
0   1 -2.0
1   2  8.0
2   3  6.0
3   4  4.0
4   5  1.0
5   6  0.0
6   7  3.0
7   8  5.0

Call the function:


> res <- hanaml.Periodogram(data=data,
                            key='ID',
                            endog='X',
                            sampling.rate=100,
                            window="hamming",
                            freq.range="two.sides")

Output:


> res$Collect()
   ID  FREQ       PXX
0   1   0.0  0.449371
1   2  12.5  0.072737
2   3  25.0  0.075790
3   4  37.5  0.006659
4   5 -50.0  0.000960
5   6 -37.5  0.006659
6   7 -25.0  0.075790
7   8 -12.5  0.072737