ToneQ15_Direct

Generates a tone with a given frequency, phase, and magnitude.

Syntax

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

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].

Description

The function ippsToneQ15_Direct is declared in the ipps.h file. This function generates the tone with the specified frequency rFreqQ15, phase pPhaseQ15, and magnitude magn. Data in Q15 format are converted to the corresponding float data type that lay in the range [0, 0.5) for relative frequency and [0, 2π ) 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.

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 ippsTone_Direct for computing real tones.

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.

Submit feedback on this help topic

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