DewDSPMasterNET
AmpltToDb Routine
Summary
Convert amplitude to decibels.

Unit
SignalUtils

Declaration
Function AmpltToDb(Data: TDenseMtxVec; Base, Span, AMax: TSample; Normalized: boolean): TSample;

Description
Converts Data (amplitude) to decibels. Base is the base of the logarithm and should be 10, if decibels are desired. The logarithm is then scaled by 20 according to the formula LogN(Base,Value)*20. Span defines the dynamic range in dB on the left axis. The values below the span will be replaced with the minimum allowed value which is calculated as: AMax - Span. If Normalized is True, the maximum will be set to zero and minimum to -Span. The function returns the new minimum value. This minimum value is equal to -Span, if Normalized is True.

Copyright 2008 Dew Research
http://www.dewresearch.com