Convolution.h File Reference

#include <vector>
#include <cmath>
#include <boost/math/special_functions/bessel.hpp>
#include <iostream>
#include <utils/Convolution.hpp>
Include dependency graph for Convolution.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ConvolutionPadding { ZERO, SPECULAR, CIRCULAR }
enum  ConvolutionResult { SAME, FULL }

Functions

template<class Numeric >
std::vector< Numeric > besselKernel1D (Numeric sigma, unsigned int kernelSize)
template<class Numeric >
std::vector< Numeric > convolve1D (const std::vector< Numeric > &source, const std::vector< Numeric > &kernel, int offset=0, ConvolutionPadding padding=SPECULAR, ConvolutionResult resultType=SAME)
template<class Numeric >
std::vector< Numeric > gaussianKernel1D (Numeric sigma, unsigned int kernelSize)
template<class Numeric >
std::ostream & operator<< (std::ostream &out, const std::vector< Numeric > &vector)

Enumeration Type Documentation

Simple functions for performing convolution on discrete signals.

Author:
Gian Diego Tipaldi The padding strategy for the convolution operation.
Enumerator:
ZERO 

The zero padding strategy. The original signal is augmented with zeros at the borders.

SPECULAR 

The specular padding strategy. The original signal is replicated in a specular way at the borders.

CIRCULAR 

The circular padding strategy. It implements the circular convolution.

Definition at line 41 of file Convolution.h.

The size of the convolution result

Enumerator:
SAME 

The convolution result has the same size of the original signal.

FULL 

The convolution result has the full size.

Definition at line 51 of file Convolution.h.


Function Documentation

template<class Numeric >
std::vector<Numeric> besselKernel1D ( Numeric  sigma,
unsigned int  kernelSize 
) [inline]

Compute the Bessel kernel for smoothing

Parameters:
sigma The standard deviation of the kernel.
kernelSize The size of the kernel.

Definition at line 76 of file Convolution.hpp.

template<class Numeric >
std::vector<Numeric> convolve1D ( const std::vector< Numeric > &  source,
const std::vector< Numeric > &  kernel,
int  offset = 0,
ConvolutionPadding  padding = SPECULAR,
ConvolutionResult  resultType = SAME 
) [inline]

Convolve the kernel over the source, if the size of the source is bigger than the size of the kernel, the opposite otherwise. The padding is defined according to padding and can be ZERO, SPECULAR or CIRCULAR. The size of the result is defined by resultType and can be FULL or SAME. The parameter offset define the offset of the kernel with respect to the source.

Parameters:
source The signal to convolve.
kernel The convolution kernel. If the kernel is bigger than the source kernel and source are inverted.
offset The offset of the convolution. It is useful to shifting the signal to the left or right.
padding The type of padding. See the ConvolutionPadding enum.
resultType The size of the convolution result. See the ConvolutionResult enum.

Definition at line 11 of file Convolution.hpp.

template<class Numeric >
std::vector<Numeric> gaussianKernel1D ( Numeric  sigma,
unsigned int  kernelSize 
) [inline]

Compute the Gaussian kernel for smoothing

Parameters:
sigma The standard deviation of the kernel.
kernelSize The size of the kernel.

Definition at line 94 of file Convolution.hpp.

template<class Numeric >
std::ostream& operator<< ( std::ostream &  out,
const std::vector< Numeric > &  vector 
) [inline]

Print the signal to a stream

Definition at line 3 of file Convolution.hpp.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines


flirtlib
Author(s): Bhaskara Marthi, Gian Diego Tipaldi
autogenerated on Fri Jan 11 11:15:31 2013