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

How do I FFT from C#? What is my code missing?

jsrober
Beginner
591 Views
Hi,
Below is the code I have so far. My questions is how do I properly allocate

IppsFFTSpec_C_32fc and how do I pass it as the first parameter to

ippsFFTInitAlloc_C_32fc?

Also, what's the second parameter to theippsFFTInitAlloc_C_32fc function? I want it to be IPP_FFT_NODIV_BY_ANY, but I can't find the C# equivalent.

THANK YOU!

John

// Defines

int

PSD_SIZE = 4096;

int

PSD_ORDER = 12;

// Variables

ipp.Ipp32fc []fftOut =

new ipp.Ipp32fc[PSD_SIZE];

byte

[]fftScratch = new byte[PSD_SIZE];

// Workspace

ipp.IppsFFTSpec_C_32fc fftws =

new ipp.IppsFFTSpec_C_32fc();

// Status

ipp.IppStatus status;

status = ipp.sp.ippsFFTInitAlloc_C_32fc(fftws, PSD_ORDER, 0, ipp.IppHintAlgorithm.ippAlgHintFast);

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
591 Views
Hi,
In C# interface enums were written as

enum {
IPP_FFT_DIV_FWD_BY_N = 1,
IPP_FFT_DIV_INV_BY_N = 2,
IPP_FFT_DIV_BY_SQRTN = 4,
IPP_FFT_NODIV_BY_ANY = 8
};

To allocate IppsFFTSpec_C_32fc in C# use:
ipp.IppStatus status;
ipp.IppsFFTSpec_C_32fc spec =
new IppsFFTSpec_C_32fc();
ipp.IppsFFTSpec_C_32fc* pSpec = &spec;
status = ipp.sp.ippsFFTInitAlloc_C_32fc(&pSpec, 12, 8, ipp.IppHintAlgorithm.ippAlgHintFast);

//

status = ipp.sp.ippsFFTFree_C_32fc(pSpec);

Regards,
Vladimir

0 Kudos
Reply