amplitudeToDecibels(_:zeroReference:)
Returns double-precision amplitude values converted to decibel values.
Declaration
static func amplitudeToDecibels<U>(_ amplitude: U, zeroReference: Double) -> [Double] where U : AccelerateBuffer, U.Element == DoubleParameters
- amplitude:
The input vector that defines the amplitude values.
- zeroReference:
The zero reference that the function uses for the conversion.
Discussion
The function uses the following calculation to perform the conversion:
alpha = 20;
for (n = 0; n < N; ++n)
C[n] = alpha * log10(A[n] / B[0]);