def rms(data):
 if (data.dtype == np.int16):
  md2 = (data.astype(np.float) ** 2)
 else:
  md2 = (data ** 2)
 return np.sqrt(np.mean(md2))

def rms ( data ) : if ( data . dtype == np . int16 ) : md2 = ( data . astype ( np . float ) ** 2 ) else : md2 = ( data ** 2 ) return np . sqrt ( np . mean ( md2 ) )
basic audio-power measure: root-mean-square of data .