---
title: vDSP_DCT_Type.II
framework: accelerate
role: symbol
role_heading: Case
path: accelerate/vdsp_dct_type/ii
---

# vDSP_DCT_Type.II

A constant that specifies a type II discrete cosine transform.

## Declaration

```swift
case II
```

## Discussion

Discussion The type-II DCT uses the following operation for a discrete cosine transform: // `N` is the length given in the setup. // `h` is the input array that contains real numbers. // `H` is the output array that contains real numbers.

For 0 <= k < N     Or[k] = sum(Ir[j] * cos(k * (j+1/2) * pi / N, 0 <= j < N)

## See Also

### Discrete Cosine Transform Types

- [vDSP_DCT_Type.III](accelerate/vdsp_dct_type/iii.md)
- [vDSP_DCT_Type.IV](accelerate/vdsp_dct_type/iv.md)
