- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to compute a 1d fft with dfti.
Here is my code
#include "mkl_dfti.h" #include <stdio.h> int main() { float y[8]; for (int i=0; i<4; i++) { y = i+1; } DFTI_DESCRIPTOR_HANDLE handle; MKL_LONG status; status = DftiCreateDescriptor( &handle, DFTI_SINGLE, DFTI_REAL, 1, 4 ); status = DftiCommitDescriptor( handle); status = DftiComputeForward( handle,&y[0] ); status = DftiFreeDescriptor( &handle ); for (int i=0; i<8; i++) { printf("%.2f ", y); } return 0; }
The result should be 10 0 -2 2 -2 0 -2 -2, however, instead it only outputs the first six number, and the last two numbers are just chaos. Why?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The result from MKL is correct, in real-to-complex tranforms, the packed format of complex numbers is used (to save memory). In your case, the default format is CCS, and MKL guarantees only 10.00 0.00 -2.00 2.00 -2.00 0.00 output. As it outputs only near half of complex numbers, the last half can be recovered from previous one, because of the conjugate-even symmetry feature of r2c transforms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By the way, you can read about the formats in the online documentation from here http://software.intel.com/en-us/node/470850

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page