code: def extract_loudness(signal, sampling_rate, block_size, n_fft=2048):
      S = li.stft(
          signal,
          n_fft=n_fft,
          hop_length=block_size,
          win_length=n_fft,
          center=True,
      )
      S = np.log(abs(S) + 1e-7)
      f = li.fft_frequencies(sampling_rate, n_fft)
      a_weight = li.A_weighting(f)
  
      S = S + a_weight.reshape(-1, 1)
  
      S = np.mean(S, 0)[..., :-1]
  
      return S
  
imports: import math
  import librosa
  import numpy
  import torch
  import torch.fft
  import torch.nn
  from scipy.signal import get_window
label_desc: Use image node_id 8 for calling a global function with example usage: extract_loudness(signal, sampling_rate, block_size, n_fft) and returns: S