code: def check_operator_spectrogram_vs_python_wave_1d(
      device,
      batch_size,
      input_length,
      nfft,
      window_length,
      window_step,
      window,
      center,
  ):
      f = 4000  # [Hz]
      sr = 44100  # [Hz]
      x = np.arange(input_length, dtype=np.float32)
      y = np.sin(2 * np.pi * f * x / sr)
  
      data1 = ConstantDataIterator(batch_size, y, dtype=np.float32)
      data2 = ConstantDataIterator(batch_size, y, dtype=np.float32)
  
      compare_pipelines(
          SpectrogramPipeline(
              device,
              batch_size,
              iter(data1),
              nfft=nfft,
              window_length=window_length,
              window_step=window_step,
              window=window,
              center=center,
          ),
          SpectrogramPythonPipeline(
              device,
              batch_size,
              iter(data2),
              nfft=nfft,
              window_length=window_length,
              window_step=window_step,
              window=window,
              center=center,
          ),
          batch_size=batch_size,
          N_iterations=3,
          eps=1e-04,
      )
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import nvidia.dali.types
  import nvidia.dali
  import numpy
  from functools import partial
  from test_utils import get_files
  from test_utils import compare_pipelines
  from test_utils import RandomDataIterator
  from test_utils import ConstantDataIterator
  import librosa
  import math
label_desc: Use image node_id 6 for calling a global function with example usage: check_operator_spectrogram_vs_python_wave_1d(device, batch_size, input_length, nfft, window_length, window_step, window, center) without return types