# Understanding phase graphs



## 3ll3d00d (Jun 6, 2006)

When comparing phase of 2 drivers, it seems to be necessary to get the time alignment right first and then shift one impulse to t=0 and the other by the same amount. 

If I understand correctly, if this is not done correctly then the phase overlay is basically useless. Is my understanding correct? If so, why is it necessary to move the impulse to t=0? 

Thanks
Matt


----------



## jtalden (Mar 12, 2009)

No, that doesn't sound quite right. We shift the higher freq driver IR to near 0 ms first. It does not need to be at "exactly" at 0ms. It just needs to close. I usually adjust it so the so the right phase tail is pretty much horizontal. We can then see the phase trace of that driver clearly on the chart.

Then the lower freq driver IR is shifted as needed so that its phase tracks as closely as possible through the XO range. Once the delay (relative difference in IR shift amounts) is established and entered into the AVR/DCX/miniDSP/?? then the good phase tracking is locked in. 

To see why it this is done this way we can just look at what happens if we don't. This will be most clear if we look at extremes (often a good technique). If we have 7.xxx ms TW IR position and a 7.yyy ms MR IR position when initially measured (due the mic distance, XO delay, and speaker delays). We can try to do the phase tracking alignment job without moving both IR positions to near 0ms. We leave the TW IR where it is and try to align the tracking of the MR phase by moving its IR position. If we can do it then the answer will be the same. We will find the same relative IR shift (delay) needed to align them as we would working near 0 ms. It is just almost impossible to do it. The phase chart is so cluttered with lines from all the wraps it is not clear what we are looking at. 

The phase chart cannot be easily understood unless the excess delay of the system is removed.


----------



## 3ll3d00d (Jun 6, 2006)

jtalden said:


> No, that doesn't sound quite right. We shift the higher freq driver IR to near 0 ms first. It does not need to be at "exactly" at 0ms. It just needs to close. I usually adjust it so the so the right phase tail is pretty much horizontal. We can then see the phase trace of that driver clearly on the chart.
> 
> Then the lower freq driver IR is shifted as needed so that its phase tracks as closely as possible through the XO range. Once the delay (relative difference in IR shift amounts) is established and entered into the AVR/DCX/miniDSP/?? then the good phase tracking is locked in.
> 
> ...


Your reply has provided me with more questions to ask if I may

- what does "the right phase tail is pretty much horizontal" mean? where are you looking at this? I imagine a picture tells a 1000 words here
- I read your reply as "shift the HF driver to near 0 only, now shift the LF driver to establish good phase tracking" but this means we lose information about the existing delay difference between them, hence I thought the approach was "move HF to 0, move the LF by the amount by we moved the HF, now shift LF around to get good tracking & apply this delta to the actual system"
- I had noticed all the phase wraps when it is not shifted, why does this happen?

Thanks
Matt


----------



## jtalden (Mar 12, 2009)

3ll3d00d said:


> - I had noticed all the phase wraps when it is not shifted, why does this happen?


The phase is plotted in REW relative to 0ms. There is no feature in REW to plot phase relative to another time setting. :sad2: This not the easiest situation for making adjustments to align the phase tracking so we work within this constraint. 

If we do a TW measurement with REW loopback timing activated using a mic at a 2m LP, we may get an IR delay (arrival time) of 8.000 ms due to the mic distance and any other delays in the measuring system. The phase angle for this measurement is calculated by REW from the 0 ms reference time. 8ms at 20kHz results in; 0.008 s / 0.00005 s/cycle = 160 cycles. Each cycle being 360° of course. So if we plot the phase angle on the wrapped phase chart (360° chart) the it would wrap around 160 times before reaching 20 kHz. That's a very cluttered chart! We want to see what the phase is doing without all the extra wraps so we need to remove the excess delay time by shifting the IR back that amount of time. We actually don't know the exact amount of excess time added so we estimated it. We do that either by letting REW automatically estimate it or do it ourselves manually. REW normally does a good job, but sometimes the IR shape can cause an issue that needs to be manually corrected. 

With the excess time removed we can better see the phase tracking on the chart. Any small IR shift will move the right tail up or down according to the phase calculation. The high freqs (right tail) are very sensitive to IR time position. The lower freqs (left tail) is much less sensitive due to the longer wavelength. 

Since we are after the relative differences between 2 drivers, we don't really care if the shift is not exactly the excess amount as any extra rotation is present in both drivers. The relative phase tracking is still accurate.



> - I read your reply as "shift the HF driver to near 0 only, now shift the LF driver to establish good phase tracking" but this means we lose information about the existing delay difference between them, hence I thought the approach was "move HF to 0, move the LF by the amount by we moved the HF, now shift LF around to get good tracking & apply this delta to the actual system"


You are correct in this statement. I didn't understand this to be what you said in your last post. I explain the process in different ways to try to get the concept across. Maybe that just makes it more confusing. 

However we get there, good phase tracking can only be found easily with both IRs initial rise near 0ms. Then adjust the LF IR as need to best overlay the traces in the XO range. The time difference in the amount of shift needed for the 2 IRs is the additional delay need in the speaker management box to implement the correction. We can either keep track of all the adjustments in IR positions so we can determine the difference between the 2 or we can use REW to measure the starting IR position and final positions to determine the relative changes.

If we want to see the existing tracking, then yes, both IRs must be shifted the same amount. 



> - what does "the right phase tail is pretty much horizontal" mean? where are you looking at this? I imagine a picture tells a 1000 words here


In 70 Hz XO example below we have an MW driver with XOs at 70 Hz and 1800 Hz we can call that the bandpass range for this purpose. We had REW estimate the excess delay and the resulting SPL and phase charts are shown. The right tail is the high freq stopband tail of the phase trace. In this example the right tail is just before the phase is lost into the noise floor which is ~6kHz. 

This is the HF driver of the 70 Hz XO. This IR shift is an okay estimate of the excess time for our 70Hz XO. If the W is shifted the same amount then the current relative phase tracking can be seen without excess rotations. We still have to deal with (look past or ignore) room modes/reflections. There is lots of room modes and reflections present to disrupt the direct sound phase trace. I roughly indicated the direct sound phase. We could use this chart as is or clean it up a little with the use of window settings.
















Below I cleaned up the higher portion of the freq range by setting a too small IR window. The phase is only accurate >~500Hz with this window setting. It indicates the general direction down to about 200Hz. Note that the right phase tail is still falling until the noise floor (not horizontal), but this IR position is a perfectly good setting for the target. We would need to increase the right window though so we can see the phase through the lower stopband if we want to align a SW with it. A right window setting time such that the REW "Frequency Resolution" is reported at maybe 10-15Hz will probably work well (1/3 or 1/2 the lowest freq of the XO range).















Below, to create the right horizontal tail that was mentioned in the last post the IR would need to be moved another +0.040 ms. This will have no significant impact to the left tail and lower bandpass region the we use to match with the SW phase. This fine tuning is not needed as we are close enough when the right tail is within ±180° of horizontal.


----------



## 3ll3d00d (Jun 6, 2006)

Thanks for such a detailed reply, v v useful and much appreciated. A couple of further questions/comments



jtalden said:


> We still have to deal with (look past or ignore) room modes/reflections. There is lots of room modes and reflections present to disrupt the direct sound phase trace. I roughly indicated the direct sound phase. We could use this chart as is or clean it up a little with the use of window settings.


would an alternative be to look at a near field measurement of the speaker or do we *need* a listening position measurement here?



jtalden said:


> Below, to create the right horizontal tail that was mentioned in the last post the IR would need to be moved another +0.040 ms. This will have no significant impact to the left tail and lower bandpass region the we use to match with the SW phase. This fine tuning is not needed as we are close enough when the right tail is within ±180° of horizontal.


I'm still not clear on why you want the tail to be horizontal? is it just to make it more obvious that that it an area of little interest to you or is there some other reason?

Another Q concerns unwrapping the phase. Here's an example, this is my sub

















the unwrapped view, intuitively, seems to make sense to me in that I am experiencing ~240 degree phase shift between 45 and 65Hz (and this region corresponds to where EQ is most active dealing with room modes). I interpret this as meaning the lower registers of the sub will be somewhat delayed relative to the upper bass. In contrast, I find the wrapped view somewhat confusing.

Is my interpretation correct? Are there reasons for/against unwrapping that I am missing?


----------



## jtalden (Mar 12, 2009)

3ll3d00d said:


> would an alternative be to look at a near field measurement of the speaker or do we *need* a listening position measurement here?


It depends on the situation. With the speakers in the application position and the mic at the LP, it is always correct for phase tracking. It can be more difficult to read the chart however. If we have a 2 drivers on a baffle reasonable close to each other, we can move the mic toward the speaker staying on the listening axis. This works well. For a small speaker 1m would be a minimum for me. For a large MR horn and TW 1.5-2m would seem a better choice.  The phase chart will be much cleaner the closer we move. If we are using a SW then the LP mic position is pretty much a necessity unless there is a closer mic position that retains the distance differential of the main vs the SW. I can't think how that would commonly occur, but if we have a stereo setup with 2 mains and 2 stereo SW placed close to inline with them then any error would be very small if we moved closer.

For my SWs-mains XO I like to see the room modes and adjust the XO point, the phase tracking, and EQ setting all with the mic at the LP position.

If we just want see the natural phase responses of a single driver with any XO or EQ active then we can put the mic as close as we want without touching the diaphragm. This is a good way to understand what we are looking for as we measure further back for the purpose of phase tracking between drivers. Up very close, we will find the phase very smooth indeed. All the irregularity from greater distance is due to diffractions/reflections.



> I'm still not clear on why you want the tail to be horizontal? is it just to make it more obvious that that it an area of little interest to you or is there some other reason?


I stated that right tail horizontal is a good target and if it curls up or down 180° then the result will still be easy to read. 

If we have an IR with a large peak that trails the initial smaller IR peaks then REW sometimes adjusts that large peak to 0ms. That can make the chart more difficult to read. We are adding in additional wraps for no reason. I think I mentioned (maybe in another thread) that theoretically someone could do the phase tracking process at any offset from 0ms. I would not even attempt to do it away from 0ms as it can get very difficult to tell which lines on the chart are the ones we want to align. We can't just align any two lines! If there is a particular situation where it easy to read the chart with some other setting then, no problem. I am just trying to give advice that works well accounting for most all situations.



> Another Q concerns unwrapping the phase. Here's an example, this is my sub
> ...
> the unwrapped view, intuitively, seems to make sense to me in that I am experiencing ~240 degree phase shift between 45 and 65Hz (and this region corresponds to where EQ is most active dealing with room modes). I interpret this as meaning the lower registers of the sub will be somewhat delayed relative to the upper bass. In contrast, I find the wrapped view somewhat confusing.
> 
> Is my interpretation correct? Are there reasons for/against unwrapping that I am missing?


The unwrapped view is always easier to read if there are no modes/reflections that cause 360° offsets to the chart. You have 6 of those <180Hz. The unwrapped phase is therefore dropping off the chart and would be useable. You were not interested in that range so it is no problem in this case.

The phase trend and subject wrap at 54 Hz doesn't look right. It is not obvious as to the cause however. My first guess is that this is a SW-main XO issue? The trend of the phase above and below the disruption do not seem to smoothly align. Maybe the delay/distance setting was not correct and then EQ was used to smooth the SPL and hence the 240° phase offset of this chart? Or, maybe the mic was moved away from the LP for this measurement? It is impossible to say with so little info and no data to work with. 

If you want to post an .mdat with SW and main measurements from the LP with loopback timing activated, I may be able to better understand. If there is large EQ setting in this area it would is best to disable it for this purpose. Modest EQ filters do not normally create a problem.


----------



## 3ll3d00d (Jun 6, 2006)

Thanks for the further clarification



jtalden said:


> The phase trend and subject wrap at 54 Hz doesn't look right. It is not obvious as to the cause however. My first guess is that this is a SW-main XO issue? The trend of the phase above and below the disruption do not seem to smoothly align. Maybe the delay/distance setting was not correct and then EQ was used to smooth the SPL and hence the 240° phase offset of this chart? Or, maybe the mic was moved away from the LP for this measurement? It is impossible to say with so little info and no data to work with.
> 
> If you want to post an .mdat with SW and main measurements from the LP with loopback timing activated, I may be able to better understand. If there is large EQ setting in this area it would is best to disable it for this purpose. Modest EQ filters do not normally create a problem.


XO is a linear phase 2nd order neville-thiele at 120Hz so this range is the subwoofer only & the mic had not moved between generating the XO/correction and measuring the end product. 

I have not found a way to get a loopback to work with REW when measuring the output of a jriver hosted convolution. I had another idea on how to do this though so will try again tomorrow. Having said that, the same phase wrap is visible in a similar measurement taken in acourate directly so I'm pretty sure it's not a measurement error. The same "problem" appears to be present in the uncorrected measurement though which confuses me further.


----------



## jtalden (Mar 12, 2009)

SW with Port on the back?
If not, what is the SW box design?


----------



## 3ll3d00d (Jun 6, 2006)

jtalden said:


> SW with Port on the back?
> If not, what is the SW box design?


15" Fi SP4 in a 65L sealed cabinet, theoretical Q=0.71, LT applied that should produce Q=0.5 however the the driver has an inductance hump so the real life Q != theoretical Q. I do EQ out the hump (via a near field measurement and this gets embedded in my XO and is combined with the room correction to produce the final correction filter). The hump is centred around 60Hz, this seems a rather large coincidence if it isn't the source of that phase shift....


----------



## jtalden (Mar 12, 2009)

The LT is very likely the cause. Its phase will drop down quickly just after the early part of the shelf kicks in. It then stays a little below where the speaker phase would otherwise be.

So both charts posted are incorrect in the way it connects up across that 45-70Hz region. If you look at the wrapped chart, the phase connection between the upper an lower portion of the trace should actually go the other way. So the offset going from 70Hz to 45Hz is -115° as you show. The line should connect in that way, not as it shown now.

Another way to say it is that looking at the unwrapped trace the lower portion of the trace (9-45 Hz) is offset 360° too high. If that portion was shifted back down where it should be then the connection between it and the upper portion would slope up 115°. 

Windowing the IR would probably show this. If we set a right window a little too narrow and increase it in steps. The wrapped phase trace may first show the correct connection path of the phase across that range and then at some point just a little wider will jump to the opposite (wrong) connection.


----------



## jtalden (Mar 12, 2009)

Below see the impact of the LT on phase for an example SW. I found the chart *Here*.









I think I am interpreting the impact on your SW correctly, but I would need to see the .mdat to strengthen my confidence.


----------



## 3ll3d00d (Jun 6, 2006)

Here's an mdat containing 3 measurements; 

* directly to the sub with loopback on (i.e. raw response at listening position)
* the sub with the convolution filter active & with loopback on
* the sub with the convolution filter active but no loopback

the 2nd measurement seems accurately delayed in time but the response looks like garbage, I don't know what is going on there

the phase wrap appears to be present in both cases :huh:

View attachment sw_phase_investigation.mdat


----------



## jtalden (Mar 12, 2009)

First note that the window settings for all 3 measurements were not ideally set (as saved) to properly capture the IR. You apparently moved all 3 the IR initial peaks to 0ms. That was good. The "Window Ref Time" (Ref) was not set to 0ms though. For the purpose of reading phase we need to set the Ref to 0ms. The "Loopback Convolved" measurement looked strange because the window was set so that the entire IR was not captured. See Below:









"Loopback on" has no value in this case as we are only concerned with the SW response, not the delay between drivers. There is no issue with it on, but in this case the convolution process (2nd measurement) delayed the IR by the length of the convolution IR and processing time so that the IR was delayed 616ms. REW thus moved the Ref by 616ms to capture the IR in the window so the SPL would be represented properly. When you shifted the IR 616ms back to 0ms the IR was no longer in the window - all very confusing. The 2nd and 3rd measurements both look the same when the window settings are corrected.

Note the window settings in my charts below. For phase charts the Left Window always should always be set just before the IR rise. The Right Window length can be changed as needed to best understand the chart. There is SPL and Phase distortion if the "Frequency Resolution" is not less than ~1/3 of the lowest freq we are looking at so we need to be careful that we don't shorten it up too much. 

Let's first look at the "direct" measurement (first measurement) to see what the unfiltered SW situation is.























We can see the IR has 3 large peaks out to 20ms. Ideally the first peak be the largest and the others significantly smaller. This is the impact of the room/placement and it is not uncommon. There may be a better location for the SW, but possibly not. 

The phase response is relatively clear in this chart as the room modes at 125Hz and ~58Hz (possibly more than one modes in this area) are just creating an extra 360° shift to the phase as a result of the mode. I marked the Direct Sound phase response on the chart for clarity. If we move the mic 1 cm from the driver we should get a similar phase trace to the one I penciled in.

Below, we see the phase trace of the "Loopback Convolved" measurement with similar windows settings. The convolved phase has been flattened a little so that it remains near 0° down as low at 30Hz before rising up a little. This is a very good phase response. The mode(s) at 58Hz is still present. I don't know if that can really be completely removed even with the best of FIR filter algorithms?









All these results look normal, but it doesn't explain why the charts in post 5 look like there is only a 240°/115° shift. I don't know why that is. These are different measurements however so I would guess there was a difference in the measurement setup or REW settings.


----------



## 3ll3d00d (Jun 6, 2006)

Thanks for the interpretation. I hadn't even noticed that IR params box existed & this means loopback does work after all (though I'm not sure how it is working).

More questions if I may though the number of questions seems to be reducing so I feel like I'm getting somewhere! 

- why do you use Blackman-Harris 4 for the right window?
- why does a room mode that has been equalised away still cause a phase wrap like that?
- it feels a bit arbitrary to "see through" the phase wrap like that? how can we be confident that a mode is the cause?

The near field phase does indeed look like you suggested


----------



## jtalden (Mar 12, 2009)

3ll3d00d said:


> - why do you use Blackman-Harris 4 for the right window?


It's just a modest taper rate that was used a very knowledgeable HTS member. I don't recall who. When I investigated the impact of the options, I also decided it was a good compromise for the phase charts. Others of a similar taper rate would probably work well also.

If we use a tapering window function we are reducing the influence of the later arriving data, but not eliminating it. We are also adding a little distortion to the trace if some of the data is impacted. 

You can see the shape of the filter function when the "Window" box is selected as I showed above. This shows the relative weighting of the data. So when the window function slopes off to xx% then the data influence is reduced xx% for the calculation of the graph. 

For IIR filters it takes 1/F seconds for one cycle to arrive at the mic assuming it is starting right at 0ms (it might be delayed). So the minimum length of the window is different for each freq. The setting we use is therefore depends on the freq we are interested in and how much of the late arriving signal we want to influence the result. 

For a phase chart we are at a minimum looking for the direct sound phase. This suggests we don't want to start truncating the data before it all arrives and completes one cycle. It is necessary/helpful to also see at least some of the influence of the later arriving data as that is the room modes and reflections that cause issues. 

So the window function and right window setting is function of what freq and response characteristic we want to see. I often have to slide the right window time in and out and evaluate the change to SPL or Phase to gain comfort in what is happening and why. It just takes experience.



> - why does a room mode that has been equalised away still cause a phase wrap like that?


It was not equalized away. We only boosted the SPL level up in the local range surrounding it.

We can have a perfectly flat measured SPL with a very busy phase chart. The SPL measurement does not indicate when the sound arrived. So if we have reflection that causes a dip and we EQ it out. The mechanism is just that we output enough SPL into the room that eventually enough gets to the LP to result in the dip being removed. The sound at all the other parts of the room also increased at that freq so the peaks that occurred in another parts of the room is also boosted higher.

In the case of room modes, nulls cannot be removed with IIR filters. There may be more opportunity with an FIR filter that use the inverse of the measured response? I am still uncomfortable with the impact of the mechanism to do that however. It seems to me that it may cause at least as much trouble as it resolves when considering the overall sound field in the general listening area. Take this comment very skeptically as I have no experience and have a very limited understanding of that technique.



> - it feels a bit arbitrary to "see through" the phase wrap like that? how can we be confident that a mode is the cause?


We have never seen a reasonably designed SW driver / sealed box combination that doesn't have a relatively smooth SPL and phase response. We can also use TS parameters an model the response and will find the calc response matches the anechoic measured response. So if it is not the speaker then is it something else. Acoustics theory similarly models the existence of the various room modes and reflections that will occur for a given setup and the impact it will have on the sound distribution. The more detailed we get the more intensive the model becomes so we normally are only looking at macro influences. They can apparently get very accurate and detailed analysis with the right researcher and tools. We know from theory and measurements that room modes cause exactly this type of rapid 360° phase rotation. 

Since we know all rooms exhibit some room modes it is reasonable to assume that this is one of them for your setup. A good exercise for your comfort is to see if one of the major dimensions of the room matches up with this freq.


----------



## 3ll3d00d (Jun 6, 2006)

OK thanks for that & I do indeed have a number of modes in that range; approx at 41, 46, 56 for each 1st axial mode.


----------

