LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::triangularKernel1D< T > Class Template Reference

one-dimensional filter kernel More...

#include <ltiTriangularKernels.h>

Inheritance diagram for lti::triangularKernel1D< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::triangularKernel1D< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 triangularKernel1D (const int &size=5)
void generate (const int &size)

Detailed Description

template<class T>
class lti::triangularKernel1D< T >

one-dimensional filter kernel

This class will create a one-dimensional triangular filter kernel.

The area under the filter will be normalized to one.

The one dimesional kernel is calculated with the following equation:

$ g(n) = 1 - \frac{n}{| \lfloor size/2 \rfloor |} $

with

$ n = -\lceil size/2 \rceil ~ \cdots ~ +(\lceil size/2 \rceil -1) $

Example:

  // the vector to be filtered:
  lti::vector<channel::value_type> data;

  // ... initialize vector here ...

  // triangular filter kernel with 3 elements with n = -1,0,+1
  lti::triangularKernel1D<channel::value_type> aKernel(3);

  // triangular filter kernel with 4 elements with n = -2,-1,0,+1
  lti::triangularKernel1D<channel::value_type> anotherKernel(4);

  lti::convolution filter;                        // convolution operator
  lti::convolution::parameters param;             // parameters
  param.setKernel(aKernel);                       // use the triangular kernel
  filter.setParameters(param);                    // set parameters

  // filter the vector and leave the result there too

  filter.apply(data);

Constructor & Destructor Documentation

template<class T>
lti::triangularKernel1D< T >::triangularKernel1D ( const int &  size = 5  ) 

constructor

Parameters:
size size of the kernel in one dimension (default 5)

Member Function Documentation

template<class T>
void lti::triangularKernel1D< T >::generate ( const int &  size  ) 

initialize this kernel with the specified value

Parameters:
size size of the kernel in one dimension

The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:57 2010 for LTI-Lib by Doxygen 1.6.1