Ejemplo n.º 1
0
 def __init__(self, mic_positions, n_theta=20, n_phi=1, *args, **kwargs):
     """
     :param mic_positions: locations of microphones. Each row should be the
                         location of a given microphone. The dimension
                         is taken to be the number of columns of this
                         matrix
     :type mic_positions: numpy array
     :param n_theta: The number of points to sample in theta search
                     space where theta is angle in spherical coordinates
     :type n_theta: int
     :param n_phi: The number of points to sample in phi search space
                   where phi is the polar angle in spherical coordinates. The
                   default value is 1, which indicates a 2d search space
     :type n_phi: int
     """
     AudioLocalizer.__init__(self, *args, **kwargs)
     self._n_theta = n_theta
     self._n_phi = n_phi
     if mic_positions is not None:
         self._process_mic_positions(mic_positions)
         self._setup_distances()
         self._setup_search_space()
         self._setup_freq_spaces()
     else:
         sys.stderr.write(
             "WARNING: No mic positions provided -- certain public methods"
             "may fail")
 def __init__(self, mic_positions, n_theta=20, n_phi=1, *args, **kwargs):
     """
     :param mic_positions: locations of microphones. Each row should be the
                         location of a given microphone. The dimension
                         is taken to be the number of columns of this
                         matrix
     :type mic_positions: numpy array
     :param n_theta: The number of points to sample in theta search
                     space where theta is angle in spherical coordinates
     :type n_theta: int
     :param n_phi: The number of points to sample in phi search space
                   where phi is the polar angle in spherical coordinates. The
                   default value is 1, which indicates a 2d search space
     :type n_phi: int
     """
     AudioLocalizer.__init__(self, *args, **kwargs)
     self._n_theta = n_theta
     self._n_phi = n_phi
     if mic_positions is not None:
         self._process_mic_positions(mic_positions)
         self._setup_distances()
         self._setup_search_space()
         self._setup_freq_spaces()
     else:
         sys.stderr.write("WARNING: No mic positions provided -- certain public methods"
                          "may fail")
Ejemplo n.º 3
0
 def __init__(self, mic_positions, shift_n=31, shift_max=15, *args, **kwargs):
     """
      :param mic_positions: locations of microphones. Each row should be the
                          location of a given microphone. The dimension
                          is taken to be the number of columns of this
                          matrix
      :type mic_positions: numpy array
      :param sample_rate: Sample rate that was used when sampling data
      :type sample_rate: int
      :param shift_n: Number of points to break shift range into
      :type shift_n: int
      :param shift_max: Will search for shifts in range -shift_max to shift_max
      :type shift_max: int
      """
     AudioLocalizer.__init__(self, *args, **kwargs)
     if mic_positions is not None:
         self._mic_positions = mic_positions.copy()
         self._setup_distances()
     self._shift_n = shift_n + (1 - (shift_n % 2))  # Use odd number so zero shift possible
     self._shift_max = shift_max
Ejemplo n.º 4
0
 def __init__(self, mic_positions, shift_n=31, shift_max=15, *args, **kwargs):
     """
      :param mic_positions: locations of microphones. Each row should be the
                          location of a given microphone. The dimension
                          is taken to be the number of columns of this
                          matrix
      :type mic_positions: numpy array
      :param sample_rate: Sample rate that was used when sampling data
      :type sample_rate: int
      :param shift_n: Number of points to break shift range into
      :type shift_n: int
      :param shift_max: Will search for shifts in range -shift_max to shift_max
      :type shift_max: int
      """
     AudioLocalizer.__init__(self, *args, **kwargs)
     if mic_positions is not None:
         self._mic_positions = mic_positions.copy()
         self._setup_distances()
     self._shift_n = shift_n + (1 - (shift_n % 2))  # Use odd number so zero shift possible
     self._shift_max = shift_max