A Survey of Gaussian Convolution Algorithms
Typedefs | Functions
strategy_gaussian_conv.h File Reference

Suite of different 1D Gaussian convolution methods. More...

Detailed Description

Suite of different 1D Gaussian convolution methods.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.cmla..nosp@m.ens-.nosp@m.cacha.nosp@m.n.fr

Copyright (c) 2013, Pascal Getreuer All rights reserved.

This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.

You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file strategy_gaussian_conv.h.

#include "num.h"

Go to the source code of this file.

Typedefs

typedef struct gconv_ gconv
 Plan to perform a 1D Gaussian convolution for any algorithm. More...
 

Functions

gconvgconv_plan (num *dest, const num *src, long N, long stride, const char *algo, double sigma, int K, num tol)
 Plan a 1D Gaussian convolution. More...
 
void gconv_execute (gconv *g)
 Execute a 1D Gaussian convolution. More...
 
void gconv_free (gconv *g)
 Free memory associated with a gconv. More...
 

Typedef Documentation

typedef struct gconv_ gconv

Plan to perform a 1D Gaussian convolution for any algorithm.

The gconv* object represents a generic plan to perform a 1D Gaussian convolution using any of the implemented algorithms. It is an application of the strategy design pattern to allow the different Gaussian convolution algorithms to be easily interchangeable in the benchmarking code.

Use is similar to FFTW's fftw_plan. A gconv* object is first created by gconv_plan(), then the 1D Gaussian convolution is performed by gconv_execute(), and finally gconv_free() cleans up. The same Gaussian convolution may be executed multiple times by multiple calls to gconv_execute(). This interface allows to separate precomputation and actual execution in timing tests.

Most of the Gaussian convolution algorithm implementations follow this structure of plan, execute, free, but there are variations in the number of algorithm parameters and whether additional workspace memory is required. The implementation of gconv* is simply a set of wrapper functions to unify all algorithms to the same interface.

Example
algorithm_name, sigma, K, tol);

Definition at line 54 of file strategy_gaussian_conv.h.

Function Documentation

void gconv_execute ( gconv g)

Execute a 1D Gaussian convolution.

Parameters
ggconv* created by gconv_plan()

Definition at line 125 of file strategy_gaussian_conv.c.

void gconv_free ( gconv g)

Free memory associated with a gconv.

Parameters
ggconv* created by gconv_plan()

Definition at line 134 of file strategy_gaussian_conv.c.

gconv* gconv_plan ( num dest,
const num src,
long  N,
long  stride,
const char *  algo,
double  sigma,
int  K,
num  tol 
)

Plan a 1D Gaussian convolution.

Parameters
destdestination array
srcsource array
Nnumber of samples
stridestride between successive samples
algoGaussian convolution algorithm
sigmaGaussian standard deviation
Kalgorithm steps or filter order parameter
tolalgorithm accuracy parameter
Returns
gconv pointer or NULL on failure

Definition at line 72 of file strategy_gaussian_conv.c.