Conv

Performs finite, linear convolution of two vectors.

Syntax

IppStatus ippsConv_32f(const Ipp32f* pSrc1, int src1Len, const Ipp32f* pSrc2, int src2Len, Ipp32f* pDst);

IppStatus ippsConv_64f(const Ipp64f* pSrc1, int src1Len, const Ipp64f* pSrc2, int src2Len, Ipp64f* pDst);

IppStatus ippsConv_16s_Sfs(const Ipp16s* pSrc1, int src1Len, const Ipp16s* pSrc2, int src2Len, Ipp16s* pDst, int scaleFactor);

Parameters

pSrc1, pSrc2

Pointers to the source vectors.

src1Len

Number of elements in the vector pSrc1.

src2Len

Number of elements in the vector pSrc2.

pDst

Pointer to the destination vector.

scaleFactor

Scale factor, refer to Integer Scaling.

Description

The function ippsConv is declared in the ipps.h file. This function performs finite linear convolution of two sequences. The src1Len elements of the vector pSrc1 is convolved with the src2Len elements of the vector pSrc2 to produce an (src1Len + src2Len - 1)-length vector pDst. The result of the convolution is defined as follows:



Here pSrc1[i] = 0, if i ≥ src1Len, and pSrc2[j]= 0, if j ≥ src2Len.

The example below shows the code for the convolution of two vectors using ippsConv_16s_Sfs function.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pDst or pSrc pointer is NULL.

ippStsSizeErr

Indicates an error when src1Len or src2Len is less than or equal to 0.

ippStsMemAllocErr

Indicates an error when there is not enough memory for internal buffers.

Using the Function ippsConv to Convolve Two Vectors

IppStatus convolution(void) {
      Ipp16s x[5] = {-2,0,1,-1,3}, h[2] = {0,1}, y[6];
      IppStatus st = ippsConv_16s_Sfs(x, 5, h, 2, y, 0);
      printf_16s(“conv =”, y, 6, st);
      return st;
}
Output: 
    conv = 0 -2 0 1 -1 3
Matlab* Analog: 
                 >> x = [-2,0,1,-1,3]; h = [0,1]; y = conv(x,h)

	

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.