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
16
namespace
dspark::detail
17
{
19
template
<FloatType T>
struct
TptSvfState
20
{
21
T
ic1eq
= T(0);
22
T
ic2eq
= T(0);
23
};
24
26
template
<FloatType T>
struct
TptSvfOutput
27
{
28
T
lowpass
;
29
T
bandpass
;
30
};
31
42
template
<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
dspark::detail
Definition
AccountedAllocator.h:17
dspark::detail::tptSvfStep
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
dspark::detail::TptSvfOutput
Lowpass and constant-skirt-gain bandpass outputs.
Definition
TptSvf.h:27
dspark::detail::TptSvfOutput::bandpass
T bandpass
Definition
TptSvf.h:29
dspark::detail::TptSvfOutput::lowpass
T lowpass
Definition
TptSvf.h:28
dspark::detail::TptSvfState
Equivalent-current memories of the two trapezoidal integrators.
Definition
TptSvf.h:20
dspark::detail::TptSvfState::ic2eq
T ic2eq
Definition
TptSvf.h:22
dspark::detail::TptSvfState::ic1eq
T ic1eq
Definition
TptSvf.h:21
Core
detail
TptSvf.h
Generated by
1.9.8