DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
DcBlock.h
1// DSPark - Professional Audio DSP Framework
2// Copyright (c) 2026 Cristian Moresi - MIT License
3
4#pragma once
5
14namespace dspark::detail
15{
18{
19 double x1 = 0.0;
20 double y1 = 0.0;
21};
22
24[[nodiscard]] inline double dcBlockStep(double pole, DcBlockState &state, double input) noexcept
25{
26 const double output = (input - state.x1) + pole * state.y1;
27 state.x1 = input;
28 state.y1 = output;
29 return output;
30}
31} // namespace dspark::detail
double dcBlockStep(double pole, DcBlockState &state, double input) noexcept
Applies (1 - z^-1) / (1 - pole * z^-1), with a pole in [0, 1).
Definition DcBlock.h:24
Previous input and output of the one-pole DC blocker.
Definition DcBlock.h:18