Skip to content
SpecializedSource checked

Phase Vocoder

Changes time scale or pitch by manipulating short-time Fourier transform frames.

Quick Facts

Compact metadata for implementation and discovery.

Category
Signal Processing
Difficulty
Advanced
Family
Time-Frequency Processing
Tier
Specialized
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
2
Code example
Ready
Visualization
Ready

Overview

A Phase Vocoder analyzes overlapping spectral frames, adjusts their timing or frequency interpretation, and reconstructs a signal with coherent phase.

Core Concepts

STFT framephase advancetime stretchingoverlap-add

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n log w)

Average

O(frames * w log w)

Worst

O(frames * w log w)

Space

O(w)

When to Use

  • Use when audio duration or pitch needs to change without simply changing playback speed.
  • Use when time stretching audio is a central requirement.

When Not to Use

  • Avoid when transient sharpness is more important than smooth spectral transformation.
  • Avoid when the sampling rate, window size, or stationarity assumptions do not hold.

What It Does

  • Analyzes overlapping spectral frames
  • Tracks phase changes
  • Resynthesizes with modified timing or pitch

Use Cases

  • Time stretching audio
  • Pitch shifting
  • Spectral audio effects

Inputs

  • Audio signal
  • Window size
  • Hop size
  • Stretch or pitch factor

Outputs

  • Modified audio signal

Key Formulas (1)

Phase advance

phaseexpected = 2·π·bin·hopsize/fftsize
phase_expected = 2*pi*bin*hop_size/fft_size

Predicts how much phase should advance between adjacent frames.

Pseudocode

  1. 1.Compute STFT frames
  2. 2.Measure magnitude and phase for each bin
  3. 3.Adjust phase increments for the new timing
  4. 4.Reconstruct frames with inverse transforms
  5. 5.Overlap-add the frames

Canonical Example

Input
audio = 1 second tone, stretch = 2
Output
output = 2 second tone at similar pitch
Explanation
The vocoder spaces frames farther apart while preserving phase continuity.

Implementation Notes

  • Handle transients separately if percussive audio sounds smeared.
  • Plot or inspect both the original and processed signal for small test cases.
  • Keep a tiny example with expected output beside the implementation.

Common Pitfalls

  • Ignoring expected phase advance causes phase drift between frames.
  • Boundary handling and phase response can change the result in visible or audible ways.
  • Not defining boundary, empty, or degenerate inputs before implementation.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Show spectrogram frames stretched apart while phase lines stay coherent.

Phase Vocoder mechanism walkthrough step 1 of 5x₀x₁x₂x*
Step 1 of 5: Compute STFT frames
signal-transform

Notes

Poor phase handling creates smearing or robotic artifacts.

Sources (1)

What each reference supports for this entry.

Dolson 1986

Paper

Tutorial reference for phase-vocoder analysis and time-scale modification.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Phase vocoders analyze and resynthesize signals through STFT frames.

Tags

Signal ProcessingTime FrequencyAudio ProcessingFrequency Domain