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

ipps fft function

sever70
Beginner
1,132 Views
Hi,

I am trying to take FFT of a real signal and also the output should be a real signal. Thus, I useone of these functions :

ippsFFTFwd_RToPerm_32f

ippsFFTFwd_RToPack_32f

ippsFFTFwd_RToCCS_32f

However the output signal doesn't match with the Matlab output of fft function. Any idea?

Thanks in advance
0 Kudos
9 Replies
Thomas_Jensen1
Beginner
1,132 Views
What is it that doesn't match?

Numbers?
0 Kudos
sever70
Beginner
1,132 Views
Yes, the numbers doesn't match..
0 Kudos
sever70
Beginner
1,132 Views

Matlab output for a length of 8 array

4.000000

-1.414214

4.000000

1.414214

-4.000000

1.414214

4.000000

-1.414214

And by using these ippsfunctions,

ippsFFTInitAlloc_R_32f( &pSpec, 3, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone );

ippsFFTFwd_RToCCS_32f(pX, pY, pSpec, pBuf);


I got these outputs:


4

0

-1.41421

-1.41421

4

-4

1.41421

-1.41421

0 Kudos
Thomas_Jensen1
Beginner
1,132 Views
You should have taken a look at the IPP documentation. For CCS, your output is as expected.
Look at the IPP definition of CCP, you'll see it there:

http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/lin/ipp/ipps/ipps_ch7/ch7_packed_formats.html#CCS
0 Kudos
sever70
Beginner
1,132 Views
Thank you Thomas. But shouldn't there be a one to one match with matlab fft functions. Or which function I should use for this purpose?
0 Kudos
SergeyKostrov
Valued Contributor II
1,132 Views
Quoting sever70
Hi,

I am trying to take FFT of a real signal and also the output should be a real signal. Thus, I useone of these functions :

ippsFFTFwd_RToPerm_32f

ippsFFTFwd_RToPack_32f

ippsFFTFwd_RToCCS_32f

However the output signal doesn't match with the Matlab output of fft function. Any idea?

As far as I know the Matlab does calculations usingDouble-Precision variables. The set of IPPSfunctions
you're using are Single-Precision ( ..._32f ). Could you submit a complete IPP Test-Case?

Best regards,
Sergey
0 Kudos
Thomas_Jensen1
Beginner
1,132 Views
There would only be a match if the output of matlap and of ipp was in the same "domain", I mean, of the same type.

FFT and DFT uses different data domains (types) for efficiency purposes.
For instance, if you data is purely real, you can hold its complex version is a so-called packed domain. This is much smaller the the full complex version and thus faster (better cache utilization etc.).
However, if you print packed data, it looks not at all like normal complex data. You would have to convert packed to complex before printing it.

I don't really know useful purpose of the CCS format, but if you simply select normal complex output format, and then print that (possible first converting to real format), I'm sure your comparison would understandable.

Do you understand my text?
0 Kudos
Ying_H_Intel
Employee
1,132 Views
Hi Sever70,

Not sure Matlab's out put format. But same suggestion as Thomas,
The format is as below
Arrangement of Forward Fourier Transform Results in Packed Formats - Even Length
Index0123. . .N-2N-1NN+1
PackR0R1I1R2. . .I(N-1)/2RN/2
PermR0RN/2R1I1. . .RN/2-1IN/2-1
CCSR00R1I1. . .RN/2-1IN/2-1RN/20
Forward Fourier transform Result Representation in Packed Formats - Odd Length
Index0123. . .N-2N-1N
PackR0R1I1R2. . .R(N-1)/2I(N-1)/2
PermR0R1I1R2. . .R(N-1)/2I(N-1)/2
CCSR00R1I1. . .I(N-1)/2-1R(N-1)/2I(N-1)/2


and you may use the Transform Functions to get real complex result.

Intel IPP Transform Functions
Function Base Name Operation
Support Functions
ConjPackConverts the data inPack format to complex data format.
ConjPermConverts the data in Perm format to complex data format.
ConjCcsConverts the data in CCS format to complex


Best Regards,
Ying
0 Kudos
sever70
Beginner
1,132 Views

Thanks Thomas and Ying.Finally I got correctFFT values for real data by usingCCS format.
0 Kudos
Reply