Author Topic: Phase Vocoder frame 0  (Read 1990 times)

simonk

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 75
    • View Profile
Phase Vocoder frame 0
« on: November 12, 2019, 07:42:33 PM »
 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

  • Sr. Member
  • ****
  • Posts: 73
    • View Profile
Re: Phase Vocoder frame 0
« Reply #1 on: November 19, 2019, 10:22:09 AM »
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

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 75
    • View Profile
Re: Phase Vocoder frame 0
« Reply #2 on: November 20, 2019, 06:47:46 PM »
Thanks Richard for clearing that up.
It has to start somewhere, obvious really.

I'll pass it on

loganmcbroom

  • Sr. Member
  • ****
  • Posts: 66
    • View Profile
    • Music
Re: Phase Vocoder frame 0
« Reply #3 on: November 27, 2019, 12:41:10 AM »
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.