# nvidia.dali.fn.power_spectrum¶

nvidia.dali.fn.power_spectrum(*inputs, **kwargs)

Calculates power spectrum of the signal.

Supported backends
• ‘cpu’

Parameters

input (TensorList) – Input to the operator.

Keyword Arguments
• axis (int, optional, default = -1) –

Index of the dimension to be transformed to the frequency domain.

By default, the last dimension is selected.

• bytes_per_sample_hint (int or list of int, optional, default = [0]) –

Output size hint, in bytes per sample.

If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.

• nfft (int, optional) –

Size of the FFT.

By default, the nfft is selected to match the length of the data in the transformation axis.

The number of bins that are created in the output is calculated with the following formula:

nfft // 2 + 1


Note

The output only represents the positive part of the spectrum.

• power (int, optional, default = 2) –

Exponent of the FFT magnitude.

The supported values are:

• 2 for power spectrum (real*real + imag*imag)

• 1 for the complex magnitude (sqrt(real*real + imag*imag)).

• preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.

• seed (int, optional, default = -1) –

Random seed.

If not provided, it will be populated based on the global seed of the pipeline.