A Survey of Gaussian Convolution Algorithms
Macros | Functions
gaussian_short_conv.c File Reference

Gaussian convolution for short signals (N <= 4) More...

Detailed Description

Gaussian convolution for short signals (N <= 4)

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

Copyright (c) 2012, 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 this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file gaussian_short_conv.c.

#include "gaussian_short_conv.h"
#include <assert.h>
#include <math.h>

Go to the source code of this file.

Macros

#define M_PI_4   0.78539816339744830961566084581987572
 The constant pi/4.
 
#define M_1_SQRT2   0.70710678118654752440084436210484904
 The constant 1/sqrt(2)
 
#define M_SQRT3   1.73205080756887729352744634150587237
 The constant sqrt(3)
 
#define M_COSPI_8   0.92387953251128675612818318939678829
 The constant cos(pi/8) = sqrt(sqrt(2) + 2)/2.
 
#define M_COSPI3_8   0.38268343236508977172845998403039887
 The constant cos(pi 3/8) = sqrt(2 - sqrt(2))/2.
 

Functions

void gaussian_short_conv (num *dest, const num *src, long N, long stride, num sigma)
 Gaussian convolution on a short signal (N <= 4) More...
 

Function Documentation

void gaussian_short_conv ( num dest,
const num src,
long  N,
long  stride,
num  sigma 
)

Gaussian convolution on a short signal (N <= 4)

Parameters
destoutput convolved data
srcdata to be convolved, modified in-place if src=dest
Nnumber of samples (0 < N <= 4)
stridestride between successive samples
sigmaGaussian standard deviation

This routine performs DCT-based Gaussian convolution for very short signals, N <= 4. Some of the Gaussian convolution implementations cannot handle such short signals, and this routine is used as a fallback.

Since the signals are of very short lengths, we compute the DCTs by direct formulas rather than with FFTW.

Definition at line 63 of file gaussian_short_conv.c.