DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
TptSvf.h
1// DSPark - Professional Audio DSP Framework
2// Copyright (c) 2026 Cristian Moresi - MIT License
3
4#pragma once
5
14#include "../DspMath.h"
15
16namespace dspark::detail
17{
19template <FloatType T> struct TptSvfState
20{
21 T ic1eq = T(0);
22 T ic2eq = T(0);
23};
24
26template <FloatType T> struct TptSvfOutput
27{
30};
31
42template <FloatType T>
43[[nodiscard]] inline TptSvfOutput<T> tptSvfStep(T input, TptSvfState<T> &state, T a1, T a2,
44 T a3) noexcept
45{
46 const T v3 = input - state.ic2eq;
47 const T v1 = a1 * state.ic1eq + a2 * v3;
48 const T v2 = state.ic2eq + a2 * state.ic1eq + a3 * v3;
49 state.ic1eq = T(2) * v1 - state.ic1eq;
50 state.ic2eq = T(2) * v2 - state.ic2eq;
51 return {v2, v1};
52}
53} // namespace dspark::detail
TptSvfOutput< T > tptSvfStep(T input, TptSvfState< T > &state, T a1, T a2, T a3) noexcept
Advances the expanded Simper TPT recurrence by one sample.
Definition TptSvf.h:43
Lowpass and constant-skirt-gain bandpass outputs.
Definition TptSvf.h:27
Equivalent-current memories of the two trapezoidal integrators.
Definition TptSvf.h:20