Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
6669 Discussions

Problem on applying ippsIIRGenLowpass/Highpass

Wei_Kin_Wong
Beginner
267 Views
Hi,

I am having difficulties on applying ippsIIRGenLowpass/Highpass since there is no sample code online. What I need is to filter a Fourier transformed signal using Butterworth filter. The code below is what I figure out so far by studying Example 6-10 and 6-16 in IPPS manual.


//FFT of input signal
Ipp32f buf_FFT_left[len_FFT];
Ipp32f buf_FFT_right[len_FFT];
Ipp64f buf_FFT_left_64f[len_FFT];
Ipp64f buf_FFT_right_64f[len_FFT];
IppsFFTSpec_R_32f* spec;
ippsFFTInitAlloc_R_32f(&spec, 12, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone );
ippsFFTFwd_RToCCS_32f( buf_left_32f, buf_FFT_left, spec, NULL );
ippsFFTFwd_RToCCS_32f( buf_right_32f, buf_FFT_right, spec, NULL );

//Butterworth filter
ippsConvert_32f64f(buf_FFT_left,buf_FFT_left_64f,len_buf);
ippsConvert_32f64f(buf_FFT_right,buf_FFT_right_64f,len_buf);
int order=4;
Ipp64f rFreq=10*2/RATE;
int tapslen=2*(order+1);
IppsIIRState_64f* pState;
Ipp64f* pTaps=ippsMalloc_64f(tapslen*sizeof(Ipp64f));
ippsIIRGenHighpass_64f(rFreq,0,order,pTaps,ippButterworth);
ippsIIRInitAlloc_64f(&pState,pTaps,order,0);
ippsIIR_64f_I(buf_FFT_left_64f,len_FFT,pState);
ippsIIR_64f_I(buf_FFT_right_64f,len_FFT,pState);
ippsIIRFree_64f(pState);
ippsConvert_64f32f(buf_FFT_left_64f,buf_FFT_left,len_buf);
ippsConvert_64f32f(buf_FFT_right_64f,buf_FFT_right,len_buf);


Without the filter, the FFT signal works in my application, but filtered signal do not work. Is anyone have any idea on what is wrong with my code? May be can point me to some sample code or way to display the signal in graph?

Thank you very much.

Wong
0 Kudos
2 Replies
Chao_Y_Intel
Employee
267 Views

Hi Wong,

Could you provide some clarification about the code: what is the error of the filtered signal?

For the code, the FFT result is CCS format ( the data are the complex), but ippsIIR use a real filter for the computation. Is this expected?

Thanks,
Chao

Chao_Y_Intel
Employee
267 Views

To display the data in graph, do you notice IPP demo at \IPP\6.1.6.056\ia32\demo\ippsDemo.exe.
It can demo the IPP single processing function usage.

Thanks,
Chao
Reply