#include <vector>
#include <cmath>
#include <boost/math/special_functions/bessel.hpp>
#include <iostream>
#include <utils/Convolution.hpp>
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) |
enum ConvolutionPadding |
Simple functions for performing convolution on discrete signals.
Definition at line 41 of file Convolution.h.
enum ConvolutionResult |
The size of the convolution result
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.
std::vector<Numeric> besselKernel1D | ( | Numeric | sigma, | |
unsigned int | kernelSize | |||
) | [inline] |
Compute the Bessel kernel for smoothing
sigma | The standard deviation of the kernel. | |
kernelSize | The size of the kernel. |
Definition at line 76 of file Convolution.hpp.
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.
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.
std::vector<Numeric> gaussianKernel1D | ( | Numeric | sigma, | |
unsigned int | kernelSize | |||
) | [inline] |
Compute the Gaussian kernel for smoothing
sigma | The standard deviation of the kernel. | |
kernelSize | The size of the kernel. |
Definition at line 94 of file Convolution.hpp.
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.