Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rtf_filter(3) [debian man page]

RTF_FILTER(3)							 rtfilter library						     RTF_FILTER(3)

NAME
rtf_filter - filters a chunk of data SYNOPSIS
#include <rtfilter.h> unsigned int rtf_filter(hfilter filt, const void *x, void *y, unsigned int ns); DESCRIPTION
This function applies the filter referenced by filt on ns samples specified by the pointer x and writes the filtered data into the array pointed by y. The arrays pointed by made of values whose correspond to the type specified at the creation of the filter. In addition, the two arrays must not overlap (failing to comply will lead to undefined results). Their number of elements have to be equal to ns multiplied by the number of channels processed (specified at the creation of the filter). The arrays should be packed by channels with the following pattern: |S1C1|S1C2|...|S1Ck|S2C1|S2C2|....|S2Ck|...|SnsCk| where SiCj refers to the data value of the i-th sample and the j-th channel and k refers to the number of channel specified at the creation of the filter. RETURN VALUE
Returns the number of samples written in the array pointer by y. For most of the filters, this value will always be equal to ns. This is however not the case of a downsampling filter whose the number of samples returned may vary from one call to another. PERFORMANCE CONSIDERATION
On platforms that support SIMD instructions, rtf_filter() is implemented in 2 different versions: one normal and one using SIMD instruction set which performs nearly 4x faster than the normal one when processing float data types. The SIMD version is automatically selected at runtime if the following conditions are met (otherwise, the implementation falls back to the normal version): - The input x and output y are aligned on 16 bytes boundary (128 bits) - The sample strides (the size of the data type multiplied by the number of channel) of the input and output are multiples of 16 bytes. The first condition is easily met by allocating x and y using memory allocation function mandating a certain alignment (for example, posix_memalign(3) on POSIX platform). The second condition is met if the number of channels is carefully chosen. Given the boost obtained with the SIMD version, it is often interesting to add unused channels into the input and output (when possible) just to make the strides multiple of 16 bytes (for example using always a multiple of 4 channels when dealing with float and real values). SEE ALSO
rtf_create_filter(3), rtf_init_filter(3) EPFL
2010 RTF_FILTER(3)

Check Out this Related Man Page

RTF_CREATE_FILTER(3)						 rtfilter library					      RTF_CREATE_FILTER(3)

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
This function creates and initializes a digital linear filter whose the Z-transform is rational and processing nchann channels of a data type specified by proctype. The numerator and denominator of the rational expression are specified by respectively two arrays num and denum containing the coefficients in the ascending order of the 2 polynoms. The number of elements in each arrays is controlled by num_len and enum_len. denum_len is allowed to be equal to zero as well as denum is allowed to be NULL. In such case, the denominator will be set to 1. The data type of the values in num and denum are specified by type. The proctype and type must be one the following constants: 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) The expected data type of the output of the filter has the same precision as the one specified by proctype and is complex proctype or type specifies a complex type. Said otherwise: * If proctype is RTF_FLOAT or RTF_CFLOAT then the output data type will have single precision. Otherwise it will have double precision. * If proctype or type specifies 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 corre- sponds exactly to respectively num and denum. RETURN VALUE
Returns the handle to the created filter in case of success, NULL otherwise. PERFORMANCE CONSIDERATION
See note of rtf_filter(3) SEE ALSO
rtf_destroy_filter(3), rtf_init_filter(3), rtf_filter(3) EPFL
2010 RTF_CREATE_FILTER(3)
Man Page