RTF_CREATE_FILTER(3)
π RTF_CREATE_FILTER π
okay bestie, we're diving into rtf_create_filter(3) from the rtfilter library β and yes, the vibe is "custom filter, made by you, for you" β¨
πΈ NAME πΈ
rtf_create_filter β creates a custom filter π
π SYNOPSIS π
#include <rtfilter.h>
hfilter rtf_create_filter(unsigned int nchann, int proctype,
unsigned int num_len, const void *num,
unsigned int denum_len, const void *denum,
int type);
π¦ DESCRIPTION π¦
So this function creates and initializes a digital linear filter, and it's giving rational Z-transform realness π It processes nchann channels, and the data type it's working with is whatever proctype says.
The numerator and the denominator of that rational expression? They come from two arrays β num and denum β holding the coefficients in ascending order of the 2 polynoms. How many elements live in each array is controlled by num_len and enum_len. And here's the cute part: denum_len is allowed to be equal to zero, and denum is allowed to be NULL too π«Ά In that case, the denominator just gets set to 1. The data type of the values inside num and denum is specified by type.
proctype and type have to be one of these constants, no cap:
RTF_FLOATβ specifies real single precision (float)RTF_DOUBLEβ specifies real double precision (double)RTF_CFLOATβ specifies complex single precision (complex float)RTF_CDOUBLEβ specifies complex double precision (complex double)
Now, the expected data type of the filter's output has the same precision as the one specified by proctype, and it's complex if proctype or type specifies a complex type. Said otherwise (fr fr):
- If
proctypeisRTF_FLOATorRTF_CFLOAT, then the output data type will have single precision. Otherwise it will have double precision. - If
proctypeortypespecifies a complex type, then the output will be complex as well. Otherwise, it will be real.
rtf_create_filter() can be used to use a filter that has been designed somewhere else π In particular, this function can be used directly with the output of filter design function of MATLAB. In such case, the usual B and A arrays returned by the filter design functions corresponds exactly to num and denum respectively. iconic tbh π
π RETURN VALUE π
Returns the handle to the created filter in case of success, NULL otherwise. that's it, that's the deal π«‘
π₯ PERFORMANCE CONSIDERATION π₯
See note of rtf_filter(3) β yes, go look, it's important, I'm not gonna gatekeep π
π SEE ALSO π
and that's the whole page bestie, you ate π EPFL, 2010, RTF_CREATE_FILTER(3) β go build something gorgeous with it π¦β¨
π¦ where this page comes from
- debian bookworm: librtfilter-dev 1.1-4+b2
- debian trixie: librtfilter-dev 1.1-4+b3
- ubuntu jammy: librtfilter-dev 1.1-4build1
- ubuntu noble: librtfilter-dev 1.1-4build2
- ubuntu questing: librtfilter-dev 1.1-4build2
- Copyright 2010 (c) EPFL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms