
/*!

\page signal_func_conv_desc Convolution

A convolution is a common operation between a source array, a, and a filter (or kernel) array b.
The answer to the convolution is the same as computing the coefficients in polynomial multiplication,
if a and b are the coefficients.

Another way to think about it is that the filter kernel is centered on each pixel in a,
and the output for that pixel or data point is the sum of the products.

Depending on the dimensions of the input signal and the filter signal, any one of the following
batch mode convolutions take place.

- **No Batch**   - Single filter applied to single input.
- **Filter is Batched**  - Many filters applied on same input
- **Signal is Batched**  - Single filter applied to a set of inputs.
- **Identical Batches** - A set of filters applied onto to a set of inputs in one-to-one correspondence.
- **Non overlapping Batches** - All batched filters are applied to all batched signals. The batch dimension of Signal and Filter **should not** be the same.



\page signal_func_conv2_batch_desc convolve2

For example, if the signal is two dimensional with m & n as sizes along the 0th & 1st dimensions
respectively, then the possible batch operations are as follows.

| Input Signal Dimensions | Filter Dimensions | Output Dimensions | Batch Mode | Explanation |
|:-----------------------:|:-----------------:|:-----------------:|:----------:|:------------|
| [m n 1 1] | [m n 1 1] | [m n 1 1] | No Batch  | Output will be a single convolve array |
| [m n 1 1] | [m n p 1] | [m n p 1] | Filter is Batched | p filters applied to same input |
| [m n p 1] | [m n 1 1] | [m n p 1] | Signal is Batched | 1 filter applied to p inputs |
| [m n p 1] | [m n p 1] | [m n p 1] | Identical Batches | p filters applied to p inputs in one-to-one correspondence |
| [m n p 1] | [m n 1 q] | [m n p q] | Non-overlapping batches | q filters applied to p inputs in to produce p x q results |
| [m n 1 p] | [m n q 1] | [m n q p] | Non-overlapping batches | q filters applied to p inputs in to produce q x p results |


\page signal_func_fft_desc fft

The Fast Fourier Transform (FFT) is an efficient algorithm to compute the discrete Fourier
transform (DFT) of a signal or array. This is most commonly used to convert data in the
time (or space) domain to the frequency domain, Then, the inverse FFT (iFFT) is used to
return the data to the original domain.

There are numerous algorithms to compute the FFT of an array, and the specifics of the
algorithm depend on the target hardware. Most algorithms, however, use a Cooley-Tukey
scheme in a divide-and-conquer approach.

\note There are some convenience functions provided for fft where normalization
factor is not required as input paramter. In such cases, the normalization
factor is calculated internally based on the input data provided.

*/

//=====================================================================
/**
\addtogroup arrayfire_func
@{

\defgroup signal_func_convolve convolve
\ingroup convolve_mat

\brief Convolution Integral for any dimensional data

\copydoc signal_func_conv_desc

\copydoc signal_func_conv2_batch_desc




\defgroup signal_func_convolve1 convolve1
\ingroup convolve_mat

\brief Convolution Integral for one dimensional data

\copydoc signal_func_conv_desc

For example, if the input size is m along 0th dimension, then the possible batch operations are as follows.

| Input Signal Dimensions | Filter Dimensions | Output Dimensions | Batch Mode | Explanation |
|:-----------------------:|:-----------------:|:-----------------:|:----------:|:------------|
| [m n 1 1] | [m n 1 1] | [m n 1 1] | No Batch  | Output will be a single convolve array |
| [m n 1 1] | [m n p 1] | [m n p 1] | Filter is Batched | p filters applied to same input |
| [m n p 1] | [m n 1 1] | [m n p 1] | Signal is Batched | 1 filter applied to p inputs |
| [m n p 1] | [m n p 1] | [m n p 1] | Identical Batches | p filters applied to p inputs in one-to-one correspondence |
| [m n p 1] | [m n 1 q] | [m n p q] | Non-overlapping batches | q filters applied to p inputs in to produce p x q results |
| [m n 1 p] | [m n q 1] | [m n q p] | Non-overlapping batches | q filters applied to p inputs in to produce q x p results |


\defgroup signal_func_convolve2 convolve2
\ingroup convolve_mat

\brief Convolution Integral for two dimensional data

\copydoc signal_func_conv_desc

\copydoc signal_func_conv2_batch_desc



\defgroup signal_func_convolve3 convolve3
\ingroup convolve_mat

\brief Convolution Integral for three dimensional data

\copydoc signal_func_conv_desc

For example, if the signal is three dimensional with m, n & p sizes along the 0th, 1st & 2nd dimensions
respectively, then the possible batch operations are as follows.

| Input Signal Dimensions | Filter Dimensions | Output Dimensions | Batch Mode | Explanation |
|:-----------------------:|:-----------------:|:-----------------:|:----------:|:------------|
| [m n 1 1] | [m n 1 1] | [m n 1 1] | No Batch  | Output will be a single convolve array |
| [m n 1 1] | [m n p 1] | [m n p 1] | Filter is Batched | p filters applied to same input |
| [m n p 1] | [m n 1 1] | [m n p 1] | Signal is Batched | 1 filter applied to p inputs |
| [m n p 1] | [m n p 1] | [m n p 1] | Identical Batches | p filters applied to p inputs in one-to-one correspondence |
| [m n p 1] | [m n 1 q] | [m n p q] | Non-overlapping batches | q filters applied to p inputs in to produce p x q results |
| [m n 1 p] | [m n q 1] | [m n q p] | Non-overlapping batches | q filters applied to p inputs in to produce q x p results |

===============================================================================

\defgroup signal_func_fft_convolve fftConvolve
\ingroup convolve_mat

\brief Convolution using Fast Fourier Transform

\copydoc signal_func_conv_desc

===============================================================================

\defgroup signal_func_fft_convolve2 fftConvolve2
\ingroup convolve_mat

\brief 2D Convolution using Fast Fourier Transform

\copydoc signal_func_conv_desc

===============================================================================

\defgroup signal_func_fft_convolve3 fftConvolve3
\ingroup convolve_mat

\brief 3D Convolution using Fast Fourier Transform

\copydoc signal_func_conv_desc

===============================================================================

\defgroup signal_func_fft fft
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_fft2 fft2
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_fft3 fft3
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_ifft ifft
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_ifft2 ifft2
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_ifft3 ifft3
\ingroup fft_mat

\brief Fast Fourier Transform

\copydoc signal_func_fft_desc


\defgroup signal_func_fft_r2c fftR2C
\ingroup fft_mat

\brief Real to Complex Fast Fourier Transform


\defgroup signal_func_fft_c2r fftC2R
\ingroup fft_mat

\brief Complex to Real Fast Fourier Transform


\defgroup signal_func_approx1 approx1
\ingroup approx_mat

approx1 interpolates data along the first dimensions.
It has three options for the type of interpolation to perform:
- Nearest neighbor  - \ref AF_INTERP_NEAREST
- Linear interpolation  - \ref AF_INTERP_LINEAR
- Bilinear interpolation - \ref AF_INTERP_BILINEAR
- Cubic interpolation - \ref AF_INTERP_CUBIC

\defgroup signal_func_approx2 approx2
\ingroup approx_mat

approx2 performs interpolation on data along the first and second dimensions.
It has three options for the type of interpolation to perform:
- Nearest neighbor  - \ref AF_INTERP_NEAREST
- Linear interpolation  - \ref AF_INTERP_LINEAR
- Bilinear interpolation - \ref AF_INTERP_BILINEAR
- Cubic interpolation - \ref AF_INTERP_CUBIC

\defgroup signal_func_fir fir
\ingroup sigfilt_mat

\brief This function implements a Finite Impulse Filter

Finite impulse filters take an input **x** and a co-efficient array **b** to generate an output **y** such that:

       \f$y[n] = \sum_{i = 0}^N b_i . x[n]\f$


\defgroup signal_func_iir iir
\ingroup sigfilt_mat

\brief This function implements a Infinite Impulse Filter

Iinite impulse filters take an input **x** and a feedforward array **b**, feedback array **a** to generate an output **y** such that:

       \f$\sum_{j = 0}^Q a_j . y[n] = \sum_{i = 0}^P b_i . x[n]\f$
@}
*/
