Understanding a lowpass - comb filter implementation

64 Views Asked by At

I try to understand the implementation of the low-pass comb filter of the Freeverb reverberation algorithm:

https://ccrma.stanford.edu/~jos/pasp/Lowpass_Feedback_Comb_Filter.html

The original implementation is as follows:

inline float comb::process(float input)
{
    float output;
    output = buffer[bufidx];
    filterstore = (output*damp2) + (filterstore*damp1);
    buffer[bufidx] = input + (filterstore*feedback);
    if(++bufidx>=bufsize) bufidx = 0;
    return output;
}

I drew the closed loop of this algorithm:

enter image description here

In the link, it says:

Inspection of comb.h in the Freeverb source shows that Freeverb's ``comb'' filter is more specifically a lowpass-feedback-comb filter (LBCF4.11--§2.6.5). It is constructed using a delay line whose output is lowpass-filtered and summed with the delay-line's input. The particular lowpass used in Freeverb is a unity-gain one-pole lowpass having the transfer function

$\displaystyle H(z) = \frac{1-d}{1-d\,z^{-1}}. $

When $ d=0$ , the LBCF reduces to the feedback comb filter (FBCF) of §2.6.2 in which the feedback was not filtered. The overall LBCF transfer function is then

$ \displaystyle \hbox{LBCF}_{N}^{\,f,\,d} \;= \; \frac{z^{-N}}{1 -f\frac{1-d}{1-d\,z^{-1}}\,z^{-N}}. $

Apparently, this transfer function is implemented here. But can someone tell me, how to derive this implementation out of this transfer function?

1

There are 1 best solutions below

0
On

From the block diagram. Solving the equations

$$ \cases{ (x_n+x_f)z^{-N} = y_n\\ x_l = y_n d_2+x_l z^{-1}d_1\\ x_f = (\text{gfb})x_l } $$

we obtain

$$ \frac{y_n}{x_n} = \frac{z^{-N}}{1-\frac{\text{(gfb)}d_2}{1-d_1z^{-1}}z^{-N}} $$