Accelerating the pace of engineering and science

# db2pow

Convert decibels to power

## Description

example

y = db2pow(ydb) returns the power measurements, y, that correspond to the decibel (dB) values specified in ydb. The relationship between power and decibels is ydb = 10 log10(y).

## Examples

expand all

### Power Values of Random Numbers

Generate a 2-by-4-by-2 array of Gaussian random numbers. Assume the numbers are expressed in decibels and compute the corresponding power measurements.

```r = randn(2,4,2);

pows = db2pow(r)
```
```pows(:,:,1) =

1.1318    0.5944    1.0762    0.9050
1.5254    1.2196    0.7400    1.0821

pows(:,:,2) =

2.2795    0.7328    1.1818    1.1789
1.8921    2.0114    0.9856    0.9539

```

Use the definition to check the calculation.

```chck = 10.^(r/10)
```
```chck(:,:,1) =

1.1318    0.5944    1.0762    0.9050
1.5254    1.2196    0.7400    1.0821

chck(:,:,2) =

2.2795    0.7328    1.1818    1.1789
1.8921    2.0114    0.9856    0.9539

```

## Input Arguments

expand all

### ydb — Input array in decibelsscalar | vector | matrix | N-D array

Input array in decibels, specified as a scalar, vector, matrix, or N-D array. When ydb is nonscalar, db2pow is an element-wise operation.

Data Types: single | double

## Output Arguments

expand all

### y — Power measurementsscalar | vector | matrix | N-D array

Power measurements, returned as a scalar, vector, matrix, or N-D array of the same size as ydb.