Introduction

You have heard Autotune thousands of times without ever thinking about it. Modern pop vocals, country radio, hip-hop — almost everything is pitch-corrected. But the name hides a surprisingly concrete algorithm: PSOLA, short for Pitch-Synchronous Overlap-Add.

Invented by Eric Moulines and Francis Charpentier in 1990, PSOLA is not a synthesizer. It does not generate a new signal from scratch. Instead it surgically relocates tiny fragments of the original voice — called grains — to new positions in time, so that the period between successive pitch peaks matches the target frequency. The waveform is real; only its spacing changes.

The result is pitch correction that feels transparent because it is the singer's voice, grain by grain, rearranged on a timeline. Understanding PSOLA means understanding how digital audio is just an array of numbers — and how moving numbers around in a principled way can change what your ear perceives as pitch without touching timbre.

Snap a Note to a Scale

The demo below simulates the core of PSOLA: a wobbly pitch curve (the input voice) and a target scale. Each vertical bar is one pitch grain. Press Snap to Scale to relocate every grain so its pitch lands on the nearest in-tune note — exactly what Autotune does in real time.

<!-- {{c_html_comment}} -->
<p class="hint">{{hint_para}}</p>
<div class="controls">
  <label>{{label_scale}}
    <select id="scale-select">
      <option value="major">{{opt_major}}</option>
      <option value="minor">{{opt_minor}}</option>
      <option value="pentatonic">{{opt_pentatonic}}</option>
    </select>
  </label>
  <label>{{label_speed}}
    <input id="speed-range" type="range" min="1" max="10" value="5">
  </label>
</div>
<canvas id="pitch-canvas" width="560" height="200"></canvas>
<div class="status" id="status">{{status_idle}}</div>
<div class="btns">
  <button id="btn-snap" type="button">{{btn_snap}}</button>
  <button id="btn-reset" type="button" class="ghost">{{btn_reset}}</button>
</div>
/* {{c_css_comment}} */
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .6rem; line-height: 1.45; }
.controls { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: .6rem; align-items: center; }
label { font-size: .85rem; color: #555; display: flex; align-items: center; gap: .4rem; }
select, input[type=range] { font-size: .85rem; }
canvas { display: block; width: 100%; max-width: 560px; border: 1px solid #cdd9e3;
         border-radius: 8px; background: #f5f8fa; }
.status { font-size: 1rem; font-weight: 600; margin: .5rem 0; min-height: 1.4em; color: #1d3557; }
.status.done { color: #0a7d33; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
// Code not found

Notice that snapping does not flatten everything to one note. The algorithm finds the nearest scale pitch for each grain independently, so melodic contour is preserved while tuning errors vanish. Speed the correction up to feel the "robotic" Autotune sound; slow it down for the transparent correction pop producers prefer.

The Real Complexity

PSOLA itself is a solved algorithm: given the pitch marks and a target pitch, resynthesis is O(N)O(N) in the number of grains — it runs in linear time, fast enough for real-time use on a laptop.

The hard part is the step that comes before: pitch detection.

  • Autocorrelation finds the period TT such that the signal looks most like a shifted copy of itself. It costs O(N2)O(N^{2}) naively, but FFT-based methods bring it to O(NlogN)O(N \log N).
  • The YIN algorithm (de Cheveigné & Kawahara, 2002) improves accuracy by computing a difference function d(τ)=j(xjxj+τ)2d(\tau) = \sum_{j}(x_{j} - x_{j+\tau})^{2} and scanning for its first dip below a threshold, achieving O(N)O(N) per frame.
  • In the general case, deciding the correct pitch from a noisy polyphonic recording is equivalent to solving a combinatorial search over harmonic overtones — and can be NP-hard.

So the PSOLA pipeline splits neatly: detection is the hard estimation problem, resynthesis is the easy linear pass. The algorithm's tractability is a consequence of that separation.

Where It Matters

Pitch-synchronous grain relocation is one of the most-used DSP ideas in audio:

  • Music production: Antares Auto-Tune (1997) popularized PSOLA for studio vocals; Melodyne extended it to polyphonic audio.
  • Text-to-speech: concatenative TTS systems select speech units from a database and pitch-shift them with PSOLA so that prosody sounds natural across unit boundaries.
  • Voice conversion: changing one speaker's voice to sound like another's is partly a pitch-shifting task — PSOLA resamples grains to match the target's F0F_0 contour.
  • Speech therapy: assistive tools use real-time pitch feedback to help patients with [Parkinson's disease or dysarthria maintain target pitch ranges.
  • Time-stretching: by over- or under-sampling grains in time without changing pitch, PSOLA enables speed adjustment without the chipmunk effect.

Like pattern matching, the algorithm's power comes from a simple structural insight applied at scale — and like most audio DSP, its real complexity hides in the preprocessing, not the synthesis.

Conclusion

Autotune's secret is almost anticlimactic: the algorithm just moves pieces of audio around in time, carefully enough that the ear hears a different pitch but the same voice.

PSOLA achieves this in three steps — detect pitch marks in the input, decide where each grain should land in the output, overlap-add the grains with a smooth window. The math is linear, the speed is real-time, and the result is everywhere.

The deeper lesson is about digital audio itself: a recording is nothing but an array of pressure samples. Change the rhythm of those samples and you change the pitch. The ear, it turns out, cares far more about periodicity than about the exact waveform shape — which is why a grain relocated a few milliseconds still sounds like the same singer. And that insight, as simple as it sounds, is the engine behind most modern vocal production.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/autotune-psola/Content licensed under CC BY-NC 4.0.