Robochameleon  v1.0
lin2dB.m
Go to the documentation of this file.
1 
2 function dB = lin2dB(lin,varargin)
3 
4 [type] = defaultargs({'db'},varargin);
5 
6 switch lower(type)
7  case 'db'
8  fact = 0;
9  case 'dbm'
10  fact = -30;
11  case 'dbu'
12  fact = -60;
13  otherwise
14  error('Conversion type can be ''dB'', ''dBm'', ''dBu''.')
15 end
16 
17 dB = 10*log10(lin)-fact;
function lin2dB(in lin, in varargin)
Convert linear units to dB.