parameters: (self, frequencies)
return_statement: return mels
docstring: Converts frequencies from hz to mel scale. Input can be a number or a vector.
docstring_summary: Converts frequencies from hz to mel scale. Input can be a number or a vector.
docstring_tokens: Converts frequencies from hz to mel scale . Input can be a number or a vector .
function: def hz_to_mel(self, frequencies):
          '''
              Converts frequencies from hz to mel scale. Input can be a number or a vector.
          '''
          frequencies = np.asanyarray(frequencies)
  
          f_min = 0.0
          f_sp = 200.0 / 3
  
          mels = (frequencies - f_min) / f_sp
  
          # Fill in the log-scale part
          min_log_hz = 1000.0  # beginning of log region (Hz)
          min_log_mel = (min_log_hz - f_min) / f_sp  # same (Mels)
          logstep = np.log(6.4) / 27.0  # step size for log region
  
          if frequencies.ndim:
              # If we have array data, vectorize
              log_t = frequencies >= min_log_hz
              mels[log_t] = min_log_mel + np.log(frequencies[log_t] / min_log_hz) / logstep
          elif frequencies >= min_log_hz:
              # If we have scalar data, directly
              mels = min_log_mel + np.log(frequencies / min_log_hz) / logstep
          return mels
function_tokens: def hz_to_mel ( self , frequencies ) : frequencies = np . asanyarray ( frequencies ) f_min = 0.0 f_sp = 200.0 / 3 mels = ( frequencies - f_min ) / f_sp # Fill in the log-scale part min_log_hz = 1000.0 # beginning of log region (Hz) min_log_mel = ( min_log_hz - f_min ) / f_sp # same (Mels) logstep = np . log ( 6.4 ) / 27.0 # step size for log region if frequencies . ndim : # If we have array data, vectorize log_t = frequencies >= min_log_hz mels [ log_t ] = min_log_mel + np . log ( frequencies [ log_t ] / min_log_hz ) / logstep elif frequencies >= min_log_hz : # If we have scalar data, directly mels = min_log_mel + np . log ( frequencies / min_log_hz ) / logstep return mels