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

ippsResamplePolyphase data type question

Kamil_K_
Beginner
814 Views

Hello,

I was re-writing Matlab DSP algorithm to C++ and managed to receive almost the same result. But Matlab is using double data type by default and thanks to that result is slightly better. Small difference between Matlab code and my code appears because of resampling function (I've checked everything for sure very small difference appears after resampling). So as ippsResamplePolyphase has only 16s and 32f constructors I am forced to convert my double data to float which causes loss of data. I wouldn't mind buying newest IPP, but I see that there is also only 32f ippsResamplePolyphase function.

My question is: It there is any method that would allow me to perform ippsResamplePolyphase on 64f (double) data? (Matlab is using polyphase implementation too - and because of that my result is almost perfect, but I would like to make it perfect)

What I am using currently:

  •  IPP 7.1 in C++ code:

(link to documentation of IPP 7.1 - https://software.intel.com/sites/products/documentation/doclib/iss/2013/ipp/ipp_manual/IPPS/ipps_ch6/functn_ResamplePolyphase.htm)

 

IppStatus ippsResamplePolyphaseFixed_32f(const Ipp32f* pSrc, int len, Ipp32f* pDst, Ipp32f norm, Ipp64f* pTime, int* pOutlen, const IppsResamplingPolyphaseFixed_32f* pSpec);

  • Matlab R2014a uses this:

(link to documentation - http://www.mathworks.com/help/signal/ref/resample.html)

 

resample - Change the sampling rate of a signal.

Y = resample(X,P,Q) resamples the sequence in vector X at P/Q times
the original sample rate using a polyphase implementation.  Y is P/Q
times the length of X (or the ceiling of this if P/Q is not an integer).  
P and Q must be positive integers.
 
resample applies an anti-aliasing (lowpass) FIR filter to X during the
resampling process, and compensates for the filter's delay.  The filter
is designed using FIRLS.  resample provides an easy-to-use alternative
to UPFIRDN, relieving the user of the need to supply a filter or
compensate for the signal delay introduced by filtering.
 
In its filtering process, resample assumes the samples at times before

and after the given samples in X are equal to zero. Thus large
deviations from zero at the end points of the sequence X can cause
inaccuracies in Y at its end points.

 

0 Kudos
2 Replies
Jonghak_K_Intel
Employee
814 Views

Hi Kamil,

I'm afraid that the latest IPP doesn't provide a such option. I will contact the engineer team and will let you know if they have a plan to extend the coverage of the function.

Thank you

0 Kudos
Igor_A_Intel
Employee
814 Views

Hi Kamil,

the easiest way is to use Multi-Rate FIR for 64f data type for this purpose: (https://software.intel.com/sites/products/documentation/doclib/iss/2013/ipp/ipp_manual/IPPS/ipps_ch6/functn_FIRMRInit.htm#functn_FIRMRInit )

IppStatus ippsFIRGetStateSize_64f(int tapsLen, int* pBufferSize);

IppStatus ippsFIRMRInit_64f(IppsFIRState_64f** ppState, const Ipp64f* pTaps, int tapsLen, int upFactor, int upPhase, int downFactor, int downPhase, const Ipp64f* pDlyLine, Ipp8u* pBuffer);

and then

IppStatus ippsFIR_64f(const Ipp64f* pSrc, Ipp64f* pDst, int numIters, IppsFIRState_64f* pState);

regards, Igor.

0 Kudos
Reply