Spread

Computes spreading function.

Syntax

IppStatus ippsSpread_16s_Sfs(Ipp16s* Src1, Ipp16s Src2, int inScaleFactor, Ipp16s* pDst);

Parameters

Src1

Input data 1.

Src2

Input data 2.

inScaleFactor

Input value scalefactor value.

pDst

Pointer to the output data vector, output data is in Q15 format.

Description

The function ippsSpread is declared in the ippac.h file. This function gives a masking threshold produced by a single tone masker frequency Src2 (in Bark) for neighboring frequency Src1 (in Bark). This function is widely used in psychoacoustics.

Below see code example  of using ippsSpread_16s_Sfs function.

The function ippsSpread_16s_Sfs is used in the fixed-point version of AAC encoder included into IPP Samples downloadable from http://www.intel.com/cd/software/products/asmo-na/eng/220046.htm.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when pDst pointer is NULL.

ippsSpread Usage  

// Function ippsSpread_16s_Sfs calculates spread(b1,b2) value 
// using the following formula:
// tmpx = (b2 >= b1) ? 3*(b2-b1) : 1.5f*(b2-b1);
// tmpz = 8 * ((tmpx-0.5f)*(tmpx-0.5f) - 2*(tmpx-0.5f));
// if (tmpz > 0) tmpz = 0;
// tmpy = 15.811389f + 7.5f*(tmpx + 0.474f)-
// 17.5f*(float)sqrt(1 + (tmpx+0.474f)*(tmpx+0.474f));
//
// spread = (tmpy < -100 ? 0 : (float)pow(10,(float)(tmpz + tmpy)/10));
// The output of ippsSpread_16s_Sfs in Q15 format.

		
IppStatus spread(void)
{
   Ipp16s b1 = 18668; /* 9.115234 in Q11 */
   Ipp16s b2 = 20255; /* 9.890137 in Q11 */
   Ipp16s dst;
   IppStatus st = ippsSpread_16s_Sfs(b1, b2, -11, &dst);

		
   printf ("dst = %i\n", dst);
   return st;
}

		
//Output:
//   dst = 547

Submit feedback on this help topic

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