code: def power_spectrum_numpy(nfft, axis, waveform):
      fft_out = np.fft.fft(waveform, axis=axis, n=nfft)
      power_spectrum = fft_out.real**2 + fft_out.imag**2
      shape = waveform.shape
  
      out_shape = list(shape)
      out_shape[axis] = nfft // 2 + 1
      out_shape = tuple(out_shape)
  
      if len(out_shape) == 1:
          out = power_spectrum[0 : out_shape[0]]
      elif len(out_shape) == 2:
          out = power_spectrum[0 : out_shape[0], 0 : out_shape[1]]
      elif len(out_shape) == 3:
          out = power_spectrum[
              0 : out_shape[0], 0 : out_shape[1], 0 : out_shape[2]
          ]
      return out
  
file_path: DALI/dali/test/python/operator_1/test_power_spectrum.py
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import numpy
  from functools import partial
  from test_utils import compare_pipelines
  from test_utils import RandomDataIterator
label_desc: Use image node_id 1 for calling a global function with example usage: power_spectrum_numpy(nfft, axis, waveform) and returns: out