Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::FeedbackClipperT< SampleType > Class Template Reference

The op-amp gain stage with the diode network either at its output or across its feedback resistor. More...

#include <distortion.hpp>

Public Types

using Model = DiodeModel
using Topology = ClipperTopology

Public Member Functions

 FeedbackClipperT ()
void prepare (double sample_rate)
void set_topology (Topology topology)
Topology topology () const
void set_diode_model (Model model)
void set_symmetry (double symmetry)
void set_feedback_resistance (double ohms)
void set_input_resistance (double ohms)
void set_knee_corner_hz (double hz)
double linear_gain () const
 The stage's linear (small-signal) gain, Rf/Rin — the bound the loop can never exceed at frequencies below the feedback capacitor's corner.
void reset ()
int last_iteration_count () const
SampleType process (SampleType input)

Static Public Attributes

static constexpr double kFeedbackResistanceDefault = 51000.0
 Feedback resistor: sets the linear gain Rf/Rin and, with Cf, the in-loop knee corner.
static constexpr double kInputResistanceDefault = 4700.0
 Input resistor.
static constexpr double kKneeCornerHzDefault = 720.0
 In-loop knee corner, fc = 1/(2π·Rf·Cf).

Detailed Description

template<typename SampleType = float>
class pulp::signal::FeedbackClipperT< SampleType >

The op-amp gain stage with the diode network either at its output or across its feedback resistor.

The in-loop KCL at the virtual ground reduces to the SAME functional form as the to-ground ODE with v ≡ −vout, R ≡ Rf, C ≡ Cf, plus a vin/Rin forcing term. So this reuses the identical TR-BDF2 + Newton solver rather than introducing a second numerical method.

Small-signal gain and its bound (series law 1). At v → 0 the diodes' incremental conductance is Is/(n·Vt) — for silicon about 3.9e-13 S, utterly negligible against 1/Rf — so at zero signal the diodes are effectively an open circuit and the small-signal gain is exactly the linear Rf/Rin. As |v| grows the diodes' conductance grows exponentially, shunting more feedback current and REDUCING loop gain monotonically. The loop is therefore self-limiting, never self-amplifying, and Rf/Rin bounds it above at every amplitude. That is the tested invariant the Forge registry cites.

Member Typedef Documentation

◆ Model

template<typename SampleType = float>
using pulp::signal::FeedbackClipperT< SampleType >::Model = DiodeModel

◆ Topology

template<typename SampleType = float>
using pulp::signal::FeedbackClipperT< SampleType >::Topology = ClipperTopology

Constructor & Destructor Documentation

◆ FeedbackClipperT()

template<typename SampleType = float>
pulp::signal::FeedbackClipperT< SampleType >::FeedbackClipperT ( )
inline

Member Function Documentation

◆ last_iteration_count()

template<typename SampleType = float>
int pulp::signal::FeedbackClipperT< SampleType >::last_iteration_count ( ) const
inline

◆ linear_gain()

template<typename SampleType = float>
double pulp::signal::FeedbackClipperT< SampleType >::linear_gain ( ) const
inline

The stage's linear (small-signal) gain, Rf/Rin — the bound the loop can never exceed at frequencies below the feedback capacitor's corner.

Above that corner the capacitor shunts feedback current and the gain is lower, which is the topology's defining behaviour rather than a caveat.

◆ prepare()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::prepare ( double sample_rate)
inline

◆ process()

template<typename SampleType = float>
SampleType pulp::signal::FeedbackClipperT< SampleType >::process ( SampleType input)
inline

◆ reset()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::reset ( )
inline

◆ set_diode_model()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_diode_model ( Model model)
inline

◆ set_feedback_resistance()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_feedback_resistance ( double ohms)
inline

◆ set_input_resistance()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_input_resistance ( double ohms)
inline

◆ set_knee_corner_hz()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_knee_corner_hz ( double hz)
inline

◆ set_symmetry()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_symmetry ( double symmetry)
inline

◆ set_topology()

template<typename SampleType = float>
void pulp::signal::FeedbackClipperT< SampleType >::set_topology ( Topology topology)
inline

◆ topology()

template<typename SampleType = float>
Topology pulp::signal::FeedbackClipperT< SampleType >::topology ( ) const
inline

Member Data Documentation

◆ kFeedbackResistanceDefault

template<typename SampleType = float>
double pulp::signal::FeedbackClipperT< SampleType >::kFeedbackResistanceDefault = 51000.0
staticconstexpr

Feedback resistor: sets the linear gain Rf/Rin and, with Cf, the in-loop knee corner.

[design parameter] default 51 kΩ, range 10 kΩ .. 200 kΩ.

◆ kInputResistanceDefault

template<typename SampleType = float>
double pulp::signal::FeedbackClipperT< SampleType >::kInputResistanceDefault = 4700.0
staticconstexpr

Input resistor.

Rf/Rin is the stage's linear gain. [design parameter] default 4.7 kΩ, range 1 kΩ .. 100 kΩ.

◆ kKneeCornerHzDefault

template<typename SampleType = float>
double pulp::signal::FeedbackClipperT< SampleType >::kKneeCornerHzDefault = 720.0
staticconstexpr

In-loop knee corner, fc = 1/(2π·Rf·Cf).

Above it the capacitor shunts feedback current around the diodes, so high harmonics see less clipping-loop gain — the mechanism behind the smoother, brighter-forgiving character of this topology. The default sits in the documented behavioural neighbourhood, not on any schematic. [design parameter] default 720 Hz, range 100 Hz .. 5000 Hz.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/distortion.hpp