levelfilter(L,freq,x) = (L * L0 * x) + ((1.0-L) * lp2out(x)) with { L0 = pow(L,1/3); Lw = PI*freq/SR; // = w1 T / 2 Lgain = Lw / (1.0 + Lw); Lpole2 = (1.0 - Lw) / (1.0 + Lw); lp2out = *(Lgain) : + ~ *(Lpole2); };
To intensify the effect, units can be used in series, with the desired Nyquist-limit level divided by for each section:
levelfilterN(Nd,freq,L) = seq(i,Nd,levelfilter((L/Nd),freq));