Jump to content

Fir filter thoughts?


NBPK402

Recommended Posts

14 hours ago, Chris A said:

 

So the question is: how flat does the phase need to be?  For SPL response, audio system standards quote ±2 dB flatness (without "house curves"--which is another can of worms).  My experience is ±90 degrees (per Danley).  How about your experience?


Chris

Yep, that's the question alright!

My experience so far has been the flatter i get phase the better.  By flatter i mean zero degrees flat, or linear phase.

The improvement in sound seems to mainly be built off a clearer bass foundation.

 

But, and a pretty big but, I've come to realize how the higher tap count also increases frequency resolution, which appears to matter down low.

For example, an OpenDRC with 6144 total taps at 48Hz with impulse centering for linear phase, has a resolution of 15.6Hz (48,000 / 3072).

Whereas a Qsys Core with 16384 total taps at 48k has a 5.9Hz frequency resolution. (48k/8192). 

(I'm pretty sure you know all this quite well, but thought i should illustrate for others who might be following along.)

 

So how much of the improvement in the bottom end is due to flatter phase, and how much is due to increased resolution, I can't say.

Since both notes and transients seem improved,  i have to believe both factors matter.

 

Given that FIR filters can have the impulse peak wherever within the tap count, even at the beginning for pure IIR emulation, 

I've been playing with moving the impulse away from linear phase center and peak closer to start, trading off phase flattening capability for increased resolution.

Hopefully this will help determine what matters most, in what situations.

Link to comment
Share on other sites

44 minutes ago, gnarly said:

My experience so far has been the flatter i get phase the better.  By flatter i mean zero degrees flat, or linear phase.

 

Fundamentally, you cannot achieve "zero degrees flat" in a causal system. I'm assuming that you are measuring 0° because you are mathematically removing the delay from the system. That's OK; I just want to emphasize that there is no difference between "linear phase with slope" and "zero phase", once you account for the delay mathematically.

 

Quote

I've come to realize how the higher tap count also increases frequency resolution, which appears to matter down low.

 

It also demonstrates why a low-frequency FIR filter must have a lot of taps.

 

Quote

I've been playing with moving the impulse away from linear phase center and peak closer to start, trading off phase flattening capability for increased resolution.

 

As the peak in the response gets closer to the start, the filter becomes closer to minimum phase. Minimum phase may not put the peak right at the start, but it will put it as close to the start as possible for a given causal magnitude response. The minimum phase system thus also exhibits minimum group delay for that magnitude response. In a minimum phase system, the phase response is related to the amplitude response through through the natural logarithm. https://en.wikipedia.org/wiki/Minimum_phase#Minimum_phase_as_minimum_group_delay

Link to comment
Share on other sites

1 hour ago, gnarly said:

The improvement in sound seems to mainly be built off a clearer bass foundation

I tend to accept this at face value.  My experiences have shown that it's in the most difficult area to correct--the bass (because of the number of taps required)--that the improvement is the most easily heard.

 

27 minutes ago, Edgar said:

As the peak in the response gets closer to the start, the filter becomes closer to minimum phase.

It's interesting that the ear apparently wants to hear minimum phase, but the easy way to correct bass phase growth is through increased FIR filtering time delays (i.e., a design tradeoff).

 

One thing that I haven't talked a lot about is the high-pass behavior of the bass bins...that creates most low bass loudspeaker phase growth.  The lower the f3, the lower the phase growth (all other things being equal--which they're not...).  If you want the sound of really deep bass, then it might be easier to provide a subwoofer with a very low f3 and flat phase response. 

 

Here is a discussion on the very low frequency phase and group delay behavior of some bass bins that may be of some interest.  This is the reason why I gathered the data and plotted it...to discuss the low frequency phase/group delay behavior of bass bins.  I now believe it's pretty important to select something that's got flatter phase response:

https://community.klipsch.com/index.php?/topic/182419-subconscious-auditory-effects-of-quasi-linear-phase-loudspeakers/page/8/&tab=comments#comment-2597971

 

Chris

Link to comment
Share on other sites

13 minutes ago, Chris A said:

It's interesting that the ear apparently wants to hear minimum phase

 

My own observations tend to agree with this. It may be because so many mechanical systems in nature are minimum phase, so it just sounds "right" to us.

 

Quote

but the easy way to correct bass phase growth is through increased FIR filtering time delays (i.e., a design tradeoff).

 

Pure delay (linear phase) is a worthwhile trade -- as I mentioned earlier, as long as you don't have to sync with video, delay is a non-issue. It just means that it takes the signal a few milliseconds longer to get through the electronics.

 

Quote

One thing that I haven't talked a lot about is the high-pass behavior of the bass bins...that creates most low bass loudspeaker phase growth.  The lower the f3, the lower the phase growth (all other things being equal--which they're not...).  If you want the sound of really deep bass, then it might be easier to provide a subwoofer with a very low f3 and flat phase response.

 

I haven't done a lot of experimentation with this, but I have noticed one thing for certain: The closer the woofer highpass response is to a "pure" response, the better it sounds. Now I have to define what "pure" means in this context. By "pure" I mean a response that fits a well-defined, mathematically-derived response like Butterworth or Bessel. Responses like these have very smooth (though nonlinear) phase response curves, and their associated group delay characteristics are similarly smooth, and monotonically decreasing with increasing frequency in the passband.

 

I was led to this conclusion when I changed the EQ in my woofers from simple PEQ that corrected only the magnitude (and had a pretty ragged phase response) to a mathematically-derived 4th-order Butterworth highpass response. The bass sounded deeper, even though it wasn't, and (for lack of better terms) more natural and effortless.

 

That said, I suspect that a 2nd-order Butterworth highpass response will sound even more natural than a 4th-order Butterworth highpass response. I think that most mechanical systems in our world are 2nd-order, so it might just be what our brains equate with reality.

Link to comment
Share on other sites

1 hour ago, Edgar said:

 

Fundamentally, you cannot achieve "zero degrees flat" in a causal system. I'm assuming that you are measuring 0° because you are mathematically removing the delay from the system. That's OK; I just want to emphasize that there is no difference between "linear phase with slope" and "zero phase", once you account for the delay mathematically.

 

 

It also demonstrates why a low-frequency FIR filter must have a lot of taps.

 

 

As the peak in the response gets closer to the start, the filter becomes closer to minimum phase. Minimum phase may not put the peak right at the start, but it will put it as close to the start as possible for a given causal magnitude response. The minimum phase system thus also exhibits minimum group delay for that magnitude response. In a minimum phase system, the phase response is related to the amplitude response through through the natural logarithm. https://en.wikipedia.org/wiki/Minimum_phase#Minimum_phase_as_minimum_group_delay

 

 

Yes, that's what I meant.  And I believe out brain removes delay the same way out measurement programs do mathematically.

And more yes, that 'linear phase with slope' (on a linear frequency scale) is the same as 'zero phase'.

 

And another yes, regarding lots of taps needed for low freq.....my motto has become 'it takes time to fix time' ! 😄

 

I've been able to put impulse peaks right at the start of FIR filters for no delay.  But it seems IIR is the better way to go, because it doesn't have the frequency resolution per number of taps  issue mentioned earlier.

 

 

Going further back in our conversation, in response to your question what do I mean by 'phase wrapped signal'....

i meant wraps such as provided by IIR xovers, at 90 degrees per order. 

I think they do concern the linearity of phase, because once beyond first order they guarantee that phase cannot be linear, and that the higher the order the greater the non-linearity.

 

When i measure IIR group delay as a function of frequency, holding order constant, i see that group delay approximately doubles for each octave decrease.

When i measure group delay as a function of order, holding frequency constant, I see it increases approx 2.5X for each order doubling.

So to me, since group delay is both frequency and order dependent, it simply reflects the degree of phase wrap, and where in frequency the wrap(s) occurred.

 

Edited by gnarly
grammar
Link to comment
Share on other sites

8 minutes ago, gnarly said:

I've been able to put impulse peaks right at the start of FIR filters for no delay.

 

Be careful with this. If you arbitrarily place the response peak at the beginning, on some filters you will find that the resulting magnitude response is not what you expected.

 

Quote

i meant wraps such as provided by IIR xovers, at 90 degrees per order. 

I think they do concern the linearity of phase, because once beyond first order they guarantee that phase cannot be linear, and that the higher the order the greater the non-linearity.

 

Not necessarily. For example, the phase response of a Bessel lowpass filter is nearly linear within the passband, and the linearity improves with higher orders. (The same is not true, unfortunately, for Bessel highpass filters.)

 

Quote

When i measure IIR group delay as a function of frequency, holding order constant, i see that group delay approximately doubles for each octave decreases.

When i measure group delay as a function of order, holding frequency constant, I see it increases approx 2.5X for each order doubling.

 

It's strongly dependent upon the Q of the filters. Ultimately the phase change is, as you said, 90° per order. The slope at the critical frequency changes with Q.

Link to comment
Share on other sites

2 hours ago, Edgar said:

 

Be careful with this. If you arbitrarily place the response peak at the beginning, on some filters you will find that the resulting magnitude response is not what you expected.

 

Is this perhaps when using wav as the FIR file?   I have seen some strange results then.

So far, with csv files I've been able to put impulse peak anywhere without issue.

But that said, I haven't played with mixed-phase FIR all that much.  I've been more interested in just achieving a higher tap count.

Quote

 

Not necessarily. For example, the phase response of a Bessel lowpass filter is nearly linear within the passband, and the linearity improves with higher orders. (The same is not true, unfortunately, for Bessel highpass filters.)

Bessels are certainly not my forte.  Bewildering number of highpass options. And the term "order" doesn't seems to apply to them like BW or LRs.

I've seen on lowpass, that what my processor calls 'natural cutoff', group delay is indeed flat, but doubles for each order doubling.

Whereas for lowpass called  '-3dB cutoff', group delay is flat but doesn't vary too much as "order" is increased.

And then Bessel highpass has 4 different types of settings....Yikes!  beyond me.... I'll bet you have forgotten more about Bessel than I've learned 😅

 

But i really only look at Bessel, or any other non-complementary IIR out of curiosity.

As again, so far i've found  complementary  steep linear phase xovers to be a simple path with excellent results. (whenever latency can be tolerated)

 

Quote

 

It's strongly dependent upon the Q of the filters. Ultimately the phase change is, as you said, 90° per order. The slope at the critical frequency changes with Q.

Yep. 

I guess i  see Q,  order,  group delay,  phase wrap,  etc..... as all just different ways of talking about the underlying issue.... non linear relative phase.

Edited by gnarly
clarity
Link to comment
Share on other sites

21 minutes ago, Edgar said:

@gnarly I sent you a PM.

3 hours ago, Edgar said:

 

Be careful with this. If you arbitrarily place the response peak at the beginning, on some filters you will find that the resulting magnitude response is not what you expected.

 

 

Not necessarily. For example, the phase response of a Bessel lowpass filter is nearly linear within the passband, and the linearity improves with higher orders. (The same is not true, unfortunately, for Bessel highpass filters.)

 

 

It's strongly dependent upon the Q of the filters. Ultimately the phase change is, as you said, 90° per order. The slope at the critical frequency changes with Q.

 Thank you for that !

I knew you had forgotten more about Bessel than I've ever seen 😁

  • Like 1
Link to comment
Share on other sites

On 10/22/2020 at 10:32 AM, NBPK402 said:

This is a video from Audioholics...

So what do you think?  The language of the domain is digital signal processing (DSP) and like anything else, it's a different language from what most here are used to seeing.

 

The more serious audiophiles might talk about amplifier specifications/capabilities, classes of amplification and their specific types and levels of distortion as they pertain to the exact (and perceived) types of sound quality produced by the loudspeakers.  So deep topics in applicable technologies are not alien to our vocabulary.  Deep dives into these subjects on forums such as this one aren't really a rare occurrence. 

 

Fast forward to today.  The technologies now employed (as described above) are something that 40 years ago only signal processing engineers/geophysicists would talk about.  My first direct exposure to digital filtering was in the early 1980s. 

Now your home hi-fi can easily employ IIR and FIR filtering to correct loudspeaker and upstream electronics nonlinearities, issues that couldn't be corrected in the past, and certainly not to the level possible today, and at a price point that's easily accessible to most all serious "audiophiles".  The software tools employed are largely free/shareware, and all the documentation is available online.  All it takes is additional learning.

  • Should audiophiles shy away from all of this?  Not if better sound quality is desired. 
     
  • Are these type of DSP filters going to become ubiquitous in audiophile circles?  Yes, especially once you hear a good implementation of the technologies talked about here.  You'll probably never go back after hearing what can occur in your own listening room. 
     
  • Does it take some knowledge of "how to do it".  Yes.
     
  • Can this be done "automatically" by using bought room correction software.  In my experience, not so much--at least not presently.  Someone with knowledge of how to do it needs to set it up in-room.

Some beginning tutorials on what FIR filters actually are (a concept that isn't really that complicated...in my opinion):  https://barrgroup.com/embedded-systems/how-to/digital-filters-fir-iir

 

More here for those that have heard of digital signal processing (mathematical) transforms, such as Fast Fourier transform (FFT) and the Hilbert transform:  http://www.minidsp.com/images/documents/fir_filter_for_audio_practitioners.pdf

 

Chris

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...