Bachelor's thesis project in Engineering focused on pitch correction in the frequency domain, implemented using the phase vocoder technique.
The input audio signal is analyzed frame by frame (STFT), its fundamental frequency is estimated for each frame, and the pitch shift needed to snap the intonation to the closest note of a chosen musical scale (chromatic, major or minor, with a configurable A4 reference) is computed. The shift is applied through spectral-domain time-stretching with phase coherence (to avoid phasiness artifacts), followed by resampling, so that the perceived pitch is changed without altering the duration of the sound. The result is then reconstructed with the Overlap-Add (OLA) technique, including a best-lag search between frames to preserve phase coherence across overlapping regions.
The goal of the thesis is not just to make autotune work, but to understand and mathematically optimize every stage of the pipeline (STFT, phase propagation, pitch estimation, resampling, COLA reconstruction constraints) in order to reduce the computational cost and make the algorithm sustainable for real-time use, with minimal latency and no audible artifacts. The detailed documentation (thesis.pdf) covers the theoretical foundations of these methods and the optimization choices made with real-time processing in mind.
The research also covers the original filter-bank interpretation of the phase vocoder (the classic formulation predating the STFT-based one), included both for historical/theoretical completeness and as a comparison term for the optimizations pursued in the STFT approach. This is reflected in FB_PhaseVocoder.m (FB standing for Filter Bank), which implements this earlier formulation alongside the STFT-based one.
git/
├── documentation.pdf # Detailed mathematical research and project documentation
└── src/
└── MATLAB/ # Prototype and validation of the algorithms
├── autotune.m # Full autotune pipeline
├── pitch_detector.m # F0 estimation via autocorrelation (Wiener-Khinchin)
├── closest_note_detector.m # Closest-note search within a scale
├── pitch_shifter.m # Pitch shifting (time-stretch + resample)
├── STFT_PhaseVocoder.m # STFT analysis/synthesis and phase vocoder
├── FB_PhaseVocoder.m # Phase vocoder variant
├── time_stretch*.m # Time-stretching variants (basic, improved, optimized, interpolated)
└── AMDF.m # Average Magnitude Difference Function