Signal Toolkit - db


Function File: dbout = db (x)
Function File: dbout = db (x, signaltype)
Function File: dbout = db (x, R)
Function File: dbout = db (x, "voltage", R)

Convert signal values to decibels (dB).

If x represents voltage (default):

 dbout = 10 * log10 (abs(x).^2 / R)
 

where R is the resistance in ohms (default = 1).

If x represents power:

 dbout = 10 * log10 (x)
 

Usage forms:

db(x)

Voltage conversion with R = 1.

db(x, signaltype)

signaltype is "voltage" (default) or "power".

db(x, R)

Voltage conversion with resistance R. R can be a scalar, vector, matrix, or N-D array with a size compatible with x.

db(x, "voltage", R)

Same as db(x, R).

See also: pow2db, db2pow.