<< postpad | FOSSEE_Signal_Processing_Toolbox | prepad >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > pow2db

# pow2db

Convert power values to decibels (dB).

### Syntax

    ydb = pow2db(y)

### Parameters

y:

  Input power values (scalar, vector, or matrix). Must be non-negative.

### Description

The `pow2db` function converts power values specified in `y` to decibels (dB) using the formula: ydb = 10 * log10(y). If `y` contains zeros, the corresponding `ydb` values are set to -Inf. If `y` contains negative values, an error is raised.

### Examples

    // Convert a single power value to dB:
    y = 2000;
    ydb = pow2db(y)

### Authors

- Debdeep Dey

Report an issue
<< postpad | FOSSEE_Signal_Processing_Toolbox | prepad >>