|
sfFDN
|
A signal-dependent fractional delay filter. More...
#include <nonlinear.h>
Public Member Functions | |
| SignalDependentFractionalDelay (const SignalDependentFractionalDelayOptions &options={}) | |
| Constructs a signal-dependent fractional delay. | |
| void | SetD (float d) |
| Sets the interpolation weight. | |
| float | GetD () const noexcept SFFDN_NONBLOCKING |
| Returns the interpolation weight. | |
| float | Tick (float input) noexcept SFFDN_NONBLOCKING |
| Processes a single sample. | |
| void | Process (const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override |
| Processes the audio buffer. | |
| uint32_t | InputChannelCount () const noexcept SFFDN_NONBLOCKING override |
| Returns the number of input channels this processor expects. | |
| uint32_t | OutputChannelCount () const noexcept SFFDN_NONBLOCKING override |
| Returns the number of output channels this processor produces. | |
| void | Clear () override |
| Clears the delay state. | |
| std::unique_ptr< AudioProcessor > | Clone () const override |
| Creates a copy of the processor. | |
Public Member Functions inherited from sfFDN::AudioProcessor | |
Additional Inherited Members | |
Protected Member Functions inherited from sfFDN::AudioProcessor | |
| AudioProcessor (const AudioProcessor &)=default | |
| AudioProcessor & | operator= (const AudioProcessor &)=default |
| AudioProcessor (AudioProcessor &&) noexcept=default | |
| AudioProcessor & | operator= (AudioProcessor &&) noexcept=default |
A signal-dependent fractional delay filter.
Implements the filter of Fig. 5 of the paper, after J. R. Pierce and S. A. Van Duyne, "A passive nonlinear digital filter design which facilitates physics-based sound synthesis of highly nonlinear musical instruments", J. Acoust. Soc. Amer., 1997, and V. Välimäki, T. Tolonen and M. Karjalainen, "Signal-dependent nonlinearities for physical models using time-varying fractional delay filters", Proc. ICMC, 1998.
The input is split into its positive and negative half-wave rectified components, each is delayed by a different fractional amount, and the two are summed:
\[ p(n) = \max(x(n), 0), \qquad q(n) = \min(x(n), 0), \\ y(n) = d\,q(n) + (1 - d)\,q(n-1) + d\,p(n-2) + (1 - d)\,p(n-1). \]
The two interpolators are linear and carry complementary weights, so the positive component is delayed by \(1 + d\) samples and the negative one by \(1 - d\). The result keeps the fundamental and the overall amplitude of a sinusoidal input but distorts it around its zero crossings, generating even harmonics. It is a milder effect than ControllableFullWaveRectifier, and a good alternative to it on sustained input.
|
explicit |
Constructs a signal-dependent fractional delay.
| options | The configuration options. |
| std::invalid_argument | if d is not in [0, 1]. |
|
overridevirtual |
Clears the delay state.
The interpolation weight is left untouched.
Implements sfFDN::AudioProcessor.
|
overridevirtual |
|
overridevirtualnoexcept |
Returns the number of input channels this processor expects.
This is always 1.
Implements sfFDN::AudioProcessor.
|
overridevirtualnoexcept |
Returns the number of output channels this processor produces.
This is always 1.
Implements sfFDN::AudioProcessor.
|
overridevirtualnoexcept |
Processes the audio buffer.
Implements sfFDN::AudioProcessor.
| void sfFDN::SignalDependentFractionalDelay::SetD | ( | float | d | ) |
Sets the interpolation weight.
| d | The interpolation weight, in [0, 1]. |
| std::invalid_argument | if d is not in [0, 1]. |