Do more. Code less. Free software for GPU computing.
<scroll to top>
Namespaces | Enumerations | Functions

signal.h File Reference

#include <cuComplex.h>
#include "defines.h"

Go to the source code of this file.

Namespaces

namespace  af

Enumerations

enum  afConv { afConvSame = 0, afConvValid = -1, afConvFull = 1 }
 

Specify which part of convolution to retain.

More...

Functions

array fft (const array &, unsigned pad=0)
 Fast Fourier Transform in one dimension.
array ifft (const array &, unsigned pad=0)
 Inverse Fast Fourier Transform in one dimension.
array fft2 (const array &, unsigned nx=0, unsigned ny=0)
 Fast Fourier Transform in two dimensions.
array ifft2 (const array &, unsigned nx=0, unsigned ny=0)
 Inverse Fast Fourier Transform in two dimensions.
array fft3 (const array &)
 Fast Fourier Transform in three dimensions.
array fft3 (const array &, const dim4 &dims)
 Fast Fourier Transform in three dimensions.
array ifft3 (const array &)
 Inverse Fast Fourier Transform in three dimensions.
array ifft3 (const array &, const dim4 &dims)
 Inverse Fast Fourier Transform in three dimensions.
array fir (int nb, const float *h_b, const array &x)
 Finite impulse response filtering.
array fir (const array &b, const array &x)
 Finite impulse response filtering.
array iir (int nb, const float *h_b, int na, const float *h_a, const array &x)
 Infinite impulse response filter (transposed Direct Form II implementation).
array iir (const array &b, const array &a, const array &x)
 Infinite impulse response filter (transposed Direct Form II implementation).
array convolve (const array &f1, const array &f2, const array &signal, afConv shape=afConvFull)
 Separable convolution (2D) with device arrays.
template<typename ty >
array convolve (unsigned n1, const ty *f1, unsigned n2, const ty *f2, const array &signal, afConv shape=afConvFull)
 Separable convolution (2D) with host arrays.
array convolve (const array &signal, const array &filter, afConv shape=afConvFull)
 Convolution (1D,2D,3D).
template<typename ty >
array convolve (const array &signal, unsigned ndims, unsigned *dims, const ty *h_kernel, afConv shape=afConvFull)
 Convolution (1D,2D,3D) with host filter.
array interp (array &X, array &Y, array &Xi, unsigned method=0)
 Interpolation in one dimension (1D).
array interp (array &X, array &Y, array &Xi, float init, unsigned method=0)
 Interpolation in one dimension (1D).
array interp (array &X, array &Y, array &Z, array &Xi, array &Yi, unsigned method=0)
 Interpolation in two dimensions (2D).
array interp (array &X, array &Y, array &Z, array &Xi, array &Yi, float init, unsigned method=0)
 Interpolation in two dimensions (2D).
afError af_fft_setplans (int max_plans)
 Set the number of CUSIGNAL plans to cache.
afError af_fft_clear (void)
 Clear the fft plan cache.
void af_fft_info (void)
 Print status of fft plan cache.
Device pointer interface: Forward and Inverse 1D fft
Parameters:
[in]noutSize of output array
[out]d_OOutput array (always complex)
[in]ninSize of input array
[in]batchNumber of input tiles
[in]directionDirection of fft. 0 for FORWARD, 1 for INVERSE
afError af_fft_S (unsigned nout, cuComplex *d_O, unsigned nin, const float *d_I, unsigned batch, int direction)
 Single precision, One dimensional fft.
afError af_fft_C (unsigned nout, cuComplex *d_O, unsigned nin, const cuComplex *d_I, unsigned batch, int direction)
 Complex, Single precision, One dimensional fft.
afError af_fft_D (unsigned nout, cuDoubleComplex *d_O, unsigned nin, const double *d_I, unsigned batch, int direction)
 Double precision, One dimensional fft.
afError af_fft_Z (unsigned nout, cuDoubleComplex *d_O, unsigned nin, const cuDoubleComplex *d_I, unsigned batch, int direction)
 Complex, Double precision, One dimensional fft.
Device pointer interface: Forward and Inverse 2D fft
Parameters:
[in]xonumber of rows in the output
[in]yonumber of columns in the output
[out]d_OOutput array (always complex)
[in]xinumber of rows in the input
[in]yinumber of columns in the ouput
[in]batchNumber of input tiles
[in]directionDirection of fft2. 0 for FORWARD, 1 for INVERSE
afError af_fft2_S (unsigned xo, unsigned yo, cuComplex *d_O, unsigned xi, unsigned yi, const float *d_I, unsigned batch, int direction)
 Single precision, two dimensional fft.
afError af_fft2_C (unsigned xo, unsigned yo, cuComplex *d_O, unsigned xi, unsigned yi, const cuComplex *d_I, unsigned batch, int direction)
 Complex, Single precision, two dimensional fft.
afError af_fft2_D (unsigned xo, unsigned yo, cuDoubleComplex *d_O, unsigned xi, unsigned yi, const double *d_I, unsigned batch, int direction)
 Double precision, two dimensional fft.
afError af_fft2_Z (unsigned xo, unsigned yo, cuDoubleComplex *d_O, unsigned xi, unsigned yi, const cuDoubleComplex *d_I, unsigned batch, int direction)
 Complex, Double precision, two dimensional fft.
Device pointer interface: Forward and Inverse ND fft.
Parameters:
[in]dims_ODimensions of the output array
[out]d_OOutput array (always complex)
[in]dims_IDimensions of the input array
[in]batchNumber of input tiles
[in]batchSize of the batch of inputs
afError af_fft3_S (dim3 dims_O, cuComplex *d_O, dim3 dims_I, const float *d_I, unsigned batch, int direction)
 Single precision, multi-dimensional fft.
afError af_fft3_C (dim3 dims_O, cuComplex *d_O, dim3 dims_I, const cuComplex *d_I, unsigned batch, int direction)
 Complex, Single precision, multi-dimensional fft.
afError af_fft3_D (dim3 dims_O, cuDoubleComplex *d_O, dim3 dims_I, const double *d_I, unsigned batch, int direction)
 Double precision, multi-dimensional fft.
afError af_fft3_Z (dim3 dims_O, cuDoubleComplex *d_O, dim3 dims_I, const cuDoubleComplex *d_I, unsigned batch, int direction)
 Complex, Double precision, multi-dimensional fft.
Device pointer filter1D:
Parameters:
[out]d_outThe filtered output
[in]len_inSize of input array
[in]d_inInput to the filter
[in]len_aNumber of feed-forward co-efficients (maximum 50)
[in]h_aFeed-forward co-efficients
[in]len_bNumber of feed-forward co-efficients (maximum 50)
[in]h_bFeed-back co-efficients
[in]d_initInitial value of the delay units
[out]d_finalFinal value of the delay units
[in]NinNumber of input batches
[in]NinitNumber of initial conditions
afError af_filter1D_SS (float *d_out, unsigned len_in, const float *d_in, unsigned len_a, const float *h_a, unsigned len_b, const float *h_b, const float *d_init, float *d_final, unsigned Nin, unsigned Ninit)
 Single precision, Transposed direct form II filtering.
Device pointer interface: 1D convolution
Parameters:
[out]d_outThe convolved output
[in]niSize of input signal
[in]d_inInput signal
[in]batchiNumber of input signal tiles
[in]nfSize of input filter
[in]d_filtInput filter
[in]batchfNumber of input signal tiles
shapetype of convolution
afError af_conv_SS (float *d_out, unsigned ni, const float *d_in, unsigned batchi, unsigned nf, const float *d_filt, unsigned batchf, afConv shape)
 Single precision, real input, real filter, one dimensional convolution.
afError af_conv_CS (cuComplex *d_out, unsigned ni, const cuComplex *d_in, unsigned batchi, unsigned nf, const float *d_filt, unsigned batchf, afConv shape)
 Single precision, complex input, real filter, one dimensional convolution.
afError af_conv_CC (cuComplex *d_out, unsigned ni, const cuComplex *d_in, unsigned batchi, unsigned nf, const cuComplex *d_filt, unsigned batchf, afConv shape)
 Float precision, complex input, complex filter, one dimensional convolution.
afError af_conv_DD (double *d_out, unsigned ni, const double *d_in, unsigned batchi, unsigned nf, const double *d_filt, unsigned batchf, afConv shape)
 Single precision, real input, real filter, one dimensional convolution.
afError af_conv_ZD (cuDoubleComplex *d_out, unsigned ni, const cuDoubleComplex *d_in, unsigned batchi, unsigned nf, const double *d_filt, unsigned batchf, afConv shape)
 Double precision, complex input, real filter, one dimensional convolution.
afError af_conv_ZZ (cuDoubleComplex *d_out, unsigned ni, const cuDoubleComplex *d_in, unsigned batchi, unsigned nf, const cuDoubleComplex *d_filt, unsigned batchf, afConv shape)
 Double precision, complex input, complex filter, one dimensional convolution.
Device pointer interface: 2D convolution
Parameters:
[out]d_outThe convolved output
[in]miRows in input signal
[in]niColumns in input signal
[in]d_inInput signal
[in]batchiNumber of input signal tiles
[in]mfRows in the input filter
[in]nfColumns in the input filter
[in]d_filtInput filter
[in]batchfNumber of input signal tiles
[in]shapetype of convolution
afError af_conv2_SS (float *d_out, unsigned mi, unsigned ni, const float *d_in, unsigned batch_in, unsigned mf, unsigned nf, const float *d_filt, unsigned batch_filt, afConv shape)
 Single precision, real input, real filter, two dimensional convolution.
afError af_conv2_CS (cuComplex *d_out, unsigned mi, unsigned ni, const cuComplex *d_in, unsigned batch_in, unsigned mf, unsigned nf, const float *d_filt, unsigned batch_filt, afConv shape)
 Single precision, complex input, real filter, two dimensional convolution.
afError af_conv2_CC (cuComplex *d_out, unsigned mi, unsigned ni, const cuComplex *d_in, unsigned batch_in, unsigned mf, unsigned nf, const cuComplex *d_filt, unsigned batch_filt, afConv shape)
 Single precision, complex input, complex filter, two dimensional convolution.
afError af_conv2_DD (double *d_out, unsigned mi, unsigned ni, const double *d_in, unsigned batch_in, unsigned mf, unsigned nf, const double *d_filt, unsigned batch_filt, afConv shape)
 Double precision, real input, real filter, two dimensional convolution.
afError af_conv2_ZD (cuDoubleComplex *d_out, unsigned mi, unsigned ni, const cuDoubleComplex *d_in, unsigned batch_in, unsigned mf, unsigned nf, const double *d_filt, unsigned batch_filt, afConv shape)
 Double precision, complex input, real filter, two dimensional convolution.
afError af_conv2_ZZ (cuDoubleComplex *d_out, unsigned mi, unsigned ni, const cuDoubleComplex *d_in, unsigned batch_in, unsigned mf, unsigned nf, const cuDoubleComplex *d_filt, unsigned batch_filt, afConv shape)
 Double precision, complex input, complex filter, two dimensional convolution.
Device pointer interface: filter is device pointer
Parameters:
[out]d_outThe convolved output
[in]ndimsiNumber of dimensions in input signal
[in]dimsiDimensions of input signal
[in]d_inInput signal
[in]batchiNumber of input signal tiles
[in]ndimsfNumber of dimensions in input filter
[in]dimsfDimensions of input filter
[in]d_filtInput filter
[in]batchfNumber of input signal tiles
[in]shapetype of convolution
afError af_convn_SS (float *d_out, unsigned ndimsi, unsigned *dimsi, const float *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const float *d_filt, unsigned batchf, afConv shape)
 Single precision, real input, real filter, multi-dimensional convolution.
afError af_convn_CS (cuComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const float *d_filt, unsigned batchf, afConv shape)
 Single precision, complex input, real filter, multi-dimensional convolution.
afError af_convn_CC (cuComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const cuComplex *d_filt, unsigned batchf, afConv shape)
 Single precision, complex input, complex filter, multi-dimensional convolution.
afError af_convn_DD (double *d_out, unsigned ndimsi, unsigned *dimsi, const double *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const double *d_filt, unsigned batchf, afConv shape)
 Double precision, real input, real filter, multi-dimensional convolution.
afError af_convn_ZD (cuDoubleComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuDoubleComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const double *d_filt, unsigned batchf, afConv shape)
 Double precision, complex input, real filter, multi-dimensional convolution.
afError af_convn_ZZ (cuDoubleComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuDoubleComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const cuDoubleComplex *d_filt, unsigned batchf, afConv shape)
 Double precision, complex input, complex filter, multi-dimensional convolution.
Device pointer interface: filter is host pointer

Multi-dimensional convolution (filter on host)

Parameters:
[out]d_outThe convolved output
[in]ndimsiNumber of dimensions in input signal
[in]dimsiDimensions of input signal
[in]d_inInput signal
[in]batchiNumber of input signal tiles
[in]ndimsfNumber of dimensions in input filter
[in]dimsfDimensions of input filter
[in]h_filtInput filter (on host)
[in]batchfNumber of input signal tiles
[in]shapetype of convolution
afError af_convh_SS (float *d_out, unsigned ndimsi, unsigned *dimsi, const float *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const float *h_filt, unsigned batchf, afConv shape)
 Single precision, real input, real filter, multi-dimensional convolution.
afError af_convh_CS (cuComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const float *h_filt, unsigned batchf, afConv shape)
 Single precision, complex input, real filter, multi-dimensional convolution.
afError af_convh_DD (double *d_out, unsigned ndimsi, unsigned *dimsi, const double *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const double *h_filt, unsigned batchf, afConv shape)
 Double precision, real input, real filter, multi-dimensional convolution.
afError af_convh_ZD (cuDoubleComplex *d_out, unsigned ndimsi, unsigned *dimsi, const cuDoubleComplex *d_in, unsigned batchi, unsigned ndimsf, unsigned *dimsf, const double *h_filt, unsigned batchf, afConv shape)
 Double precision, complex input, real filter, multi-dimensional convolution.
Device pointer interface: Rescale a matrix.

d_ZI = scale(d_Z, factor, method)

Parameters:
[out]d_ZIRescaled matrix
[in]mdInput rows (first dimension)
[in]ndInput columns (second dimension)
[in]d_ZOriginal matrix.
[in]factorInteger scaling factor
[in]methodInterpolaiton method. Currently should be 'linear' only
afError af_scale2D_S (float *d_ZI, unsigned md, unsigned nd, const float *d_Z, int factor, unsigned method)
 Single-precision rescale.
afError af_scale2D_D (double *d_ZI, unsigned md, unsigned nd, const double *d_Z, int factor, unsigned method)
afError af_scale2D_C (cuComplex *d_ZI, unsigned md, unsigned nd, const cuComplex *d_Z, int factor, unsigned method)
afError af_scale2D_Z (cuDoubleComplex *d_ZI, unsigned md, unsigned nd, const cuDoubleComplex *d_Z, int factor, unsigned method)
afError af_scale2D_c (char *d_ZI, unsigned md, unsigned nd, const char *d_Z, int factor, unsigned method)
 Character (8-bit) rescale.
Device pointer interface: Vector (1D) interpolation.
Parameters:
[out]d_YIInterpolated function values
[in]nNumber of elements in inputs d_Y, d_X
[in]d_YFunction values
[in]batch_YNumber of tiles of d_Y
[in]d_XDomain values (currently needs to be NULL)
[in]batch_XNumber of tiles of d_X
[in]niNumber of elements in d_XI
[in]d_XIGrid values to interpolate on.
[in]Y0Value for interpolations off the grid (i.e. out-of-bounds)
[in]methodOnly supports 0='linear'
afError af_interp1D_S (float *d_YI, unsigned n, const float *d_Y, unsigned batch_Y, const float *d_X, unsigned batch_X, unsigned ni, const float *d_XI, float Y0, unsigned method)
 Single precision, vector interpolation.
afError af_interp1D_C (cuComplex *d_YI, unsigned n, const cuComplex *d_Y, unsigned batch_Y, const float *d_X, unsigned batch_X, unsigned ni, const float *d_XI, float Y0, unsigned method)
 Complex, Single precision, vector interpolation.
afError af_interp1D_D (double *d_YI, unsigned n, const double *d_Y, unsigned batch_Y, const double *d_X, unsigned batch_X, unsigned ni, const double *XI, double Y0, unsigned method)
 Double precision, vector interpolation.
afError af_interp1D_Z (cuDoubleComplex *d_YI, unsigned n, const cuDoubleComplex *d_Y, unsigned batch_Y, const double *d_X, unsigned batch_X, unsigned ni, const double *d_XI, double Y0, unsigned method)
 Complex, Double precision, vector interpolation.

Device pointer interface: Matrix (2D) interpolation.

Parameters:
[out]d_ZIInterpolated function values
[in]mNumber of rows in inputs d_Z, d_Y, d_X
[in]nNumber of columns in inputs d_Z, d_Y, d_X
[in]d_ZFunction values
[in]batch_ZNumber of tiles of d_Z
[in]d_XX Domain values
[in]batch_XNumber of tiles of d_X
[in]d_YY Domain values
[in]batch_YNumber of tiles of d_Y
[in]miNumber of rows in d_XI, d_YI
[in]niNumber of columns in d_XI, d_YI
[in]d_XIX Grid values to interpolate on.
[in]d_XIY Grid values to interpolate on.
[in]Z0Value for interpolations off the grid (i.e. out-of-bounds)
[in]methodOnly supports 0='linear'

#define INTERP(ty, tyi, T)
 Single precision, matrix interpolation.
afError af_interp2D_S (float *d_ZI, unsigned m, unsigned n, const float *d_Z, unsigned batch_Z, unsigned mi, unsigned ni, const float *d_XI, unsigned batch_XI, const float *d_YI, unsigned batch_YI, float Z0, unsigned method)
afError af_interp2D_D (double *d_ZI, unsigned m, unsigned n, const double *d_Z, unsigned batch_Z, unsigned mi, unsigned ni, const double *d_XI, unsigned batch_XI, const double *d_YI, unsigned batch_YI, double Z0, unsigned method)
afError af_interp2D_C (cuComplex *d_ZI, unsigned m, unsigned n, const cuComplex *d_Z, unsigned batch_Z, unsigned mi, unsigned ni, const float *d_XI, unsigned batch_XI, const float *d_YI, unsigned batch_YI, float Z0, unsigned method)
afError af_interp2D_Z (cuDoubleComplex *d_ZI, unsigned m, unsigned n, const cuDoubleComplex *d_Z, unsigned batch_Z, unsigned mi, unsigned ni, const double *d_XI, unsigned batch_XI, const double *d_YI, unsigned batch_YI, double Z0, unsigned method)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines