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

ippsFIR_32f delay Line: delayline behaviour and FIR implementation

rohitspandey
Beginner
652 Views

Hi,

I would like to use ippsFIR_32f function for filtering. I have written the following code.

****************************************************

FloatVector pDlyLine(Ntaps);

pDlyLine.assign(Ntaps-1,0);

IppsFIRState_32f *ppState_FIR=NULL;//Pointer which will point to FIR delay line structure

Ipp32f *temp_fir_out_buffer=NULL,*temp_alloc_buff=NULL;

std::copy(pSrc,pSrc+Ntaps/2+IntErr,&pDlyLine[Ntaps/2-1+IntErr]);

ippStats= ippsFIR_32f( pSrc+Ntaps/2+IntErr, temp_fir_out_buffer, Ninput, ppState_FIR

ippStats = ippsFIRInitAlloc_32f( &ppState_FIR, pFilter, Ntaps, &pDlyLine[0])

ippsFIRFree_32f(ppState_FIR);

************************************************************

Here we are setting the first half of delay line with 0 and rest half with initial ntaps/2 src input. While calling the filter we are skipping the first ntaps/2 samples as they are already in delayline, So as per this configuration

we should the get y[0] as the valid out instead of filter ramp. But output is not correct for first ntaps/2 samples. Can anyone tell if something I missed in understanding the delay line in the function? I referred the following post in the forum for this implementation. (http://software.intel.com/file/32933 Difference between FIR MR and FIR MR Stream? http://software.intel.com/en-us/forums/showthread.php?t=79151)


Kindly provide help with regards to delayline behaviour and FIR implementation

Regards

Rohit

0 Kudos
3 Replies
VipinKumar_E_Intel
652 Views
Rohit,

Have you taken a look at the IPP FIR sample (fir.cpp)available in http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-source-code-examples/ ?

-Vipin

0 Kudos
rohitspandey
Beginner
652 Views
Hi,
I checked the fir.cpp. and Resample.cpp in both the case the delayline is set to 0. I am interested in case where I utilise the delayline to be loaded with the input samples i.e the filter output doesn't have filter ramp. as given in link http://software.intel.com/file/32933.

So ideally the

At start the filter input struct should look like this

Inputlength = N;

dlyLn =x0 x1 x2 x3..... xfilt_len-1
Input = xFilt_len,xFilt_len+1,.......xN
filterCoff = h1,h2,h3......hfilt_Len

y[0] = x0*h1+x1*h2+.....+xFilt_len-1*hFilt_len;
y[1] = x1*h1+..............+xFilt_len*hFilt_len;
...
...

y[N-filt_len]=xN-filt_Len*h1+.......xN*hFilt_len


Can you is it possible to achive the above by setting the delay line, the way i mentioned. Or Can you explain how the input and delayline being utilised in the ippsFIR_32f?

Regards
Rohit
0 Kudos
rohitspandey
Beginner
652 Views
Hi,


I figured out. The delay line is setup with the pointer pointing to the D[Ntaps] instead on D[0]. So to load the delay line I have to reverse the input instead pointing to the x[0].So when i reverse it works fine

Regards
Rohit
0 Kudos
Reply