ToneInitAllocQ15

Allocates memory and initializes the tone generator specification structure for fixed point data.

Syntax

IppStatus ippsToneInitAllocQ15_16s(IppToneState_16s** ppToneState, Ipp16s magn, Ipp16s rFreqQ15, Ipp32s phaseQ15);

Parameters

ppToneState

Double pointer to the tone generator specification structure.

magn

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

phaseQ15

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

rFreqQ15

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

Description

The function ippsToneInitAllocQ15 is declared in the ipps.h file. This function allocates memory and initializes the tone generator structure pToneState with the specified frequency rFreqQ15, phase phaseQ15, and magnitude magn. Input data in the fixed point format Q15 are converted to the corresponding float data type that lay in the range [0, 0.5) for relative frequency and [0, 2p) for phase. 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.

Code example demonstrates how to use the function ippsToneInitAllocQ15.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pToneState pointer is NULL.

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.

Submit feedback on this help topic

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