latest version v1.9 - last update 10 Apr 2010 |
one-dimensional filter kernel More...
#include <ltiTriangularKernels.h>
Public Member Functions | |
triangularKernel1D (const int &size=5) | |
void | generate (const int &size) |
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:
with
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);
lti::triangularKernel1D< T >::triangularKernel1D | ( | const int & | size = 5 |
) |
constructor
size | size of the kernel in one dimension (default 5) |
void lti::triangularKernel1D< T >::generate | ( | const int & | size | ) |
initialize this kernel with the specified value
size | size of the kernel in one dimension |