ToneQ15

Generates a tone with a frequency, phase, and magnitude specified in the tone generator structure.

Syntax

IppStatus ippsToneQ15_16s(Ipp16s* pDst, int len, IppToneState_16s* pToneState);

Parameters

pDst

Pointer to the array which stores the samples.

len

Number of samples to be computed.

pToneState

Pointer to the tone generator specification structure.

Description

The function ippsToneQ15 is declared in the ipps.h file. This function generates the tone with the frequency, phase, and magnitude parameters that are specified in the previously created structure pToneState. 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.

Example  below demonstrates how to use the function ippsToneQ15.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pDst or pToneState pointer is NULL.

ippStsSizeErr

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

Using Tone Generating Functions

void func_toneq15()
{
    IppToneState_16s *TS; 
    Ipp16s magn = 4095;
    Ipp16s rFreqQ15 = 512;
    Ipp16s phaseQ15 = 0;
    Ipp16s* pDst;
    IppStatus status;
		
    status = ippsToneInitAllocQ15_16s(&TS,magn,rFreqQ15,phaseQ15);
    if(ippStsNoErr != status)
      printf("IPP Error: %s",ippGetStatusString(status));

		
    status = ippsToneQ15_16s(pDst,rFreqQ15,TS);
    if(ippStsNoErr != status)
      printf("IPP Error: %s",ippGetStatusString(status));
}
result:




Submit feedback on this help topic

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