mag2db
Convert a magnitude to decibels (dB).
📝Syntax
db = mag2db(mag)
📥Input Arguments
Parameter Description
mag input array: scalar, vector or matrix.
📤Output Arguments
Parameter Description
db corresponding values in decibels
📄Description

db = mag2db(mag) converts magnitude values to decibels (dB).

The conversion formula is:

$$\text{dB} = 20 \log_{10}(\text{magnitude})$$

This conversion is commonly used in signal processing, acoustics, and electronics to express ratios on a logarithmic scale.

💡Examples
DB = mag2db([1, 0.01])
🔗See Also
db2mag
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub