The No.1 Website for Pro Audio
 Search This Thread  Search This Forum  Search Reviews  Search Gear Database  Search Gear for sale  Search Gearslutz Go Advanced
Explain 0-360 phase shift to me? Multi-Ef­fects Plugins
Old 23rd December 2010
  #1
Gear Nut
 
lejon's Avatar
 

Explain 0-360 phase shift to me?

Hi geeks. I'm really confused about this. What does it actually happen to the signal when applying 0-360 degree phase shift to it?

I understand that phase is NOT delay, because this shifting can be done also in analog domain. And because for different frequencies 90 degree phase shift means different amount of time shift, so it doesn't add up.

Then I read about all-pass filters and found out that this phase shifting between 0-360 is made with that, but I DON'T UNDERSTAND THE FREAKING ALL-PASS FILTER.. Is it just a filter that changes polarity after or before a highpass/lowpass filter of a signal? So is phase shifting between 0-360 degrees just all about doing this:



As I understand, the phase shift between 0-180 degrees is made by sweeping the crossover frequency over the frequency range and 180-360 is doing the same thing but polarity flipped from input signal. Or am I getting this horribly wrong? Please enlighten me. I just don't get it if you can say filtering + polarity switching "phase shifting". And which one of the filter outputs gets its polarity reversed? The highpass one or the lowpass one? Or am I just stupid and got it all wrong?

- Leo
Old 23rd December 2010
  #2
Gear Addict
 
jaddie's Avatar
 

Actually, phase shift is a specific case of time delay.

Recall that to talk about phase, there must be a reference signal, and a signal that we measure the phase of relative to the reference. In the case of an all-pass filter, the reference is the input, the measured signal is the output.

If you were to plot the phase response of a first order all-pass filter, you'd see that there would be some frequency at which it would begin to change phase, and another where phase had reached 180 degrees and leveled off (hard to verbally describe an curve, so see one here: All Pass Filter ). The all-pass filter has a varying phase shift vs frequency over an area that starts above one frequency, and ends below a second one.

To compare to time delay, if you plotted the phase response through a delay vs its input, you'd get a changing phase with frequency, but as frequency goes up, the rate of phase change also increases, and never stops changing. To put it another way, straight time delay would result in a phase plot that shows increasing phase shift as frequencies go up, an all-pass filter will stop shifting at some point, and that's the real difference.

You can't really build an all-pass network that has a fixed amount of phase shift over all frequencies (see the curve in the line), but you can build two all-pass filters that have a fixed difference, like say 90 degrees. Also, you can build multi-pole all-pass filters that have a more rapid change in phase vs frequency, or depending on how many poles and how they are tuned and cascaded, have more than 180 degrees of phase shift. For example, say the first network ends up at 180 degrees at 1KHz, and the second network starts it's phase shift at 1KHz. By the time that one levels out in phase response, you'd have 360 degrees at some frequency.

Two common uses for all pass networks are to attempt to pre-compensate for the poor phase response of another filter such as an anti-aliasing filter, by adding the inverse phase shift of that caused by the filter. This phase compensation technique is outdated now given digital filtering, and while it helped smooth out transient response in analog filters, was almost impossible to perfectly compensate a steep anti-aliasing analog filter.

A second use is to develop a precise phase shift between two audio channels for use in matrix encoding, such as in early quad (4 channel) systems, and more commonly in Dolby Stereo encoding of L,C,R, and S. The problem they had was when panning from front to surround, the matrix would cause a cancellation at a point mid-pan. The surround channel, in this case, is defined as L - R. If surround channel encoding was done via set of all-pass filters that ended up 90 degrees apart across the audio band (at least to 7KHz), you could pan from front to surround without cancellation mid-pan. But remember, no single all pass would to a flat 90 degree shift, it had to be several stages as a multi-pole all pass, then another built identically, but with it's tuning skewed resulting in a 90 degree difference between the two networks.

An all-pass filter is also useful in dealing with interaction between drivers in a speaker design as they are affected by a crossover in the crossover region, or as a method of pattern control.

Jim
Old 23rd December 2010
  #3
Gear Nut
 
lejon's Avatar
 

Thanks Jim!
I understood the allpass filter now that it has that frequency vs phase curve but still I'm having hard time understanding what does an allpass filter actually do for example to a 1khz sine wave?

Ok, let's put a question out this way:

We have a 1 khz sine wave and then we apply 90 degrees phase shift to it. What happens? You can of course demostrate this with a picture that shows that there is time delay between the input and output. But as you said, the difference between allpass filter and time delay is that allpass filter starts and stops the "time shifting?" between certain frequency range? I'm still a little bit confused.. A 1 khz sine wave is pretty easy to understand but what about more complex waveforms? I don't get it.. You got the information, can you make understand?

- Leo
Old 24th December 2010
  #4
Gear Addict
 
jaddie's Avatar
 

Quote:
Originally Posted by lejon View Post
Thanks Jim!

We have a 1 khz sine wave and then we apply 90 degrees phase shift to it. What happens?
Nothing, it's still a 1KHz sine wave. Without knowing the input reference you wouldn't even be able to tell it's been phase shifted.

Quote:
Originally Posted by lejon View Post
You can of course demostrate this with a picture that shows that there is time delay between the input and output. But as you said, the difference between allpass filter and time delay is that allpass filter starts and stops the "time shifting?" between certain frequency range?
Not quite, it begins to change phase, relative to the input signal, at a certain frequency. Once it reaches 180 degrees, it stops, at least for a first-order filter. That's phase shift, not time shift. If you were to measure the time delay required for that kind of phase response, you'd see the time delay is not consistent over frequency. In fact, it might be useful to introduce another term: group delay. That's a measurement of time delay for a group of frequencies, averaged into a single number, or plotted as a curve. The reason for using the term is that in the case of any kind of filter, the actual time delay that results in phase shift changes with frequency. You can only refer to the time delay of a filter by specifying a frequency group, otherwise it is always changing with frequency.

For example, an all-pass filter produces a 90 degree phase lag at 1KHz. You could say that's 250uS of group delay at 1KHz. But the same filter produces 180 degrees phase lag at 10KHz, and on up. You can no longer refer to time delay, because 180 degrees at 10KHz is the same as a 50us delay, but the filter still does 180 degrees at 30KHz, which is about 16us.

By comparison, a pure time-delay device produces a fixed time delay for all frequencies, but if you were to plot that as phase shift, you'd see less phase shift at low frequencies, more progressively more as frequency goes up. For example, a 1ms time delay would produce almost no noticeable phase shift at 20Hz, but at 500Hz 1ms is 180 degrees (the period of 500Hz is 2ms, so a 1ms delay is half the period, or 180 degrees). At 1KHz, it's 360 degrees, at 1KHz it's 720, and so on, doubling every time the frequency doubles.

Quote:
Originally Posted by lejon View Post

I'm still a little bit confused.. A 1 khz sine wave is pretty easy to understand but what about more complex waveforms? I don't get it.. You got the information, can you make understand?

- Leo
A1KHz sine wave passed through an all-pass filter is still a 1KHz sine wave. Nothing about the waveform changes, but if you use the input as a reference, you can measure the degree of phase shift that has occurred in the all-pass filter at the output. The only change is a shift in phase relative to the input.

For a complex wave form, it's a little different. If you think of any complex wave form as being made up of a fundamental and harmonics in various magnitudes and phase relationships, then pass that through a filter that has a varying phase response with frequency, the resulting wave a the output will look different because the filter has changed the phase of the harmonics. However, experiments have shown that with symmetrical complex wave forms, unless there's a whole lot of phase shift, way more than a first-order filter, the effect is inaudible or not very audible because the harmonic distribution remains the same, only the phase of the harmonics have changed. A square wave would no longer look square, but would sound the same.

But being practical now, a graphic representation of the wave on an oscilloscope depends on both magnitude and phase of the harmonics. Hearing depends more on magnitude of harmonics than their specific phase. To complicate matters in the case of a square wave, no speakers made can produce a square wave in air, so you're not hearing a real square wave anyway. Not even in headphones. It's a highly sensitive signal to evaluate visually, but not very useful audibly.

This is not as true with asymmetrical wave forms, such as some male voices, where there can be a sharp high energy peak in the wave in one polarity, but not in the other. In this case, an all-pass filter can upset that asymmetry, and the effect can be audible, though the basic character of the voice will not change because harmonic distribution is constant. A listener could in this case easily detect the absence or presence of the filter, but won't be able to tell which is "right". You can also hear a 180 degree phase flip on some voices but not others.

Does that help? Or did I just muddy it up for you?

Jim
Old 24th December 2010
  #5
Lives for gear
 
monomer's Avatar
 

Quote:
Originally Posted by lejon View Post
Thanks Jim!
I understood the allpass filter now that it has that frequency vs phase curve but still I'm having hard time understanding what does an allpass filter actually do for example to a 1khz sine wave?

Ok, let's put a question out this way:

We have a 1 khz sine wave and then we apply 90 degrees phase shift to it. What happens? You can of course demostrate this with a picture that shows that there is time delay between the input and output. But as you said, the difference between allpass filter and time delay is that allpass filter starts and stops the "time shifting?" between certain frequency range? I'm still a little bit confused.. A 1 khz sine wave is pretty easy to understand but what about more complex waveforms? I don't get it.. You got the information, can you make understand?

- Leo
I think that you don't realize that an all-pass filter gives a different phase shift for every frequency.

So you can have a phase curve that describes an all-pass filters phase response.
This is realy a plot of how much phase shift you get at what frequency.
Let's say that at 500Hz the phase is unchanged.
This means that every time a 500Hz frequency/component hits the filter it will pass unchanged.
But this same filter would, for instance, change the phase by 90 degrees at 1kHz.
This means that any 1kHz component of the sound will get delayed/phase shifted by 90 degrees.

What you can see from the plot is that there is a smooth change to the phase, depending on frequency.
So a frequency of, say, 700Hz would in this case have it's phase delayed by something inbetween 0 and 90 degrees.

In the case of a single frequency at the input there realy is no difference with a delay.

heh
Old 25th December 2010
  #6
Lives for gear
 

so is the 180 phase shift button on analog consoles is usually at 1k?

its a pretty complicated change in sound if you think about it!
Old 25th December 2010
  #7
Gear Maniac
 
brad347's Avatar
 

Quote:
Originally Posted by spice house View Post
so is the 180 phase shift button on analog consoles is usually at 1k?

its a pretty complicated change in sound if you think about it!
the "phase" button on the console is erroneously named-- it is not introducing a phase shift but is rather flipping electronic polarity. Positive voltages become negative, and negative voltages become positive.

This polarity flip does NOT have anything to do with phase, except that it can interact with it. The naming convention stems from an older time in audio, where "polarity" was used when discussing power supplies and "phase" was used in discussing audio signals. This is unfortunately incorrect, and has confused people ever since.
Old 25th December 2010
  #8
Gear Nut
 
lejon's Avatar
 

Thanks guys! Ok, so now I'm starting to realize the idea of "Phase". So, as I understand now, the phase shifting is adding different delay values into input signal based on All-pass filters phase/frequency curve? So phasing is ultimately just delaying frequencies for some microseconds?

And about that analog console thing that brad347 asked, I think the phase 180 button is just a polarity reverse button, not an allpass filter with a fixed corner frequency. I've been actually referring to Little Labs IBP and similar gear that I didn't quite get how they work.

So am I now understanding this? It's delaying the signal and that delay becomes from an allpass filter that has a corner frequency where time delay is 0. And changing that corner frequency we can alter the phase response curve to do the wanted time delay (=phase shift) to the input signal?

One thing I don't quite understand is that two all-pass filter design with a fixed phase difference.. I know that Little labs ibp uses two all-pass filter design, so is it somehow essential for making a precision phase shifter?

- Leo
Old 25th December 2010
  #9
Gear Maniac
 
brad347's Avatar
 

Quote:
Originally Posted by lejon View Post
And about that analog console thing that brad347 asked
Correct, except it wasn't me that asked!
Old 26th December 2010
  #10
Here for the gear
 

Funnily enough I've been grinding my brain on all-pass filters myself over the past couple of days. Turned out they're no use to me, but I learned where to click in LTspice to get a group delay plot, so it's all good.

First, though:

Quote:
Originally Posted by brad347 View Post
the "phase" button on the console is erroneously named (...)

This polarity flip does NOT have anything to do with phase, except that it can interact with it.
I've heard this assertion before, but it's not correct.

When a sine wave is at the peak positive value its phase angle is 90 degrees. When it is at its peak negative value phase angle is 270 degrees.

If the positive peaks of the output waveform coincide with the negative peaks of the input, they are 180 degrees out of phase, whether any delay has occurred or not. This 180-degree phase change can be achieved by polarity inversion with no group delay, or it can be done by introducing group delay equal to half the period.

"Phase reverse" is just as valid a label for this function on a desk as "polarity inversion", and it does not imply that group delay has or has not occurred.

I like nit-picking as much as the next guy*, but hair-splitters among you will have to find something else to be pedantic about, I'm afraid. heh

Quote:
Originally Posted by lejon View Post
So phasing is ultimately just delaying frequencies for some microseconds?
No. A 180-degree phase change can be achieved with no delay at all. If someone tells you the phase-shift in a circuit, any multiple of 180 degrees covered may be due to polarity inversion or to group delay.

Regarding analogue all-pass circuitry:

(If you understand what opamps do, this is easy to see from the diagram here. Just picture the cap as a short for the high-frequency circuit, and open for low-freqs.)

A first order all-pass filter is a unity-gain inverting buffer at low frequencies, and a unity-gain non-inverting buffer at high frequencies. At low frequencies there is group delay, because the capacitor creates a leading power factor (voltage change lagging behind current change). The delay is constant over a wide range, but starts to drop as it approaches the turnover frequency where the group delay is half the length, above the turnover frequency the group delay drops to zero, where it remains for the high frequencies.

Cascading two such first order filters doubles the group delay, so the HF still has no latency.

A second-order all-pass filter can be made based on a band-pass filter, as described here in section 16.7.2 which behaves differently. There is no group delay at HF or at LF, just a 360-degree difference in phase.

Group delay emerges at low frequency, increasing with frequency until it reaches the the tuning frequency, when it is equal to one quarter-wavelength, then falls with increasing frequency until it reaches zero again.

That kind of response is shown here.

Hope this helps.
_________________________________
*: actually, more.

Last edited by Omega_Void; 26th December 2010 at 09:16 AM.. Reason: Oops, looking at the wrong damn graph!
Old 26th December 2010
  #11
Gear Nut
 
lejon's Avatar
 

Quote:
Originally Posted by brad347 View Post
Correct, except it wasn't me that asked!
:D Sorry! That's what happens when I don't use the quote button..
Old 27th December 2010
  #12
Lives for gear
 

Yeah the polarity switch switches the - and + on the input signal, right? that was always my understanding. There would be no delay in that case. Digitally, that would be like reflecting the graph (waveform) over the x-axis, right?
Old 27th December 2010
  #13
Here for the gear
 

Quote:
Originally Posted by spice house View Post
Yeah the polarity switch switches the - and + on the input signal, right? that was always my understanding. There would be no delay in that case. Digitally, that would be like reflecting the graph (waveform) over the x-axis, right?
Yes, exactly so. (And it still counts as a 180-degree phase change, even though there is no group delay.)
Old 27th December 2010
  #14
Gear Maniac
 
brad347's Avatar
 

It might be semantic, but might I be so bold as to question this "polarity flip equals 180˚ out-of-phase" thing?

Let us look at the dictionary definition of phase as it applies to physics:

Quote:
a particular stage or point of advancement in a cycle; the fractional part of the period through which the time has advanced, measured from some arbitrary origin often expressed as an angle (phase angle), the entire period being taken as 360°.
Note that phase is necessarily something measured in the time domain. A polarity flip doesn't change the wave's "point of advancement in a cycle," nor does it change the "fractional part of the period through which time has advanced."

It simply flips positive for negative.

Correct?

Now, functionally, it may be equivalent to a group delay of 180˚, but the mechanism is diffferent. Right?

I'm no physicist, just an intellectually curious person, but I've ALWAYS heard the distinction made between phase and polarity in audio signal. I'm not ruling out the possibility that everything I've ever heard was wrong or misguided, but I just want to understand clearly.
Old 27th December 2010
  #15
Gear Addict
 
jaddie's Avatar
 

180 degrees is a special case. It's the only phase relationship (other than zero degrees) that is commonly referred to that occur without a time difference. It is correct to refer to two AC signals that are exactly opposite in polarity as 180 degrees out of phase, and a discussion of phase cancellation would include that condition. Assuming a continuous sine wave, phase and time have an exact relationship, and refer to the same thing. Again, a signal inversion is the exception, but what that inversion does when combined with the reference is identical to that of a signal with 180 degrees of phase shift obtained with time delay. However, if we don't use a continuous sine wave as a reference, the phase/time relationship disconnect as changing frequency through a fixed time delay changes phase, and changing frequency through a fixed phase network changes time delay.

In terms of spectrum, a polarity reversal is the only out of phase condition that affects the entire spectrum uniformly. Phase shifts obtained via a time delay device or phase shift network are all highly frequency dependent.

Phase measurement always implies a reference signal and a measured signal. All phase relationships can be referred to in terms of time also, with the exception of 180 degrees obtained through polarity reversal. In fact, a phase meter is actually time-blind. It only reads zero to 180 degrees, then applies a lead/lag indication. So, to a phase meter, a 180 degree polarity inversion reads 180 degrees, and a 360 degree phase shift is zero degrees, and 540 degrees reads 180. And, for a continuous sine wave, it actually doesn't matter that time is ignored. When summing two sine waves of any phase relationship results are the same if time delay is involved or not.

It seems confusing, but by convention we refer to two signal that are reversed in polarity as "180 degrees out of phase" or simply "out of phase". The condition is applied to microphone phase, speaker phase, and cable wiring.

Ok, someone ask how you can have "phase lead" when all we talk about is "time delay" and "phase delay". Go ahead, I know you want too...of course, the key to the answer is in this post.
Old 27th December 2010
  #16
Lives for gear
 
DrFrankencopter's Avatar
Lots of phase discussion, and possible enlightenment to be had in this thread I started early this summer.


Dr.Frankencopter's phase test

Cheers

Kris
Old 27th December 2010
  #17
Lives for gear
 
DrFrankencopter's Avatar
Quote:
Originally Posted by jaddie View Post
Ok, someone ask how you can have "phase lead" when all we talk about is "time delay" and "phase delay". Go ahead, I know you want too...of course, the key to the answer is in this post.
An IIR EQ bell boost will cause phase lead around the boost frequency, and an IIR HPF will cause a seemingly static phase lead above the 'cutoff' frequency. The group delay is related to the derivative of the phase angle wrt to frequency.

Cheers

Kris
Post Reply

Welcome to the Gearslutz Pro Audio Community!

Registration benefits include:
  • The ability to reply to and create new discussions
  • Access to members-only giveaways & competitions
  • Interact with VIP industry experts in our guest Q&As
  • Access to members-only sub forum discussions
  • Access to members-only Chat Room
  • Get INSTANT ACCESS to the world's best private pro audio Classifieds for only USD $20/year
  • Promote your eBay auctions and Reverb.com listings for free
  • Remove this message!
You need an account to post a reply. Create a username and password below and an account will be created and your post entered.


 
 
Slide to join now Processing…
Thread Tools
Search this Thread
Search this Thread:

Advanced Search
Similar Threads
Thread
Thread Starter / Forum
Replies
Graeme86 / So much gear, so little time
8
madriaan / High end
8
Mr.HOLMES / So much gear, so little time
41
OberHeim-Kenobi / Mastering forum
18
Shaman / So much gear, so little time
4

Forum Jump
Forum Jump