Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::dsp::Convolution Class Reference

#include <Convolution.h>

List of all members.


Detailed Description

Methods for performing operations related to convolution and correlation.


Static Public Methods

template<class T> util::Matrix< T > conv (const util::Matrix< T > &a, const util::Matrix< T > &b)
 Two-dimensional convolution of two matrices.

template<class T> util::Matrix< T > conv (const util::Matrix< T > &a, const util::List< T > &b, bool rows=true)
 One-dimensional convolution of a matrix and a vector.

template<class T> util::List< T > conv (const util::List< T > &a, const util::List< T > &b, bool zeropad=false)
 One-dimensional convolution of two vectors.

template<class T> util::Matrix< T > xcorr (const util::Matrix< T > &a, const util::Matrix< T > &b)
 Two-dimensional cross-correlation of two matrices.

template<class T> util::Matrix< T > xcorr (const util::Matrix< T > &a, const util::List< T > &b, bool rows=true)
 One-dimensional cross-correlation of a matrix and a vector.

template<class T> util::List< T > xcorr (const util::List< T > &a, const util::List< T > &b)
 One-dimensional cross-correlation of two vectors.

template<class T> void conjugate (util::List< util::Complex< T > > &lst)
 Transform each complex value in a List into its complex conjugate.

template<class T> void conjugate (util::Matrix< util::Complex< T > > &lst)
 Transform each complex value in a Matrix into its complex conjugate.

template<class T> void conjugate (util::List< T > &lst)
template<class T> void conjugate (util::Matrix< T > &lst)


Member Function Documentation

template<class T>
util::List< T > prapi::dsp::Convolution::conv const util::List< T > &    a,
const util::List< T > &    b,
bool    zeropad = false
[static]
 

One-dimensional convolution of two vectors.

The length of the resulting vector will be M-N+1 where M and N are the length of the input vectors a and b, respectively. If zero-padding is in use, the result will be M+N-1 items long.

Parameters:
a  source vector
b  convolution filter
zeropad  if true vectors add padded with zero if needeed. (Convolution will be calculated for all points).

template<class T>
util::Matrix< T > prapi::dsp::Convolution::conv const util::Matrix< T > &    a,
const util::List< T > &    b,
bool    rows = true
[static]
 

One-dimensional convolution of a matrix and a vector.

The size of the resulting matrix will be either (M-L+1)xN or Mx(N-L+1) where the size of the input matrix is MxN and L is the length of the vector.

Parameters:
a  source matrix
b  convolution filter
rows  if true, convolution is calculated vertically (rows are convolved), otherwise it is calculated horizontally.

template<class T>
util::Matrix< T > prapi::dsp::Convolution::conv const util::Matrix< T > &    a,
const util::Matrix< T > &    b
[static]
 

Two-dimensional convolution of two matrices.

Convolution is performed on pixels on which it is fully defined. If you want to retain the original size of the input matrix, pad it with zeros. The size of the resulting matrix will be (M-O+1)x(N-P+1) if the input matrices are of sizes MxN and OxP. Make sure b is not larger than a.

Parameters:
a  source matrix
b  convolution filter

template<class T>
util::List< T > prapi::dsp::Convolution::xcorr const util::List< T > &    a,
const util::List< T > &    b
[static]
 

One-dimensional cross-correlation of two vectors.

The length of the resulting vector will be M-N+1 where M and N are the length of the input vectors a and b, respectively. If the length of the input vector is to be preserved, pad a with zeros.

Parameters:
a  source vector
b  convolution filter

template<class T>
util::Matrix< T > prapi::dsp::Convolution::xcorr const util::Matrix< T > &    a,
const util::List< T > &    b,
bool    rows = true
[static]
 

One-dimensional cross-correlation of a matrix and a vector.

The size of the resulting matrix will be either (M-L+1)xN or Mx(N-L+1) where the size of the input matrix is MxN and L is the length of the vector.

Parameters:
a  source matrix
b  convolution filter
rows  if true, convolution is calculated vertically (rows are convolved), otherwise it is calculated horizontally.

template<class T>
util::Matrix< T > prapi::dsp::Convolution::xcorr const util::Matrix< T > &    a,
const util::Matrix< T > &    b
[static]
 

Two-dimensional cross-correlation of two matrices.

Correlation is performed on pixels on which it is fully defined. If you want to retain the original size of the input matrix, pad it with zeros. The size of the resulting matrix will be (M-O+1)x(N-P+1) if the input matrices are of sizes MxN and OxP. Make sure that b is smaller than a. Autocorrelation can be calculated by padding a with zeros and performing the xcorr operation on the padded an the original matrix.

Parameters:
a  source matrix
b  convolution filter


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.