Signal processing functions (fft, convolve, etc).
arrayfire.signal.
approx1
(signal, x, method=<INTERP.LINEAR: 1>, off_grid=0.0, xp=None, output=None)[source]¶
Interpolate along a single dimension.Interpolation is performed along axis 0 of the input array.
Input signal array (signal = f(x))
The x-coordinates of the interpolation points. The interpolation function is queried at these set of points.
Interpolation method.
The value used for positions outside the range.
The x-coordinates of the input data points
Optional preallocated output array. If it is a sub-array of an existing af_array, only the corresponding portion of the af_array will be overwritten
Values calculated at interpolation points.
arrayfire.signal.
approx1_uniform
(signal, x, interp_dim, idx_start, idx_step, method=<INTERP.LINEAR: 1>, off_grid=0.0, output=None)[source]¶
Interpolation on one dimensional signals along specified dimension.
af_approx1_uniform() accepts the dimension to perform the interpolation along the input. It also accepts start and step values which define the uniform range of corresponding indices.
Input signal array (signal = f(x))
The x-coordinates of the interpolation points. The interpolation function is queried at these set of points.
is the dimension to perform interpolation across.
is the first index value along interp_dim.
is the uniform spacing value between subsequent indices along interp_dim.
Interpolation method.
The value used for positions outside the range.
Optional preallocated output array. If it is a sub-array of an existing af_array, only the corresponding portion of the af_array will be overwritten
Values calculated at interpolation points.
arrayfire.signal.
approx2
(signal, x, y, method=<INTERP.LINEAR: 1>, off_grid=0.0, xp=None, yp=None, output=None)[source]¶
Interpolate along a two dimension.Interpolation is performed along axes 0 and 1 of the input array.
Input signal array (signal = f(x, y))
The x-coordinates of the interpolation points. The interpolation function is queried at these set of points.
The y-coordinates of the interpolation points. The interpolation function is queried at these set of points.
Interpolation method.
The value used for positions outside the range.
The x-coordinates of the input data points. The convention followed is that the x-coordinates vary along axis 0
The y-coordinates of the input data points. The convention followed is that the y-coordinates vary along axis 1
Optional preallocated output array. If it is a sub-array of an existing af_array, only the corresponding portion of the af_array will be overwritten
Values calculated at interpolation points.
arrayfire.signal.
approx2_uniform
(signal, pos0, interp_dim0, idx_start0, idx_step0, pos1, interp_dim1, idx_start1, idx_step1, method=<INTERP.LINEAR: 1>, off_grid=0.0, output=None)[source]¶
Interpolate along two uniformly spaced dimensions of the input array. af_approx2_uniform() accepts two dimensions to perform the interpolation along the input. It also accepts start and step values which define the uniform range of corresponding indices.
Input signal array (signal = f(x, y))
positions of the interpolation points along interp_dim0.
is the first dimension to perform interpolation across.
is the first index value along interp_dim0.
is the uniform spacing value between subsequent indices along interp_dim0.
positions of the interpolation points along interp_dim1.
is the second dimension to perform interpolation across.
is the first index value along interp_dim1.
is the uniform spacing value between subsequent indices along interp_dim1.
Interpolation method.
The value used for positions outside the range.
Optional preallocated output array. If it is a sub-array of an existing af_array, only the corresponding portion of the af_array will be overwritten
Values calculated at interpolation points.
arrayfire.signal.
convolve
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>, conv_domain=<CONV_DOMAIN.AUTO: 0>)[source]¶
Non batched Convolution.
This function performs n-dimensional convolution based on input dimensionality.
An n-dimensional array.
A n-dimensional kernel.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Specifies the domain in which convolution is performed.
af.CONV_DOMAIN.SPATIAL: Performs convolution in spatial domain.
af.CONV_DOMAIN.FREQ: Performs convolution in frequency domain.
af.CONV_DOMAIN.AUTO: Switches between spatial and frequency based on input size.
Output of n-dimensional convolution.
arrayfire.signal.
convolve1
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>, conv_domain=<CONV_DOMAIN.AUTO: 0>)[source]¶
Convolution: 1D
A 1 dimensional signal or batch of 1 dimensional signals.
A 1 dimensional kernel or batch of 1 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Specifies the domain in which convolution is performed.
af.CONV_DOMAIN.SPATIAL: Performs convolution in spatial domain.
af.CONV_DOMAIN.FREQ: Performs convolution in frequency domain.
af.CONV_DOMAIN.AUTO: Switches between spatial and frequency based on input size.
Output of 1D convolution.
arrayfire.signal.
convolve2
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>, conv_domain=<CONV_DOMAIN.AUTO: 0>)[source]¶
Convolution: 2D
A 2 dimensional signal or batch of 2 dimensional signals.
A 2 dimensional kernel or batch of 2 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Specifies the domain in which convolution is performed.
af.CONV_DOMAIN.SPATIAL: Performs convolution in spatial domain.
af.CONV_DOMAIN.FREQ: Performs convolution in frequency domain.
af.CONV_DOMAIN.AUTO: Switches between spatial and frequency based on input size.
Output of 2D convolution.
arrayfire.signal.
convolve2NN
(signal, kernel, stride=(1, 1), padding=(0, 0), dilation=(1, 1))[source]¶
This version of convolution is consistent with the machine learning formulation that will spatially convolve a filter on 2-dimensions against a signal. Multiple signals and filters can be batched against each other. Furthermore, the signals and filters can be multi-dimensional however their dimensions must match.
Signals with dimensions: d0 x d1 x d2 x Ns Filters with dimensions: d0 x d1 x d2 x Nf
Resulting Convolution: d0 x d1 x Nf x Ns
A 2 dimensional signal or batch of 2 dimensional signals.
A 2 dimensional kernel or batch of 2 dimensional kernels.
Specifies how much to stride along each dimension
Specifies signal padding along each dimension
Specifies how much to dilate kernel along each dimension before convolution
Convolved 2D array.
arrayfire.signal.
convolve2_separable
(col_kernel, row_kernel, signal, conv_mode=<CONV_MODE.DEFAULT: 0>)[source]¶
Convolution: 2D separable convolution
A column vector to be applied along each column of signal
A row vector to be applied along each row of signal
A 2 dimensional signal or batch of 2 dimensional signals.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Output of 2D sepearable convolution.
arrayfire.signal.
convolve3
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>, conv_domain=<CONV_DOMAIN.AUTO: 0>)[source]¶
Convolution: 3D
A 3 dimensional signal or batch of 3 dimensional signals.
A 3 dimensional kernel or batch of 3 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Specifies the domain in which convolution is performed.
af.CONV_DOMAIN.SPATIAL: Performs convolution in spatial domain.
af.CONV_DOMAIN.FREQ: Performs convolution in frequency domain.
af.CONV_DOMAIN.AUTO: Switches between spatial and frequency based on input size.
Output of 3D convolution.
arrayfire.signal.
dft
(signal, odims=(None, None, None, None), scale=None)[source]¶
Non batched Fourier transform.
This function performs n-dimensional fourier transform depending on the input dimensions.
A multi dimensional arrayfire array.
If None, calculated to be signal.dims()
Scale factor for the fourier transform.
If none, calculated to be 1.0.
A complex array that is the ouput of n-dimensional fourier transform.
arrayfire.signal.
fft
(signal, dim0=None, scale=None)[source]¶
Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the full output of the fft.
arrayfire.signal.
fft2
(signal, dim0=None, dim1=None, scale=None)[source]¶
Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the full output of the fft.
arrayfire.signal.
fft2_c2r
(signal, is_odd=False, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies if the first dimension of output should be even or odd.
Specifies the scaling factor.
If None, scale is set to 1 / (signal.dims()[0] * signal.dims()[1]).
A real af.Array containing the full output of the fft.
arrayfire.signal.
fft2_inplace
(signal, scale=None)[source]¶
In-place Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.
arrayfire.signal.
fft2_r2c
(signal, dim0=None, dim1=None, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the non-redundant parts of the full FFT.
arrayfire.signal.
fft3
(signal, dim0=None, dim1=None, dim2=None, scale=None)[source]¶
Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the size of the output.
If None, dim2 is calculated to be the third dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the full output of the fft.
arrayfire.signal.
fft3_c2r
(signal, is_odd=False, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies if the first dimension of output should be even or odd.
Specifies the scaling factor.
If None, scale is set to 1 / (signal.dims()[0] * signal.dims()[1] * signal.dims()[2]).
A real af.Array containing the full output of the fft.
arrayfire.signal.
fft3_inplace
(signal, scale=None)[source]¶
In-place Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.
arrayfire.signal.
fft3_r2c
(signal, dim0=None, dim1=None, dim2=None, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the size of the output.
If None, dim2 is calculated to be the third dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the non-redundant parts of the full FFT.
arrayfire.signal.
fft_c2r
(signal, is_odd=False, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies if the first dimension of output should be even or odd.
Specifies the scaling factor.
If None, scale is set to 1 / (signal.dims()[0]).
A real af.Array containing the full output of the fft.
arrayfire.signal.
fft_convolve
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>)[source]¶
Non batched FFT Convolution.
This function performs n-dimensional convolution based on input dimensionality.
An n-dimensional array.
A n-dimensional kernel.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Output of n-dimensional convolution.
arrayfire.signal.
fft_convolve1
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>)[source]¶
FFT based Convolution: 1D
A 1 dimensional signal or batch of 1 dimensional signals.
A 1 dimensional kernel or batch of 1 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Output of 1D convolution.
arrayfire.signal.
fft_convolve2
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>)[source]¶
FFT based Convolution: 2D
A 2 dimensional signal or batch of 2 dimensional signals.
A 2 dimensional kernel or batch of 2 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Output of 2D convolution.
arrayfire.signal.
fft_convolve3
(signal, kernel, conv_mode=<CONV_MODE.DEFAULT: 0>)[source]¶
FFT based Convolution: 3D
A 3 dimensional signal or batch of 3 dimensional signals.
A 3 dimensional kernel or batch of 3 dimensional kernels.
Specifies if the output does full convolution (af.CONV_MODE.EXPAND) or maintains the same size as input (af.CONV_MODE.DEFAULT).
Output of 3D convolution.
arrayfire.signal.
fft_inplace
(signal, scale=None)[source]¶
In-place Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.
arrayfire.signal.
fft_r2c
(signal, dim0=None, scale=None)[source]¶
Real to Complex Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.
A complex af.Array containing the non-redundant parts of the full FFT.
arrayfire.signal.
fir
(B, X)[source]¶
Finite impulse response filter.
A 1 dimensional array containing the coefficients of the filter.
A 1 dimensional array containing the signal.
The output of the filter.
arrayfire.signal.
idft
(signal, scale=None, odims=(None, None, None, None))[source]¶
Non batched Inverse Fourier transform.
This function performs n-dimensional inverse fourier transform depending on the input dimensions.
A multi dimensional arrayfire array.
If None, calculated to be signal.dims()
Scale factor for the fourier transform.
If none, calculated to be 1.0 / signal.elements()
A complex array that is the ouput of n-dimensional inverse fourier transform.
arrayfire.signal.
ifft
(signal, dim0=None, scale=None)[source]¶
Inverse Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.0 / (dim0)
A complex af.Array containing the full output of the inverse fft.
arrayfire.signal.
ifft2
(signal, dim0=None, dim1=None, scale=None)[source]¶
Inverse Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.0 / (dim0 * dim1)
A complex af.Array containing the full output of the inverse fft.
arrayfire.signal.
ifft2_inplace
(signal, scale=None)[source]¶
Inverse In-place Fast Fourier Transform: 2D
A 2 dimensional signal or a batch of 2 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.0 / (signal.dims()[0] * signal.dims()[1])
arrayfire.signal.
ifft3
(signal, dim0=None, dim1=None, dim2=None, scale=None)[source]¶
Inverse Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies the size of the output.
If None, dim0 is calculated to be the first dimension of signal.
Specifies the size of the output.
If None, dim1 is calculated to be the second dimension of signal.
Specifies the size of the output.
If None, dim2 is calculated to be the third dimension of signal.
Specifies the scaling factor.
If None, scale is set to 1.0 / (dim0 * dim1 * dim2).
A complex af.Array containing the full output of the inverse fft.
arrayfire.signal.
ifft3_inplace
(signal, scale=None)[source]¶
Inverse In-place Fast Fourier Transform: 3D
A 3 dimensional signal or a batch of 3 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.0 / (signal.dims()[0] * signal.dims()[1] * signal.dims()[2]).
arrayfire.signal.
ifft_inplace
(signal, scale=None)[source]¶
Inverse In-place Fast Fourier Transform: 1D
A 1 dimensional signal or a batch of 1 dimensional signals.
Specifies the scaling factor.
If None, scale is set to 1.0 / (signal.dims()[0])
arrayfire.signal.
iir
(B, A, X)[source]¶
Infinite impulse response filter.
A 1 dimensional array containing the feed forward coefficients of the filter.
A 1 dimensional array containing the feed back coefficients of the filter.
A 1 dimensional array containing the signal.
The output of the filter.
arrayfire.signal.
medfilt
(signal, w0=3, w1=3, edge_pad=<PAD.ZERO: 0>)[source]¶
Apply median filter for the signal.
A 2 D arrayfire array representing a signal, or
A multi dimensional array representing batch of signals.
The length of the filter along the first dimension.
The length of the filter along the second dimension.
Flag specifying how the median at the edge should be treated.
The signal after median filter is applied.
arrayfire.signal.
medfilt1
(signal, length=3, edge_pad=<PAD.ZERO: 0>)[source]¶
Apply median filter for the signal.
A 1 D arrayfire array representing a signal, or
A multi dimensional array representing batch of signals.
The length of the filter.
Flag specifying how the median at the edge should be treated.
The signal after median filter is applied.
arrayfire.signal.
medfilt2
(signal, w0=3, w1=3, edge_pad=<PAD.ZERO: 0>)[source]¶
Apply median filter for the signal.
A 2 D arrayfire array representing a signal, or
A multi dimensional array representing batch of signals.
The length of the filter along the first dimension.
The length of the filter along the second dimension.
Flag specifying how the median at the edge should be treated.
The signal after median filter is applied.
arrayfire.signal.
set_fft_plan_cache_size
(cache_size)[source]¶
Sets plan cache size.
the number of plans that shall be cached
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4