double AmpltToDb(TDenseMtxVec *Data, double Base, double span, double aMax, bool Normalized);
Convert amplitude to decibels in place.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TDenseMtxVec * | Amplitude data; converted to dB in place. |
| 2 | Base | double | Logarithm base; use 10 for decibels. |
| 3 | span | double | |
| 4 | aMax | double | Reference amplitude X_(max). |
| 5 | Normalized | bool | When 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