TriangleInitQ15

Initializes the triangle generator specification structure for fixed point data.

Syntax

IppStatus ippsTriangleInitQ15_16s(IppTriangleState_16s* pTriangleState, Ipp16s magn, Ipp16s rFreqQ15, Ipp32s phaseQ15, Ipp32s asymQ15);

Parameters

pTriangleState

Pointer to the triangle generator specification structure.

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 ippsTriangleInitQ15 is declared in the ipps.h file. This function initializes the triangle generator structure pTriangleState with the specified magnitude magn, frequency rFreqQ15, phase phaseQ15, and asymmetry asymQ15. The structure is allocated in the external buffer, the size of which must be computed by the function ippsTriangleGetStateSizeQ15. 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, 2p) for the phase, and (-p, p) 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.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pTriandleState pointer is NULL.

ippStsTriangleMagnErr

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

ippStsTriangleFreqErr

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

ippStsTrianglePhaseErr

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.