You are here : matlabSignal Processingdb2mag

db2mag() - Signal Processing

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).


Syntax

y = db2mag(ydb) example


Example

Magnitudes of Random NumbersOpen This ExampleGenerate 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(:,:,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(:,:,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


Output / Return Value


Limitations


Alternatives / See Also


Reference