SignalUtils::AmpltToDb Function

double AmpltToDb(TDenseMtxVec *Data, double Base, double span, double aMax, bool Normalized);

Convert amplitude to decibels in place.

#NameTypeDescription
1DataTDenseMtxVec *Amplitude data; converted to dB in place.
2BasedoubleLogarithm base; use 10 for decibels.
3spandouble
4aMaxdoubleReference amplitude X_(max).
5NormalizedboolWhen True, peak maps to 0 dB and floor to -Span.

Returns: The clipping floor -Span.

Remarks:

Converts the amplitude data in Data to a decibel scale in place, using X_(dB) = 20 log_(Base)(X/X_(max)), clipped from below at -Span. Use Base =10 for true decibels; the scale factor is fixed at 20 (so this is the amplitude, not the power, convention). Span is the dynamic range in dB: any value mapping below -Span is set to -Span. When Normalized is False the reference X_(max) = aMax is used as given; when Normalized is True the data is normalized so its maximum becomes 0 dB and its floor -Span. If aMax is not positive every output is set to -Span. The function returns -Span.

Declared in Dew::Signal::Units::SignalUtils · Dew.Signal/Units.SignalUtils.h · Cross-compiler