Filtering of a finite length signal by a filter defined by its transfert function.

Namespace: dsp::filter

Prototype

Vector<T> filter(const Design &d, const Vector<T> &x)

Parameters

dTransfert function (can be IIR or FIR) or coefficients vector (can only be FIR).
xInput signal to be filtered

Returns

Output signal

Description

This function will only work for finite length signals. To filter streaming signals, better use one of the structure with context (see filter_fir(), filter_sois(), etc.).

For a FIR filter, this function computes the convolution product: \[ y_n = (h \star x)_n = \sum_{k=0}^{K-1} h_k\cdot x_{n-k} \]

There will be as many output samples as input ones, by inserting virtual zeros before the beginning of the signal.

See also

filtfilt(), filter (2)