audio

@audio/filter-dcblocker1.2.0

DC blocking filter

Status
calibrated
Updated
Family
filter, 16 packages under it
Plugin
dcblocker, effect, streaming, 1 parameter
Category
effects
Licence
MIT
Dependencies
none
Downloads
2,306 last month
Tests
at least 129 in audiojs/filter's CI, passed at 878f618,

Listen

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html
audio('/samples/music/modern/local-forecast.mp3').dcblocker()

// "Local Forecast" by Kevin MacLeod (incompetech.com), CC BY 4.0, incompetech.com/music/royalty-free/faq.html

Parameters

  • effect
  • streaming
  • tail
R
0.995
0.9 to 0.9999
import dcBlocker from '@audio/filter-dcblocker'

Removes DC offset — the simplest useful filter.

H(z)=1−z−11−Rz−1H(z) = \dfrac{1 - z^{-1}}{1 - Rz^{-1}}

Topology: zero at z=1z = 1 (DC), pole at z=Rz = R
Cutoff: fc≈(1−R)fs2πf_c \approx \frac{(1-R) f_s}{2\pi} — R=0.995R = 0.995 gives ~35 Hz at 44.1 kHz

let params = { R: 0.995 }
dcBlocker(buffer, params)
Param Default
R 0.995 pole radius — closer to 1 pushes the cutoff lower

Pass the same params object on every call to persist the one-pole state across blocks.

Use when: removing DC bias before processing, preventing lowpass filter saturation.


Part of @audio/filter — the filter family umbrella. This README is generated from the umbrella docs.

MIT © audiojs