#NEWLINE# def dbp( x ) : #NEWLINE# #INDENT# 'Calculate the dB equivalent of the power ratio ``x``.\n\n    .. math::\n\n        P_{dB} = 10 \\mathrm{log}_{10}(x)\n\n    **Parameters:**\n\n    x : scalar or sequence\n        The power ratio to be converted.\n\n    **Returns:**\n\n    PdB : scalar or sequence\n           The input expressed in dB.\n\n    .. seealso:: :func:`undbp`, :func:`db`, :func:`dbm`, :func:`dbv`\n\n    ' #NEWLINE# iform = save_input_form ( x ) #NEWLINE# x = carray ( x ) #NEWLINE# y = ( ( - np . Inf ) * np . ones ( x . shape ) ) #NEWLINE# nonzero = ( x != 0 ) #NEWLINE# y [ nonzero ] = ( 10.0 * np . log10 ( np . abs ( x [ nonzero ] ) ) ) #NEWLINE# return restore_input_form ( y , iform )