code: def get_mel_spectrogram(fb, wav, stft_params):
      EPSILON = 1e-9
      window_fn = torch.hann_window
  
      spec = torch.stft(
          input=wav,
          n_fft=stft_params["n_fft"],  # 1024
          hop_length=stft_params["hop_length"],  # 256
          win_length=stft_params["win_length"],  # 1024
          window=window_fn(stft_params["win_length"], periodic=False)
          .to(torch.float)
          .to("cuda")
          if window_fn
          else None,
          return_complex=True,
          center=True,
      )
  
      if spec.dtype in [torch.cfloat, torch.cdouble]:
          spec = torch.view_as_real(spec)
      spec = torch.sqrt(spec.pow(2).sum(-1) + EPSILON)
  
      mel = torch.matmul(fb.to(spec.dtype), spec)
      log_mel = torch.log(
          torch.clamp(mel, min=torch.finfo(mel.dtype).tiny)
      )
  
      return log_mel
  
imports: import argparse
  import json
  import os
  import time
  from multiprocessing import Pool
  from pathlib import Path
  import hydra.utils
  import librosa
  import numpy
  import torch
  from omegaconf import open_dict
  from tqdm import tqdm
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.tts.models import ssl_tts
  from nemo.collections.tts.parts.utils.tts_dataset_utils import get_base_dir
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: get_mel_spectrogram(fb, wav, stft_params) and returns: log_mel