Community
cancel
Showing results for 
Search instead for 
Did you mean: 
thomtek
Beginner
98 Views

ippsWinKaiser_32f_I fails for many length & alpha values

I'm usingippsWinKaiser_32f_I(Ipp32f* pSrcDst, int len, float alpha) from v7.0.5. On both x86 and x64 systems.

I have found that if the value"prod = alpha * (len-1)/2"> ~39 (where len and alpha are arg values to the function), the functionreturns an error code and does not calculate the requested window points. The error code and string returned is (-39), "ippStsHugeWinErr: Kaiser window is too huge".

For example, for len = 40, any alpha > 1.9 causes the function error. For len = 100, alpha > 0.77 causes the error. The _64f version does not appear to have this problem.

Here is example code for len=40:

void Test_ippsWinKaiser_32f_I(void)

{

Ipp32s LEN = 40; // LEN can be varied

Ipp32f* pDst = ippsMalloc_32f(LEN);

for (Ipp32s n=0 ; n

pDst = 0.0f;

Ipp32f beg=36.0f, end=42.0f, step=1.0f; // range to trap error, happens around prod=39

for (Ipp32f prod=beg ; prod<=end ; prod+=step) // loop thru range in steps

{

Ipp32f alpha = prod / (Ipp32f)(LEN-1)*2.0f; // calc alpha related to prod & LEN

IppStatus s=ippsWinKaiser_32f_I(pDst, LEN, alpha);

printf("Len = %i, Prod = %.5f, Alpha = %.5f", LEN, prod, alpha);

if (s != ippStsNoErr) // print when error detected.

{

printf(" ---> err=%i, msg=\\"%s\\"",

(int)s, ippGetStatusString(s));

}

printf("\\n");

}

ippsFree(pDst);

}

The output in this case is:
Len = 40, Prod = 36.00000, Alpha = 1.84615
Len = 40, Prod = 37.00000, Alpha = 1.89744
Len = 40, Prod = 38.00000, Alpha = 1.94872 ---> err=-39, msg="ippStsHugeWinErr: Kaiser window is too huge"
Len = 40, Prod = 39.00000, Alpha = 2.00000 ---> err=-39, msg="ippStsHugeWinErr: Kaiser window is too huge"
Len = 40, Prod = 40.00000, Alpha = 2.05128 ---> err=-39, msg="ippStsHugeWinErr: Kaiser window is too huge"
Len = 40, Prod = 41.00000, Alpha = 2.10256 ---> err=-39, msg="ippStsHugeWinErr: Kaiser window is too huge"
Len = 40, Prod = 42.00000, Alpha = 2.15385 ---> err=-39, msg="ippStsHugeWinErr: Kaiser window is too huge"

0 Kudos
2 Replies
igorastakhov
New Contributor II
98 Views

Hi,

it's designed behavior:

#define IPP_MAX_EXP64f 308

#define IPP_MAX_EXP32f 38

#define IPP_HUGE_WIN_RET(alpha,N) \

IPP_BADARG_RET(fabs(alpha)*(N-1)/2 > IPP_MAX_EXP64f, ippStsHugeWinErr)

#define IPP_HUGE_WIN2_RET(alpha,N) \

IPP_BADARG_RET(fabs(alpha)*(N-1)/2 > IPP_MAX_EXP32f, ippStsHugeWinErr)

Take a look at the Kaiser window formula and you'll uderstand the reason of such limitation. If you really need so huge alphas - use 64f flavor of this function

Regards,
Igor

thomtek
Beginner
98 Views

Thanks, that makes sense. We'll handle it appropriately now that we know the reason.

It would be helpful ifthis restriction could be added to the Ref manual.
Reply