control.matlab.mag2db

control.matlab.mag2db(mag)[source]

Convert a magnitude to decibels (dB).

If A is magnitude,

db = 20 * log10(A)

Parameters

mag (float or ndarray) – input magnitude or array of magnitudes

Returns

db – corresponding values in decibels

Return type

float or ndarray

Examples

>>> ct.mag2db(10.0)                                         
20.0
>>> ct.mag2db(np.array([1, 0.01]))                          
array([  0., -40.])