def peakDetection(mX, t):
 thresh = np.where((mX[1:(-1)] > t), mX[1:(-1)], 0)
 next_minor = np.where((mX[1:(-1)] > mX[2:]), mX[1:(-1)], 0)
 prev_minor = np.where((mX[1:(-1)] > mX[:(-2)]), mX[1:(-1)], 0)
 ploc = ((thresh * next_minor) * prev_minor)
 ploc = (ploc.nonzero()[0] + 1)
 return ploc

def peakDetection ( mX , t ) : thresh = np . where ( ( mX [ 1 : ( - 1 ) ] > t ) , mX [ 1 : ( - 1 ) ] , 0 ) next_minor = np . where ( ( mX [ 1 : ( - 1 ) ] > mX [ 2 : ] ) , mX [ 1 : ( - 1 ) ] , 0 ) prev_minor = np . where ( ( mX [ 1 : ( - 1 ) ] > mX [ : ( - 2 ) ] ) , mX [ 1 : ( - 1 ) ] , 0 ) ploc = ( ( thresh * next_minor ) * prev_minor ) ploc = ( ploc . nonzero ( ) [ 0 ] + 1 ) return ploc
detect spectral peak locations mx: magnitude spectrum .