db2mag
Convert decibels (dB) to magnitude
Syntax
Description
Examples
Magnitude of Elements in an Array
For this example, generate a 2-by-3-by-4 array of Gaussian random numbers. Assume the numbers are expressed in decibels and compute the corresponding magnitudes.
rng('default');
ydb = randn(2,3,4);
y = db2mag(ydb)
y = y(:,:,1) = 1.0639 0.7710 1.0374 1.2351 1.1044 0.8602 y(:,:,2) = 0.9513 1.5098 0.8561 1.0402 1.3755 1.4182 y(:,:,3) = 1.0871 1.0858 0.9858 0.9928 0.9767 1.1871 y(:,:,4) = 1.1761 1.0804 1.0861 1.1772 0.8702 1.2065
Use the definition to check the calculation.
chck = 10.^(ydb/20)
chck = chck(:,:,1) = 1.0639 0.7710 1.0374 1.2351 1.1044 0.8602 chck(:,:,2) = 0.9513 1.5098 0.8561 1.0402 1.3755 1.4182 chck(:,:,3) = 1.0871 1.0858 0.9858 0.9928 0.9767 1.1871 chck(:,:,4) = 1.1761 1.0804 1.0861 1.1772 0.8702 1.2065
Input Arguments
ydb
— Input array in decibels
scalar | vector | matrix | array
Input array in decibels, specified as a scalar, vector, matrix, or an array. When
ydb
is nonscalar, db2mag
is an element-wise
operation.
Data Types: single
| double
Output Arguments
y
— Magnitude measurements
scalar | vector | matrix | array
Magnitude measurements, returned as a scalar, vector, matrix, or an array of the
same size as ydb
.
Version History
Introduced in R2008a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)