class_docstr: Measure of audio loudness using standard ITU-R BS.1770-3
  
  WARNING: Sampling frequencies other that 44100Hz and 48000Hz are not fully supported
  
  Outputs: 
  Gated Loudness
  Relative Threshold
  Block Loudness    
class_docstr_tok: ["Measure","of","audio","loudness","using","standard","ITU-R","BS.1770-3","WARNING",":","Sampling","frequencies","other","that","44100Hz","and","48000Hz","are","not","fully","supported","Outputs",":","Gated","Loudness","Relative","Threshold","Block","Loudness"]
code: def setup(
      self,
      channels=None,
      samplerate=None,
      blocksize=None,
      totalframes=None,
  ):
      super(LoudnessITU, self).setup(
          channels, samplerate, blocksize, totalframes
      )
  
      self.input_blocksize = int(
          round(0.4 * self.input_samplerate)
      )  # return a 400ms block
      self.input_stepsize = int(
          round(0.1 * self.input_samplerate)
      )  # 75% overlap <=> 25% step
      self.z = [
          [] for x in range(self.input_channels)
      ]  # generate empty list of list which dimensionality matches the number of channels
  
      # Setting filters coefficients according to sampling frequency
      if self.input_samplerate == 44100:
          self.B1 = np.array(
              [1.53093728623786, -2.65120001232265, 1.16732946528280]
          )
          self.A1 = np.array(
              [1.0, -1.66410930225081, 0.711176041448821]
          )
          self.B2 = np.array(
              [0.994975383507587, -1.98995076701517, 0.994975383507587]
          )
          self.A2 = np.array([1, -1.98992552008493, 0.989976013945421])
      elif self.input_samplerate == 48000:
          self.B1 = np.array(
              [1.53512485958697, -2.69169618940638, 1.19839281085285]
          )
          self.A1 = np.array([1.0, -1.69065929318241, 0.73248077421585])
          self.B2 = np.array([1.0, -2.0, 1.0])
          self.A2 = np.array([1.0, -1.99004745483398, 0.99007225036621])
      else:
          warnings.warn(
              "Sample frequency is neither 44100Hz nor 48000Hz, using filter coeficients optimised for 48000Hz"
          )
          self.B1 = np.array(
              [1.53512485958697, -2.69169618940638, 1.19839281085285]
          )
          self.A1 = np.array([1.0, -1.69065929318241, 0.73248077421585])
          self.B2 = np.array([1.0, -2.0, 1.0])
          self.A2 = np.array([1.0, -1.99004745483398, 0.99007225036621])
  
file_path: TimeSide/timeside/plugins/analyzer/loudness_ITU.py
imports: from timeside.core import implements, interfacedoc
  from timeside.core.analyzer import Analyzer
  from timeside.core.api import IAnalyzer
  from timeside.core.tools.parameters import HasTraits
  from timeside.core.preprocessors import downmix_to_mono, frames_adapter
  import numpy
  import numpy
  from scipy.signal import lfilter
  import warnings
  from timeside.core.grapher import DisplayAnalyzer
label_desc: Use image node_id 2 for calling the LoudnessITU obj's underlying member method code with example usage: obj.setup(channels, samplerate, blocksize, totalframes) without return types