Phase Meter …

Jan 21, 2010 at 2:08pm

Phase Meter …

Anyone know how to build a phase meter?
I’m after is the ability to stream data expressing the phase (0-180 degrees) difference between left and right of two audio signals.. Any help would be awesome..
Scope does this very nicely expressing in visual form only and has no outputs..(ie data outs)


Jan 21, 2010 at 6:21pm

I’m not 100% sure this is correct, but I thought it was interesting so I had a go!

If someone more knowledgeable than myself can confirm this to be accurate, then you could convert the output to degrees and you’re sorted.

– Pasted Max Patch, click to expand. –
Jan 22, 2010 at 3:27am

That’s exactly what I’ve been trying to hammer out. Thanks so much for your very awesome patch. Hopefully it will help other people too.

Jan 22, 2010 at 5:40am

Hey Tim,
I’ve been nosing about the patch a bit more..
It seems if you feed perfectly out of phase audio, the meter still measures in the + range.
Could the patch be measuring the phase difference from 0 degrees(mono)
and phase difference from 180 degrees and expressing it equally in the + range only?

Jan 22, 2010 at 9:32am

So it does…….It’s the way I’ve done the p_meter subpatch that is messing it up. If you get rid of the meter altogether the result of the +~ object shows perfectly in phase as 0 and perfectly out of phase as maximum deviation from 0:

– Pasted Max Patch, click to expand. –

Not got time to mess with the subpatch right now, but it shouldn’t be hard to make it work as expected.

Jan 25, 2010 at 10:31am

thanks tim, Cat wait to check you new patch.
Kinda tied up at the mo but I do thank you for your help on this..
Much appreciated..

Jan 25, 2010 at 10:23pm

I’ve not tried to fix the patch yet, but just had a thought. If you feed in perfectly out of phase audio (which implies the two channels being exactly the same and 180 degrees out of phase) it would result in the two signals canceling completely. So the way I’ve done it by phase-inverting one input means that the output will just be the sum of both signals, now completely in phase with each other if that makes sense.

I also have a feeling that to calculate the exact difference in phase angle between two signals you need to know the wavelength of both, which makes it almost impossible to do accurately in real-time.

I did a quick test with Logic, and playing 2 test oscillators at the same frequency, with one phase inverted the phase correlation in multimeter reads +1 just like my patch.

—— I guess you could have an rms meter before the inversion of one channel in my patch, and if the rms of the sum of both input channels was 0 it would mean the two channels were perfectly out of phase (ie 180 degrees)……which could then multiply the output of +~ by -1……………

Sorry but I’ve got a bit of an epic stint of uni work to finish over the next few days, I may have time to fiddle with it next week.

Apr 16, 2010 at 3:31pm

Hi Timlloyd,
Hmmmm, Do you think the meter should have read +1? Perhaps your Logic experiment expresses the data “rectified”? What i’m trying to write should have a 180deg phase diff as reading -1(my range is -1 to +1 where 0 is 90deg phase diff i.e. perfect stereo) Its a tricky one hey but I’m sure there is a really simple way to deal with this kind of analysis…

Apr 18, 2010 at 12:47pm

you answered it already in your question: a phasemeter shows the difference
between right and left: you could build one around [-~ ]

there are different methods of smoothing the output of [-~] … i would just
choose slide~ or rampsmooth~.

one could also get the rms power of say 25-200 milliseconds and then substract
the results from each other. in this case the “minus” could be done outside
the signal layer.

the question is if you really need to recreate the existing industry standards or
just make your own tool.


Aug 17, 2012 at 12:25pm

Ok, so I’m trying to build roughly the same thing, but it seems to be a little trickier to come up with – I’m sure the solution is simple.

See what you guys think of my rough patch. There are a few issues such as when one channel is off it goes to infinity – maybe this isn’t actually a problem as the slider will still read +1, but maybe it would be nice for it to recognise that the two channels are effectively completely different in this instance, and therefore the slider should read 0.

Anyway, really open to suggestions!

  1. goniometer.rtf
Aug 17, 2012 at 12:27pm

P.S. copy the text and open as new from clipboard, it is a Max 6 file. Let me know if its not working for anyone and i’ll just put up a screen shot (its a very basic patch).

Aug 17, 2012 at 12:58pm


there’s a ‘copy compressed’ option in Max (I think it’s in the ‘Edit’ menu), if you select your full patch and then you choose ‘copy compressed’ from the menu, you’ll get a base64-formatted string on your clipboard that can be simply pasted into the forum. That’s actually the preferred way of sharing patches.


Aug 17, 2012 at 9:19pm

Ha! Thanks Adam!

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.