DSPRelated.com
Forums

Linear phase vs Min. Phase

Started by Max October 18, 2014
I noticed a post about 'pre-ring' here recently (couldn't find the
thread again), and I'm trying to follow up to figure the implications
to audio systems. Web searches turn up conflicting info regarding
subjective notions of sound, but some of the samples I've heard are
convincing (if a bit contrived).

I haven't seen this covered in any books or references, which is
surprising, given the consequences.  Is there a good method for
achieving linear phase while avoiding pre-ring?  Minimal phase filter
followed by an all-pass to compensate?
If you achieve linear phase then you will have a symmetric impulse response no matter how you get there. The pre-ringing argument only applies to systems where you are cascading a large number of filters in a row. 
More people are switching to min phase in recent years. Personally I think that using the term "linear" to describe the phase response has subtly influenced the way people think, because who wouldn't want linear?
There are some interesting filter approaches where you don't bother holding the linear- phase condition above 20khz. This can give a good compromise between low group delay and holding the linear- phase condition over the audio band. 

Bob
See "Antialias Filters and System Transient Response at High Sample Rates", by
Peter Craven; JAES vol 52 no 3 March 2004. This paper is targets the design of
antialias filters, but the discussion can be generalized and is very
interesting.
On Sat, 18 Oct 2014 07:06:26 -0700 (PDT), radams2000@gmail.com wrote:

>If you achieve linear phase then you will have a symmetric impulse response no matter how you get there. The pre-ringing argument only applies to systems where you are cascading a large number of filters in a row. >More people are switching to min phase in recent years. Personally I think that using the term "linear" to describe the phase response has subtly influenced the way people think, because who wouldn't want linear? >There are some interesting filter approaches where you don't bother holding the linear- phase condition above 20khz. This can give a good compromise between low group delay and holding the linear- phase condition over the audio band. > >Bob
Hi Bob, I believe I follow what you are saying about the creation of linear phase creating symmetric impulse response, but I have heard that cascaded min-phase + allpass has been used to counter the pre-ring problem (Not sure that it was effective in achieving that). How would "a large number of filters in a row" differ from a single filter with very sharp rolloff, and hence a lot of stages? I've heard demos where the pre-ring was amazingly intrusive in audio midband, much like sputtery reverse-tape echo effects. That was induced with some common commerical EQ plugins. Those filters presumably did not have the number of stages that you'd see in, for instance, the 22khz LPF in a CD player. So I would assume that the 22k LPF could cause pre-ring over quite a time interval, despite the relatively high frequency. For some reason, this does not seem to be a mainstream concern in DSP land, but seems to be picking up attention in the pro audio world. If the clips that I've heard are representative, then there is good reason for that. I would love to get a feel for what's actually going on (is this simply Gibbs phenomenon as applied to filters?) and how to gauge the magnitude of the pre-ring signal. Also, is there any windowing scheme that will minimize the effects?
On Sat, 18 Oct 2014 09:45:49 -0500, Greg Berchin
<gjberchin@chatter.net.invalid> wrote:

>See "Antialias Filters and System Transient Response at High Sample Rates", by >Peter Craven; JAES vol 52 no 3 March 2004. This paper is targets the design of >antialias filters, but the discussion can be generalized and is very >interesting.
Thanks for the reference, Greg. That paper seems to be mentioned everywhere, but I believe the full text is only available to AES members (which I am not, unfortunately). Still, a great search key, since it turns up lots of relevant comments.This seems like a very lively subject these days. Of course many of the comments and assessments that do turn up are conflicting, so it may take a while to get into focus with the implications (amplitudes, audibility, etc). If this were an innocuous effect, I would not expect there to be such a buzz about it currently. I'm surprised to see that it has largely gone unnoticed until recently.
Max

The min- phase plus allpass technique gives the same results as I was mentioning in that when you specify the allpass optimization you would only extend it to 20khz and let the phase do whatever it wants above that. If you were to specify outstandingly good phase accuracy then I think you start to look more and more like a standard linear- phase FIR. It's interesting in this case that you can get very flat response and trade off phase accuracy to get lower group delay; somehow it seems like a direct fir optimization should be able to accomplish the same goal, but most fir design techniques are matching against a complex target response and the errors in phase are treated the same as errors in magnitude.  In other words you can't get very low magnitude ripple without also getting very low phase error, and that (unnecessary) restriction causes the group delay to be longer than desired. There should be a program that allows you to say. "I want a low pass filter that is +/-.001 db flat up to 20 kHz and holds phase to 1degree while minimizing group delay".  Maybe a good job for an optimizer. 

Bob
On Saturday, October 18, 2014 9:34:14 AM UTC-4, Max wrote:
> Is there a good method for > achieving linear phase while avoiding pre-ring?
instead of using the equi-ripple Parks-McClellan alg to design the brick-wall FIR filter, use the least-squares design.\ the P-McC method puts in ripples in the pass-band that have the appearance of being sinusoidal. so it looks like multiplying in the frequency domain by ( 1 + a*cos(2*pi*f/f0) ) where a is hopefully small and f0 is the spacing of the bumps in the ripple. now, if it's doing that, what is the effect in the time-domain? you get a blip on both sides of the central lobe in the impulse response. one is a pre-echo, the other is a post-echo.
> Minimal phase filter followed by an all-pass to compensate?
this might be something to do if you're implementing this with an IIR. r b-j
On Sat, 18 Oct 2014 12:52:51 -0700 (PDT), radams2000@gmail.com wrote:

>Max > >The min- phase plus allpass technique gives the same results as I was mentioning in that when you specify the allpass optimization you would only extend it to 20khz and let the phase do whatever it wants above that. If you were to specify outstandingly good phase accuracy then I think you start to look more and more like a standard linear- phase FIR. It's interesting in this case that you can get very flat response and trade off phase accuracy to get lower group delay; somehow it seems like a direct fir optimization should be able to accomplish the same goal, but most fir design techniques are matching against a complex target response and the errors in phase are treated the same as errors in magnitude. In other words you can't get very low magnitude ripple without also getting very low phase error, and that (unnecessary) restriction causes the group delay to be longer than desired. There should be a program that allows you to say. "I want a low pass filter that is +/-.001 db flat >up to 20 kHz and holds phase to 1degree while minimizing group delay". Maybe a good job for an optimizer. > >Bob
That program would make sense. I'm very curious now about how this is handled in production systems for audio CD's. The customary adage about "44.1Khz is enough" would seem to relate only to recreation of isolated sinusoids, but the overall picture looks much more complex. If simple midband audio filters can create very audible 'splatter' effects over large fractions of a second, then brickwall filters at 22Khz seem likely to cause artifacts over the duration of many samples. This would seem to shed a different light on the practical application of Nyquist for accurate reproduction. I don't understand the latter just yet, as this certainly should be very measurable. Not like it would have stayed under the radar for so long. Yet standard wisdom in the pro audio world still maintains that 96Khz or 192Khz sample rates are completely unnecessary. Even if there is an argument that pure audio artifacts due to pre-ring are inaudible in the 20khz range, interchannel synchronization of transients in stereo playback would also seem to be affected in a big way. I think the jury is still out re the threshold timing, but I've heard figures as low as 2 microseconds. BTW your comment "you can't get very low magnitude ripple without also getting very low phase error"... I presume that you meant lower ripple yields higher phase error? I'll try to relocate the samples that I found online. There was an interesting conversation about this whole thing was just a mathematical quirk stemming from misinterpretation of spectrum of a Dirac delta pulse, but then a couple audio engineers posted rather shocking audio samples clearly showing the effect. That kind of changed the tenor of the exchange.
On Sat, 18 Oct 2014 16:30:35 -0700 (PDT), robert bristow-johnson
<rbj@audioimagination.com> wrote:

>On Saturday, October 18, 2014 9:34:14 AM UTC-4, Max wrote: >> Is there a good method for >> achieving linear phase while avoiding pre-ring? > >instead of using the equi-ripple Parks-McClellan alg to design the brick-wall FIR filter, use the least-squares design.\ > >the P-McC method puts in ripples in the pass-band that have the appearance of being sinusoidal. so it looks like multiplying in the frequency domain by > > ( 1 + a*cos(2*pi*f/f0) ) > >where a is hopefully small and f0 is the spacing of the bumps in the ripple. now, if it's doing that, what is the effect in the time-domain? you get a blip on both sides of the central lobe in the impulse response. one is a pre-echo, the other is a post-echo.
Hmmm.... Do you think that this would correct the problem then, Robert? I've been seeing an increasing buzz about abandoning linear phase filters due to the pre-ring problem. I've seen plugin manufacturers' videos on Youtube demoing differences with their new minimal phase approach. It sounds like the problem can be -minimized- by use of minimal phase filters in place of linear phase, but that is based purely on moviing artifacts from the front of the signal to the back, hoping that they will be masked. In any case, this would seem to dispell any notion of completely accurate reproduction of signals 'just as long as they comply with Nyquist.' Certainly there must be something missing here. I can't imagine that the audio industry could have overlooked this for so long.
On Sat, 18 Oct 2014 12:52:51 -0700 (PDT), radams2000@gmail.com wrote:

>Max > >The min- phase plus allpass technique gives the same results as I was mentioning in that when you specify the allpass optimization you would only extend it to 20khz and let the phase do whatever it wants above that. If you were to specify outstandingly good phase accuracy then I think you start to look more and more like a standard linear- phase FIR. It's interesting in this case that you can get very flat response and trade off phase accuracy to get lower group delay; somehow it seems like a direct fir optimization should be able to accomplish the same goal, but most fir design techniques are matching against a complex target response and the errors in phase are treated the same as errors in magnitude. In other words you can't get very low magnitude ripple without also getting very low phase error, and that (unnecessary) restriction causes the group delay to be longer than desired. There should be a program that allows you to say. "I want a low pass filter that is +/-.001 db flat >up to 20 kHz and holds phase to 1degree while minimizing group delay". Maybe a good job for an optimizer. > >Bob
I found the thread: https://www.gearslutz.com/board/mastering-forum/925681-echoes-past.html It starts off with a reasonable assurance regarding Dirac spectrum, but then about 1/3 of the way down, you'll see links to some rather shocking audio samples. (Those links are still valid) The audio samples are obviously an exaggeration in that they are intentionally placed in a relatively low frequency range, but still, the same thing must be happening with every implementation of any digital filter. The conversation seems to be shifting from "44.1Khz is enough for completely accurate reproduction" to "if we fudge this, we can sort of mask the distortion." Still trying to understand how this is possible.