Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

## Problem with ippsCrossCorr

Beginner
190 Views

Hi,

I'm using the trial version of the Ipps libraries and i have difficulties with the result of the function IppsCrossCorr_32f()

in the FAQ sheet the Usage is explained as follows :

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

void crossCorr(void) {
#undef LEN
#define LEN 11
Ipp32f win[LEN], y[LEN];
IppStatus st;
ippsSet_32f (1, win, LEN);
ippsWinHamming_32f_I (win, LEN);
st = ippsCrossCorr_32f (win, LEN, win, LEN, y, LEN, -(LEN-1));
printf_32f(cross corr =, y,7,st);
}
Output:
cross corr = 0.006400 0.026856 0.091831 0.242704 0.533230
1.009000 1.672774
Matlab* analog:
>> x = hamming(11)'; y = xcorr(x,x); y(1:7)

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

so i wrote a code (snippet) as follows:

const int SIZE = 100;

Ipp32f *temp = new Ipp32f[SIZE];

// Then i load some data from disc to "temp"
Ipp32f *temp1 = new Ipp32f[SIZE];
Ipp32f *temp2 = new Ipp32f[1];

IppStatus st;
ippsWinHamming_32f(temp,temp1,SIZE); // I don't want to manipulate my original signal
st = ippsCrossCorr_32f(temp1,30,temp1+40,30,temp2,1,30);

// i just want one cross correlation on a certain part of the same signal
cout << temp2[0] << "-" << st <

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

But the output of temp2[0] is always -0.00132704 no matter what data i load into temp. the value of "st" is -6 which tells me just nothing, but maybe you.

In my real code i use the cross_corr() function on one signal more than once, going step by step over a very long signal seqence checking every time a small part of the signal to find a maximum value. So the real code is a bit more complex than this .. but i checked many parts of my code. The input signal changes every loop , i used different sources for the temp array. No matter what i do the output is always -0.00132704.

I suppose the fault is made by me but i don't know where i did something wrong, so please can you give me some advice ?

2 Replies
Employee
190 Views
Hello,
there is special function in IPP (ippGetStatusString) which translate IppStatus value to textual string (of course you can do the same just looking at ippdefs.h file forenumerator value.
I would recommend youto look at function description in IPP manual, it might help to understand function behavior.
Regards,