AW on Phase Graphs and Impulses

Viewing phase graphs—what’s a “wrap”?

When someone refers to a “wrap” what does that mean? Sometimes when I read that word, it seems an indication of the point at which the analysis turns from thinking about what’s happening to the phase of a signal and into a process of identifying a specific attribute—kind of a short cut away from understanding toward just applying a remedy.

So today, we’re going to explore what a wrap actually is.

Here’s a perfect impulse response with no delay.

p01-01.png — from page 1

And since we’ve measured an impulse, our measurement includes both time and frequency components, and from those, we can view the frequency AND phase response. Since our impulse is perfect and peaks at T=0, phase and frequency response are both flat.

Red is frequency and green is phase. Green is at 0 degrees (or thereabouts) from 20-20k.

We are going to start this by viewing the phase in an UNWRAPPED graph. Notice that in this one screen, we can view a total of 765 degrees of phase from the top to the bottom. Of course, this can be expanded or contracted in order for us to view smaller details more easily or a greater range with less focus on the details.

Let’s apply a simple second order low pass filter to the signal at 1k. We’re going to choose 1k so the entire phase shift appears before we reach our low frequency limit of 20Hz

p02-01.png — from page 2

p02-02.png — from page 2

Here’s our 12dB Linkwitz Riley LPF. Notice that the phase shifts at HIGH frequencies from 0 degrees at 20Hz to 180 degrees at 20kHz, and that the phase crosses -90 degrees at our filter frequency of 1kHz.

Let’s change this to a high pass filter of the same kind, slope and frequency.

Now, check it out. The phase goes from 0 at 20kHz to 180 at 20Hz. At our filter frequency the phase is 90 degrees.

p03-01.png — from page 3

p03-02.png — from page 3

OK, since we’re here, lets look at BOTH phase graphs together so we can see what happens with a crossover.

These speakers are 180 degrees out of phase everywhere.

But why is the SHAPE of the phase the same, but in the low pass filter the phase shifts at HIGH frequencies, and in the high pass filter the phase shifts at LOW frequencies?

Because phase shifts at frequencies that are changed by the filter. In a low pass filter, low frequencies are unchanged and in a high pass filter, high frequencies are unchanged.

OK, on to the main topic—reading this display.

With a crossover that changes the phase by only 180 degrees, we can view the entire thing on a display that allows us to see only 360 degrees of phase at a time. Simple.

But what about when we have way more phase shift than that? Let’s change these to 24dB/octave slopes.

Here are those two 24dB/octave filters:

Notice that just as before, the phase is affected at frequencies where the filter changes the frequency response. The low pass filter phase is 0 at high frequencies and 360 at low frequencies and the high pass filter is 0 at high frequencies.

These are 360 degrees apart. For steady state signals or signals that are like steady state signals (we kind of consider music to be these kinds of signals), 360 degrees is the same as 0 degrees when we are looking at frequency response and phase response.

p04-01.png — from page 4

p05-01.png — from page 5

The fact that 360 and 0 can be seen as “the same” makes it possible for us to view this another way—and that’s the wrapped graph. The picture above is the unwrapped graph in which we can see about 1200 degrees of phase in one screen. We can see that the graphs are ACTUALLY 360 degrees apart.

Here’s what the wrapped graph looks like:

p05-02.png — from page 5

These are not different phase responses. They are the same phase response shown in different ways. They are still ACTUALLY 360 degrees apart, but when we choose “wrapped” we agree that every multiple of 360 is the same as 0 - so we can keep this all on one screen and allows us to see HUGE shifts in phase all on one screen.

The dotted line in this graph doesn’t indicate that the phase REVERSES, although that’s what it looks like. The dotted line indicates that the phase graph CONTINUES.

If you start from the right and move toward the left along the brown line, at the point at which it reaches 180 and further shift can no longer be plotted on the graph, the dotted line indicates that +181 degrees, for example, will be plotted as 181-360, or -179. It ISN’T -179, but we agree to view it this way to keep it on our display.

Here it is again.

So why do we do this? Why do we need to see huge shifts in phase? What could we possibly do that would cause phase to shift by so much that we can’t even see it on one screen if we expand and expand and expand the view? Here, I’ve expanded this so we can see more than 4,000 degrees of phase.

Isn’t that enough?

Let’s pretend that these are measurements of speakers in a car and the high pass speaker is closer than the low pass speaker so the delay in the sound’s arrival at the mic is delayed by 1mS for the high pass and 2mS for the low pass.

Like this, if we were to measure impulses:

p07-01.png — from page 7

p07-02.png — from page 7

Now what about the phase?

Now we can’t see the entire phase shift on one screen even though we have zoomed out as far as we can.

But why? Why did such a small amount of delay shift phase by so many degrees?

Because 1mS is 360 degrees at 1kHz. It takes 1mS for a 1kHz wave complete one cycle. At 2kHz, 1mS is 720 degrees (2 cycles). At 4kHz it’s 1440 degrees.

Below I have applied that 1mS delay to the perfect impulse so you can see the phase shift caused by ONLY delay, without the high pass and low pass filters, and I have marked each of the points i mentioned above with a red dot.

I’ve zoomed out as far as I can and can’t even see how far this 1mS shifts the phase at high frequencies.

And this is what the wrapped graph is for.

We need a way to see all of this phase shift.

So let’s change to the wrapped graph. We’ll use this same measurement that ONLY includes delay. This is what a 1mS delay looks like on a wrapped graph:

p08-01.png — from page 8

p09-01.png — from page 9

p09-02.png — from page 9

Here it is again. Remember, the dotted line indicates CONTINUATION and the DIRECTION of the dotted line indicates in which direction the continuation occurs. At every red dot, the phase continues decreasing by -360 degrees. It does NOT indicate that the phase “reverses”.

Why does this matter?

It matters because reflected energy looks kind of like this, but it is NOT this.

What’s that? A reflection.

Here, I’ve added 1mS of delay to the perfect impulse, saved that and added it to the original perfect impulse. This is like sound coming directly from a speaker AND sound reflected off another surface (like the windshield) that arrives 1mS later.

This creates a comb filter.

Like this:

Here is the phase response of our perfect impulse (a straight and flat line—there’s no delay). That one is green.

The red graph is the phase of our delayed impulse. Remember that the dotted line indicates CONTINUATION. This is the same as before. The phase CONTINUES going negative until the phase shift is so big that we cannot see it on the screen, so we use the wrapped graph to see it.

p10-01.png — from page 10

p11-01.png — from page 11

p11-02.png — from page 11

Now, let’s add the phase plot of the sum of these two—our measurement of the direct sound COMBINED with the sound of the reflection—like a simplified version of what we might measure in a car:

What about that purple graph? Notice anything different about that one?

p12-01.png — from page 12

Has the same shape as the one with delay, right?

Are those “wraps”?

Is the vertical line a dotted line?

Does the peak at the top and the peak at the bottom reach 180 or -180?

No.

Look again. Here it is by itself

And here it is with the frequency response:

p13-01.png — from page 13

p13-02.png — from page 13

These are NOT wraps. These are points at which the phase ACTUALLY changes direction.

And now, I’ve added an additional 1mS to the graph above, which is much more like what we’d measure if we measured an actual speaker and a reflection— because it also takes some time for the signal to go from the speaker to the mic— and then more time for the reflection to arrive.

Here’s what that looks like on a wrapped graph.

So, we can identify the INITIAL delay because of the DOTTED line transitions from top to bottom and the reflection as the SMALLER “wiggles” without the dotted line.

If we unwrap and expand the graph, this becomes more obvious. Now we see the downward slope as the delay and the wiggles as the reflection.

And if we change the horizontal axis to LINEAR instead of log, delay appears and STRAIGHT lines with slopes. And, since all of this is attributed to delay, we only see straight lines.

p14-01.png — from page 14

p15-01.png — from page 15

p15-02.png — from page 15

And in the linear view, phase changes as a result of frequency response changes will appear as CURVES rather than straight lines. Here’s the phase of the low pass filter on a linear axis:

And now I’ve applied a VERY small delay to the low pass filter so you can see both.

In the red circle is the curved shape that indicates the phase change caused by the FILTER and the blue arrow indicates the slope caused by the delay—this is in the LINEAR axis view.

p16-01.png — from page 16

p16-02.png — from page 16

One more thing.

Here, we have the impulse of the high pass and low pass filters. These are not time aligned, as you can see.

And here they are in the phase view with the LINEAR axis. The CURVED part is the crossover. The different slopes to the right of that are the different arrivals—the delay.

p17-01.png — from page 17

p17-02.png — from page 17

Notice that the brown graph with the steeper slope is the high pass, which arrives later.

Now, instead of trying to identify the beginning of the low pass impulse, which is pretty difficult, we can add delay while viewing this linear graph until the slopes are the same.

Here, I’ve added 0.1mS and the slope has increased.

I’ll keep adding. Oops, added too much.

p18-01.png — from page 18

p18-02.png — from page 18

There, now they’re perfectly aligned in time.

And here’s what that looks like in the impulse graph, which is maybe not what you’d choose if you used it to do this alignment.

p19-01.png — from page 19

p19-02.png — from page 19

And to verify that this is correct, we can add the high pass and the low pass together to check the sum, which is in purple:

And that’s a MUCH more accurate way than trying to identify the initial rise of the impulse.

p20-01.png — from page 20