Multiband Compressor?

I was messing around with my approach of bandsplitting the input (borrowed from Nathan, who also said this method is not 100% accurate). Here is how I tested, the difference is small, maybe be even negligible.

(
f = {
	var sigIn = WhiteNoise.ar(); // full scale signal
	var freqs = [5000, 2000, 500, 150];
	var sigs = [sigIn] ++ freqs.collect{|n, i| LPF.ar(LPF.ar(sigIn, n), n) };
	// sigs contain sigIn plus sigIn lowpassed at 5000, 2000, 500, 150 Hz;
	var bands = (freqs.size.collect{|i| sigs[i] - sigs[i + 1] } ++ [sigs.last]);
	// subtracting bands to get [5000-upperHzLim of SR, 2000-5000 hz, 500-2000 hz, 150-500 hz, plus the lowpassed at 150 Hz sig] 
	bands.sum - sigIn; // difference of the original signal and the sum the bands
};
f.plot(0.1)
)

c = f.asBuffer(0.1, action: {|buf| buf.loadToFloatArray(action: {|fa| fa.maxItem.debug(\maxDifference)  })}); 
// Max Difference approx 1.19e-07
1 Like

@Thor_Madsen

It’s not Rocket Science. Just follow the steps:

Calculating the center frequencies and bandwidths for each band-pass filter is necessary to create a precise filter bank with minimal gaps and overlaps. That’s how I do:

  1. For each pair of adjacent frequencies f_i and f_i+1, the center frequency f_c is the geometric mean.

Given Frequencies: Frequencies=[5000,2000,500,150,50], the geometric mean is:

  1. Bandwidths are:
BW_1 = 5000 - 2000 = 3000 
BW_2 = 2000 - 500 = 1500 
BW_3 = 500 - 150 = 350 
BW_4 = 150 - 50 = 100
  1. Q factors can also be calculated: [1.05, 0.67, 0.78, 0.87]

In this case, something like this would give such a filter bank:

freqs = [5000, 2000, 500, 150, 50];
centers = [3162.28, 1000, 273.86, 86.60];
bws = [3000, 1500, 350, 100];
qs = [1.05, 0.67, 0.78, 0.87];

But remember, DSP is sometimes very tricky. To get real about it, it would be necessary to do some study.

Also, it’s subjective. That’s why I am collecting the specs for the one I like.

This is the hardcore version: Simple Examples of Perfect Reconstruction

Also, I think most of those calculations are based on IIR filters (more complex behavior, analogs, and some digital – less common, but possible)

Commercial plugins mostly use FIR filters( non-recursive and without memory), but they may also use biquad IIR filters for high-quality EQs (may be the case with harrison mixbus, I would guess).

1 Like

If you’re up for using FIR filters, SignalBox offers a method for generating prefect reconstruction: Signal: *gaussianBank

3 Likes

28 posts were split to a new topic: Arbitrarily high-order IIR filters