Convert decibels to magnitude
y = db2mag(ydb)
example
y = db2mag(ydb) returns the magnitude measurements, y, that correspond to the decibel (dB) values specified in ydb. The relationship between magnitude and decibels is ydb = 20 log10(y).
y
ydb
collapse all
Generate a 2-by-4-by-2 array of Gaussian random numbers. Assume the numbers are expressed in decibels and compute the corresponding magnitudes.
r = randn(2,4,2); mags = db2mag(r)
mags = mags(:,:,1) = 1.0639 0.7710 1.0374 0.9513 1.2351 1.1044 0.8602 1.0402 mags(:,:,2) = 1.5098 0.8561 1.0871 1.0858 1.3755 1.4182 0.9928 0.9767
Use the definition to check the calculation.
chck = 10.^(r/20)
chck = chck(:,:,1) = 1.0639 0.7710 1.0374 0.9513 1.2351 1.1044 0.8602 1.0402 chck(:,:,2) = 1.5098 0.8561 1.0871 1.0858 1.3755 1.4182 0.9928 0.9767
Input array in decibels, specified as a scalar, vector, matrix, or N-D array. When ydb is nonscalar, db2mag is an element-wise operation.
db2mag
Data Types: single | double
single
double
Magnitude measurements, returned as a scalar, vector, matrix, or N-D array of the same size as ydb.
db | db2pow | mag2db | pow2db
db
db2pow
mag2db
pow2db
You have a modified version of this example. Do you want to open this example with your edits?