• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. 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!

Does Phase Distortion/Shift Matter in Audio? (no*)

OCA

Addicted to Fun and Learning
Forum Donor
Joined
Feb 2, 2020
Messages
717
Likes
553
Location
Germany
there is no easy way to capture the 3D space of the speakers in the room
There are recent very compute intensive solutions using spherical mic arrays.



slide1_1.jpg
 

Keith_W

Major Contributor
Joined
Jun 26, 2016
Messages
2,790
Likes
6,427
Location
Melbourne, Australia
Hi @j_j thanks for hanging around the thread and answering questions :) I have another question for you. It is known that the output of minphase filters can not reconstruct a square wave input. For linphase filters, the summation of the low pass and high pass will reconstruct the square wave. A transient is the closest thing we have in music to a square wave. I have heard people say that minphase filters smear the transient in the same way a square wave is smeared across time. The audible consequence is less "attack" of the transient. In your opinion, is this true?

BTW, here is an anecdote you might find interesting. DSP filters are used to filter out high frequency noise when ECG's are taken to improve legibility. Normally, this is sent through a linphase filter. The latency is not a problem. You hit a button, wait a few seconds, and the ECG prints. But latency is a problem in some applications, e.g. cardiac monitors and defibrillators. So these use minphase IIR's. Since an ECG is by definition an impulse, the minphase IIR has the effect of distorting the waveform and making it wider than it actually is. It is well known among doctors (I am one) that cardiac monitors are only good for rhythm interpretation. We call them "cardiac RHYTHM monitors" to drive home the point, lest someone forgets and tries to read more into the waveform than they should. I have seen broad complexes on a cardiac monitor before. When I hit "print", the waveform is sent through a linphase filter and it comes out the printer with a slight delay. More often than not, the waveforms look normal.

All this was before I knew the difference between minphase and linphase filtering. This is why I love learning just for the sake of learning :) Apparently useless information I learnt as part of my hobby may turn out to have some application.
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
Hi @j_j thanks for hanging around the thread and answering questions :) I have another question for you. It is known that the output of minphase filters can not reconstruct a square wave input. For linphase filters, the summation of the low pass and high pass will reconstruct the square wave. A transient is the closest thing we have in music to a square wave. I have heard people say that minphase filters smear the transient in the same way a square wave is smeared across time. The audible consequence is less "attack" of the transient. In your opinion, is this true?

...

This goes back to a very simple issue, the length of the impulse response of a filter. The resolution (in frequency) of a filter determines how long the impulse response must be.

I forget where, but there is a set of examples here where I posted a minimum phase, constant delay, and maximum phase trio of filters that all have exactly the same frequency (magnitude, not phase) response.

If you use an IIR (typically minimum phase) filter, the peak of the filter response is near the start. If you use a constant delay filter, it's in the middle. But, for the same frequency response, you're going to have the same overall length.

So, you trade off things like potential pre-echo vs. potential audible phase-shift. It is entirely possible to build a mixed-phase filter, some IIR and minimum phase, some FIR of any phase you choose.

BUT, IIR filters must always have minimum phase pole roots. Otherwise they aren't stable. It's not just a good idea, as they say, it's the MATH. :)

FIR filters can be anything they want. You can take a constant delay filter, use standard cepstrum techniques and make it minimum phase, for instance. You can take the roots of the filter (this is a much more "high-precision" effort and hard to do past very short filter lengths) identify the zero pairs and quads (for a symmetric filter, there will always be quads for complex roots, one is the inverse of the other in the root value), and swap pairs back and forth between the root and 1/root to make things more minimum phase, or more maximum phase, or whatever you choose. Some people call this apodizing, I call it math.
 

Keith_W

Major Contributor
Joined
Jun 26, 2016
Messages
2,790
Likes
6,427
Location
Melbourne, Australia
Thanks @j_j . I am able to simulate all the different filters you mentioned in my software so I have seen the differences. My question is whether you think that smearing of the a musical transient is audible with an IIR.

I performed this simulation to test. I created IIR and FIR versions of a 32nd order Linkwitz-Riley XO with a 50Hz XO point. I convolved HPF and LPF with a 50Hz square wave. I deliberately chose a steep slope and a square wave as a torture test. I then added LPF+HPF and studied the responses.

This is the result of the Linphase FIR:

1716515436368.png


And this is the minphase IIR:

1716515466353.png


So it seems clear that the impulse is smeared and widened. I know that shifting phase of a square wave test tone is not audible, but what about a square wave impulse? Something like a transient in music?

I did not show the start and end of the impulse but I can clearly see the pre and post ringing in the linphase FIR and the post ringing in the minphase IIR. I understand the audibility of that since I have done my own experiments by deliberately creating nasty filters and playing it in my system. I think I can hear it, to me the transients sound smeared. But I am not sure if it's my imagination or whether it's real. I am also unsure if the transient smearing is due to actual widening of the transient or the copious post-ringing that follows. With this particular example, there is 250ms of post-ringing in the IIR. With the FIR, the summation of LPF+HPF cancels the pre and post ringing, but as Linkwitz points out, the summation is only perfect on the computer and not on loudspeakers in listening rooms. Regardless, it too sounds smeared and I can see 140ms of pre and post-ringing in the simulation. The post-ringing is about 1/2 the duration and amplitude of the IIR version.

I should probably try to answer my own question to see if I can pass a Foobar blind test.
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
The answer to your question is primarily in what time cues are you mangling at those low frequencies?

Will the source material have any places where such mangling is audible? I frankly can't say offhand. Above a few 100Hz, yes, one can create such a signal. I'm not sure about that at 40 or 60 Hz.
 

Keith_W

Major Contributor
Joined
Jun 26, 2016
Messages
2,790
Likes
6,427
Location
Melbourne, Australia
1716530598181.png


Yes it does sound obviously different. The first half is a pulsating hum. The second is a series of loud pulses. There is so much bass in the second half that my head hurts a little. I think your intention is for me to compare a nasty FIR vs. a nasty IIR. I will have to make those again. I'll go do it and report back.
 

audiofooled

Addicted to Fun and Learning
Joined
Apr 1, 2021
Messages
547
Likes
604

Grab this file. It has two equal length parts, that sound different. You'll have to listen to both halves independently for an ABC/hr or ABX. See if there's any effect.

Very clever, and very audible, thank you. Be careful about the "click" though. :)

Screenshot_20240524_084709_Spectroid.jpg
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
FYI, the first and second part have identical magnitude spectra. It's all phase shift. I dropped the matlab in the message thread.

You could write out 'x' and 'y' from the script separately, and then take the spectrum of each. No click there.
 

audiofooled

Addicted to Fun and Learning
Joined
Apr 1, 2021
Messages
547
Likes
604
The first part seems to be modulating around 48Hz center frequency, so no decay at that frequency. Second one is a pulse of the entire spectrum. 53-63Hz are exactly the same in both?
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
The first part seems to be modulating around 48Hz center frequency, so no decay at that frequency. Second one is a pulse of the entire spectrum. 53-63Hz are exactly the same in both?
It's 50Hz, with sidebands at +- 7 Hz. The first has the 2 sidebands out of phase, the second the two sidebands are in phase. Identical amplitude spectra. Exact same level.
 

audiofooled

Addicted to Fun and Learning
Joined
Apr 1, 2021
Messages
547
Likes
604
It's 50Hz, with sidebands at +- 7 Hz. The first has the 2 sidebands out of phase, the second the two sidebands are in phase. Identical amplitude spectra. Exact same level.

Thanks for the clarification. The above is not exactly a precision device nor does it have enough processing power for any higher resolution. For transients it's reasonably quick only at 1024 bins FFT size, 4 decimations, flat top window.
 

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
Thanks for the clarification. The above is not exactly a precision device nor does it have enough processing power for any higher resolution. For transients it's reasonably quick only at 1024 bins FFT size, 4 decimations, flat top window.
Yeah, this was generated with a double-precision 2^20th long FFT. I find that 'over the top' ensures you don't bollix something. :D
 

Keith_W

Major Contributor
Joined
Jun 26, 2016
Messages
2,790
Likes
6,427
Location
Melbourne, Australia
I made some FIR and IIR filters and compared them with your test signal. Both were LR4's with a subwoofer XO point of 50Hz. I deliberately made huge volume cuts to provoke as much ringing as possible.

The audible difference between the two filters is really subtle. I think the FIR has the bass at lower pitch, and the IIR at higher pitch. But the reason why can be seen in my verification measurement. The FIR has a touch more bass between 20Hz - 45Hz, about 1.5dB more.

1716640661404.png


Red = FIR, Brown = IIR, left channel only. The right channel looks similar, so I'm not showing it.

The processing of both FIR and IIR was exactly the same. Both were time aligned, but the IIR had a massive time discrepancy compared to the FIR - 35ms to align the subwoofer as opposed to 9ms, no doubt due to phase rotation at 50Hz.
 

Jazzman53

Active Member
Joined
May 15, 2019
Messages
169
Likes
403
I had a recent experience that convinced me that phasing does matter because I heard it.

I have hybrid ESLs with woofers under the panels, back-mounted on a common open baffle, and the speakers are bi-amped with a DSP/crossover.

As back-mounted on the OB, the woofers' surrounds are about 1/2" behind the stat panels but their conical diaphragms emit sound from a center of pressure located closer to the voice coil, which is about 4 inches behind the stat panels, hence; out of phase with the stat panels.

Knowing this, I setup a microphone a couple of feet away, between the panel and woofer, then fed in a 260Hz sinewave test tone (matching the crossover frequency) and applied time-delay on the panel to obtain max SPL (i.e. max constructive interference) on the DSP's RTA screen. A 0.33 millisecond delay on the panel exactly time-aligned it to the woofer (i.e. zero phasing error).

Later I was playing music and alternately enabling and disabling the time-delay on the stat panel, to see if I could detect an audible difference.

I happend to be playing a song by the Supremes, which would have been recorded in the sixties, and it was obvious that the recording engineer had applied some reverb on Diana Ross's voice, for ambience (I used to be a soundman for a jazz band and I'm familiar with what reverb of that era sounds like). I was amazed to note that the reverb on Ross's voice disappeared when I disabled the time-delay on the stat panel.

OK, now I'm convinced... phasing errors do matter.
 
Last edited:

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,325
Likes
4,849
Location
My kitchen or my listening room.
I made some FIR and IIR filters and compared them with your test signal. Both were LR4's with a subwoofer XO point of 50Hz. I deliberately made huge volume cuts to provoke as much ringing as possible.

The audible difference between the two filters is really subtle. I think the FIR has the bass at lower pitch, and the IIR at higher pitch. But the reason why can be seen in my verification measurement. The FIR has a touch more bass between 20Hz - 45Hz, about 1.5dB more.

View attachment 371171

Red = FIR, Brown = IIR, left channel only. The right channel looks similar, so I'm not showing it.

The processing of both FIR and IIR was exactly the same. Both were time aligned, but the IIR had a massive time discrepancy compared to the FIR - 35ms to align the subwoofer as opposed to 9ms, no doubt due to phase rotation at 50Hz.

Comparing the first and second half as far as changes didn't do much, I guess?

If I had to guess, the first half might get more like the second half, i.e. more heavily modulated. But that's not necessarily "enough heavily" to be audible. You'd need response down to 40Hz for that. There is no signal content below 43Hz, btw.
 

antcollinet

Master Contributor
Forum Donor
Joined
Sep 4, 2021
Messages
8,045
Likes
13,680
Location
UK/Cheshire
A transient is the closest thing we have in music to a square wave
What sort of transient in music are you thinking of? Because the typical features I hear being described as transients (Percussion/drum strikes/Cymbal hits etc) are nothing like a square wave. They build up over a significant number of cycles of in band frequencies.
 

Keith_W

Major Contributor
Joined
Jun 26, 2016
Messages
2,790
Likes
6,427
Location
Melbourne, Australia
Comparing the first and second half as far as changes didn't do much, I guess?

If I had to guess, the first half might get more like the second half, i.e. more heavily modulated. But that's not necessarily "enough heavily" to be audible. You'd need response down to 40Hz for that. There is no signal content below 43Hz, btw.

I didn't think so. I thought the FIR version had lower pitch with both halves. It was exceedingly difficult to hear and the volume had to be turned up. I am not sure what this test tone demonstrates?

By the way, I heard something really odd when I was performing the sweeps. I have an 8 channel DSP controlled active speaker system. With the FIR XO's I could hear one smooth sweep. With the IIR I could hear the overlap - it was clearly audible as a double tone, as if two people were singing together in a duet. I was confused because I thought I did the time alignment properly. So I checked the step response and all the XO's to see where the impulse peak was. They looked OK. I shrugged and continued. Now the really strange thing is ... when I sat in the listening position and played music, the "double tone" effect was gone. Bizarre. I have no explanation. Something really odd is going on, and I need to investigate.

There is something else too.

1716686993880.png


This is the raw uncorrected response of the FIR (red) vs IIR (brown). I was pretty flabbergasted when I saw this. Both have the exact same LR4 XO. If I open them up, the amplitude is exactly the same, only the phase is different.

I am used to making FIR filters only. People say that IIR filters are less predictable. I guess now I know.

What sort of transient in music are you thinking of? Because the typical features I hear being described as transients (Percussion/drum strikes/Cymbal hits etc) are nothing like a square wave. They build up over a significant number of cycles of in band frequencies.

I am thinking of a transient which has both high and low frequency components, similar to a Dirac pulse several samples wide. Something like a very big drum. Actually, I should go and play some Dirac pulses and see if I can hear a difference between the FIR and IIR.
 

witwald

Senior Member
Forum Donor
Joined
Jul 23, 2019
Messages
485
Likes
514
It is known that the output of minphase filters can not reconstruct a square wave input.
I was under the impression that 1st-order low-pass and high-pass Butterworth filters sum together and do not vary the phase response. The latter is necessary for the correct reconstruction of a square wave. Of course, using 1st-order filters in loudspeaker crossovers has other issues that can make them a poor choice.
 
Top Bottom