TriangleQ15_Direct

Generates a triangle with a given frequency, phase, and magnitude for fixed point data.

Syntax

IppStatus ippsTriangleQ15_Direct_16s(Ipp16s* pDst, int len, Ipp16s magn, Ipp16s rFreqQ15, Ipp32s phaseQ15, Ipp32s asymQ15);

Parameters

pDst

Pointer to the array which stores the samples.

magn

Magnitude of the tone, that is, the maximum value attained by the wave.

rFreqQ15

Frequency of the tone relative to the sampling frequency in Q0.15 format. It must be in the range [0, 16383].

phaseQ15

Phase of the tone relative to a cosine wave in Q16.15 format. It must be in the range [0, 205886].

asymQ15

Asymmetry h of a triangle in Q16.15 format. It must be in the range [-102943, 102943]. If h=0, then the triangle is symmetric and a direct analog of a tone.

Description

The function ippsTriangleQ15_Direct is declared in the ipps.h file. This function generates the triangle with the specified magnitude magn, frequency rFreqQ15, phase pPhaseQ15, and asymmetry asymQ15. Input data in the fixed point format Q15 format are converted to the corresponding float data type that lay in the range [0, 0.5) for the relative frequency, [0, 2π) for the phase, and [- π, π) for the asymmetry.

Q16.15 designates that 16 bits before and 15 bits after fixed point position are used to present a 32-bit value in the fixed point format. Q0.15 designates that 0 bits before and 15 bits after fixed point position are used to present a 16-bit value in the fixed point format.

The function computes len samples of the tone, and stores them in the array pDst. Generated values x[n] are computed using the same formulas as in the function ippsTriangle_Direct for computing real triangles.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to zero.

ippStsToneMagnErr

Indicates an error when magn is less than or equal to zero.

ippStsToneFreqErr

Indicates an error when rFreqQ15 is negative, or greater than 16383.

ippStsTonePhaseErr

Indicates an error when the phaseQ15 value is negative, or greater than 205886.

ippStsTriangleAsymErr

Indicates an error when the asymQ15 value is less than -102943 or greater than 102943.

Submit feedback on this help topic

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