<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/convert(amplitude:toDecibels:zeroReference:)-4io4p",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO7convert9amplitude10toDecibels13zeroReferenceyx_q_zSdtAA0A6BufferRzAA0a7MutableI0R_Sd7ElementRtzSdAJRt_r0_lFZ"
  },
  "title" : "convert(amplitude:toDecibels:zeroReference:)"
}
-->

# convert(amplitude:toDecibels:zeroReference:)

Converts double-precision amplitude values to decibel values.

```
static func convert<U, V>(amplitude: U, toDecibels decibels: inout V, zeroReference: Double) where U : AccelerateBuffer, V : AccelerateMutableBuffer, U.Element == Double, V.Element == Double
```

## Parameters

`amplitude`

The input vector that defines the amplitude values.

`decibels`

The output vector that contains the decibel values.

`zeroReference`

The zero reference that the function uses for the conversion.

## Discussion

The function uses the following calculation to perform the conversion:

```swift
alpha = 20;

for (n = 0; n < N; ++n)
    C[n] = alpha * log10(A[n] / B[0]);
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)