Phase Vocoder frame 0

Started by simonk, November 12, 2019, 07:42:33 PM

Previous topic - Next topic

simonk

 I'm posting this on behalf of Logan McBroom who is having some difficulty logging in at the moment ( weird server issues, that we SHALL resolve..)
Anyway, his question:

When transforming a signal via the phase vocoder, knowing
that instantaneous frequency is calculated via phase differences, how is
frequency calculated on frame 0?
I am having a hard time following the c
code for this.

rwdobson

In that particular pvoc implementation (Mark Dolson original author decades ago), the first frame in an analysis file is all-zeroes. Other implementations may skip that, but the arithmetic is the same. In the general case, all bin phases have to start from somewhere on the circle, so to speak, and the default choice is zero, just as it tends to be for any digital oscillator. since pvoc is based on the FFT, converting phase increments to frequency, each bin has a (default) centre frequency arranged linearly from DC to Nyquist.

In theory, any other starting phase could be used; one would expect this to be the same value for all bins, but there have been suggestions to start with randomised phases. Probably less useful for pvoc in analysis mode, but often a way to avoid extreme peak amplitude values when creating an oscillator bank. The Dolson pvoc code is certainly more difficult and opaque to read than others (some clever code involved to apply overlapped windowing while avoiding all memory movements); but the payoff is that it is significantly faster than other more "straight-forward" implementations.

simonk

Thanks Richard for clearing that up.
It has to start somewhere, obvious really.

I'll pass it on

loganmcbroom

Thanks for the reply Richard, Simon relayed your answer to me while I was exiled. Setting initial phases to zero lead to fine results for me, but slightly different output compared to the CDP. It's possible the difference was instead in my rewrite of blur_blur, I'll have to investigate further. The algorithm source is appreciated. I'm sticking to my suboptimal PVOC for now, I'll trade a bit of speed for simplicity most days.