Signal Statistical Functions

Functions that provide global signal statistics like: sum, mean, standard deviation, min, max, etc.

Signal Min Every Or Max Every

MinEvery And MaxEvery Functions

Performs the min or max operation on the samples of a signal.

Functions

NppStatus nppsMinEvery_I_Ctx(NppDataType eSrcDstType, const void *pSrc, void *pSrcDst, size_t nLength, NppStreamContext nppStreamCtx)

In place min value for each pair of elements.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsMaxEvery_I_Ctx(NppDataType eSrcDstType, const void *pSrc, void *pSrcDst, size_t nLength, NppStreamContext nppStreamCtx)

In place max value for each pair of elements.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

Signal Sum

signal_min_every_or_max_every

Sum

Performs the sum operation on the samples of a signal.

Functions

NppStatus nppsSumGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsSum.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Maximum

Maximum

Performs the maximum operation on the samples of a signal.

Functions

NppStatus nppsMaxGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMax.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMaxIndxGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMaxIndx.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMaxAbsGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMaxAbs.

Supported data types include NPP_16S, NPP_32S.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMaxAbsIndxGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMaxAbsIndx.

Supported data types include NPP_16S, NPP_32S.

Parameters
Returns

NPP_SUCCESS

Signal Minimum

Minimum

Performs the minimum operation on the samples of a signal.

Functions

NppStatus nppsMinGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMin.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMinIndxGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMinIndx.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMinAbsGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMinAbs.

Supported data types include NPP_16S, NPP_32S.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMinAbsIndxGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMinAbsIndx.

Supported data types include NPP_16S, NPP_32S.

Parameters
Returns

NPP_SUCCESS

Signal Mean

Mean

Performs the mean operation on the samples of a signal.

Functions

NppStatus nppsMeanGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMean.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal StdDev

Standard Deviation

Calculates the standard deviation for the samples of a signal.

Functions

NppStatus nppsStdDevGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsStdDev.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Mean And StdDev

Mean And Standard Deviation

Performs the mean and calculates the standard deviation for the samples of a signal.

Functions

NppStatus nppsMeanStdDevGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device scratch buffer size (in bytes) for nppsMeanStdDev.

Supported data types include NPP_16S, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal MinMax

Minimum Maximum

Performs the maximum and the minimum operation on the samples of a signal.

Functions

NppStatus nppsMinMaxGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsMinMax.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32U, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMinMax_Ctx(NppDataType eSrcDstType, const void *pSrc, size_t nLength, void *pMin, void *pMax, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Vector min and max method Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32U, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsMinMaxIndxGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsMinMaxIndx_8u.

Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32S, NPP_32U, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsMinMaxIndx_Ctx(NppDataType eSrcDstType, const void *pSrc, size_t nLength, void *pMin, int *pMinIndx, void *pMax, int *pMaxIndx, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Vector min and max with indices method Supported data types include NPP_8U, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

Signal Norms

Signal Norm Inf

Infinity Norm

Performs the infinity norm on the samples of a signal.

Functions

NppStatus nppsNormInfGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNorm_Inf.

Supported data types include NPP_32S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Norm L1

L1 Norm

Performs the L1 norm on the samples of a signal.

Functions

NppStatus nppsNormL1GetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNorm_L1.

Supported data types include NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Norm L2

L2 Norm

Performs the L2 norm on the samples of a signal.

Functions

NppStatus nppsNormL2GetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNorm_L2.

Supported data types include NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Norm Inf NormDiff

Infinity Norm Diff

Performs the infinity norm on the samples of two input signals’ difference.

Functions

NppStatus nppsNormDiffInfGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNormDiff_Inf.

Supported data types include NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Norm L1 NormDiff

L1 Norm Diff

Performs the L1 norm on the samples of two input signals’ difference.

Functions

NppStatus nppsNormDiffL1GetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNormDiff_L1.

Supported data types include NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Norm L2 NormDiff

L2 Norm Diff

Performs the L2 norm on the samples of two input signals’ difference.

Functions

NppStatus nppsNormDiffL2GetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsNormDiff_L2.

Supported data types include NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Dot Product

Dot Product

Performs the dot product operation on the samples of two input signals.

Functions

NppStatus nppsDotProdGetBufferSize_Ctx(NppDataType eDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsDotProd.

Supported data types include NPP_16S, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

NppStatus nppsDotProd_Ctx(NppDataType eSrcType, NppDataType eDstType, const void *pSrc1, const void *pSrc2, size_t nLength, void *pDp, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

dot product method, return value is eDstType.

Supported source data types include NPP_16S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsDotProd_Sfs_Ctx(NppDataType eSrcType, NppDataType eDstType, const void *pSrc1, const void *pSrc2, size_t nLength, void *pDp, int nScaleFactor, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Integer dot product method, return value is eDstType.

Supported source data types include NPP_16S, NPP_32S.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

Signal Count In Range

Count In Range

Calculates the number of elements from specified range in the samples of a signal.

Signal Count Zero Crossings

Count Zero Crossings

Calculates the number of zero crossings in a signal.

Signal Maximum Error

MaximumError

Primitives for computing the maximum error between two signals. Given two signals \(pSrc1\) and \(pSrc2\) both with length \(N\), the maximum error is defined as the largest absolute difference between the corresponding elements of two signals.

If the signal is in complex format, the absolute value of the complex number is used.

Functions

NppStatus nppsMaximumError_Ctx(NppDataType eSrcDstType, const void *pSrc1, const void *pSrc2, size_t nLength, Npp64f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Maximum error method.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsMaximumErrorGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsMaximumError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Average Error

AverageError

Primitives for computing the Average error between two signals. Given two signals \(pSrc1\) and \(pSrc2\) both with length \(N\), the average error is defined as

\[Average Error = \frac{1}{N}\sum_{n=0}^{N-1}\left|pSrc1(n) - pSrc2(n)\right|\]

If the signal is in complex format, the absolute value of the complex number is used.

Functions

NppStatus nppsAverageError_Ctx(NppDataType eSrcDstType, const void *pSrc1, const void *pSrc2, size_t nLength, Npp64f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

Average error method.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsAverageErrorGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsAverageError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Maximum Relative Error

MaximumRelativeError

Primitives for computing the MaximumRelative error between two signals. Given two signals \(pSrc1\) and \(pSrc2\) both with length \(N\), the maximum relative error is defined as

\[MaximumRelativeError = max{\frac{\left|pSrc1(n) - pSrc2(n)\right|}{max(\left|pSrc1(n)\right|, \left|pSrc2(n)\right|)}}\]

Functions

NppStatus nppsMaximumRelativeError_Ctx(NppDataType eSrcDstType, const void *pSrc1, const void *pSrc2, size_t nLength, Npp64f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

MaximumRelative error method.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsMaximumRelativeErrorGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsMaximumRelativeError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS

Signal Average Relative Error

AverageRelativeError

Primitives for computing the AverageRelative error between two signals. Given two signals \(pSrc1\) and \(pSrc2\) both with length \(N\), the average relative error is defined as

\[AverageRelativeError = \frac{1}{N}\sum_{n=0}^{N-1}\frac{\left|pSrc1(n) - pSrc2(n)\right|}{max(\left|pSrc1(n)\right|, \left|pSrc2(n)\right|)}\]

Functions

NppStatus nppsAverageRelativeError_Ctx(NppDataType eSrcDstType, const void *pSrc1, const void *pSrc2, size_t nLength, Npp64f *pDst, Npp8u *pDeviceBuffer, NppStreamContext nppStreamCtx)

AverageRelative error method.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

Signal Data Related Error Codes, Length Related Error Codes.

NppStatus nppsAverageRelativeErrorGetBufferSize_Ctx(NppDataType eSrcDstType, size_t nLength, size_t *hpBufferSize, NppStreamContext nppStreamCtx)

Device-buffer size (in bytes) for nppsAverageRelativeError.

Supported data types include NPP_8U, NPP_8S, NPP_16U, NPP_16S, NPP_32U, NPP_32S, NPP_64S, NPP_32F, NPP_64F.

Parameters
Returns

NPP_SUCCESS