📍 Join the 1st DeepEval meetup in SF, this Friday 5pm PT. RSVP on Luma →
💥 Introducing JevEval: Jev-as-a-Judge for LLM evaluation. Read the post →
Voice AgentsProsody

Abrupt Pitch Jump

Beta
Multi-turn
Referenceless
Chatbot
Voice

The abrupt pitch jump metric checks whether your voice agent's voice cracks or squeaks: a sudden leap up in pitch, faster than a human voice can move and above the voice's usual range. It returns the share of agent replies without one, between 0 and 1.

0.0s / 4.5s

Required Arguments

To use the AbruptPitchJumpMetric, you'll have to provide a ConversationalTestCase with:

  • audio on the agent's turns, one clip per reply, or on the test case as a stereo recording of the whole call*

* Full call audio has to be stereo, with the caller and agent on separate channels, and is only used when no turn has audio. Each agent reply is then heard on the agent's channel, from its first sound until the caller speaks.

Usage

The AbruptPitchJumpMetric() can be used for end-to-end evaluation of voice calls, such as ones produced by the ConversationSimulator in voice mode:

from deepeval import evaluate
from deepeval.dataset import ConversationalGolden
from deepeval.metrics import AbruptPitchJumpMetric
from deepeval.simulator import ConversationSimulator
from deepeval.voice import ElevenLabsConnector, VoiceConfig


golden = ConversationalGolden(
    scenario="The user asks the agent to look up an order by its number.",
    expected_outcome="The agent reads back the order status.",
)

simulator = ConversationSimulator(
    voice_config=VoiceConfig(
        connector=ElevenLabsConnector(agent_id="your-agent-id"),
    )
)
test_cases = simulator.simulate([golden])

metric = AbruptPitchJumpMetric(threshold=0.8)
evaluate(test_cases=test_cases, metrics=[metric])

There are TWO optional parameters specific to the AbruptPitchJumpMetric, on top of the common voice metric parameters:

  • [Optional] eval_mode: "deterministic" or "hybrid". In "hybrid", each candidate jump is heard by an audio decision model before it counts. Defaulted to the configured voice eval mode ("deterministic" unless set).
  • [Optional] audio_decision_model: the model that does the second check in "hybrid" mode. Defaulted to HumeDecisionModel().

The jump limits are fixed, since a crack is a defect, not a matter of taste.

As a standalone

You can also run the AbruptPitchJumpMetric on a single test case as a standalone, one-off execution:

metric.measure(test_cases[0])

print(metric.score, metric.reason)
print(metric.score_breakdown)

See Events for what score_breakdown contains.

Events

Each pitch jump shows up in score_breakdown as its own event. Here is what the example call returns:

{
    "eligible_turns": 4,
    "turns_with_events": 1,
    "events": [
        {
            "type": "pitch_jump",
            "turn": 3,
            "timing_source": "turn_timestamps",
            "description": "Pitch jumped abruptly to 6 semitones above the voice's usual range",
            "pitch_hz": 365.4,
            "offset_seconds": 0.96,
            "duration_seconds": 0.08,
            "start_time": 9.46,
            "mark": "moment",
        }
    ],
    "skipped": [{"turn": 9, "error": "Reply has no voiced speech."}],
}
FieldWhat it means
offset_secondsWhere the jump is, in seconds from the start of the turn's clip: the 40 ms just before the step
duration_secondsAlways 0.08: the 40 ms either side of the step
pitch_hzThe pitch the voice jumped to, in Hz. Only in the "deterministic" eval mode

Only the step up counts, so a crack that goes up and comes back down is one event. Replies with no voiced speech, or audio that can't be decoded, are listed under skipped.

Every event also has the fields all voice events share, such as mark and description.

eligible_turns is how many agent replies were counted and turns_with_events how many had at least one jump. The score is the share that had none.

How Is It Calculated?

The AbruptPitchJumpMetric score is calculated according to the following equation:

Abrupt Pitch Jump=Number of Agent Replies Without a Pitch JumpTotal Number of Scored Agent Replies\text{Abrupt Pitch Jump} = \frac{\text{Number of Agent Replies Without a Pitch Jump}}{\text{Total Number of Scored Agent Replies}}

The metric reads per-turn audio, one agent clip at a time, or replies cut from stereo full call audio when no turn has audio. The caller's turns are never checked. A reply counts as having a jump at most once, however many it has.

Which replies are scored

Agentturn 1turn 3reply 1no voice0s2s4s6s8s

The metric tracks the pitch of every 40 ms of the clip, between 70 and 500 Hz, and leaves out stretches that are near silent or have no clear pitch (such as "s" or "f" sounds). What's left is the voiced speech. A reply is scored if it has any.

Pitch jump criteria

Agentturn 1jump up: countsback down: ignored0s1s2s3s4s

A jump is a step in pitch from one 40 ms frame to the very next one:

CheckRule
Step size6 semitones or more, between the steady pitch before and the steady pitch after
Steady beforeAt least 5 frames (200 ms), each within 3 semitones of the one before
Steady afterAt least 5 frames, the same way
No gapThe two frames are back to back, with no unvoiced frame between
Above the usual rangeThe pitch it lands on is at least 1 semitone above the top of the voice's usual range: the pitch the agent's voice stays under 95% of the time, across all its replies on the call

A 6-semitone step in 40 ms is 150 semitones a second, about 2.5 times the fastest pitch change a speaker can make on purpose. The last check keeps only steps up and out of the voice's range. Inside the range, a step is how the voice normally moves, and a step down, such as the crack coming back, never lands above the range.

If no agent reply has voiced speech, the metric is skipped.

Second check

In the hybrid eval mode, the metric casts a wider net and lets the audio decision model decide. A stressed word steps up just like a crack does, and only a listener can tell them apart. So instead of the rules above, every step up of 6 semitones or more that holds for 120 ms and lands in the top tenth of the voice's range is a candidate. The model hears about 5 seconds of the agent's audio around each one, from the full call audio when there is one, otherwise from the turn's own clip, and is asked:

Does the speaker's voice suddenly jump to a different pitch, as if it glitched or cracked?

If the model judges "no" more likely than "yes", the candidate is dismissed and doesn't count against the score. Candidates the model keeps are reported with the description "Pitch jumped abruptly" and no pitch_hz. If the model can't be reached, only candidates the rules above would flag still count.

Example call

A call with five agent replies: one cracks up for 400 ms, one dips down for 400 ms, and one is silent. Each row is one agent reply and whether it had a jump.

Agent13579jump updrop, then backskipped0s5s10s15s20s25s
Agent turnWhat happensJump?
1Normal speechNo
3Held vowel leaps up 8 semitones, to 365 Hz, at 1.0 s and comes back down at 1.4 sYes (1 event, for the step up)
5Held vowel drops 8 semitones at 1.0 s and comes back up at 1.4 sNo, it never goes above the usual range
7Steady held vowelNo
9Silence, no voiced speechSkipped
4 replies1 with a jump → 3/4 = 0.75

FAQs

How is this different from pitch variation?
PitchVariationMetric looks at how widely pitch moves across the whole reply and ignores single spikes. This metric looks for the spikes themselves, so one cracked word fails this metric only.
Can it miss a crack?
Yes. A sudden drop in pitch is never counted, since it can't land above the voice's usual range. Nor is a crack shorter than 200 ms, or one that stays within the range. In the "hybrid" eval mode, shorter steps up are also sent to the audio decision model.
Does this metric call an LLM or an external speech model?
Not by default. Detection is deterministic and runs locally over the audio, so it has no model or token cost. In the "hybrid" eval mode, each candidate jump is checked by an audio decision model, at one paid request per candidate.
Does it check the caller's audio too?
No. Only the agent's replies are scored. The caller is your simulator's TTS voice or a real customer, so their audio says nothing about the agent.

On this page