rePhase, a loudspeaker phase linearization, EQ and FIR filtering tool

Hi everyone,

I use REW and rephase to create a param eq IR for convolution in JRiver mostly for attenuating some bass peaks, which sounded ok. A pretty basic use I thought I understood until I decided to run REW to check the convolution.

The new versions of REW can generate a sweep with 2 acoustic references (one before and the other after the sweep for clock adjustment). Without convolution the two acoustic refs would play nicely. With convo using the middle default centering the last one would not, indicating some problem with the convolution.

First I thought it could be something related to the number of taps but to no avail. Then I changed the default centering from 'middle' to 0ms and the convoluted sweep played nicely with both acoustic reference, and the REW SPL, as expected, showed a response similar to the effect of the filter (param EQ).

I realized I did not understand what is the effect of this 'centering'. Could someone explain to me why 'middle' did not work and a 0 or small delay did? or point to a link to some documentation about it?
Many thanks
 
Hi everyone,

I use REW and rephase to create a param eq IR for convolution in JRiver mostly for attenuating some bass peaks, which sounded ok. A pretty basic use I thought I understood until I decided to run REW to check the convolution.

The new versions of REW can generate a sweep with 2 acoustic references (one before and the other after the sweep for clock adjustment). Without convolution the two acoustic refs would play nicely. With convo using the middle default centering the last one would not, indicating some problem with the convolution.

First I thought it could be something related to the number of taps but to no avail. Then I changed the default centering from 'middle' to 0ms and the convoluted sweep played nicely with both acoustic reference, and the REW SPL, as expected, showed a response similar to the effect of the filter (param EQ).

I realized I did not understand what is the effect of this 'centering'. Could someone explain to me why 'middle' did not work and a 0 or small delay did? or point to a link to some documentation about it?
Many thanks


I’m just learning cantering , so I’ll take a stab at it (I promise I’ll either be completely wrong or mostly right , I just can’t tell you where lol)


So centering the impulse,

You FFT length is n-taps (samples) and the impulse length is x samples.

It depends on 1 the sample speed and how many samples are in your impulse

If you have 2042 samples (taps) and you run at 96k you have to do the math (calculator online) to how many ms long the IR is.

So moving the centering forward helps center the impulse over the LF
So more efficient and better use of taps and also more centered over the length of the impulse. It’s not so much a matter of time alignment from subs to highs as it is more what type of filter your trying to generate and at what speed and how many samples.

On HF if you align in center of impulse you can almost always bet the HF if going to be in the center of the impulse , the wavelength is small so it takes up little room on the window , low frequency takes up more room on the window , and depending where your targeting on the low frequency you can move the centering up to better match where your trying to move things.

If your trying to move something that is let’s say centered 10ms after the peak you can move the centering to 10ms and it will make much better use of the delay taps. For example a low frequency linearization on a low pass filter
The phase moves positive as the amplitude attenuates, if that phase is moving positive that means it comes out before the rest of the magnitude. It’s moved forward in time. So the electrical filter releases the attenuation first and than the magnitude in actuality it doesn’t release it first it’s because those frequencies at the top of the low pass are shorter in wavelength because it’s getting quieter. (Except on some cases where it’s the opposite as the filters order reverses it’s polarity)

As a frequency looses amplitude it’s cycle peaks get shorter. If that makes sense.

So, In that LPF you could move the centering forward in time to center it at the middle of that portion of time.it makes much better use of delay taps and focus the impulse where it needs to be.


If your doing in a vst or on jriver you should have plenty of taps so it shouldn’t be as much as issue, unless it a multi-way, in that case you could move the centering forward on some of the bass fir, if the fir is full range I would keep exact centering value.

Another way is if your running let’s say 96k and have 1024 samples , off the cuff , the center of that is (I think) 5.33ms but that maximum size is let’s say 10.66ms long FFT block. And your trying to convolve a frequency that is much longer. So you have to move ahead in time as that frequency can’t necessarily fit in the window to begin with. It’s like adding delay before it runs its instruction.
 
Last edited:
I’m just learning cantering , so I’ll take a stab at it (I promise I’ll either be completely wrong or mostly right , I just can’t tell you where lol)


So centering the impulse,

You FFT length is n-taps (samples) and the impulse length is x samples.

It depends on 1 the sample speed and how many samples are in your impulse

If you have 2042 samples (taps) and you run at 96k you have to do the math (calculator online) to how many ms long the IR is.

....

Thanks for the detailed explanation, and success with cantering. I am not even close to be in the saddle with all this IR stuff lol.

You have a point. I did some tests after reading your reply.

I just wanted a gain EQ IR (no phase adjustments) and now I see the impact of the phase changes that middle or anything different from 0ms will cause.

0ms seems to have only the phase changes related to the filter itself as shown in the attached 3 REW SPL graphics of the IRs generated by rephase.

It may well be that these many HF phase changes when using middle are affecting the high frequencies including the last acoustic reference of the sweep when testing the convolution.

regards and thanks again..
 

Attachments

  • centering0ms.jpg
    centering0ms.jpg
    116.8 KB · Views: 297
  • centering1ms.jpg
    centering1ms.jpg
    137.6 KB · Views: 298
  • centeringMiddle.jpg
    centeringMiddle.jpg
    189.7 KB · Views: 295
I hope there is room for a more basic question in this thread?

I have been running EQ APO for active filters and EQ for about a year. Being able to set correct delays between drivers (offset), and proper EQ of each driver really improves things. I've tried this on various speakers, and always had a significant improvement.

I tried to do phase EQ and zero phase XO in Rephase, but for some reason I get tired of listening to this setup, gives me a headache after listening a while. If I only do a normal EQ for the drivers FR and save that as a .wav. and use the 'built in' XO in EQ APO, everything is fine.
I varied the amount of phase correction, and it seemed the less I was correcting, the longer I could listen to it.
I hear a small difference in the sound with and without correction (somehow more 'authentic' with phase correction), but for some reason I can't live with the sound.
At first I even tried some phase correction in the bass, but that sounded terrible, drums sounded strange etc. Later I mainly tried to correct mid-range, since I did not notice any significant difference with phase correction on treble.

I guess I'm doing something wrong, but not sure what.. After trying and listening and getting headaches, I kind of gave up after a while, and just left the phase correction alone.

Are there some basic guidelines on what to do, and what not to do? I have read some tips and hints here and there (ie don't correct bass), but it seems different people have different experiences?
I'm not a signal processing guru, so it should be pretty basic for me to comprehend..
 
Thank you.
I have done it as described with minimum phase, equalizing drivers first, and then filtering with linear phase for XO.

Only thing I did not try was the windowing options mentioned later with the rectangular window and exact centering, since I don't understand the terminology or theory behind it.
 
Thanks for the detailed explanation, and success with cantering. I am not even close to be in the saddle with all this IR stuff lol.

You have a point. I did some tests after reading your reply.

I just wanted a gain EQ IR (no phase adjustments) and now I see the impact of the phase changes that middle or anything different from 0ms will cause.

0ms seems to have only the phase changes related to the filter itself as shown in the attached 3 REW SPL graphics of the IRs generated by rephase.

It may well be that these many HF phase changes when using middle are affecting the high frequencies including the last acoustic reference of the sweep when testing the convolution.

regards and thanks again..
Hello hibikijin,

Centering will have an impact of the final delay of the processed signal.
When building a multiway crossover care has to be taken keeping all delays in check to create a properly time-aligned system, but for a global EQ (like you are doing here if I understand correctly), this will just be a delay.

The final value of that delay in showed under the "generate" button after the FIR generation. This delay has to be used a the time reference (sometimes called t=0) when displaying the response of the impulse in order to get actual phase response.

In practice when setting centering to "middle" you will have halve the impulse of delay. So let's say you have set an FIR length of 16384 sample at 48kHz, middle centering would be 8192 samples of delay, ie 170ms.

I suspect the delay you set was long enough to confuse that specific measurement strategy of REW?
 
Thank you.
I have done it as described with minimum phase, equalizing drivers first, and then filtering with linear phase for XO.

Hello Rallyfinnen

How did you EQ the drivers? Compensate filters?
Did you properly align the different FIRs?

What exactly did change between you linear-headache-phase settings and your minimum-okay-phase ones?

Only thing I did not try was the windowing options mentioned later with the rectangular window and exact centering, since I don't understand the terminology or theory behind it.
You should probably stick with "perfect impulse" centering setting. Rectangular windowing is also not necessary (nor wanted) when enough taps can be used.
 
How did you EQ the drivers? Compensate filters?

Min phase EQ and compensation filters. Tweeters are waveguided, so they need EQ for the waveguide too. I used EQ for baffle step for the woofers, and to smooth out some other variations in the response. Later I wanted to be able to adjust XO 'on the fly' in EQ APO by turning the 'knobs', so no XO-filtering was in the wav-files from RePhase. This created a problem with too much gain from the compensation filters 'out of band', so I only used EQ to compensate them reasonably past the XO frequency.
When using linear phase filters, I could use the linearisation filters since the gain out of band was down again, but have not used them with XO filtering in EQ APO.
Speakers are 2-way WTW.

Did you properly align the different FIRs?
Sorry, I don't understand the question..

What exactly did change between you linear-headache-phase settings and your minimum-okay-phase ones?
Minimum phase: far out of band EQ for drivers not done most of the time, but I tried Full compensation and minimum phase filters applied in RePhase too, and it sounded fine.
Linear phase: Only replaced the filters in RePhase with linear phase.
Allways used 12db LR.

Kind of hard to remember all the variations I tried abt a year ago, but had consistent headache problems with linear phase. First I even tried with passive XO, and only did phase EQ for that, same result. The less phase compensation applied, the longer I could listen.

You should probably stick with "perfect impulse" centering setting. Rectangular windowing is also not necessary (nor wanted) when enough taps can be used.

Ok, I tried it anyway yesterday, but did not have time to listen much, so no headache. I did notice that there was definitely more sense of depth on some recordings, but drums sounded a bit odd. I would say acoustic music sounded better, but rock etc not so much. Long time since I listened to phase corrected sound now, so it was kind of a reminder.
 
Hi Rallyfinnen,

Some thoughts, hope okay : )

Its a mystery why a linear phase XO slope gives you a headache compared to same slope done minimum phase, think this phenomen points to there is some non optimal settings in DSP somewhere when running linear phase mode, maybe it could be sample rate mitchmatch or timing of acoustic center that goes nuts in that DSP chain.

A note is for linear phase filter that best listening position is right on design axis, thats because the phase manipulation in the impulse response is the right number to linearize the amplitude slope there, but as we go off axis especially for the low pass section and probaly not for the high pass section the amplitude slope will change and so is the phase manipulation in the impulse response not the right number as we go more and more off axis.

You write about always used 12dB LR, a note for such 2nd order slope is that then we need to flip polarity on one of the transducer sections, in minimum phase mode one need to flip polarity on tweeter to get woofer going in standard forward direction on a positive impulse, but its the other way around using linear phase where its a woofer polarity flip to get woofer going in standard forward direction on a positive impulse.

Another thought is that when you in linear phase mode and live with the more or less system time lag, then why not go say 8th order LR slopes because the active XO region band is much less for 8th order than for 2nd order so XO region acoustic summing errors will be much less.
 
Rallyfinnen, thanks for the details.
It is difficult to tell what could possibly go wrong without seeing the whole EQ process, but it looks like beside linear phase filters, all the rest was identical between the two scenarios, right?

The difference between a proper linear-phase and a minimum-phase 12dB/oct acoustical crossover in this kind of frequency range should be... subtil at best.
Probably not audible. So if you hear/feel major differences then something might be amiss.

Did you reverse polarity of one of the two ways in the minimum-phase senario?
If not then that would be a difference, as a 12dB/oct minimum-phase LR crossover will cause a 180° difference, whereas a linear-phase one will not.

You should probably stick with "perfect impulse" centering setting. Rectangular windowing is also not necessary (nor wanted) when enough taps can be used.

Ok, I tried it anyway yesterday, but did not have time to listen much, so no headache. I did notice that there was definitely more sense of depth on some recordings, but drums sounded a bit odd. I would say acoustic music sounded better, but rock etc not so much. Long time since I listened to phase corrected sound now, so it was kind of a reminder.
"exact centering" will cause unwanted ripples in the IR (probably not audible tho), and rectangular window will raise the ripple floor in the magnitude response (might not be a problem if the FIR is long enough, but many other/gentler windowing algorithms would do then).

"exact centering" should only be used when exact sub-sample timing is mandatory (eg low sampling rate / high cutoff frequency combination, coaxial drivers, etc.)

rectangular windowing should only really be useful when magnitude stays relatively high throughout the frequency response (eg phase-only corrections, gentle EQ without filters, etc.)
 
Last edited:
Thank you for all your responses! Now, how can I answer everything..

First, image is very 'focused' even with minimum phase filters. With linear phase I think it's even a bit more sensitive where my ears are. I can move my head a few centimeters only before the image gets lost, and distance to speakers is more than 3 meters.

EQ APO does not allow other sampling rate / bit depth from what the sound card is running. I also use convoltion wav's for the minimum phase EQ of the drivers while using the XO in EQ APO, and that works fine.

When it comes to polarity, I have an easy 'switch' in EQ APO, so I can change the polarity on the tweeters. I 'switch' this when I change to linear phase.

However, there might be something about the timing between the two (linear/minimum phase), because I think I hear a bigger 'dip' if the tweeter is out of phase with minimum phase filters. I did not confirm this by measurement though..
I only confirmed 'perfect time alignment' by adjusting delay and measuring frequency response (to get maximum dip) with tweeter out of phase using minimum phase filters. I only assume the delays are the same with linear phase filters, since the settings used to generate the wav-files are the same.

I'm not so keen on steep filters, since my understanding is that it can be negative for polar response. Again, not verified by measurements.

I don't think interference/response ripple in the crossover region should give me a headache. I think this is common with drivers blending in the XO region no matter if the XO is active, passive, minimum phase or linear phase. I actually think the 'blending' can be good..
Before conversion to active, I used the same speakers with passive first order XO (Vifa C17 speakers designed by Troels G), and a slight 'misalignment' in offset. No headaches, but not sounding so good IMO.

What about pre-ringing? I have read the term, but I have no clue if it can be heard?

Anyway, I will go back to the standard window/centering-settings.
 
Rallyfinnen, a better way (I think) to align the delays is to play a 3 cycle or so sine wave generated with Audacity for example, and delay say 200ms one of the upper or lower driver and measure the peak distance between them when played and recorded in front of the speaker, vertically 1/2 between the center of drivers. Then you can see the real distance and align proper the delay.
 
Rallyfinnen,

Thanks note the info about your speaker design, that info make me think will hint you that as far as i know from linear phase XO trials that in your dual woofers covers all the band from lows up to that tweeter takes over probably at 2kHz or higher then a linear phase XO will not be so audioable a difference for realism as if you had a XO point in lower regions say below 1kHz area. Maybe you can run some trials yourself in its pretty easy use head phones and switch between some Rephase made all-pass filters that add only XO region phase distortion, go to "Filters Linearization" tab and pick the order you want and then change "Linearize" setting to "Rotate", now create the same filters at for example 200/400/1000/2000/3000Hz. Outcome for me in such a test is its in general hard to hear the difference but of cource it also depend of its low order or high order slopes that is used, but the higher the frq of filter the harder it becomes notice any difference in realism and also we should note or remember that in 6kHz area any real reproducing of square waves will fade out because bandwidth of real world tweeters is not that high as for other electronics in audio chain.

Suggest if you want to optimize that speaker using DSP instead if the original passive network developed by TG is use the free VituixCad and follow its measurement plus manual guide of how to setup stuff because then you should get some great data of power response/directivity index/polar maps to base and optimize the design and also it can easy switch between minimum phase and linear phase XO points and show the visual simulated difference.

Have fun : )
 
Thank you all for your replies!

chebum: I'ts just that I started with rephase from the beginning to be able to use linear phase, and just removed that from the generated wav when I had problems with the sound, and kept the driver EQ part.

arcgotic: Ok, I will try that when I have the time. Have some projects in the pipeline for the winter, so I might compare methods then.

BYRTT:
At the moment I'm running the speakers standalone, so bass is up to abt 2k.
Ok, so basically, the higher you go in frequency, the less audiable the phase linearization will be? I think I was reading before that phase correction in bass is not recommended? I did a quick try with this between main speakers and multiple subs, and did not get a good result. Also tried MSO with some success. I found that playing with delays and normal EQ worked well. What would be the 'recommended frequency range' for phase corrections?
 
Hello hibikijin,

Centering will have an impact of the final delay of the processed signal.
When building a multiway crossover care has to be taken keeping all delays in check to create a properly time-aligned system, but for a global EQ (like you are doing here if I understand correctly), this will just be a delay.

The final value of that delay in showed under the "generate" button after the FIR generation. This delay has to be used a the time reference (sometimes called t=0) when displaying the response of the impulse in order to get actual phase response.

In practice when setting centering to "middle" you will have halve the impulse of delay. So let's say you have set an FIR length of 16384 sample at 48kHz, middle centering would be 8192 samples of delay, ie 170ms.

I suspect the delay you set was long enough to confuse that specific measurement strategy of REW?


Hi pos,
Yes, it is related to the amount of delay. I am doing just global EQ at the moment using rephase (great application, thanks) and convolution.


After your comment, I tried with lower number of taps (not larger as I tried initially) and the issue with REW disappeared even with middle centering. (e.g. 32768 instead of 65536 for 44.1kHz, increasing the # of taps for higher rates)



amicalement
 
I'm having a problem with '.dbl' format files exported from rePhase for use in Roon.

I created room correction filters using REW. Exported filters .WAV impulse, compressed files to ZIP, loaded into Roon DSP Convolution and works fine.

Used RePhase. Imported REW measurement (txt format), Imported REW Filters (xml format). Corrected Phase using rePhase Filters. Exported impulse filters from RePhase as ‘64 bits IEEE-754’ (.dbl) format. Created configuration file as per instructions in Roon Knowledge-base. Created ZIP file with configuration file and .dbl files. Loaded into Roon DSP convolution filter. Got message saying “Unexpected Error Communicating with Device” “Too Many Failures. Stopping Playback”.

So, my question is why the filters exported from REW work but the same filters exported from RePhase do not?

Also, noticed that the .wav files exported from REW are larger filesize and vary according to sample rate (from 524Kb to 2.1Mb) whereas the .dbl files exported from RePhase are all 131Kb. Is this what would be expected?

Text of .cfg file I created is below.

44100 2 2 0
0 0
0 0
ASW_RP_L_44.dbl
0
0.0
0.0
ASW_RP_R_44.dbl
0
1.0
1.0
88200 2 2 0
0 0
0 0
ASW_RP_L_88.dbl
0
0.0
0.0
ASW_RP_R_88.dbl
0
1.0
1.0
88200 2 2 0
0 0
0 0
ASW_RP_L_88.dbl
0
0.0
0.0
ASW_RP_R_88.dbl
0
1.0
1.0
48000 2 2 0
0 0
0 0
ASW_RP_L_48.dbl
0
0.0
0.0
ASW_RP_R_48.dbl
0
1.0
1.0
96000 2 2 0
0 0
0 0
ASW_RP_L_96.dbl
0
0.0
0.0
ASW_RP_R_96.dbl
0
1.0
1.0
19200 2 2 0
0 0
0 0
ASW_RP_L_192.dbl
0
0.0
0.0
ASW_RP_R_192.dbl
0
1.0
1.0