Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- FFT not working for N >= 2048

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

Novack__Bryan

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-09-2018
11:28 AM

62 Views

FFT not working for N >= 2048

I'm attempting to compute an FFT on sizes N>=2048. What I can't explain is why the FFT output looks great for N<2048 but then goes to garbage when N>=2048. I've poured over other forum posts and examples online and haven't found anything useful to date. I'm using the 2019 initial release on 64-bit CentOS7 machine compiled into C++ project.

My code is pretty simple, but hopefully it is something obvious that I've just overlooked.

My tempSignal variable is the real data coming from an RF receiver. You'll notice the printf statements. The first printf statement is logging the fftInput to terminal which I then copy into Matlab. The final printf shows only the first 20 entries of the fftOutput which I then compare to what Matlab produces via its fft function.

unsigned int N = 2048 std::vector<MKL_Complex8> fftInput(N); for(unsigned int i=0; i<fftInput.size(); ++i) { fftInput.data().real = tempSignal.getData().real(); fftInput.data().imag = tempSignal.getData().imag(); printf("%f + %fi\n", fftInput.data().real, fftInput.data().imag); } std::vector<MKL_Complex8> fftOutput(fftInput.size()); DFTI_DESCRIPTOR_HANDLE descriptor; MKL_LONG status; status = DftiCreateDescriptor(&descriptor, DFTI_SINGLE, DFTI_COMPLEX, 1, fftInput.size()); status = DftiSetValue(descriptor, DFTI_PLACEMENT, DFTI_NOT_INPLACE); //Out of place FFT status = DftiCommitDescriptor(descriptor); //Finalize the descriptor status = DftiComputeForward(descriptor, fftInput.data(), fftOutput.data()); //Compute the Forward FFT status = DftiFreeDescriptor(&descriptor); //Free the descriptor for(unsigned int i=0; i<20; ++i) { printf("i: %d, (%f, %f)\n", i, fftOutput.real, fftOutput.imag); }

Thanks in advance for any help.

Link Copied

2 Replies

Gennady_F_Intel

Moderator

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-10-2018
08:44 PM

62 Views

could you show VERBOSE mode output?

Novack__Bryan

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-11-2018
05:03 AM

62 Views

For those who come across this post.....

I don't fully understand why but my problem was solved by linking against the following libraries:

"iomp5",

"mkl_core",

"mkl_intel_ilp64",

"mkl_intel_thread",

I was initially linking against only "mkl_rt" which 'worked' in the sense that it executed, but the results were not correct. Someone mentioned in a different forum post to use the following website which I did and it led me to use the libraries I listed above.

https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor

Maybe this will help someone else along the way.

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

For more complete information about compiler optimizations, see our Optimization Notice.