Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Wrong results with ippsFIRSR_32fc and ippAlgAuto

Christoph_W_
Beginner
1,277 Views

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.re, dst.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.re, dst.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

0 Kudos
9 Replies
Chao_Y_Intel
Moderator
1,277 Views

Christoph, 

Thanks for your report.  We are checking this code. 

Regards,
Chao

0 Kudos
Roman_Z_1
Beginner
1,277 Views

I've spotted the same bug with ippAlgFFT. ippsFIRSR_32fc produces awful results compared to MATLAB and ippAlgDirect... IPPS version: ippSP AVX2 (h9) 9.0.1 

0 Kudos
Igor_A_Intel
Employee
1,277 Views

Hi Christoph,

I can't reproduce your issue with the next params:

#define TAPS_LEN 11

#define LEN 256

#define LEN_PRINT 10

could you provide your params to reproduce this issue?

Regards, Igor

0 Kudos
Christoph_W_
Beginner
1,277 Views

Hi Igor,

sorry for the delay. My parameters are:

#define LEN 5000
#define LEN_PRINT 16
#define TAPS_LEN 20

Regards, Christoph

 

0 Kudos
Igor_A_Intel
Employee
1,277 Views

Hi Christoph,

thank you for bug report - we already found and fixed that bug. The fix will be available in IPP update 9.0.2 that will be available publically soon.

Regards, Igor.

0 Kudos
Keith_L_
Beginner
1,277 Views
Hello Igor, I have also seen errors using ippsFIRSR_32fc when selecting ippAlgFFT​ or ippAlgAuto. Name : ippSP AVX (g9) Version : 9.0.0 (r47849) I am using a 65 tap real only tap value lowpass filter with 1024 samples. In a unit test, I pass in a 100Hz complex sine wave at 24kHz sample rate. The output shows unusual initial amplitude growth and then regular jumps in the output. Strangely, I get different results using my Embarcadero C++Builder 10 Seattle (using Clang) build at home and my Visual Studio 2015 build at work (running both programs on the same PC at work). When do you expect the 9.0.2 update to ship? thanks, Keith
0 Kudos
Chao_Y_Intel
Moderator
1,277 Views

Keith,  we are preparing for the release,  and expect it will be ready soon.   I post an announcement  in the forum when it is ready.  thanks for your report here. 

regards,
Chao

0 Kudos
Keith_L_
Beginner
1,277 Views
Hello Chao, many thanks for the update. I can confirm that using 9.0.2 (r49912) I get the correct answer with any algorithm option passed to IppsFIRSRInit_32fc. Keith
0 Kudos
Chao_Y_Intel
Moderator
1,277 Views

Keith, Glad to know it works now.  Feel free to contact us for any questions with Intel IPP. 

Regards,
Chao

0 Kudos
Reply