• Welcome to ASR. 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!

Time Alignment with Wavelets

A bit late noticing I was mentioned in this thread, sorry. A couple of comments:
  • It isn't meaningful to compare wavelets of different frequencies, that's why Pat picks the crossover frequency for his wavelets and why the Alignment tool's impulse mode applies the same filter to each response being aligned.
  • To deal with high latencies you could capture the signals as WAV and then Import them as impulse responses in REW - they're not impulse responses of course, but telling REW they are let's you use some of REW's IR tools to examine or process them. Examples would be:
    • the octave and fractional octave filters on the Filtered IR graph
    • windowing the reference regions of the imports and using the cross correlation alignment process to align them
    • using the t=0 offset tools.
 
My other criticism is - the only way to save this measurement is to export it as a .TXT file. But REW can not import the file that it just exported. I would love to overlay the measurement of the sub and the woofer, align the the loopback wavelet, and directly compare the delay of the sub vs. the woofer. Is there a way to do this? Do we need the Pro version of REW?
The scope is quite limited in what you can do with the data. For the next beta build I have added a Save button that saves the visible portion of the current traces as measurements in REW, they can then be exported and/or re-imported from there.
 
  • It isn't meaningful to compare wavelets of different frequencies, that's why Pat picks the crossover frequency for his wavelets and why the Alignment tool's impulse mode applies the same filter to each response being aligned..

Thanks for your comments. The reason I compared different frequencies is because my crossover points are at 50Hz, 500Hz, and 4500Hz. I know the time alignment values of these XO points by heart since I have done them dozens of times, and I was surprised to see vastly different results to what I was used to. For example, the relative delay between mid/tweeter on my system is 0.05ms, and the delay between mid/woofer is 0.4ms. With the wavelet method, it's almost 2ms for mid/tweeter, and 6ms for mid/woofer. Further investigation led me to conclude that it was because I was aligning to the middle peak of the wavelet train that was giving me the spurious results.
 
Anyway, the main point I was trying to make is that using the wavelet is for time alignment....of two sources with a single frequency stimulus. So there are no different bandwidths involved, where it's imperative to align starts (for IIR).
Phase distortion is described as an in place rotation
Time delay is described as shift to the right

given that a rotation changes the height of the peaks, it seems impossible to do anything other than align at the start of the initial rise as that is the only point/shape that is unambiguously known where it should be
 
Anyway, the main point I was trying to make is that using the wavelet is for time alignment....of two sources with a single frequency stimulus. So there are no different bandwidths involved, where it's imperative to align starts (for IIR).
My point is that a single frequency stimulus and time alignment do not match.
Single stimulus means a continuous sine wave (and therefore no time alignment possible). The moment you truncate it, the result will have a finite bandwidth. The shorter (and steeper) the wavelet, the greater the bandwidth. And the greater the bandwidth the more time resolution for alignment.
A 6.5 cycle wavelet with Hann tapering shows the envelope distortions in play, from both sources. Envelope distortion is just a different type measurement/view of group delay, i think.
Sure, but this is the theoretical point of view. A 6.5 cycle wavelet is very long at 80Hz. There will be a huge amount of reflections in the signal long before the peak will be radiated from the speaker, at least in small rooms. So the main part of the envelope distortion will be from the room reflections. Do you really want to align to that?
The wavelet start is a better part of the signal to align time.
Both Fedele and Dan make the point about how unreliable phase traces are in reflective conditions.
Yes, but you have to somehow align sub and main nevertheless, don't you?
You might want to have anechoic situation for alignment but when will this be the case in the real world?
And while the time alignment can still be done by nearfield+meter measure, the phase trace will carry the room impact.

The way I understand the videos they both use a different order:
First: time alignment, as phase is so unreliable and being one or two or three half waves off can easily happen.
Then: match phase by choosing polarity, maybe shift time a little bit or use all pass filters.
 
FYI REW Beta 82 with scope save option is out since yesterday:

 
given that a rotation changes the height of the peaks, it seems impossible to do anything other than align at the start of the initial rise as that is the only point/shape that is unambiguously known where it should be

Wavelets are a compromise. The shorter the wavelet, the more precise the time info. The longer the wavelet, the more precise the frequency info.
The trick is to find the number of cycles and widowing, that has accurate time resolution at a specific frequency and still gives some valid phase info around that specific frequency.

They are like fingerprints imo.
When I can get the sub's acoustic wavelet fingerprint to match the electrical generator's wavelet fingerprint as closely as possible at xover frequency , without regard to fixed time delay between generator and sub, step one done.
When I get the main's acoustic wavelet fingerprint to match the electrical generator's wavelet fingerprint as closely as possible at same xover frequency , without regard to fixed time delay between generator and main, step two done.
Their fingerprints now match as closely as possible. I keep repeating as closely as possible because it is impossible to get them to perfectly match due to IIR asymmetries.
Time align their peaks, step three done, and all done.

For me, there is no sense in even thinking about initial rise vs peak during this tuning process. It all comes down to how well can I get each side (sub and main) to match the wavelet stimulus fingerprint, or failing that, match each other. The closer the match, the better the phase performance match will be away from the specific xover frequency. And the better the time matchup.

What's really cool, is looking at wavelets on linear phase tunings. Then specific frequency matchup doesn't matter, as all frequencies peaks align...Yay! to hades with IIR :p
 
  • Like
Reactions: OCA
My point is that a single frequency stimulus and time alignment do not match.
Single stimulus means a continuous sine wave (and therefore no time alignment possible). The moment you truncate it, the result will have a finite bandwidth. The shorter (and steeper) the wavelet, the greater the bandwidth. And the greater the bandwidth the more time resolution for alignment.

I hope I addressed that in my previous reply. The wavelet is a purpose-built compromise, trying to gain some precision in the time domain, while still holding on to some phase info in the frequency domain. Gotta think single frequency here...and not via a sine wave.

Sure, but this is the theoretical point of view. A 6.5 cycle wavelet is very long at 80Hz. There will be a huge amount of reflections in the signal long before the peak will be radiated from the speaker, at least in small rooms. So the main part of the envelope distortion will be from the room reflections. Do you really want to align to that?
The wavelet start is a better part of the signal to align time.
I don't want ANY out in room measurements...:)

Yes, but you have to somehow align sub and main nevertheless, don't you?
You might want to have anechoic situation for alignment but when will this be the case in the real world?
And while the time alignment can still be done by nearfield+meter measure, the phase trace will carry the room impact.

Yes, as anechoic as possible, and co-located /stacked.
Then, when they need be separated i simply adjust delays via a laser distance finder. Nothing else other than levels.
It's impossible to tie phase better when apart, other than to a single spot...which is a big no-no imo.

I simply refuse to DSP a room other than knock down room modes. Acoustic solutions for acoustic problems imo...
 
What's really cool, is looking at wavelets on linear phase tunings. Then specific frequency matchup doesn't matter, as all frequencies peaks align...Yay! to hades with IIR :p
Since you build a lot of your own subs I was wondering if you use linear phase or IIR filters for non-crossover tuning? In my case I need a 2nd order high pass "safety filter" at 17 Hz and a -12 dB low pass shelf filter at 60 Hz to flatten out response. I am using IIR for these as I fear pre-ringing but maybe I should be using linear phase instead? How do you think about this?
 
For me, there is no sense in even thinking about initial rise vs peak during this tuning process. It all comes down to how well can I get each side (sub and main) to match the wavelet stimulus fingerprint, or failing that, match each other. The closer the match, the better the phase performance match will be away from the specific xover frequency. And the better the time matchup.
this reads as

me "given there can be phase differences which affect the magnitudes of the ripples in the wavelet, the only thing you know for sure is where it starts to rise in order to determine the time offset"
you "i aim to match the phase responses hence the peaks are the same (or v nearly the same)"

it's basically answering a different Q as far as I can see :) not saying that's not a valid thing to do, just that it's different point

aka

if you want to use a wavelet to understand the time delay between 2 things, you need to look at the initial rise
if you want to use it to examine phase response only, you look at the shape alone
 
this reads as

me "given there can be phase differences which affect the magnitudes of the ripples in the wavelet, the only thing you know for sure is where it starts to rise in order to determine the time offset"
you "i aim to match the phase responses hence the peaks are the same (or v nearly the same)"

it's basically answering a different Q as far as I can see :) not saying that's not a valid thing to do, just that it's different point

aka

if you want to use a wavelet to understand the time delay between 2 things, you need to look at the initial rise
if you want to use it to examine phase response only, you look at the shape alone

The thing is, wavelets don't have any timing validity until the until the magnitudes of their ripples are addressed, via phase correction.
I think it's pointless until that's done, to look at either initial rises or peaks.
Once the phase correction is done, time alignment becomes possible.

The order of the phase correction is imperative; polarity first, then phase.
Then when the phase correction is done, and the acoustic wavelets, main and sub, both take on a symmetrical look (that will be closer to the electrical wavelet),
peaks, initial rises, and even tail endings should all give close to the same fixed delay.
Peaks are just the easy way to achieve best accuracy.
 
Since you build a lot of your own subs I was wondering if you use linear phase or IIR filters for non-crossover tuning? In my case I need a 2nd order high pass "safety filter" at 17 Hz and a -12 dB low pass shelf filter at 60 Hz to flatten out response. I am using IIR for these as I fear pre-ringing but maybe I should be using linear phase instead? How do you think about this?

I think a system high pass needs to be IIR. The step response dip is just too extreme if it's lin phase.
That said, if the system high pass is only applied to the sub, I'm not as sure...because I don't know how to listen for pre-ring that can only come from a sub.

I do think I've heard pre-ring from long FIR filters when they were applied to the full range spectrum, and the system high pass was linear phase.
(I think FIR filter lengths need to be frequency dependent, decreasing with frequency. But I digress...)

Right now, I'm using a 2nd order safety IIR high pass too. Plan to continue to play with the sub high pass. I just switched all my vented subs to sealed to help hear what might be going on with lin phase vs IIR.


Sorry, I don't understand your -12dB low shelf @60 Hz.
Are you saying you are cutting below 60Hz to flatten out, or cutting above 60Hz which would make more sense to me, but I'd call that a high-shelf......
 
I think a system high pass needs to be IIR. The step response dip is just too extreme if it's lin phase.
That said, if the system high pass is only applied to the sub, I'm not as sure...because I don't know how to listen for pre-ring that can only come from a sub.

I do think I've heard pre-ring from long FIR filters when they were applied to the full range spectrum, and the system high pass was linear phase.
(I think FIR filter lengths need to be frequency dependent, decreasing with frequency. But I digress...)

Right now, I'm using a 2nd order safety IIR high pass too. Plan to continue to play with the sub high pass. I just switched all my vented subs to sealed to help hear what might be going on with lin phase vs IIR.


Sorry, I don't understand your -12dB low shelf @60 Hz.
Are you saying you are cutting below 60Hz to flatten out, or cutting above 60Hz which would make more sense to me, but I'd call that a high-shelf......
I am applying the high pass safety filter only to the sub, I guess I need to get a looped kick drum track like @ernestcarl talks about and try it myself for audibility. My understanding is that for "sealed" subs (without DSP LF boost) that you don't need a "safety filter" because the air will prevent over extension of the driver.

Yes the shelf filter I am using is a "high shelf" and again only applied to the sub, got the name wrong :(
 
I generated some minimum phase FIR filters today based on the IIR PEQ I was using for sub channels correction and set them up in Hang Loose Convolver Host as AU/VST plugins with an A/B switch. This is superimposed on top of a linear phase 8ch XO within HLC. I haven't measured yet but sonically (subjectively) I'm not hearing much difference, even on some deep bass dance tracks except maybe an added delay on the FIR version. Need to bust out the mic for some other timing measurements so hopefully report back soon.

Screenshot 2025-05-21 at 12.37.30 AM.jpg

2 instances of MEqualizer in mono with IIR filters A/B a stereo .wav FIR filter in Sir3.
 
The thing is, wavelets don't have any timing validity until the until the magnitudes of their ripples are addressed, via phase correction.
I think it's pointless until that's done, to look at either initial rises or peaks.
Once the phase correction is done, time alignment becomes possible.

The order of the phase correction is imperative; polarity first, then phase.
Then when the phase correction is done, and the acoustic wavelets, main and sub, both take on a symmetrical look (that will be closer to the electrical wavelet),
peaks, initial rises, and even tail endings should all give close to the same fixed delay.
Peaks are just the easy way to achieve best accuracy.
where do you get the idea from that it's only possible to time align something that is phase aligned? and that a wavelet analysis has zero information about time offset unless it's phase aligned? seems wrong to me
 
where do you get the idea from that it's only possible to time align something that is phase aligned? and that a wavelet analysis has zero information about time offset unless it's phase aligned? seems wrong to me

Time for a simulation to clear this up.

1747814526669.png


Take a 50Hz wavelet (red). Create a 50Hz all-pass filter with a Q of 0.3. Convolve the AP filter with the wavelet. The result is in blue. We can see that an all-pass filter changes the waveform dramatically. Let's see what the differences are.

1747816884164.png


The impulse start has not changed. If you don't believe me, here is an extreme zoom of the impulse start (look at the vertical scale on the left to see how much I have zoomed in).
1747815366171.png


This is impulse end. We can see that the AP filter has stretched the impulse by about 76.5 ms (I didn't bother trying to place the cursor exactly ... but I think i've made the point).

1747815636100.png


Now we invert the polarity of the distorted wavelet. We can see it is a better match to the original, and we can see that the "shoulders" of the waveform are asymmetrical.

1747816524980.png


This is an extreme zoom of the impulse peak. It's subtle, but you can see that the wavelet with the phase distortion is slightly delayed compared to the original. I measured it at 0.0625ms.

So we can see that phase distortion:

1. Stretches the waveform and distorts the left/right halves on either side of the main peak
2. Does not change the delay to impulse start
3. Changes the delay to impulse peak due to waveform distortion
4. Does not change the frequency
5. May give the appearance of inverted polarity

If someone wants to make the same simulation in REW, this is the procedure:
- Go to that wavelet generator and save to file. Then reopen it in REW.
- Use rePhase to make a few AP filters with the same freq but with different Q's. Then import all of those into REW.
- Trace Arithmetic A*B with A = wavelet and B = AP filter. Do this for each AP filter.

I don't think REW can be used to make AP filters. Or if it can, I haven't found the setting yet.
 
If you want more proof that we should not be aligning to the peaks, here is a more dramatic example. We are using the same 50Hz wavelet, but this time the AP filter is 30Hz, with Q 0.3.

1747825510462.png


Just as before, red is the original, and blue is the wavelet convolved with the AP filter to simulate phase distortion.

1747825451185.png


First up, let's look at impulse start: it's the same. The fact that impulse start is the same tells me that the appearance of polarity inversion is actually polarity inversion and not time shift.

1747825627338.png


So we invert the polarity. Now the phase distortion causing the time shift of the impulse peak isn't subtle any more. I'm not going to bother showing the end of the impulse, you can guess that the waveform is stretched and so impulse end is delayed.

I also wondered whether the impulse peak of the phase distorted version would change if we used a longer train of wavelets (i.e. that the measurement may be influenced by the test signal). So I simulated that, too. I'm not going to show you the curves but the short answer is: no difference.
 
The fact that impulse start is the same tells me that the appearance of polarity inversion is actually polarity inversion and not time shift.
I didn't get this statement, it's not inverting polarity, it's just a change in the phase response (which reaches 180 degrees at the specified corner frequency for a biquad all pass hence is closing in on 180 at your chosen frequency given that's not so far from the corner frequency)
 
Hi guys, a few comments before I try to in next post, give a good example of why aligning peaks is the way to go...
First, may I humbly request to step back and look at the objective of the SynAudCon method of using wavelets......
......it is to align sub to main...which means both in time and in phase.

If we peer deeply either through simulation or a high rez o-scope, how can wavelets NOT have the same initial rise time, whatever shape the of the initial rise?
Or any IIR electrical signal for that matter, filtered or not. Same absolute time result, always, no?

We don't have the ability to peer that deeply with our FFT measurements (despite what the bandwidth filtered impulse math might say ime)
We also have to question the validity of low frequency information captured by those measurements, give the wavelengths involved and the length ot the time window needed to capture the low freq info.

The 6.5 period wavelet again is a compromise, to try to overcome those difficulties/limitations. A way of looking at both time and phase together...and most importantly, a way to act on the information gleaned.
It requires a logical sequence of validation and correction steps as SynAudCon explained....polarity; phase, then time.

I strongly suggest folk play with measuring wavelets. ...electrically and/or acoustically. Been great for me, just as a general measurement understanding aid if nothing else, because much of what i thought about measurements didn't always pan out
(Although some folks here are telling me I still don't understand nothin :) !)

Anyway, next post will hopefully be a good example/case for peak alignment of 6.5 cycle
 
Back
Top Bottom