# IR response : multiple inpulse



## Stefc13 (Feb 7, 2014)

Hello,

I would like to perform a phase measurement at the LP. But I have some difficulties to interpret the IR response: 

1st:
There are 2 impulses quite similar within 1 ms. When I'm pressing "Estimate IR delay" sometimes the second is selected...

So I don't know which one I should select in order to fine tune the delay.

2nd
The phase seems to be very weird :yikes: I need to reduce a lot the cycle number in "IR windows" in order to get something acceptable but then I'm not sure this is realistic...

I attached the mdat file. Hope you can help me :smile:

The setup:
speakers are ~3 m from LP, LP is close from the back wall (10 cm between the wall and the sofa).

Thanks
Stef


----------



## jtalden (Mar 12, 2009)

The impulse response of both channels is very erratic for a 3 m LP measurement. This could be the result of reflections, but I am concerned there may be a problem with the REW settings. It would be good to review the settings. Be sure the same channel is selected as 'reference channel' for both measurement. Pick the appropriate 'measurement channel' for the left and the right measurements. Do not select 'both' for the measurement channel. That is one idea of a possible issue. 

Assuming the objective is to adjust the delay such that the L and R sound to arrives at the mic position:
1. We could just measure the difference in distance from the mic to the 2 speaker baffles and adjust accordingly.
2. if these measurements are valid, we can look at the overlay of the ETC chart and note the offset in the 2 ETC is about 0.22 ms or 75mm with the left channel arriving first. A 0.22 ms delay increase on the left channel will work. A small movement of the mic (chair) position to the right will also work.

The following shows how the ETC overlay chart can be used.


----------



## FargateOne (Mar 3, 2015)

May I ask a stupid question here to see if I understand well the Rew index which says: "Measurements will have a time delay that corresponds to the difference in their distance from the microphone compared to the distance of the *reference speaker* - if the reference speaker is further away the delay would be *negative*."

Let's say I choose the right surround as reference and measure the front left and the front right. Suppose that rew tells me that there -100mm delay for the left and + 60mm for the right. Suppose I do not want to use the AVR distance setting and move the speakers to put them at equal distance from my MLP
Am I right to conclude that my left speaker is closer to the front wall ( further away of the mic) by 100mm?
What do I do? Do I calculate 100- 60mm= 40 mm and move forward the left speaker by 40mm and bacward the right speanker by 40mm? or
Do I move the speakers the same way but for the distances given by REW?:sweat:


----------



## jtalden (Mar 12, 2009)

FargateOne,
I don't know. I have never looked into the REW reported impulse positions and thus how to remember the directions needed for adjustments. I often get things backwards if I don't follow the procedure that I carefully worked out for myself. I confess that I sometimes get confused with direction even when using my own methods. I think REW reports time to the largest early impulse peak, but if there are several similar sized peaks then a small difference on one of the 2 channels may result in REW picking a different peak. This is partly passing observation, but mostly speculation as I really don't know how reliable it is use the REW reported offset numbers. I would need to investigate it. 

My primary method is a graphical one as shown above. I prefer charts to tables of data. I usually use the impulse chart rather than the ETC chart, but sometimes the ETC is easier to interpret as it was in this example. Things that arrive earlier appear more to the left of the chart, so to move the red/left sound to the right to match the green/right ETC position we need to add delay to the left channel. If we instead want to change a speaker distance to make the adjustment then we need to move the left speaker further away from the mic (by 75 mm in this case). We could instead move the right speaker closer by 75 mm so the green curve falls at the red curve position.

Where I sometimes get confused is when I am shifting the impulse position manually within REW rather than changing the delay in a DSP box. To simulate adding delay to the left channel in REW we can manually shift the impulse position 0.22 ms to the right. To do that we need to shift it -0.22 ms. This seems backward to me as I am always thinking about adding delay time. I does make sense recognizing that this is a time scale not a delay scale so negative time is a positive delay? It still is a little confusing to me. I have finally made peace with it however. 

I hope that helps. It works pretty well for me. I suspect you will need to do some of you own experimentation to become comfortable with a methodology that makes sense to you.


----------



## Stefc13 (Feb 7, 2014)

jtalden said:


> The impulse response of both channels is very erratic for a 3 m LP measurement. This could be the result of reflections, but I am concerned there may be a problem with the REW settings. It would be good to review the settings. Be sure the same channel is selected as 'reference channel' for both measurement. Pick the appropriate 'measurement channel' for the left and the right measurements. Do not select 'both' for the measurement channel. That is one idea of a possible issue.


Thanks for your help !

I used the same channel as 'reference channel' and measured both speakers separately. I guess all this mess comes from the reflection.



jtalden said:


> Assuming the objective is to adjust the delay such that the L and R sound to arrives at the mic position:
> 1. We could just measure the difference in distance from the mic to the 2 speaker baffles and adjust accordingly.
> 2. if these measurements are valid, we can look at the overlay of the ETC chart and note the offset in the 2 ETC is about 0.22 ms or 75mm with the left channel arriving first. A 0.22 ms delay increase on the left channel will work. A small movement of the mic (chair) position to the right will also work.


My goal is to measure the phase and try to correct it with RePhase. Is it necessary to have such accuracy in the distance ? When I'm listening music I'm not exactly at the same place every time.

It looks that the second impulsion corresponds to the reflection, the mic was around 20 cm from the wall:


How can I get rid of this reflection ? Maybe by setting 1ms in the 'Right window' parameter of the 'IR windows' ? But the measurement will be still relevant ? 

Thanks again for your help :smile:


----------



## FargateOne (Mar 3, 2015)

jtalden said:


> FargateOne,
> (...)
> My primary method is a graphical one as shown above. I prefer charts to tables of data. I usually use the impulse chart rather than the ETC chart, but sometimes the ETC is easier to interpret as it was in this example. Things that arrive earlier appear more to the left of the chart, so to move the red/left sound to the right to match the green/right ETC position we need to add delay to the left channel. If we instead want to change a speaker distance to make the adjustment then we need to move the left speaker further away from the mic (by 75 mm in this case). We could instead move the right speaker closer by 75 mm so the green curve falls at the red curve position.


I will try to interpret graphs and impulse chart to see if I better understand.



> I would need to investigate it.


If you do, please give us some thoughts it would be greatly appreciated.



jtalden said:


> I hope that helps. It works pretty well for me. I suspect you will need to do some of you own experimentation to become comfortable with a methodology that makes sense to you.


I am glad to know that I am not the only one to be confused! And, after I read the MiniDSP information about acoustic reference with REW getting me more confused!. I will do test (moving forward or backward one speaker at a time and remeasure) this week-end and report here. 

Thank you!


----------



## jtalden (Mar 12, 2009)

Stefc13 said:


> My goal is to measure the phase and try to correct it with RePhase.


Oh... okay. I mentioned my guess above as I had no clue as to the basis of the questions. [The answers often depend on the objective.]



> Is it necessary to have such accuracy in the distance ?


No, none. That is why I was confused about the objective. Knowing some people do want perfect centering of the LP, that was what I guessed.



> When I'm listening music I'm not exactly at the same place every time.


Me too.



> It looks that the second impulsion corresponds to the reflection, the mic was around 20 cm from the wall:


Yes, but I question why it is stronger than the direct sound? Also, why are there several other very strong reflections? These thoughts made me think possibly there was a measurement issue. If that were the case then any data analysis is worthless.



> How can I get rid of this reflection ? Maybe by setting 1ms in the 'Right window' parameter of the 'IR windows' ? But the measurement will be still relevant ?


Yes, that is my concern as well. 

*Regarding the current measurements:*
I am not sure how I can help here. Either there is a measuring error or there are very high levels of high frequency reflections. 

I am now inclined to think the measuring setup is not the problem. To dig deeper in this area, we would need all the detail of the audio equipment and settings. I did not see any issues in the 'Info' section of the REW file you posted so that rules out several potential issues within REW. If the wire connections are correct from the soundcard to the receiver and the receiver mode is stereo then no issues come to mind.

*Regarding Acoustics:*
I am not very qualified to address this as my acoustic knowledge only fair. I tend to leave most all questions to others more experienced with various room situations. The acoustics thread may be the best place to pose any questions you have. I do observe that your high frequency SPL response rises ~5 dB over most all of the midrange response. Since the impulse appearance is primarily driven by the high frequencies the first step I would take is to apply appropriate EQ to achieve a reasonable house curve. The IR may then look much more normal. The room acoustic analysis may then be much easier to interpret. Control of room acoustics and EQ will make the phase rotation much easier to determine at the LP.

*Regarding rePhase filtering:*
I don't see any relationship between channel delay and a rePhase phase correction filter. There may be one as there are many different setups with different concerns, but I tend to think of my situation. For phase linearization on a typical setup we need only one rePhase filter that is applied to both channels and there is no impact to the resulting timing between the 2 channels. I use the 'centering/energy' option as it best utilizes the filter size chosen.

If you are instead creating left and right filters because different EQ filters will be used on the 2 channels (with or without phase linearization), then I think it is necessary locate the impulse peak at the same location in the 2 FIR filters. This appears to be easy to do in rePhase using the 'Centering' control. You can center the impulse peak with 'Middle', but that may not be the best option to best utilize all the taps for a given filter size. I would expect the 'energy' option may give different positions and thus different delays although the difference may well be trivial. 'Middle + xx' would allow the peak to be offset as needed to best fit it within the filter length chosen. We can open the resulting filters in Audacity to confirm where the peak is located. We can also and zoom in on the amplitude scale look at the tails of the filter to assure the chosen peak location does not truncate one tail too much. If it does, we can either offset the peak more accordingly, or increase the size of the filter until both tails return to zero. I have limited, almost no, experience with including EQ in rePhase filters as I use a box for EQ. Thus, I may not be the best resource for this detailed advice. I think these comments are basically correct.

*Regarding Phase linearization:*
If the only question is what is the phase correction needed for 2 stereo speakers that is fairly easy. We want to correct the direct sound phase. After EQ Just move the mic to 1 m in front of the baffle of one speaker at a height of the TW (or midway between the height of the TW and MR). Measure without acoustic timing active. Apply a 5 cycle FDW (frequency dependent window) and view the phase rotation. This is what the filter needs to address. If there is a SW (2.1 system) and it is not very near the main speaker and we want to correct phase down near the SW XO then this is not the best way to do it. It works perfectly well though for 2.0 systems. Just add this phase correction to any FIR EQ filter you may have created and confirm the proper positioning of the peaks within the new filters.


----------



## jtalden (Mar 12, 2009)

FargateOne said:


> If you do, please give us some thoughts it would be greatly appreciated.


I am good with my methods and have no interest in investigating this. Sorry.


----------



## Stefc13 (Feb 7, 2014)

jtalden said:


> *Regarding the current measurements:*
> I am not sure how I can help here. Either there is a measuring error or there are very high levels of high frequency reflections.
> 
> I am now inclined to think the measuring setup is not the problem. To dig deeper in this area, we would need all the detail of the audio equipment and settings. I did not see any issues in the 'Info' section of the REW file you posted so that rules out several potential issues within REW. If the wire connections are correct from the soundcard to the receiver and the receiver mode is stereo then no issues come to mind.


My setup is HTPC => EMOTIVA UMC200 => CROWN XLS1502 => B&W CM10 S2. The pre-amp is in 'Direct' mode 2CH.
I think my room is far from perfect... but performing the measurement at 20 cm from the wall seems to be the problem. 
I will do some measurement at 1 m just to verify that the result is more 'normal'.



jtalden said:


> *Regarding rePhase filtering:*
> I don't see any relationship between channel delay and a rePhase phase correction filter. There may be one as there are many different setups with different concerns, but I tend to think of my situation. For phase linearization on a typical setup we need only one rePhase filter that is applied to both channels and there is no impact to the resulting timing between the 2 channels. I use the 'centering/energy' option as it best utilizes the filter size chosen.
> 
> If you are instead creating left and right filters because different EQ filters will be used on the 2 channels (with or without phase linearization), then I think it is necessary locate the impulse peak at the same location in the 2 FIR filters. This appears to be easy to do in rePhase using the 'Centering' control. You can center the impulse peak with 'Middle', but that may not be the best option to best utilize all the taps for a given filter size. I would expect the 'energy' option may give different positions and thus different delays although the difference may well be trivial. 'Middle + xx' would allow the peak to be offset as needed to best fit it within the filter length chosen. We can open the resulting filters in Audacity to confirm where the peak is located. We can also and zoom in on the amplitude scale look at the tails of the filter to assure the chosen peak location does not truncate one tail too much. If it does, we can either offset the peak more accordingly, or increase the size of the filter until both tails return to zero. I have limited, almost no, experience with including EQ in rePhase filters as I use a box for EQ. Thus, I may not be the best resource for this detailed advice. I think these comments are basically correct.
> ...


Ok, so for the filtering part, I'll do the measurement at the LP and for the phase linearization I'll do the measurement at 1 meter from the speaker. With the first measurement, I will setup the FIR EQ filters and then use the second one to correct the phase.
Is that right ? 

FYI, I tried MathAudio and the result was much better than the EQ from my pre-amp. So I'm thinking that using Rephase will be even better... but first I need accurate measurements :wink2:

Last question: position of the mic 0° or 90° ?

Thanks for your help :smile:


----------



## jtalden (Mar 12, 2009)

Stefc13 said:


> My setup is HTPC => EMOTIVA UMC200 => CROWN XLS1502 => B&W CM10 S2. The pre-amp is in 'Direct' mode 2CH.
> I think my room is far from perfect... but performing the measurement at 20 cm from the wall seems to be the problem.
> I will do some measurement at 1 m just to verify that the result is more 'normal'.


Nice equipment. 
I agree; an LP that close to the back wall is not recommended.
The 1 m measurement will tell us a lot. It's a good easy first step for more information. If it still looks abnormal I would first confirm there are no settings within the HTPC that are causing the problem - more info coming on how to do this if needed.



> Ok, so for the filtering part, I'll do the measurement at the LP and for the phase linearization I'll do the measurement at 1 meter from the speaker. With the first measurement, I will setup the FIR EQ filters and then use the second one to correct the phase.
> Is that right ?


If the 1 m measurement is normal then I think that is the best plan. I would wait for that 1 m result.



> Last question: position of the mic 0° or 90° ?


Use the mic orientation that goes with the mic cal file. The UMIK-1 provides cal files for 2 mic orientations. Your last file had the 90° cal file loaded in REW so you can use a 90° mic orientation for the measurement. There is no problem with that. I use and normally recommend a 0° mic orientation and cal file for most work, but suspect the difference is trivial in most all applications. If you do switch to 0° then it is okay to just point the mic straight forward when measuring from the LP. There is no need point it directly at the speaker. A 20-30° misdirect is no problem for LP EQ work.


----------



## Stefc13 (Feb 7, 2014)

Hello,

So I gave a try with the mic at 1m from the back wall. I think the results are more consistent :smile:.

By the way, it seems that the previous measurements were done with the 2 speakers playing at the same time... :duh:

I'm a bit confuse about the way to set the reference in the IR windows. I read different ways of doing it.
- From a previous post from you: the phase should go smoothly to 0° at 20KHz
- I read also that the step response can be used, the first positive raise indicates the pic where the 0 reference should be
- the step reference should be positive, if it goes to negative then the impulse is inverted.

Should I invert the impulse ? 


Thanks again for your support :T


----------



## jtalden (Mar 12, 2009)

Stefc13 said:


> By the way, it seems that the previous measurements were done with the 2 speakers playing at the same time.


I'm glad you got that sorted out. The IR looks more normal now - well done. Note that, I did warn you in post 2 not to select 'both' as the 'measurement channel'.



> I'm a bit confuse about the way to set the reference in the IR windows. I read different ways of doing it.
> - From a previous post from you: the phase should go smoothly to 0° at 20KHz.
> - I read also that the step response can be used, the first positive raise indicates the pic where the 0 reference should be
> - the step reference should be positive, if it goes to negative then the impulse is inverted.
> ...


First, I note that acoustic timing was still active for these measurements. In post-7 I mentioned that acoustic timing should be off for rePhase phase correction measurements. This is no problem as in REW we can still adjust the IR position wherever we want it.

*Regarding Inversion:*
After aligning the 2 IR's on top of each other and placing them near 0 ms we can set the reference time to 0.00 ms and also apply an FDW of 5 cycles as shown below.









From this IR shape (and the step response not shown) it is impossible to tell for sure the correct polarity. There are still several early peaks that confuse the issue on what IR position to choose. It may have been better to measure at 1 m from the baffle as recommended above, but that also may not have helped. Regardless, we can look at the phase and see how that looks.







---

Note that the phase rises a little before reaching 20 kHz. This suggest we are probably better shifting the IR's so the next earlier peak is at 0 ms to arrive at this:

















This looks as good as any setting to get phase top fall smoothly to 0°. I tried inverting the impulses and tried other IR locations, but that did not help either. Remember, the IR location can be shifted and inverted in rePhase during the analyze so we can deal with the options there where we can see what works best for the phase correction.

*Comments:*
You can export either of the these channels for the rePhase work as they are very similar. I would not phase correct phase below 100 Hz in this case as there is apparently an abrupt phase shift around 80 Hz. This is possibly due to a SW handoff or possibly a room mode. Either of these will shift with the position of the mic so this is not representative of the situation at the LP. It's safest to leave that low bass unchanged unless you do a lot of work to investigate the situation in detail.

The Adjusted File FYI:
View attachment jaPost11.mdat


----------



## Stefc13 (Feb 7, 2014)

Thanks a lot for your help and the time you spent to provide me the adjusted file :T

I will redo all the measurement following all your recommendations.

I'll come back when it's done. Just to confirm :grin2:

Hope to have time this week-end :smile:


----------



## jtalden (Mar 12, 2009)

If by, "more measurements" you mean a measurement at 1 m mic distance then that may be a useful check. No need to measure both channels. The current data shows the 2 speakers are identical. I am not expecting any practical difference. The commnet was primarily just an observation the IR is still a little unusual. There should be no problem using either one the current measurements for the rePhase work.


----------



## Stefc13 (Feb 7, 2014)

Hello,

Yes, I tried to follow all your recommandations. I also put blankets on the floor to avoid reflections. 

I think it looks now better :smile:

But I still have some doubt about setting the 0 reference in the impulse windows. When I'm using the 'estimate' function, REW estimation seems to me a bit weird :dontknow:

Here are my results, hope this time I did it correctly. The mdat file is the original one without any tuning.


----------



## jtalden (Mar 12, 2009)

Yes, this looks identical to the last measurements for phase rotation. This is thus the accurate phase behavior of the direct sound. This response (or the last one) can be exported from REW for import into rePhase. I provided an mdat in Post-12 that shifted the IR to a reasonable position to start the work in rePhase. It may well be necessary to shift it again in rephase as it is not really clear where the XO's are actually located and how to best locate the IR. It will take some research on the XO points in the speaker and experimentation in rePhase as to how to best compensate for them. I do not have the time to explain the detail on how to do this. This is just more work than I have available time for. 

If you look up and provide the XO points of the speakers. I can do an analysis in rePhase to provide one possible solution for a phase correction filter FYI. It would work just fine in your setup. There will probably be other solutions that will also work fine also. It also can be used as an example that may be helpful in your learning the process.


----------



## Stefc13 (Feb 7, 2014)

Here are the XO values: 350Hz, 4kHz

Thanks a lot for your support. 

if you have some links available, I will be happy to try to understand by myself. If we are shifting the phase, is it to determine the "real" measurement ? Or the phase is relative, and we are trying to find the best position for an easy correction ?


----------



## jtalden (Mar 12, 2009)

The rePhase thread on diyAudio.com contains several links to various guides. It's a big thread though and I didn't review or save any links. I don't even know if any of the them step through creating a simple phase correction filter for a commercial passive XO'ed speaker such as yours. They at least briefly describe how to do it if you can find the right posts. 

I will see what I can do with your provided data and XO info. If I have some success I will try to provide a brief summary. 

I also need to know: 
> What sample rate do you use for your music? 
> What music server do you use?
> Is there a limit on the size of the FIR filter that can be applied in that music server? [32k is plenty for this, I would expect, and we can do well with much less if necessary.]


----------



## jtalden (Mar 12, 2009)

Actually 2k taps is found to be enough to do this job so that is not likely a problem.


----------



## Stefc13 (Feb 7, 2014)

jtalden said:


> I also need to know:
> > What sample rate do you use for your music?
> > What music server do you use?
> > Is there a limit on the size of the FIR filter that can be applied in that music server? [32k is plenty for this, I would expect, and we can do well with much less if necessary.]


> Mainly 44.1 (CD ripped in FLAC)
> Foobar
> Not sure to understand but it's running on a PC, I guess to issue to expect with the CPU load.

Thanks again :T


----------



## jtalden (Mar 12, 2009)

Stefc13 said:


> > Mainly 44.1 (CD ripped in FLAC)
> > Foobar
> > Not sure to understand but it's running on a PC, I guess to issue to expect with the CPU load.


Good. I am pretty sure Foobar handles 64k tap filter size so we are well below its limits. The FIR filter needs to match the sample rate of the music. I will use 44.1k to create the filter. Music for any other rate will still play normally, but the phase correction filter will not be active. I suppose you could have Foobar down sample any higher rate music to 44.1k before it then applies the filter.


----------



## jtalden (Mar 12, 2009)

Here is the result of my effort.
I started with the Left channel of the REW measurement from Post-12 and exported it as text with the settings as shown below:








I imported it into rePhase and using trial and error adjusted the 'filters linearization' 'Crossover' and 'time offset' controls to make the phase a flat as possible. I hoped the XO info you provided might assist the placement and selection of the filters shown below, but it didn't. The rePhase controls are not really designed for use with commercial passive XO speakers in mind. The chosen filters worked pretty well to remove the phase rotation. I did shift the 'time offset' by -0.01 ms as shown to best flatten the resulting phase response. This filter could be used 'as is' in Foobar.








There is still some minor ripple in the phase response. Some of this is because the actual physical XO filters do not correspond with the choices I needed to make to get a reasonable result. Some of it is due to box diffraction and room reflections. If we assume most of this is related to the direct sound rather than room effect and want to further smooth the response, we can do that. Below the 'parametric phase' filter tab was used in addition to the above settings. We can spend as much or as little effort as we want to smooth the response further using these controls:
















Below is the resulting filter as shown in Audacity. The second chart zooms in on the amplitude scale to show that the tails of the filter are not truncated using this 2048 tap filter.
















Finally, below is a zip of the rePhase and the created FIR phase correction filters:
View attachment FIRs and rePhase.zip


----------



## Stefc13 (Feb 7, 2014)

*Thanks a lot for your effort *:T

I will give a try to your filter and also try to generate on by my self :wink2:


----------

