libiir  1.0.2
Functions
Parser for user-specified IIR filters
C library

Functions

struct iir_filter_t * iir_parse (const char *desc)
 Instantiate an IIR filter based on a string description.
struct iir_filter_t ** iir_parse_n (const char *desc, int n)
 Instantiate a set of IIR filters based on a string description.

Detailed Description

This is a high-level interface that can instantiate a set of IIR filters based on a user-specified, human-readable string. The intention of this interface is to allow IIR filters to be specified in configuration files so that they can be easily modified by the user and easily understood/parsed by the system.

See Describing IIR filters as strings for details on the string description format.

Function Documentation

struct iir_filter_t* iir_parse ( const char *  desc)
read

Instantiate an IIR filter based on a string description.

Parameters
descIIR filter description.
Returns
Pointer to newly-allocated IIR filter instance.
Return values
0on error.

Parses the human-readable description of an IIR filter chain in desc, instantiating an IIR filter object to match. Returns the new filter. If desc cannot be parsed correctly, returns 0 and sets errno to EINVAL.

struct iir_filter_t** iir_parse_n ( const char *  desc,
int  n 
)
read

Instantiate a set of IIR filters based on a string description.

Parameters
descIIR filter description.
nNumber of instances to allocate.
Returns
Pointer to array of n newly-allocated IIR filter instances.
Return values
0on error.

Parses the human-readable description of an IIR filter chain in desc, instantiating a set of n identical IIR filter objects to match. Returns a pointer to an array of new filters. If desc cannot be parsed correctly, returns 0 and sets errno to EINVAL.

The user is responsible for freeing both the array elements (with iir_filter_free()) and the array itself (with free(3)).