I coded a very nice crossover using 4th order Linkwitz-Riley filters whereby their sine wave outputs do indeed sum to a flat frequency response. However, the square wave response of the summation is terrible. I am getting over 4dB of overshoot and ringing. I understand Butterworth IIR filters have non-linear phase shift - with respect to their inputs. But in the 4th order Linkwitz-Riley alignment the HP and LP filters are always 360 degrees out of phase with respect to EACH OTHER. So if the phase BETWEEN the LP and HP outputs is always constant why doesn't summing the LP and HP outputs reproduce a square wave? What am I not understanding here? (This is the reason I am pursuing linear phase FIR filters in my other post)
Linkwitz-Riley transient response
Started by ●December 6, 2006
Reply by ●December 6, 20062006-12-06
jeff227 skrev:> I coded a very nice crossover using 4th order Linkwitz-Riley filters > whereby their sine wave outputs do indeed sum to a flat frequency > response. > > However, the square wave response of the summation is terrible. I am > getting over 4dB of overshoot and ringing. > > I understand Butterworth IIR filters have non-linear phase shift - with > respect to their inputs. But in the 4th order Linkwitz-Riley alignment > the HP and LP filters are always 360 degrees out of phase with respect to > EACH OTHER. > > So if the phase BETWEEN the LP and HP outputs is always constant why > doesn't summing the LP and HP outputs reproduce a square wave? What am I > not understanding here?What you see partially ue to filtering the signal and partially due to Gibbs' phenomenon. A (continuous-time) square wave signal has infinite bandwidth. You will never actually reach those vertical leading and trailing edges, there is always another term at a higher frequency to add, that get you a *little* bit closer to vertical. So by filtering the square wave, you remove some of the harmonics in the Fourier sequence and thus destroy its "squaredness". The overshoot is a consequence of the signal being discontinuous. At the discontinuity -- the vertical leading and trailing edges of your square wave -- the Fourier series misses the upper and lower points of the signal, and hits the middle point instead. There is nothing you can do about it. Rune
Reply by ●December 6, 20062006-12-06
jeff227 wrote:> I coded a very nice crossover using 4th order Linkwitz-Riley filters > whereby their sine wave outputs do indeed sum to a flat frequency > response. > > However, the square wave response of the summation is terrible. I am > getting over 4dB of overshoot and ringing. > > I understand Butterworth IIR filters have non-linear phase shift - with > respect to their inputs. But in the 4th order Linkwitz-Riley alignment > the HP and LP filters are always 360 degrees out of phase with respect to > EACH OTHER. > > So if the phase BETWEEN the LP and HP outputs is always constant why > doesn't summing the LP and HP outputs reproduce a square wave? What am I > not understanding here?Because the phase near crossover needs to match the phase and away from crossover, and how can you do that?> > (This is the reason I am pursuing linear phase FIR filters in my other > post)Basically, it's not phase error that causes the ringing, but the sharp cutoff. I imagine you know the magnitudes of the components of a square wave, Tou can look it up if you don't, ot ask and I'll tell you. Truncate series to the first 7 components (to the thirteenth harmonic) and check for ringing. Remove a few components or add a few more; it won't matter. Sharp corners in frequency make for ringing in time. It's harder to show the reverse. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●December 6, 20062006-12-06
jeff227 wrote: > I coded a very nice crossover using 4th order Linkwitz-Riley filters > whereby their sine wave outputs do indeed sum to a flat frequency > response. > > However, the square wave response of the summation is terrible. I am > getting over 4dB of overshoot and ringing. > > I understand Butterworth IIR filters have non-linear phase shift - with > respect to their inputs. But in the 4th order Linkwitz-Riley alignment > the HP and LP filters are always 360 degrees out of phase with respect to > EACH OTHER. > > So if the phase BETWEEN the LP and HP outputs is always constant why > doesn't summing the LP and HP outputs reproduce a square wave? What am I > not understanding here? Because the phase near crossover needs to match the phase and away from crossover, and how can you do that? > > (This is the reason I am pursuing linear phase FIR filters in my other > post) Basically, it's not phase error that causes the ringing, but the sharp cutoff. I imagine you know the magnitudes of the components of a square wave, You can look it up if you don't, or ask and I'll tell you. Truncate series to the first 7 components (to the thirteenth harmonic) and check for ringing. Remove a few components or add a few more; it won't matter. Sharp corners in frequency make for ringing in time. It's harder to show the reverse. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●December 6, 20062006-12-06
jeff227 wrote:> I coded a very nice crossover using 4th order Linkwitz-Riley filters > whereby their sine wave outputs do indeed sum to a flat frequency > response.And this is not particularly useful since you need to take the whole audio system into the account.> > However, the square wave response of the summation is terrible. I am > getting over 4dB of overshoot and ringing.Doesn't matter. Listen with the ears, not with the scope.> I understand Butterworth IIR filters have non-linear phase shift - with > respect to their inputs.The linearity of phase and the amount of ringing are the two unrelated subjects. But in the 4th order Linkwitz-Riley alignment> the HP and LP filters are always 360 degrees out of phase with respect to > EACH OTHER.So what?> So if the phase BETWEEN the LP and HP outputs is always constant why > doesn't summing the LP and HP outputs reproduce a square wave? What am I > not understanding here?The LR filter is basically a Butterworth filter which has the known property to "ring". The ringing is more the higher the filter order is.> > (This is the reason I am pursuing linear phase FIR filters in my other > post)This is a popular misconception about linear/nonlinear phases and ringing. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●December 6, 20062006-12-06
Jerry Avins wrote:> Basically, it's not phase error that causes the ringing, but the sharp > cutoff.To be more exact, the ringing is caused by the cutoff sharpness vs delay in the filter. One can build a filter as sharp as he like and without any ringing. That can be either FIR or IIR structure, it does not matter.> Sharp corners in frequency make for ringing in time. It's harder to show > the reverse.Imagine a cascade of moving average filters for FIR or a cascade of 1st order filters for IIR. The cutoff can be as sharp as you like depending on the number of stages, the phase will be nonlinear for IIR, however there will be no ringing at all. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●December 6, 20062006-12-06
>Imagine a cascade of moving average filters for FIR or a cascade of 1st >order filters for IIR. The cutoff can be as sharp as you like depending >on the number of stages, the phase will be nonlinear for IIR, however >there will be no ringing at all.I tried cascading damped 2nd order sections (Bessel, I believe) with the assumption you stated above (aka, 2nd order Linkwitz-Riley "Transient perfect" crossover). No ringing on the LP/HP individual outputs but the SUMMED outputs still had very ugly square wave response even though the summed frequency response was flat. Why now? Ringing, in this case, is not the reason.
Reply by ●December 6, 20062006-12-06
jeff227 skrev:> >Imagine a cascade of moving average filters for FIR or a cascade of 1st > >order filters for IIR. The cutoff can be as sharp as you like depending > >on the number of stages, the phase will be nonlinear for IIR, however > >there will be no ringing at all. > > > I tried cascading damped 2nd order sections (Bessel, I believe) with the > assumption you stated above (aka, 2nd order Linkwitz-Riley "Transient > perfect" crossover). No ringing on the LP/HP individual outputs but the > SUMMED outputs still had very ugly square wave response even though the > summed frequency response was flat.Why do you expect the sum of a LP'd and HP'd signal to be OK? Rune
Reply by ●December 6, 20062006-12-06
Vladimir Vassilevsky wrote:> > > Jerry Avins wrote: > > >> Basically, it's not phase error that causes the ringing, but the sharp >> cutoff. > > To be more exact, the ringing is caused by the cutoff sharpness vs delay > in the filter. One can build a filter as sharp as he like and without > any ringing. That can be either FIR or IIR structure, it does not matter. > >> Sharp corners in frequency make for ringing in time. It's harder to >> show the reverse. > > > Imagine a cascade of moving average filters for FIR or a cascade of 1st > order filters for IIR. The cutoff can be as sharp as you like depending > on the number of stages, the phase will be nonlinear for IIR, however > there will be no ringing at all.Interesting. A cascade of moving average filters is a binomial filter, a digital approximation to a Gaussian. Do Gaussians not ring? As 2-D filters, they are separable. What other remarkable properties do they have? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●December 6, 20062006-12-06
jeff227 wrote:> I tried cascading damped 2nd order sections (Bessel, I believe) with the > assumption you stated above (aka, 2nd order Linkwitz-Riley "Transient > perfect" crossover).LR arrangement consists of 4 Butterworth filters of the same order: two cascaded in the lowpass branch, two cascadded in the highpass branch. In this case the frequency response will be perfect. No ringing on the LP/HP individual outputs but the> SUMMED outputs still had very ugly square wave response even though the > summed frequency response was flat. Why now?In the crossover frequency area, the group delay is at maximum, whereas it is zero at high and low frequencies. What you got by combining the HPF and LPF is the allpass filter which rings a lot. So, LR crossover is ringing. Ringing, in this case, is> not the reason.What is your goal? Yes, it is possible to design the crossover without ringing and with near perfect combined response, however it is not going to be LR. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com