fft

hana_ml.algorithms.pal.tsa.fft.fft(data, num_type=None, inverse=None, window=None, window_start=None, window_length=None, alpha=None, beta=None, attenuation=None, flattop_model=None, flattop_precision=None, r=None, flattop_mode=None)

Fast Fourier Transform (FFT) decomposes a function of time (a signal) into the frequencies that make it up. In engineering, discrete Fourier transform is applied more frequently, which is realized in PAL.

Parameters
dataDataFrame

The DataFrame contains at most 3 columns, where:

  • The first column is ID, which indicates order of sequence.

  • The second column is the real part of the sequence.

  • The third column indicates imaginary part of the sequence which is optional.

num_type{'real', 'imag'}, optional

The number type for the second column of the input data. Valid only when the input data contains 3 columns.

Defaults to 'real'.

inversebool, optional

If False, forward FFT is applied; otherwise inverse FFT is applied.

Defaults to False.

windowstr, optional

Available input

  • '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'

Only available for pure real forward FFT.

window_startint, optional

Specifies the starting point of tapering window.

Defaults to 0.

window_lengthint, optional

Specifies the length of Tapering Window.

No default value.

alphafloat, optional

Parameter for the Window and its default value:

  • Blackman, defaults to 0.16

  • Cauchy, defaults to 3.0

  • Gaussian, defaults to 2.5

  • Poisson, defaults to 2.0

  • Poisson_hann(Poisson_hanning), defaults to 2.0

betafloat, optional

A parameter for Kaiser Window.

Defaults to 8.6.

attenuationfloat, optional

A parameter for Cheb(Chebwin).

Defaults to 50.0.

flattop_modelstr, optional(deprecated)

A parameter for Flattop Window. Can be:

  • 'symmetric'

  • 'periodic'

Defaults to 'symmetric'. Deprecated, please use flattop_mode instead.

flattop_precisionstr, optional

A parameter for Flattop Window. Can be:

  • 'none'

  • 'octave'

Defaults to 'none'.

rfloat, optional

A parameter for Tukey Window.

Defaults to 0.5.

flattop_mode{'symmetric', 'periodic'}, optional

Specifies the sampling method for flattop window.

Defaults to 'symmetric'.

Returns
DataFrame

Dataframe containing the transformed sequence, structured as follows:

  • 1st column: ID, with same name and type as input data.

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

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

Examples

>>> result = fft(data=df, inverse=False)
>>> result.collect()