What's wrong with this One Pole HPF?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

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

Post

What do you guys think about this approach?

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;
};
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.

Post Reply

Return to “DSP and Plugin Development”