---
name: "rtf_create_downsampler"
section: "3"
platform: "linux"
package: "librtfilter-dev"
version: "1.1-4+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rtf_create_downsampler"
---

# rtf\_create\_downsampler(3)

Creates downsampling filter

## NAME

rtf\_create\_downsampler - Creates downsampling filter

## SYNOPSIS

**#include \<rtfilter.h\>**

**hfilter rtf\_create\_downsampler(unsigned int** *nch***, int** *type***,**\
                                **unsigned int** *r***);**\

## DESCRIPTION

**rtf\_create\_downsampler**() creates a filter that downsamples signals coming from *nch* channels of type *type* (see [**rtf\_create\_filter**(3)](/rtf_create_filter/3.md)) by a decimation factor of *r* (i.e. the sampling frequency of the input will be *r* times the sampling frequency of the output). This is achieved internally by applying a lowpass 4-order Chebychev filter to the input data using a normalized cutoff frequency of 0.8/(2\**r*) and decimating the result every *r* samples.

## RETURN VALUE

Returns the handle to the created filter in case of success, NULL otherwise.

## NOTES

On the contrary of most other filters, the number of samples returned by [**rtf\_filter**(3)](/rtf_filter/3.md) is different than the input (as expected) but also may vary at each call if the number of sample supplied in input is not a multiple of *r*.

## SEE ALSO

[**rtf\_filter**(3)](/rtf_filter/3.md), [**rtf\_create\_filter**(3)](/rtf_create_filter/3.md), [**rtf\_destroy\_filter**(3)](/rtf_destroy_filter/3.md)
