class_docstr: The :class:`Signal` class represents a signal as a (memory-mapped) numpy
  array and enhances it with a number of attributes.
  
  Parameters
  ----------
  data : numpy array, str or file handle
      Signal data or file name or file handle.
  sample_rate : int, optional
      Desired sample rate of the signal [Hz], or 'None' to return the
      signal in its original rate.
  num_channels : int, optional
      Reduce or expand the signal to `num_channels` channels, or 'None'
      to return the signal with its original channels.
  channel : int, optional
      When reducing a signal to `num_channels` of 1, use this channel,
      or 'None' to return the average across all channels.
  start : float, optional
      Start position [seconds].
  stop : float, optional
      Stop position [seconds].
  norm : bool, optional
      Normalize the signal to maximum range of the data type.
  gain : float, optional
      Adjust the gain of the signal [dB].
  dtype : numpy data type, optional
      The data is returned with the given dtype. If 'None', it is returned
      with its original dtype, otherwise the signal gets rescaled. Integer
      dtypes use the complete value range, float dtypes the range [-1, +1].
  
  Notes
  -----
  `sample_rate` or `num_channels` can be used to set the desired sample rate
  and number of channels if the audio is read from file. If set to 'None'
  the audio signal is used as is, i.e. the sample rate and number of channels
  are determined directly from the audio file.
  
  If the `data` is a numpy array, the `sample_rate` is set to the given value
  and `num_channels` is set to the number of columns of the array.
  
  The `gain` can be used to adjust the level of the signal.
  
  If both `norm` and `gain` are set, the signal is first normalized and then
  the gain is applied afterwards.
  
  If `norm` or `gain` is set, the selected part of the signal is loaded into
  memory completely, i.e. .wav files are not memory-mapped any more.
  
  Examples
  --------
  Load a mono audio file:
  
  >>> sig = Signal('tests/data/audio/sample.wav')
  >>> sig
  Signal([-2494, -2510, ...,   655,   639], dtype=int16)
  >>> sig.sample_rate
  44100
  
  Load a stereo audio file, down-mix it to mono:
  
  >>> sig = Signal('tests/data/audio/stereo_sample.flac', num_channels=1)
  >>> sig
  Signal([ 36,  36, ..., 524, 495], dtype=int16)
  >>> sig.num_channels
  1
  
  Load and re-sample an audio file:
  
  >>> sig = Signal('tests/data/audio/sample.wav', sample_rate=22050)
  >>> sig
  Signal([-2470, -2553, ...,   517,   677], dtype=int16)
  >>> sig.sample_rate
  22050
  
  Load an audio file with `float32` data type (i.e. rescale it to [-1, 1]):
  
  >>> sig = Signal('tests/data/audio/sample.wav', dtype=np.float32)
  >>> sig
  Signal([-0.07611, -0.0766 , ...,  0.01999,  0.0195 ], dtype=float32)
  >>> sig.dtype
  dtype('float32')
class_docstr_tok: ["The",":","class",":","`","Signal","`","class","represents","a","signal","as","a","(","memory-mapped",")","numpy","array","and","enhances","it","with","a","number","of","attributes",".","Parameters","--","--","--","--","--","data",":","numpy","array",",","str","or","file","handle","Signal","data","or","file","name","or","file","handle",".","sample_rate",":","int",",","optional","Desired","sample","rate","of","the","signal","[","Hz","]",",","or","'None","'","to","return","the","signal","in","its","original","rate",".","num_channels",":","int",",","optional","Reduce","or","expand","the","signal","to","`","num_channels","`","channels",",","or","'None'","to","return","the","signal","with","its","original","channels",".","channel",":","int",",","optional","When","reducing","a","signal","to","`","num_channels","`","of","1",",","use","this","channel",",","or","'None","'","to","return","the","average","across","all","channels",".","start",":","float",",","optional","Start","position","[","seconds","]",".","stop",":","float",",","optional","Stop","position","[","seconds","]",".","norm",":","bool",",","optional","Normalize","the","signal","to","maximum","range","of","the","data","type",".","gain",":","float",",","optional","Adjust","the","gain","of","the","signal","[","dB","]",".","dtype",":","numpy","data","type",",","optional","The","data","is","returned","with","the","given","dtype",".","If","'None","'",",","it","is","returned","with","its","original","dtype",",","otherwise","the","signal","gets","rescaled",".","Integer","dtypes","use","the","complete","value","range",",","float","dtypes","the","range","[","-1",",","+1","]",".","Notes","--","--","-","`","sample_rate","`","or","`","num_channels","`","can","be","used","to","set","the","desired","sample","rate","and","number","of","channels","if","the","audio","is","read","from","file",".","If","set","to","'None'","the","audio","signal","is","used","as","is",",","i.e",".","the","sample","rate","and","number","of","channels","are","determined","directly","from","the","audio","file",".","If","the","`","data","`","is","a","numpy","array",",","the","`","sample_rate","`","is","set","to","the","given","value","and","`","num_channels","`","is","set","to","the","number","of","columns","of","the","array",".","The","`","gain","`","can","be","used","to","adjust","the","level","of","the","signal",".","If","both","`","norm","`","and","`","gain","`","are","set",",","the","signal","is","first","normalized","and","then","the","gain","is","applied","afterwards",".","If","`","norm","`","or","`","gain","`","is","set",",","the","selected","part","of","the","signal","is","loaded","into","memory","completely",",","i.e",".",".wav","files","are","not","memory-mapped","any","more",".","Examples","--","--","--","--","Load","a","mono","audio","file",":",">",">",">","sig","=","Signal","(","'tests\/data\/audio\/sample.wav","'",")",">",">",">","sig","Signal","(","[","-2494",",","-2510",",","...",",","655",",","639","]",",","dtype=int16",")",">",">",">","sig.sample_rate","44100","Load","a","stereo","audio","file",",","down-mix","it","to","mono",":",">",">",">","sig","=","Signal","(","'tests\/data\/audio\/stereo_sample.flac","'",",","num_channels=1",")",">",">",">","sig","Signal","(","[","36",",","36",",","...",",","524",",","495","]",",","dtype=int16",")",">",">",">","sig.num_channels","1","Load","and","re-sample","an","audio","file",":",">",">",">","sig","=","Signal","(","'tests\/data\/audio\/sample.wav","'",",","sample_rate=22050",")",">",">",">","sig","Signal","(","[","-2470",",","-2553",",","...",",","517",",","677","]",",","dtype=int16",")",">",">",">","sig.sample_rate","22050","Load","an","audio","file","with","`","float32","`","data","type","(","i.e",".","rescale","it","to","[","-1",",","1","]",")",":",">",">",">","sig","=","Signal","(","'tests\/data\/audio\/sample.wav","'",",","dtype=np.float32",")",">",">",">","sig","Signal","(","[","-0.07611",",","-0.0766",",","...",",","0.01999",",","0.0195","]",",","dtype=float32",")",">",">",">","sig.dtype","dtype","(","'float32","'",")"]
code: def __init__(
      self,
      data,
      sample_rate=SAMPLE_RATE,
      num_channels=NUM_CHANNELS,
      channel=CHANNEL,
      start=START,
      stop=STOP,
      norm=NORM,
      gain=GAIN,
      dtype=DTYPE,
      **kwargs,
  ):
      # this method is for documentation purposes only
      pass
  
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 1 to create a new Signal object from inherited base classes: np with example: obj = Signal(data, sample_rate, num_channels, channel, start, stop, norm, gain, dtype)