What's wrong with this One Pole HPF?
-
- KVRian
- 653 posts since 4 Apr, 2010
True enough, precise DC blockers can be tricky. The most simply and obvious solutions ("hey, I've already got a direct form biquad, I'll just use that, it'll be great...") can have disasterous numerical properties when they try to place a pole real close to a zero on the unit circle.
My audio DSP blog: earlevel.com
-
- KVRist
- Topic Starter
- 119 posts since 5 Apr, 2017
What do you guys think about this approach?
https://www.dsprelated.com/freebooks/fi ... ocker.html
Example code:
I'm playing with waveguide synthesis right now and as mystran suggests - feedback loops are very sensitive to DC.
How would you adjust the coefficient 0.995 for sample rate if you wanted the same performance at all sample rates?
Still also open to any better DC blocking scripts if anyone wants to share.
https://www.dsprelated.com/freebooks/fi ... ocker.html
Example code:
Code: Select all
class DCBlocker {
public:
double processSample(double input) {
output = input - input_1 + 0.995 * output_1;
input_1 = input;
output_1 = output;
return output;
}
private:
double input = 0.0;
double output = 0.0;
double input_1 = 0.0;
double output_1 = 0.0;
};
How would you adjust the coefficient 0.995 for sample rate if you wanted the same performance at all sample rates?
Still also open to any better DC blocking scripts if anyone wants to share.