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

ippsFIR_32fc src/dst array sizes?

Bryan_H_
Beginner
293 Views

I'm trying to run a multi-rate FIR filter  in version 8.1 on some data but I am getting strange memory errors.  Running it under valgrind shows various invalid reads/writes occurring within the call to ippsFIR_32fc.  I have tried both with differing source/destinations as well as a shared source/dest.

Here is basically what I am doing:

int upFactor = 1;
int downFactor = 2;
int phase = 0;
int numTaps = 21;
int dataSize = 1024;
int stateBufSize;
Ipp8u* pStateBuf;
IppsFIRState_32fc* pState;

Ipp32fc* pSrcDst = new Ipp32fc[dataSize]; // dataSize * 10 gets rid of memory errors here

ippsFIRMRGetStateSize_32fc(numTaps, upFactor, downFactor, &stateBufSize);
pStateBuf = new Ipp8u[stateBufSize];
ippsFIRMRInit_32fc(&pState, aTaps, numTaps, upFactor, phase, downFactor, phase, NULL, pStateBuf);
ippsFIR_32fc(pSrcDst, pSrcDst, dataSize, pState);

None of the calls return any errors, but valgrind reports many read/write errors and I get segfaults on some systems.  The only way I've found to get rid of the valgrind errors is to increase the size of my src/dst array(s) by 10x (9x isn't good enough).  Am I missing something?  The documentation says that source should be numIters*downFactor and dest should be numIters*upFactor.  For whatever reason that is still 5x smaller than what I truly need.

Any thoughts?

Thanks,

-Bryan

 

0 Kudos
2 Replies
Bryan_H_
Beginner
293 Views

You can ignore this post now - turns out my downsampling factor had actually be set to 10 in the test that was throwing this error.  Not quite sure why I need an array 10x input size to output one 1/10th the input size - but I guess that works.

Thanks,

-Bryan

0 Kudos
Igor_A_Intel
Employee
293 Views

Hi Bryan,

in the IPP (signal processing volume) manual you can find that:

For multi-rate FIR filters, the length of the pSrc is equal to numIters*downFactor, the length of the pDst is equal to numIters*upFactor.

you see, that FIR function (MR flavor) takes numIters parameter that is not length - it is a number of iterations that are performed. If you allocate buffers according to the manual - everything will be ok.

regards, Igor.

0 Kudos
Reply