• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Analytical Analysis - Polarity vs Phase

René - Acculution.com

Senior Member
Technical Expert
Joined
May 1, 2021
Messages
416
Likes
1,221
- Introduction –

The effect of a polarity flip is described in many blog posts and videos as being ‘different’ from a phase shift, with the main argument being that “since a phase shift is equivalent to a time delay, it cannot equate a polarity flip”, or something to that effect. We will show that a polarity flip can indeed be described via a particular phase, namely 180 degrees across all frequencies, and that this should not be confused with a time delay.


- Details –

All necessary details are included in the attached sheet (Polarity.pdf: “Overview of Phase, Polarity, and Delay Aspects of Real and Causal All-Pass Systems”), but if you are not too familiar with such concepts as ‘negative frequencies’, and ‘Hermitian symmetry’, perhaps the following explanation can shed some light on the topic.

The entirety of this debate can be summed up in what is often called ‘The most beautiful equation in the world’, namely Euler’s identity:
Eq1.png

What is says is that the numbers e, i, and pi, (two being transcendental numbers, and one being imaginary), can be combined in way that gives us the rather mundane result of minus one. For our purpose here, we can note that a polarity inversion can be described via a sign inversion i.e., the right side of the equation, and so if we can relate the left-side expression to a phase shift, then we are done.

Via the concept of phasors, we can describe signals and system in a complex (real and imaginary parts) notation. If a signal has an amplitude A and a phase angle phi as function of angular frequency omega, it can be written in exponential form as
Eq2.png

with a corresponding real and time-dependent the signal
Eq3.png

which is what we would measure. The phasor amplitude and phase are what we see when we plot signal and system frequency responses (the amplitude response and the phase response) both as function of frequency.

By comparing equations, we can see that the phasor phase phi is exactly pi for a sign change, and that this holds for all frequencies. As time passes, the total phase does indeed change, but the initial phasor phase remains(!). This is probably the reason that the blog posts confuse phase and time to argue that a phase shift cannot describe a polarity inversion. We can certainly introduce a signal with one phasor phase and a time delay added, and make it look like another signal with no time delay and a different phasor phase, but only when viewed steady-state or non-causally (again, see the sheet). But this does not mean that the signals ARE inherently the same.

The only things left is to realize that pi in radians is the same as 180 degrees, and that there is some ambiguity when it comes to phase, so that -180 and +180 degrees are the same, and that we cannot for one phase at one frequency see how many turns the phasor took to get to that phase value; the sheet shows more details on this. If this does not feel comfortable, just remember that for real numbers there is also an ambiguity in a sign change on its own, as we cannot differentiate between multiplying by -1 once, thrice, five times, and so on. We typically plot the -180 degrees version of this sign change operation/polarity inversion, since we anyway often plot in this lower right quadrant for more typical filters that tend downwards as a function of frequency when causal.

While there are temporal characteristics related to the phasor phase, we should not consider describing the polarity inversion via delays. Interchanging two wires does not add a delay and calculating the group delay before and after the polarity inversion will both give the same result (namely zero), as seen from the attached sheet. In fact, looking at the phase value at only one frequency is not enough to state anything about the delay aspects of a signal or system; you need to know more phase values so that the gradient can be calculated.


- Conclusion –

While many blog posts argue otherwise, a polarity inversion is exactly described via a phase shift of 180 degrees. The phase in question is the phasor phase, which should not be confused with the apparent phase shift resulting from a delay. There is nothing in the textbooks on signal processing that suggests that a sign inversion should be tied to a time delay in any way, so this is a topic that has been polluted by incorrect assumptions. A good aspect of these blog posts is that they are mostly well written, and it is very clear where people take a wrong turn. Being external examiner on a lot of BSc and MSc projects, I much prefer good reports where the analysis is incorrect but well described, over reports that seemingly arrive at correct results but with an unclear analysis. People seem very split and emotional about this very topic, and it will be interesting to see what you all think of it. From a signal-processing point of view, this seems like a moot point; but with the attached sheet I believe that all necessary aspects are covered to not only arrive at the conclusion, but also illustrate why there is this confusion.


- About me -

René Christensen, BSEE, MSc (Physics), PhD (Microacoustics), FEM and BEM simulations specialist in/for loudspeaker, hearing aid, and consultancy companies. Own company Acculution, blog at acculution.com/blog
 

Attachments

  • Polarity.pdf
    788.7 KB · Views: 203

Lambda

Major Contributor
Joined
Mar 22, 2020
Messages
1,785
Likes
1,519
While many blog posts argue otherwise, a polarity inversion is exactly described via a phase shift of 180 degrees.
I actually have never herd someone argue about this.
Should be of obvious to everyone who some higher education in math or some understanding of what the phase actually means.
those who don't will probably don't understand your argument.


Many argue over 6/2(1+2)=
Search for "viral math problems 2021"
They also argue abut the sound of special SSDs


Many Active speaker have 180° switch and it is implemented by just polarity inversion.
They sell/make XLR polarity inversion cables and the are also interchangeably referred to as "180° adapter" in the professional world
 

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,579
Likes
38,280
Location
Gold Coast, Queensland, Australia
While many blog posts argue otherwise, a polarity inversion is exactly described via a phase shift of 180 degrees.

If we phase shift a single cycle, asymmetrically clipped sine 180 degrees, what do we get? Is it the same as a polarity inversion? No.

The premise only holds true for repetitive, symmetric sinusoidal signals.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,700
Location
Hampshire
If we phase shift a single cycle, asymmetrically clipped sine 180 degrees, what do we get? Is it the same as a polarity inversion? No.

The premise only holds true for repetitive, symmetric sinusoidal signals.
The OP is saying, correctly but in a roundabout way, that a polarity inversion is equivalent to 180° phase shift of each frequency component in the signal. In the complex frequency representation (as obtained by the Fourier transform), this is simply multiplication by -1. From the linear property of the Fourier transform, it trivially follows that this is equivalent to a polarity inversion of the time based representation. There is nothing remotely controversial here.

The above notwithstanding, I still prefer the term polarity inversion when this is the intended meaning. In common usage, the term phase shift is often associated with a time delay, and this can result in minor confusion, as evidenced by your post.
 

JRS

Major Contributor
Joined
Sep 22, 2021
Messages
1,158
Likes
1,003
Location
Albuquerque, NM USA
The OP is saying, correctly but in a roundabout way, that a polarity inversion is equivalent to 180° phase shift of each frequency component in the signal. In the complex frequency representation (as obtained by the Fourier transform), this is simply multiplication by -1. From the linear property of the Fourier transform, it trivially follows that this is equivalent to a polarity inversion of the time based representation. There is nothing remotely controversial here.

The above notwithstanding, I still prefer the term polarity inversion when this is the intended meaning. In common usage, the term phase shift is often associated with a time delay, and this can result in minor confusion, as evidenced by your post.
Exactly so. They are not equivalent when we start at the beginning of the waveform: this is where a delay is not equivalent as the original signal was either a rarefaction or compression. At the first zero crossing a phase shift and polarity inversion of the two become equivalent. Or at least my egg nog addled noggin thinks so. But I suspect that old argument of absolute phase will resurface because in the real world almost all sound starts with a compression, no? God forbid that the first 1/2 cycle is confused when reproducing a tympano.
 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,690
Likes
6,013
Location
Berlin, Germany
We will show that a polarity flip can indeed be described via a particular phase, namely 180 degrees across all frequencies
(bold mine)
That's the important point -- from DC to light or at least within the whole bandwidth of the system under observation.
Another one is it has to be exactly 180 degrees.

Those are very specific constraints that are normally not acheivable in the real world, at least not with any phase-modifying allpass filter in analog systems.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,700
Location
Hampshire
(bold mine)
That's the important point -- from DC to light or at least within the whole bandwidth of the system under observation.
Another one is it has to be exactly 180 degrees.

Those are very specific constraints that are normally not acheivable in the real world, at least not with any phase-modifying allpass filter in analog systems.
It's actually trivial, just swap the wires.
 

ebslo

Senior Member
Forum Donor
Joined
Jan 27, 2021
Messages
324
Likes
413
If we phase shift a single cycle, asymmetrically clipped sine 180 degrees, what do we get? Is it the same as a polarity inversion? No.

The premise only holds true for repetitive, symmetric sinusoidal signals.
Yes. The analysis is based on the phasor model. Note the first line of the wikipedia entry:
In physics and engineering, a phasor (a portmanteau of phase vector[1][2]), is a complex number representing a sinusoidal function whose amplitude (A), angular frequency (ω), and initial phase (θ) are time-invariant.
So it is based on a model of a sinusoid having no beginning and no end. No surprise that it doesn't hold when we consider real signals with a beginning and an end. That's not to say it's "wrong", just that it's applicability is limited by the model it is based on.
 

dasdoing

Major Contributor
Joined
May 20, 2020
Messages
4,209
Likes
2,674
Location
Salvador-Bahia-Brasil
1640602811570.png


 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,690
Likes
6,013
Location
Berlin, Germany
^ Yep

If you contstruct that triangle wave with sine oscillators (one on the fundamental and the others on all the harmonics), the components have specific amplitudes and start phases. See https://williamsgj.people.cofc.edu/Fourier Series.pdf, page 665, in this case all the start phases are zero.

When you apply a 180 degree phase shift to all of those oscillators (that is, add pi/2 to the start phases), you get the polarity-flipped version, which is immediately obvious as sin(t + pi/2) = -sin(t), one of the many trigonometric identities. That's the correct math/scientific notion.

What Mr.Sengpiel (someone who I deeply admire and from whom I have learnt a lot of things) meant with 180degree phase shift in the second picture is something different: when you phase-shift the base frequency by 180 degrees and shift all the other components so that the waveshape is maintained, well, then the waveshape is maintained and the wave looks like being offset by "180 degrees", with reference to what would be the case for a single sine wave (and often with the remark that the waveshape also looks like being "delayed by half a cycle"). That's the way the term phase shift is often used by engineers when describing waveforms and I often use it this way myself.
 

dasdoing

Major Contributor
Joined
May 20, 2020
Messages
4,209
Likes
2,674
Location
Salvador-Bahia-Brasil
^ Yep

If you contstruct that triangle wave with sine oscillators (one on the fundamental and the others on all the harmonics), the components have specific amplitudes and start phases. See https://williamsgj.people.cofc.edu/Fourier Series.pdf, page 665, in this case all the start phases are zero.

When you apply a 180 degree phase shift to all of those oscillators (that is, add pi/2 to the start phases), you get the polarity-flipped version, which is immediately obvious as sin(t + pi/2) = -sin(t), one of the many trigonometric identities. That's the correct math/scientific notion.

What Mr.Sengpiel (someone who I deeply admire and from whom I have learnt a lot of things) meant with 180degree phase shift in the second picture is something different: when you phase-shift the base frequency by 180 degrees and shift all the other components so that the waveshape is maintained, well, then the waveshape is maintained and the wave looks like being offset by "180 degrees", with reference to what would be the case for a single sine wave (and often with the remark that the waveshape also looks like being "delayed by half a cycle"). That's the way the term phase shift is often used by engineers when describing waveforms and I often use it this way myself.

OK, I can understand that.

but I don't get the goal here. what those said blog posts are talking about is that the polarity inversion is not the same as a delay (which is not a constant phase shift across all frequencies). a constant phase shift across all frequencies actualy breaks the sawtooth tone since the group delay is all messed up.
 
Last edited:

pjug

Major Contributor
Forum Donor
Joined
Feb 2, 2019
Messages
1,775
Likes
1,561
wait a second. the inverted sawtooth tone doesn't have the group delay issue. it still can't be the same
Here are first three components of a sawtooth wave, and with each component shifted 180 degrees. So you can see this is the same as inverted. I'm not sure if the OP is helpful in practical terms though. Usually when people talk about the importance of distinguishing between phase shift and polarity they are referring to using subwoofer settings and such.
1640611342948.png
 

dasdoing

Major Contributor
Joined
May 20, 2020
Messages
4,209
Likes
2,674
Location
Salvador-Bahia-Brasil
I'm not sure if the OP is helpful in practical terms though. Usually when people talk about the importance of distinguishing between phase shift and polarity they are referring to using subwoofer settings and such.

That was a point I made, too
 
OP
René - Acculution.com

René - Acculution.com

Senior Member
Technical Expert
Joined
May 1, 2021
Messages
416
Likes
1,221
I actually have never herd someone argue about this.
Should be of obvious to everyone who some higher education in math or some understanding of what the phase actually means.
those who don't will probably don't understand your argument.


Many argue over 6/2(1+2)=
Search for "viral math problems 2021"
They also argue abut the sound of special SSDs


Many Active speaker have 180° switch and it is implemented by just polarity inversion.
They sell/make XLR polarity inversion cables and the are also interchangeably referred to as "180° adapter" in the professional world
Just google "Polarity vs phase" and most if not all will argue this.
 
OP
René - Acculution.com

René - Acculution.com

Senior Member
Technical Expert
Joined
May 1, 2021
Messages
416
Likes
1,221
If we phase shift a single cycle, asymmetrically clipped sine 180 degrees, what do we get? Is it the same as a polarity inversion? No.

The premise only holds true for repetitive, symmetric sinusoidal signals.
Depends on what you mean (plot the situation) and how you got from one to the other. If you run it through a system that flips the polarity, why would you get anything than the inverted signal? This signal can be described via infinitely many sinousoids (https://www.thefouriertransform.com/pairs/truncatedCosine.php) and each will have a 180 degree phasor phase shift.
 

Lambda

Major Contributor
Joined
Mar 22, 2020
Messages
1,785
Likes
1,519
Just google "Polarity vs phase" and most if not all will argue this.
This is an cases of estimation bias.
If you search for Creationism vs. Evolution. you will also get the impression there is a controversy.


Don't think you can educate them or that they want to be educated.
If they would have the knowledge/educate to understand your explanation they would not argue.
 

ebslo

Senior Member
Forum Donor
Joined
Jan 27, 2021
Messages
324
Likes
413
TLDR: This is like saying unplugging the wires is a 90 degree phase shift at all frequencies.

This explanation was bothering me, even though it is mathematically correct, but it took me a while to figure out why. As @mansr has pointed out in this thread and others, F{x(A * t)} = A x F{x(t)}. If the constant A is -1 then this represents a polarity inversion and shows it is equivalent to a 180 degree phase shift at all frequencies. But what exactly is this "phase shift across all frequencies", ie. what does this do for phases other than the special case of 180 degrees? This can be seen by simply multiplying x(t) by the complex number of magnitude 1 and phase we wish to shift by; then, as speakers can only play real signals, taking the real component of the result.

So, let us look at Re(A * x(t)) for values of A with magnitude 1 and various phases. Since x(t) is real, Re(A * x(t)) = Re(A) * x(t), so it's just Re(A) applied as a gain factor, and Re(A) is of course just cos(P) where P is the phase angle of A.
30 degrees: Re(A) = 0.866
45 degrees: Re(A) = 0.707
90 degrees: Re(A) = 0
120 degrees: Re(A) = -0.5
180 degrees: Re(A) = -1

So this "phase shift at all frequencies" we're talking about is just a gain factor of cos(phase), which at 180 degrees happens to be -1. But did you see what happens at 90 degrees? It's 0, ie. unplugged from the source. So saying a polarity inversion is like a 180 degree phase shift at all frequencies, while mathematically correct, is akin to describing disconnecting the source as a "90 degree phase shift at all frequencies".
 
Top Bottom