<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PHASE",
  "identifier" : "/documentation/PHASE/PHASECardioidDirectivityModelParameters",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PHASE"
    ],
    "preciseIdentifier" : "c:objc(cs)PHASECardioidDirectivityModelParameters"
  },
  "title" : "PHASECardioidDirectivityModelParameters"
}
-->

# PHASECardioidDirectivityModelParameters

An object that directs sound in a heart-shaped curve surrounding a sound source.

```
class PHASECardioidDirectivityModelParameters
```

## Overview

This class configures a particular frequency range in the audio spectrum that emits sound in an area defined by a mathematical cardioid. PHASE refers to each frequency segment along the audio spectrum as a *subband*. This class contains an array of `subbands` that each can direct sound in a unique cardioid shape. The framework outputs a blend of a frequency’s adjacent subbands for all frequencies that lie outside of those specified in the `subbands` array.

### Emit Sound in the Shape of a Cardioid

The following code defines a two-band cardioid model. The first subband resembles a heart-shaped cardioid and the second resembles a hypercardioid.

```swift
let simpleCardioid = PHASECardioidDirectivityModelParameters()

// Create a cardioid model.
var cardioidSegment1 = PHASECardioidDirectivityModelSubbandParameters()
cardioidSegment1.frequency = 500.0
cardioidSegment1.pattern = 0.5 // Cardioid shape
cardioidSegment1.sharpness = 1.0

// Create a hypercardioid model.
var cardioidSegment2 = PHASECardioidDirectivityModelSubbandParameters()
cardioidSegment2.frequency = 5000.0
cardioidSegment2.pattern = 0.75
cardioidSegment2.sharpness = 1.5

simpleCardioid.subbands.add(cardioidSegment1)
simpleCardioid.subbands.add(cardioidSegment2)

spatialMixer.sourceDirectivityModelParameters = simpleCardioid
```

![Illustration of two different types of cardioids that position in relation to a sphere representing the user. On the left, a cardioid resembles a heart with a sphere resting in the heart’s cusp. On the right, a cardioid resembles the shape of a hypercardioid. A large oval extends outward from one side of the sphere, and a smaller oval extends in the opposite direction, from the backside of the sphere.](images/com.apple.phase/media-3919256@2x.png)

## Topics

### Creating the Cardioid Directivity Model Parameters

[`-  initWithSubbandParameters:`](/documentation/PHASE/PHASECardioidDirectivityModelParameters/init(subbandParameters:))

Creates an object that directs sound in a heart-shaped curve surrounding a sound source.

### Defining Subbands

[`subbandParameters`](/documentation/PHASE/PHASECardioidDirectivityModelParameters/subbandParameters)

An array of frequencies that describe varying sound emission across the spectrum.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`PHASEDirectivityModelParameters`](/documentation/PHASE/PHASEDirectivityModelParameters)

---

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)