First-order TPT (trapezoidal integration) filter.
More...
#include <tpt_filter.hpp>
|
| | TptFilterT ()=default |
| void | prepare (SampleType sample_rate) |
| void | set_cutoff (SampleType hz) |
| | Set cutoff frequency in Hz. Safe to modulate per-sample.
|
| SampleType | cutoff () const |
| SampleType | sample_rate () const |
| SampleType | process_lowpass (SampleType input) |
| | Process and return the lowpass output.
|
| SampleType | process_highpass (SampleType input) |
| | Process and return the highpass output.
|
| SampleType | process_allpass (SampleType input) |
| | Process and return the allpass output.
|
| void | process_lowpass (SampleType *buffer, std::size_t num_samples) |
| | Process a buffer in place, replacing it with the lowpass output.
|
| void | process_highpass (SampleType *buffer, std::size_t num_samples) |
| | Process a buffer in place, replacing it with the highpass output.
|
| void | process_allpass (SampleType *buffer, std::size_t num_samples) |
| | Process a buffer in place, replacing it with the allpass output.
|
| Outputs | process (SampleType input) |
| void | reset () |
|
| static constexpr SampleType | kMinCutoffHz = SampleType{1} |
| static constexpr SampleType | kMaxCutoffFraction = SampleType{0.49} |
| static constexpr SampleType | kMinSampleRate = SampleType{4} |
| | Conservative defensive floor that leaves a non-empty valid cutoff interval above the 1 Hz lower bound.
|
template<typename SampleType = float>
class pulp::signal::TptFilterT< SampleType >
First-order TPT (trapezoidal integration) filter.
Provides lowpass, highpass, and allpass outputs simultaneously. The TPT structure is unconditionally stable under modulation, making it ideal for filter FM and fast cutoff sweeps.
RT contract: prepare(), cutoff modulation, process paths, queries, and reset are fixed-state only and allocate no memory.
SampleType process_lowpass(SampleType input)
Process and return the lowpass output.
Definition tpt_filter.hpp:68
void prepare(SampleType sample_rate)
Definition tpt_filter.hpp:41
void set_cutoff(SampleType hz)
Set cutoff frequency in Hz. Safe to modulate per-sample.
Definition tpt_filter.hpp:49
TptFilterT< float > TptFilter
Definition tpt_filter.hpp:172
◆ TptFilterT()
template<typename SampleType = float>
◆ cutoff()
template<typename SampleType = float>
◆ prepare()
template<typename SampleType = float>
◆ process()
template<typename SampleType = float>
◆ process_allpass() [1/2]
template<typename SampleType = float>
Process a buffer in place, replacing it with the allpass output.
◆ process_allpass() [2/2]
template<typename SampleType = float>
Process and return the allpass output.
◆ process_highpass() [1/2]
template<typename SampleType = float>
Process a buffer in place, replacing it with the highpass output.
◆ process_highpass() [2/2]
template<typename SampleType = float>
Process and return the highpass output.
◆ process_lowpass() [1/2]
template<typename SampleType = float>
Process a buffer in place, replacing it with the lowpass output.
Same arithmetic as the per-sample path on a register-resident state. The denormal snap runs once per kSnapChunkSamples chunk (snap_chunks()). The integrator's pole is 1 - 2g; unless |1 - 2g| < 0.44 (cutoffs near a quarter of the sample rate) a state at or above 1e-15 at the start of a chunk cannot decay into the float subnormal range before the next snap, and inside that band the tail falls through the subnormal range; there, and with subnormal input, the state can stay subnormal until the next snap, so residency is bounded by one chunk.
◆ process_lowpass() [2/2]
template<typename SampleType = float>
Process and return the lowpass output.
The state update is written as s + 2g * (input - s) (algebraically lp + v) so the recursion is one subtract and one multiply-add; the lowpass output is formed off that path.
◆ reset()
template<typename SampleType = float>
◆ sample_rate()
template<typename SampleType = float>
◆ set_cutoff()
template<typename SampleType = float>
Set cutoff frequency in Hz. Safe to modulate per-sample.
◆ kMaxCutoffFraction
template<typename SampleType = float>
◆ kMinCutoffHz
template<typename SampleType = float>
◆ kMinSampleRate
template<typename SampleType = float>
Conservative defensive floor that leaves a non-empty valid cutoff interval above the 1 Hz lower bound.
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/tpt_filter.hpp