I like to suppress aliasing within a zfd filter in the feedback loop. I have found following interesting paper about the topic:
https://www.researchgate.net/publicatio ... onvolution
The solution looks promising and easy to implement. The only problem is the delay the filter kernel of this method introduces. I see fig. 9 in the paper, but i'm not sure how to implement that and had no success so far. I also want the tanh only for the feedback signal and not for the whole filter pole when possible.
Here is the filter code:
Code: Select all
m_wcD = 2.0f * fasttan(m_T * Pi * freq) * sampleRate;
float TwcD = m_T * m_wcD;
m_b0 = (TwcD / (TwcD + 2.0f));
m_a1 = ((TwcD - 2.0f) / (TwcD + 2.0f));
k = resonance * 4.0f;
oL = m_s4L + m_b0 * (m_s3L + m_b0 * (m_s2L + m_b0 * m_s1L));
const float b4 = m_b0 * m_b0 * m_b0 * m_b0;
const float divisor = 1.0f / (1.0f + b4 * k);
outputL = (b4 * inputWithoutRefL + oL) * divisor;
float clippedL = k * outputL;
antialiasedClipper.processTanh(&clippedL); // introduces delay (rect filter kernel, maybe 0.5 sample delay)
uL = inputWithoutRefL - clippedL;
float future1L = (m_b0 * uL + m_s1L);
m_s1L = (m_b0 * uL) - (m_a1 * future1L);
float future2L = (m_b0 * future1L + m_s2L);
m_s2L = (m_b0 * future1L) - (m_a1 * future2L);
float future3L = (m_b0 * future2L + m_s3L);
m_s3L = (m_b0 * future2L) - (m_a1 * future3L);
m_s4L = (m_b0 * future3L) - (m_a1 * outputL);
