#include <Filters.h>
Inheritance diagram for pp::Filters::IIRComb
Public Methods | |
IIRComb (unsigned delay=10, float c1 = 1.0f, float c2 = 1.0f) | |
virtual const char* | GetName () const |
T | operator() (const T& x) |
double | FrequencyResponse (float f) |
Some poeple use this for reverb when d corresponds to more than a few milliseconds.
The basic equation is: y[n] = x[n] + y[n-d]
y(n) = x(n - D) + g * y(n - D)
D represents the number of samples of the "delay". So, one can see that the current output y(n) is equal to a delayed input x(n-D) plus a previous output y(n-D) multiplied by a gain factor g. If the value for D is high (say a tenth of a second), the comb filter will act as a kind of "echo". The gain g (usually between 0 and 1) determines the "reverberation time" of the filter. Charles Dodge has suggested that the relationship between g and the reverberation time (as composers might prefer to think of it) is:
D = delay in seconds rvt = reverberation time in seconds g = pow(0.001, (D/sr/rvt))