IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
15.2 Global constants


15.2 Global constants

These constants specify what part of the result the convolve and correlate functions of this module return. Each of the following examples assumes that the following code has been executed:

arr = numarray.arange(8)

FULL
Return the full convolution or correlation of two arrays.
>>> conv.correlate(arr, [1, 2, 3], mode=conv.FULL)
array([ 0,  3,  8, 14, 20, 26, 32, 38, 20,  7])

PASS
Correlate the arrays without padding the data.
>>> conv.correlate(arr, [1, 2, 3], mode=conv.PASS)
array([ 0,  8, 14, 20, 26, 32, 38,  7])

SAME
Return the part of the convolution or correlation of two arrays that corresponds to an array of the same shape as the input data.
>>> conv.correlate(arr, [1, 2, 3], mode=conv.SAME)
array([ 3,  8, 14, 20, 26, 32, 38, 20])

VALID
Return the valid part of the convolution or correlation of two arrays.
>>> conv.correlate(arr, [1, 2, 3], mode=conv.VALID)
array([ 8, 14, 20, 26, 32, 38])

Send comments to the NumArray community.