# Calculating gain coefficients for comb filters in Moorer's algorithm

Could someone explain how Moorer calculated the gain coefficients for the comb filters in his reverb? In his book, Udo Zölzer's layed out this equation:

$$g = 10 ^ {-3 \left(\mathrm{Reverb \ Time} \cdot \frac{\mathrm{Sampling \ Rate}}{\mathrm{Delay \ length \ in \ samples}}\right)}$$

In his paper for the first comb filter he gives $50 \ \mathrm{ms}$ for the delay and the gain coefficient sampled at $25 \ \mathrm{kHz}$ to be $0.24$ given that reverb time is about $2$ seconds.

So if I plugged in those values I don't get near $0.24$, $10 ^ {-3 \frac{2 \cdot 25000} {50 \cdot 25}}$.

There is a question, however, of how to set this parameter $g_1$ which controls the roll-off of the filter. To this end, a series of optimizations was done using the Marquardt algorithm (Marquardt, 1963) to match the frequency response of this low-pass filter in a least-magnitude-squared manner to the actual data reported in the literature.
The formula in Zölzer's book tries to approximate those values from the given parameters. I'm not sure who came up with that formula, but in any case, it doesn't seem to be accurate. E.g., note that for a fixed delay length (not in samples, but in seconds), the formula becomes independent of the sampling frequency, but in Moorer's article the values for $g_1$ do depend on the sampling frequency. Also note that Zölzer's book is not known for its accurate formulas, as shown in this answer to a question about another formula in the book.