Author Topic: Aggregating digital filters.  (Read 916 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 6515
  • Country: gb
Aggregating digital filters.
« on: December 05, 2025, 06:01:03 pm »
If you had an EQ stage with 2 shelfs, H+L and 5 fully parametric bands in addition....

Could you, on each change to any filter, calculate a set of parameters for a single complex filter.

ie.  This set of coefficients is calculated only when the EQ parameters change, but instead of 7 filters in series, you apply a single "composite filter"?

It's just a random idea.  Do we have the compute power in digital MCU space to carry out those kind of filter aggregations on the fly.  There is also the question of, "Can multiple filters be simplified into one"

Would it ultimately lead to the ability to run more complex EQ on lesser hardware?
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: Aggregating digital filters.
« Reply #1 on: December 05, 2025, 09:09:04 pm »
Theoretically you can combine low order filters to a single high order filter. In practice, however, you would rather do the opposite in order to avoid numerical precision issues: Decompose a high-order IIR filter into cascaded biquad stages.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2410
  • Country: ca
Re: Aggregating digital filters.
« Reply #2 on: December 05, 2025, 09:34:33 pm »
If you are referring to FIR filters, then yes, you can quite trivially combine any number of such filters into a single set of coefficients.
For IIR filters, you need to cascade them. This shouldn't be too much of a problem since they boil down to little more than a couple of MACs per sample each, much less work than any single FIR.
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: Aggregating digital filters.
« Reply #3 on: December 05, 2025, 11:27:46 pm »
FIR is, of course, only an option if the delay can be tolerated. If it can be tolerated, yet another alternative is a STFT/iSTFT-based filter bank where you can manipulate the signal directly in the frequency domain. This approach directly provides an EQ with a large number of bands. However, if low latency is important, e.g. for real-time applications, stay with IIR filters.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 4849
  • Country: us
Re: Aggregating digital filters.
« Reply #4 on: December 06, 2025, 01:53:42 am »
To the original question: yes recomputing cascaded filters on the fly is quite practical.  One thing that can be tricky especially if you are changing the filter structure is to calculate the initial conditions of the filter state variables to minimize glitches.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5745
  • Country: Earth
Re: Aggregating digital filters.
« Reply #5 on: December 06, 2025, 05:26:17 am »
I’m not very familiar with IIR filters, but from what I’ve read, anything beyond a single biquad (order = 2) tends to behave poorly. Higher-order direct-form IIR structures become very sensitive to coefficient quantization, and even small rounding errors can shift poles enough to cause numerical instability. I’ve also seen mentions that such higher-order (order > 2) sections often produce unwanted artifacts because numerical errors accumulate in the feedback paths and the structure becomes overly sensitive.

With FIR filters I’ve tried combining multiple stages by convolving their impulse responses, and while it works mathematically, the merged filter often behaved noticeably worse than applying the individual FIR stages in sequence.
 

Offline Tation

  • Frequent Contributor
  • **
  • Posts: 311
  • Country: pt
Re: Aggregating digital filters.
« Reply #6 on: December 06, 2025, 11:35:41 am »
I’m not very familiar with IIR filters, but from what I’ve read, anything beyond a single biquad (order = 2) tends to behave poorly. Higher-order direct-form IIR structures become very sensitive to coefficient quantization, and even small rounding errors can shift poles enough to cause numerical instability. I’ve also seen mentions that such higher-order (order > 2) sections often produce unwanted artifacts because numerical errors accumulate in the feedback paths and the structure becomes overly sensitive.

More or less the same situation as with active analogue filters. The same solution here works there: use a cascade of biquads. Provided the Q of each biquad is not too high, it does work.
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: Aggregating digital filters.
« Reply #7 on: December 06, 2025, 04:59:42 pm »
Higher-order direct-form IIR structures become very sensitive to coefficient quantization, and even small rounding errors can shift poles enough to cause numerical instability.

From my experience, Octave's filter() function, which uses direct form, often produces incorrect results for orders >= 9, using double precision floating point. I remember one case where even a 6th-order filter failed. Of course, it depends on the particular filter. So even double precision FP does not always have sufficient resolution for high orders.
 
The following users thanked this post: 2N3055, radiolistener


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->