Real-Time

Phase Vocoder

 
BackTech.html

Phase vocoding uses the phase information from a Fourier transform to manipulate the pitch and time scale of an audio signal independently from each other. This implementation is the first step towards a performance instrument / effects processor where the voice or vocal percussion is the main sound source. While still a work in progress, there are elements in this version that are important in the design: large widgets for use with a touch sensitive display, easily expandable audio classes, and, of course, real-time processing.


AudioDevice is the first important class, a singleton, that calls the AudioGenerator class asking for output samples (and providing input samples) for each callback.


AudioThing (a subclass of AudioGenerator) is a poorly named phase vocoder class. It records samples from the default input to a circle buffer. Playback is a long process that involves an FFT analysis stage of two (Hann) windows separated by 25% of their size, and then a resynthesis based on the difference in their phases (which is added to a running phase) and the weighted average of their magnitudes. The resynthesized frame is windowed again with a Hann function and overlaps 75% with the next frame.


Next development steps include adding functionality to the spectrogram widget that would allow adjustments to be made to particular frequency magnitudes before the resynthesis stage, better class names, and improvements to the phase unwrapping method.


Thanks to Stephen Pope, Phil Popp and Karl Yerkes for awesome example code, to Lance Putnam for helping me out with GLV, and especially to Matt Wright for letting me hang around his office, call him at home on a Sunday, and nag him with questions at my convenience. None of this code would have worked without him.

GLV - GUI Toolkit

FFTW - FFT Library

PortAudio - Cross Platform Audio API

Xcode Project (zip)