Quantcast
Channel: Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1294

Wrong results with ippsFIRSR_32fc and ippAlgAuto

$
0
0

Hello,

I get wrong results with the ippsFIRSR_32fc functions and ippAlgAuto or ippAlgFFT mode. With mode ippAlgDirect it seems to work. I'm using IPP 9.0.1 (ippSP SSE4.2 (p8) 9.0.1 (r49101) 9.0.1.49101)   

Here is a code snippet to reproduce it:

    IppsFIRSpec_32fc *pSpec;
    Ipp32fc           *src, *dst, *dly;
    Ipp32fc* taps;
    Ipp8u           *buf;
    int             specSize, bufSize;
    IppStatus status;
    //get sizes of the spec structure and the work buffer
    status = ippsFIRSRGetSize (TAPS_LEN,  ipp32fc ,  &specSize,  &bufSize );

    src   = ippsMalloc_32fc(LEN);
    dst   = ippsMalloc_32fc(LEN);
    dly   = ippsMalloc_32fc(TAPS_LEN-1);
    taps  = ippsMalloc_32fc(TAPS_LEN);
    pSpec = (IppsFIRSpec_32fc*)ippsMalloc_8u(specSize);
    buf   = ippsMalloc_8u(bufSize);

    Ipp32fc val = {1.0f, 1.0f};
    ippsSet_32fc(val, src, LEN);
    val.im = 0.0f;
    ippsSet_32fc(val, taps, TAPS_LEN);

    printf("\nCplx FIR ippAlgDirect\n");

    //initialize the spec structure
    status = ippsFIRSRInit_32fc( taps, TAPS_LEN, ippAlgDirect, pSpec );

    //apply the FIR filter
    status = ippsFIRSR_32fc(src, dst, LEN,  pSpec,  NULL, dly,  buf);


    for (int i = 0; i < LEN_PRINT; i++)
    {
      printf("%2d: %.2f %.2f\n", i, dst[i].re, dst[i].im );
    }

    printf("\nCplx FIR ippAlgAuto\n");

    //initialize the spec structure
    status = ippsFIRSRInit_32fc( taps, TAPS_LEN, ippAlgAuto, pSpec );

    //apply the FIR filter
    status = ippsFIRSR_32fc(src, dst, LEN,  pSpec,  NULL, dly,  buf);

    for (int i = 0; i < LEN_PRINT; i++)
    {
      printf("%2d: %.2f %.2f\n", i, dst[i].re, dst[i].im );
    }

Output is:

Cplx FIR ippAlgDirect
 0: 1.00 1.00
 1: 2.00 2.00
 2: 3.00 3.00
 3: 4.00 4.00
 4: 5.00 5.00
 5: 6.00 6.00
 6: 7.00 7.00
 7: 8.00 8.00
 8: 9.00 9.00
 9: 10.00 10.00
10: 11.00 11.00
11: 12.00 12.00
12: 13.00 13.00
13: 14.00 14.00
14: 15.00 15.00
15: 16.00 16.00

Cplx FIR ippAlgAuto
 0: 5.00 9.00
 1: 6.00 10.00
 2: 7.00 9.00
 3: 6.00 10.00
 4: 6.00 12.00
 5: 6.00 14.00
 6: 6.00 14.00
 7: 6.00 14.00
 8: 7.00 15.00
 9: 8.00 16.00
10: 10.00 18.00
11: 12.00 20.00
12: 13.00 21.00
13: 14.00 22.00
14: 14.00 22.00
15: 13.00 23.00

Is this a bug?

Regards,

Christoph


Viewing all articles
Browse latest Browse all 1294

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>