dc blocker filter calculator
DC Blocker Filter Calculator guide
A DC blocker attenuates a constant offset while passing changes in a waveform. Enter a short record as it arrives at the filter, select the feedback coefficient and specify the sample rate. The table begins from zero previous input and zero previous output so a sudden initial step is visible in the result.
Play the instrument ↑- Default result
- 0.729 final output sample
Calculation and units
For each sample subtract the previous input and add R times the previous output. Save the current input and output for the next row. For a positive pole below one the exponential decay time in seconds is negative one divided by the sample rate times the natural logarithm of R. At R equal to zero the response is a first difference with no feedback tail.
Worked examples
Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.
Step at startup
Input samples = 1 1 1 1 · Feedback pole R = 0.9 · Sample rate (Hz) = 48000.
0.729 final output sample. Zero initial state. Pole decay time 0.197734 ms. Gain at Nyquist 1.052632 relative to unity. Table readings (Index, Input, Filtered output): 0, 1, 1; 1, 1, 0.9; 2, 1, 0.81; 3, 1, 0.729.
A sudden constant input initially passes through and then decays. A short block can finish before the strong startup transient has disappeared.
Pure first difference
Input samples = 1 1 1 1 · Feedback pole R = 0 · Sample rate (Hz) = 48000.
0 final output sample. Zero initial state. Pole decay time 0 ms. Gain at Nyquist 2 relative to unity. Table readings (Index, Input, Filtered output): 0, 1, 1; 1, 1, 0; 2, 1, 0; 3, 1, 0.
With zero feedback the recurrence reduces to an adjacent difference. A constant input produces zero from the second sample onward.
Impulse tail
Input samples = 1 0 0 0 · Feedback pole R = 0.5 · Sample rate (Hz) = 1000.
-0.125 final output sample. Zero initial state. Pole decay time 1.442695 ms. Gain at Nyquist 1.333333 relative to unity. Table readings (Index, Input, Filtered output): 0, 1, 1; 1, 0, -0.5; 2, 0, -0.25; 3, 0, -0.125.
The initial positive value is followed by a negative decaying tail. A filter passing a brief transient can produce output after the input returns to zero.
Longer time constant
Input samples = 1 1 1 1 · Feedback pole R = 0.99 · Sample rate (Hz) = 48000.
0.970299 final output sample. Zero initial state. Pole decay time 2.072899 ms. Gain at Nyquist 1.005025 relative to unity. Table readings (Index, Input, Filtered output): 0, 1, 1; 1, 1, 0.99; 2, 1, 0.9801; 3, 1, 0.970299.
Moving the pole closer to one slows the return toward zero. Check the decay in time as well as in samples.
Negative step
Input samples = -1 -1 -1 -1 · Feedback pole R = 0.5 · Sample rate (Hz) = 8000.
-0.125 final output sample. Zero initial state. Pole decay time 0.180337 ms. Gain at Nyquist 1.333333 relative to unity. Table readings (Index, Input, Filtered output): 0, -1, -1; 1, -1, -0.5; 2, -1, -0.25; 3, -1, -0.125.
A negative step produces the sign reversed version of the positive step response for this linear filter. The decay factor remains unchanged.
Alternating sequence
Input samples = 1 -1 1 -1 · Feedback pole R = 0.8 · Sample rate (Hz) = 44100.
-1.168 final output sample. Zero initial state. Pole decay time 0.10162 ms. Gain at Nyquist 1.111111 relative to unity. Table readings (Index, Input, Filtered output): 0, 1, 1; 1, -1, -1.2; 2, 1, 1.04; 3, -1, -1.168.
An alternating sequence probes the high frequency end. The short record includes startup effects before the output settles into its steady alternating pattern.
Interpreting the result
Follow the constant-step example one sample at a time. The first output reflects a change from the assumed initial zero. At later positions the input difference vanishes, leaving a geometric tail. Moving the pole closer to one extends the transient duration. When processing consecutive blocks in a real application, carry both prior states through each block boundary.
Measurement and model limits
These coefficients implement the unscaled form of the filter. The gain at the Nyquist frequency is two divided by one plus R, so it can be greater than unity. The decay time describes the pole; it is not an exact three-decibel cutoff frequency. This short simulation preserves floating-point sample values and does not apply clipping or quantization.
Music theory tools → · One-Pole Filter Coefficient Calculator →
Answers before you play
Common questions
Why does the constant signal initially pass?
The filter sees a transition from initial zero. The feedback state then decays while successive inputs remain equal.
Does changing the sample rate change the rows?
For the same R and identical sample sequence, the discrete output stays unchanged. The physical time corresponding to each step changes.
How can I test a polarity reversal?
Negate every input sample and keep the coefficient fixed. From zero state the resulting output samples should all reverse sign.
Should I restart state at every audio block?
A continuous stream normally carries state across blocks. Starting from zero here deliberately shows the response of a freshly initialized filter.