code: def sound_pressure_level(signal, p_ref=None):
      """
      Compute the sound pressure level of a (framed) signal.
  
      Parameters
      ----------
      signal : numpy array
          Signal.
      p_ref : float, optional
          Reference sound pressure level; if 'None', take the max amplitude
          value for the data-type, if the data-type is float, assume amplitudes
          are between -1 and +1.
  
      Returns
      -------
      spl : float
          Sound pressure level of the signal [dB].
  
      Notes
      -----
      From http://en.wikipedia.org/wiki/Sound_pressure: Sound pressure level
      (SPL) or sound level is a logarithmic measure of the effective sound
      pressure of a sound relative to a reference value. It is measured in
      decibels (dB) above a standard reference level.
  
      If `signal` is a `FramedSignal`, the sound pressure level is computed for
      each frame individually.
  
      """
      # compute the sound pressure level for every frame of the signal
      if isinstance(signal, FramedSignal):
          return np.array(
              [sound_pressure_level(frame) for frame in signal]
          )
      # compute the RMS
      rms = root_mean_square(signal)
      # find a reasonable default reference value if None is given
      if p_ref is None:
          if np.issubdtype(signal.dtype, np.integer):
              p_ref = float(np.iinfo(signal.dtype).max)
          else:
              p_ref = 1.0
      # normal SPL computation. ignore warnings when taking the log of 0,
      # then replace the resulting -inf values with the smallest finite number
      with np.errstate(divide="ignore"):
          return np.nan_to_num(20.0 * np.log10(rms / p_ref))
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  import numpy
  from ..processors import BufferProcessor, Processor
  from ..utils import integer_types
label_desc: Use image node_id 11 for calling a global function with example usage: sound_pressure_level(signal, p_ref) and returns: np, np