Skip to content

daisysp::FIRFilterImplGeneric

More...

#include <fir.h>

Inherits from daisysp::FIRMemory< max_size, max_block >

Public Functions

Name
FIRFilterImplGeneric()
float Process(float in)
void ProcessBlock(const float * pSrc, float * pDst, size_t block)
bool SetIR(const float * ir, size_t len, bool reverse)
template <typename... Args>
auto
Init(Args &&... args)
void Reset()
constexpr size_t GetLatency()

Protected Attributes

Name
float[max_size] coefs_
size_t size_
float[state_size_] state_

Additional inherited members

Protected Functions inherited from daisysp::FIRMemory< max_size, max_block >

Name
FIRMemory()
bool SetCoefs(const float coefs[], size_t size, bool reverse)
constexpr size_t MaxBlock()

Protected Attributes inherited from daisysp::FIRMemory< max_size, max_block >

Name
constexpr size_t state_size_

Detailed Description

template <size_t max_size,
size_t max_block>
class daisysp::FIRFilterImplGeneric;

Parameters:

  • max_size - maximal filter length
  • max_block - maximal block size for ProcessBlock() if both parameters are 0 (via FIRFILTER_USER_MEMORY macro) Assumes the user will provide own memory buffers via SetIR() and SetStateBuffer() functions Otherwise statically allocates the necessary buffers itself

Generic FIR implementation is always available

Public Functions Documentation

function FIRFilterImplGeneric

inline FIRFilterImplGeneric()

function Process

inline float Process(
    float in
)

Shift the state simulatenously (note: better solutions are available)


function ProcessBlock

inline void ProcessBlock(
    const float * pSrc,
    float * pDst,
    size_t block
)

function SetIR

inline bool SetIR(
    const float * ir,
    size_t len,
    bool reverse
)

Set filter coefficients (aka Impulse Response) Coefficients need to be in reversed order (tail-first) If internal storage is used, makes a local copy and allows reversing the impulse response


function Init

template <typename... Args>
inline auto Init(
    Args &&... args
)

function Reset

inline void Reset()

function GetLatency

static inline constexpr size_t GetLatency()

Protected Attributes Documentation

variable coefs_

float[max_size] coefs_;

variable size_

size_t size_;

variable state_

float[state_size_] state_;

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