Circuit to invert phase?

Started by allochthon, July 31, 2015, 06:34:38 PM

Previous topic - Next topic

allochthon

I run stereo amps and have relied on stereo pedals to maximize separation (e.g., stereo delay or stereo chorus), but want something as transparent as possible. My thought was to take one signal going to one of the amps and switch the phase - preferably using a pot to go from 100% in phase to 100% out of phase so as to dial in sweet spot.

I realize this is sometimes a feature of splitters, and think I've run across one pedal that is solely made to do this.

Is this something that even makes sense. If so, any leads suggestions on how to accomplish this?


PRR

Inverting the polarity is trivial.

Getting "in between polarity" is very non-trivial, never simple. And probably not real audible.
  • SUPPORTER

ashcat_lt

Quote from: PRR on July 31, 2015, 06:42:29 PM
Inverting the polarity is trivial.

Getting "in between polarity" is very non-trivial, never simple. And probably not real audible.
Yes.  OTOH, a variable all-pass filter is pretty simple, and just might do the trick.  That's how they do "phase adjustment" in things like the Little Labs IBP ("In Between Phase").  It's going to be weird for people moving around in front of the amps, but only if they're close enough that the whole thing doesn't just collapse to some comb-filtered mono thing, so like anything else stereo, it will really only impact the folks on the stage, and most of the house will be oblivious to all your fanciness.

Transmogrifox

If you want to go passive (no power, no battery) you can use an audio transformer to invert the phase then connect a pot between the inverted output and the input, with wiper going to right channel output.  It's basically a stereo panner in which one channel can be either in phase or out of phase.  This is sort of a crude way of emulating speaker positioning so the effect isn't particularly stunning.

An active circuit would be a single inverting op amp stage or a simple 1-transistor amplifier with gain of -1 or something.  Same idea with the pot to mix between - and + phase.

This is probably along the lines of the stereo width effect as implemented in software:
// calculate scale coefficient
coef_S = width*0.5;

// then do this per sample
m = (in_left  + in_right)*0.5;
s = (in_right - in_left )*coef_S;

out_left  = m - s;
out_right = m + s;


If you assume mono input on the left channel, then you have
m=0.5*left, s=-0.5*width*left

out_left = m-s = 0.5*left - (-) 0.5*width*left = 0.5*(left + width*left) = left*0.5*(1+width)
out_right = m+s = 0.5*left -  0.5*width*left = 0.5*(left - width*left) = left*0.5*(1-width)


When width is > 1 (which is the condition for increasing stereo width), then you have right channel out of phase with the left.  All of that is to say you're onto an industry standard method for adjusting stereo width.

I have played with this algorithm in software with a mono (guitar input) and using it on stereo chorus, phasers, and other similar time-based FX.  It's so subtle (too me) that a stereo chorus will do way more for separating left and right just by modulating the left and right chorus channels out of phase.  Delays + volume is how you can emulate speaker positioning.  It doesn't really turn into an "effect" until you modulate the relative positions.

In all cases it requires the spread between the speakers vs the distance to the audience to be a large ratio.  For example, your audience should be closer to the speakers than the distance between the speakers.  Otherwise it all just blends into a mono blob.

ashcat is right, your audience won't hear the difference in most settings.  Your best bet for really making distinct l/r separation is with a delay.

For example, if you could delay left from right by an adjustable amount about between 1ms and, well, like stereo ping pong delays up to 2 seconds -- that would let you go from anything between adjusting apparent speaker locations all the way to crazy "makes you dizzy" effects.

The speed of sound in air is approximately 1 ft per ms, so a 1ms delay is like moving the speaker 1 ft further away.  Obviously this doesn't start getting very noticeable until you're up around 10ms L-R delay.

A phase reversal in a sense tricks the ears into sensing a delay, so it definitely has a psychological effect but again, only works when the speaker separation to listener distance ratio is large.  Works best with headphones.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

ashcat_lt

Quote from: Transmogrifox on July 31, 2015, 08:32:27 PM
If you want to go passive (no power, no battery) you can use an audio transformer to invert the phase then connect a pot between the inverted output and the input, with wiper going to right channel output.  It's basically a stereo panner in which one channel can be either in phase or out of phase. 
This is better done with a switch.  At any in-between position it is simply an attenuator, with silence in the very middle.

R.G.

As Paul says, can of worms.

Getting signal or signal reversed is easy. Opamp inverters do that. There are even circuits that switch one amplifier between plus or inverted.

Getting "in between" requires some soul searching as to what this even means.

If you want a phase difference of 15 degrees at one frequency that's something way different at another frequency.

If you mix "signal" and "not signal" in various ratios, you get a volume change. Perfect mixing of half and half is cancellation, not a phase shift.

What you want to get "in between" is mixing two versions of the signal that are 90 degrees different at all frequencies. Because phase shift, frequency and time delay are so intimately related in the real world, this is not possible with continuous-time filters. But what you can do is use two allpass filters, one that shifts the signal a steadily-increasing amount at all frequencies, and a second that shifts by a steadily-increasing but continuously-90-degrees-less at all frequencies. While this may shift the signal many hundreds of degrees over the full audio spectrum, the *offset* between the two remains 90 degrees over a very wide range.

You can then add these two in varying amounts and get an in-between phase shift. And a frequency shift. And many other interesting things. These are known as Hilbert filters or dome filters.

As Paul said, the can of worms is now open.    :icon_biggrin:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Transmogrifox

Quote from: ashcat_lt on July 31, 2015, 08:42:53 PM
This is better done with a switch.  At any in-between position it is simply an attenuator, with silence in the very middle.

Attenuation corresponds with distance.  That is why I said this is a very crude speaker positioning method.  There is value in having the attenuation as something you can control.  Having a signal coming from one speaker that is out of phase with the other does create a discernable psychological effect which results in a type of perception of changing the localization of the source.  This isn't a lot more interesting than a panner, but it does add something that a plain panner doesn't have.

The idea of varying phase shift is entirely off the table as an answer for the OP, so put the lid back on the can of worms.  Anything more than a simple volume control on an out-of phase signal is better done with existing commercial DSP products because a dome filter is a big project for somebody who is asking advice about a simple phase inverter.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

ashcat_lt

Quote from: Transmogrifox on July 31, 2015, 10:59:49 PM
Attenuation corresponds with distance.  That is why I said this is a very crude speaker positioning method. 
I can sort of dig that, but can we not assume that each amp has a volume control?  Most of the time, attenuation before a guitar amp affects quite a bit more than the actual perceived volume - compression, overdrive, noise...  I just don't understand the value of fading between normal and inverted like this, and I think that a "volume knob" that is silent in the center of its rotation is just going to be awkward and weird with very little practical payout.  Course, I don't really believe in "stereo" in a live setting for reasons explained above.  I honestly think that most of these ideas are at best going to sound like a "stuck phaser" to any given audience member.  It might "sweep" a bit as they move around the room, but it's not likely to be as mind-blowing trippy for your listeners as you're hoping.

bluebunny

Quote from: R.G. on July 31, 2015, 10:30:42 PM
There are even circuits that switch one amplifier between plus or inverted.

There are indeed.   :D
  • SUPPORTER
Ohm's Law - much like Coles Law, but with less cabbage...

R.G.

As a comment on professional practice, there it a vast difference between what you hear on stage and what the audience hears.

I deal with a fair number of guitar pros in my day job. Many of them have tried stereo rigs, and they pretty much all go back to mono. The ones that don't are just hooked on how great it sounds to them.

Stereo rigs with stereo effects sound GREAT!! on stage, but the better they sound on stage, the shorter range the stereo effect has. Maybe the first couple of rows will get it, but beyond that acoustic mixing (pesky air!!) makes it mono. There are ways to get stereo sound fields out in rooms and halls, but they're a lot more complicated than two guitar amps.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.