def peakInterp(mX, pX, ploc):
 val = mX[ploc]
 lval = mX[(ploc - 1)]
 rval = mX[(ploc + 1)]
 iploc = (ploc + ((0.5 * (lval - rval)) / ((lval - (2 * val)) + rval)))
 ipmag = (val - ((0.25 * (lval - rval)) * (iploc - ploc)))
 ipphase = np.interp(iploc, np.arange(0, pX.size), pX)
 return (iploc, ipmag, ipphase)

def peakInterp ( mX , pX , ploc ) : val = mX [ ploc ] lval = mX [ ( ploc - 1 ) ] rval = mX [ ( ploc + 1 ) ] iploc = ( ploc + ( ( 0.5 * ( lval - rval ) ) / ( ( lval - ( 2 * val ) ) + rval ) ) ) ipmag = ( val - ( ( 0.25 * ( lval - rval ) ) * ( iploc - ploc ) ) ) ipphase = np . interp ( iploc , np . arange ( 0 , pX . size ) , pX ) return ( iploc , ipmag , ipphase )
interpolate peak values using parabolic interpolation mx .