Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

SampleUp

Up-samples a signal, conceptually increasing its sampling rate by an integer factor.

Syntax

IppStatus ippsSampleUp_16s (const Ipp16s* pSrc, int srcLen, Ipp16s* pDst, int* pDstLen, int factor, int* pPhase);

IppStatus ippsSampleUp_32f (const Ipp32f* pSrc, int srcLen, Ipp32f* pDst, int* pDstLen, int factor, int* pPhase);

IppStatus ippsSampleUp_64f (const Ipp64f* pSrc, int srcLen, Ipp64f* pDst, int* pDstLen, int factor, int* pPhase);

IppStatus ippsSampleUp_16sc (const Ipp16sc* pSrc, int srcLen, Ipp16sc* pDst, int* pDstLen, int factor, int* pPhase);

IppStatus ippsSampleUp_32fc (const Ipp32fc* pSrc, int srcLen, Ipp32fc* pDst, int* pDstLen, int factor, int* pPhase);

IppStatus ippsSampleUp_64fc (const Ipp64fc* pSrc, int srcLen, Ipp64fc* pDst, int* pDstLen, int factor, int* pPhase);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pSrc

Pointer to the source array (the signal to be up-sampled).

srcLen

Number of samples in the source array pSrc.

pDst

Pointer to the destination array.

pDstLen

Pointer to the length of the destination array pDst.

factor

Factor by which the signal is up-sampled. That is, factor -1 zeros are inserted after each sample of the source array pSrc.

pPhase

Pointer to the input phase value which determines where each sample from pSrc lies within each output block of factor samples in pDst. The value of pPhase is required to be in the range [0; factor-1].

Description

This function up-samples the srcLen-length source array pSrc by factor factor with phase pPhase, and stores the result in the array pDst, ignoring its length value by the pDstLen address.

Up-sampling inserts factor-1 zeros between each sample of pSrc. The pPhase argument determines where each sample from the input array lies within each output block of factor samples. The value of pPhase is required to be in the range [0; factor-1].

For example, if the input phase is 0, then every factor samples of the destination array begin with the corresponding source array sample, the other factor-1 samples are equal to 0. The length of the destination array is stored by the pDstLen address.

The pPhase value is the phase of an source array sample. It is also a returned output phase which can be used as an input phase for the first sample in the next block to process. Use pPhase for block mode processing to get a continuous output signal.

The ippsSampleUp functionality can be described as follows:

pDst[factor* n + phase] = pSrc[n], 0 n < srcLen

pDst[factor* n + m] = 0, 0 n < srcLen, 0 m< factor, m ≠ phase

pDstLen = factor * srcLen.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error if the pDst, pSrc, pDstLen, or pPhase pointer is NULL.

ippStsSizeErr

Indicates an error if srcLen is less than or equal to 0.

ippStsSampleFactorErr

Indicates an error if factor is less than or equal to 0.

ippStsSamplePhaseErr

Indicates an error when pPhase is negative, or bigger than or equal to factor.