Filtering (IIR and FIR)

The filter transformation API provides functions for executing IIR and FIR filters on tensor_t objects.

Cached API

template<size_t NR, size_t NNR, typename OutType, typename InType, typename FilterType>
void matx::filter(OutType &o, const InType &i, const std::array<FilterType, NR> h_rec, const std::array<FilterType, NNR> h_nonrec, cudaStream_t stream = 0)

FIR and IIR filtering without a plan

matxFilter_t

provides an interface for executing recursive (IIR) and non-recursive (FIR) filters. The IIR filter uses the algorithm from “S. Maleki

and M. Burtscher. “Automatic Hierarchical Parallelization of Linear Recurrences.” 23rd ACM International Conference on Architectural Support for

Programming Languages and Operating Systems. March 2018.” for an optimized implementation on highly-parallel processors. While the IIR implementation is fast for recursive filters, it is inefficient for non-recursive filtering. If the number of recursive coefficients is 0, the filter operation will revert to use an algorithm optimized for non-recursive filters.

Note

If you are only using non-recursive filters, it’s advised to use the convolution API directly instead since it can be easier to use.

Template Parameters
  • NR – Number of recursive coefficients

  • NNR – Number of non-recursive coefficients

  • RANK – Rank of input and output signal

  • OutType – Ouput type

  • InType – Input type

  • FilterType – Filter type

Parameters
  • o – Output tensor

  • i – Input tensor

  • h_rec – Vector of recursive coefficients

  • h_nonrec – Vector of non-recursive coefficients

  • stream – CUDA stream

Non-Cached API

template<size_t NR, size_t NNR, typename OutType, typename InType, typename FilterType>
static auto matx::matxMakeFilter(OutType &o, const InType &i, tensor_t<FilterType, 1> &h_rec, tensor_t<FilterType, 1> &h_nonrec)

FIR and IIR filtering

matxFilter_t

provides an interface for executing recursive (IIR) and non-recursive (FIR) filters. The IIR filter uses the algorithm from “S. Maleki

and M. Burtscher. “Automatic Hierarchical Parallelization of Linear Recurrences.” 23rd ACM International Conference on Architectural Support for

Programming Languages and Operating Systems. March 2018.” for an optimized implementation on highly-parallel processors. While the IIR implementation is fast for recursive filters, it is inefficient for non-recursive filtering. If the number of recursive coefficients is 0, the filter operation will revert to use an algorithm optimized for non-recursive filters.

Note

If you are only using non-recursive filters, it’s advised to use the convolution API directly instead since it can be easier to use.

Template Parameters
  • NR – Number of recursive coefficients

  • NNR – Number of non-recursive coefficients

  • RANK – Rank of input and output signal

  • OutType – Ouput type

  • InType – Input type

  • FilterType – Filter type

Parameters
  • o – Output tensor

  • i – Input tensor

  • h_rec – 1D input tensor of recursive filter coefficients

  • h_nonrec – 1D input tensor of recursive filter coefficients

template<size_t NR, size_t NNR, typename OutType, typename InType, typename FilterType>
static auto matx::matxMakeFilter(OutType &o, const InType &i, const std::array<FilterType, NR> &h_rec, const std::array<FilterType, NNR> &h_nonrec)

FIR and IIR filtering

matxFilter_t

provides an interface for executing recursive (IIR) and non-recursive (FIR) filters. The IIR filter uses the algorithm from “S. Maleki

and M. Burtscher. “Automatic Hierarchical Parallelization of Linear Recurrences.” 23rd ACM International Conference on Architectural Support for

Programming Languages and Operating Systems. March 2018.” for an optimized implementation on highly-parallel processors. While the IIR implementation is fast for recursive filters, it is inefficient for non-recursive filtering. If the number of recursive coefficients is 0, the filter operation will revert to use an algorithm optimized for non-recursive filters.

Note

If you are only using non-recursive filters, it’s advised to use the convolution API directly instead since it can be easier to use.

Template Parameters
  • NR – Number of recursive coefficients

  • NNR – Number of non-recursive coefficients

  • RANK – Rank of input and output signal

  • OutType – Ouput type

  • InType – Input type

  • FilterType – Filter type

Parameters
  • o – Output tensor

  • i – Input tensor

  • h_rec – Vector of recursive coefficients

  • h_nonrec – Vector of non-recursive coefficients