Skip to content

daisysp::NlFilt

More...

#include <nlfilt.h>

Public Functions

Name
void Init()
void ProcessBlock(float * in, float * out, size_t size)
void SetCoefficients(float a, float b, float d, float C, float L)
void SetA(float a)
void SetB(float b)
void SetD(float d)
void SetC(float C)
void SetL(float L)

Detailed Description

class daisysp::NlFilt;

Todo: make this work on a single sample instead of just on blocks at a time.

Non-linear filter

port by: Stephen Hensley, December 2019

The four 5-coefficients: a, b, d, C, and L are used to configure different filter types.

Structure for Dobson/Fitch nonlinear filter

Revised Formula from Risto Holopainen 12 Mar 2004

Y{n} =tanh(a Y{n-1} + b Y{n-2} + d Y^2{n-L} + X{n} - C)

Though traditional filter types can be made, the effect will always respond differently to different input.

This Source is a heavily modified version of the original source from Csound.

Public Functions Documentation

function Init

void Init()

Initializes the NlFilt object.


function ProcessBlock

void ProcessBlock(
    float * in,
    float * out,
    size_t size
)

Process the array pointed to by *in and updates the output to *out; This works on a block of audio at once, the size of which is set with the size.


function SetCoefficients

inline void SetCoefficients(
    float a,
    float b,
    float d,
    float C,
    float L
)

inputs these are the five coefficients for the filter.


function SetA

inline void SetA(
    float a
)

Set Coefficient a


function SetB

inline void SetB(
    float b
)

Set Coefficient b


function SetD

inline void SetD(
    float d
)

Set Coefficient d


function SetC

inline void SetC(
    float C
)

Set Coefficient C


function SetL

inline void SetL(
    float L
)

Set Coefficient L

---

Updated on 2024-01-03 at 19:38:46 +0000