Turn on suggestions

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

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- FPGA Intellectual Property
- FFT IP Core - Input and output number format?

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

JWall40

Beginner

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

05-12-2020
04:03 PM

299 Views

FFT IP Core - Input and output number format?

I am unsure what data format I should use for the FFT IP core input and what data format it will output

I can only find a few references to this topic in the user guide:

“Imaginary input data, which represents a signed number of data precision bits.” (in reference to sink_imag)

“Real input data, which represents a signed number of data precision bits.” (in reference to sink_real)

“The fixed transform FFT accepts a two's complement format complex data vector of length N inputs, where N is the desired transform length in natural order.”

I am assuming the input and output should always be in two’s compliment format then?

I have designed a system which takes the output of an on-chip ADC (MAX10) and performs an FFT on the data.

I am using a 1KHz test waveform and approx 4.5V.

I sample the output of the ADC every 598th tick of a 50MHz clock (83.6KHz sample rate)

I convert the 12-bit ADC data to 14-bit twos compliment by appending “00” to the front, as the signal is always positive anyway due to a DC offset.

This is then fed into the FFT core’s sink_real, whilst sink_imag is set to 0.

The FFT appears to be performing correctly with no errors, but my output looks incorrect:

sink_real format: signed line chart

source_real/imag format: unsigned line chart

The output is always almost either “11111111111111” or “00000000000000”. It is also different every time

setting the source_real/imag format to signed line chart looks like this

I’ve also attached a project archive.

Any help is greatly appreciated

Thanks for reading.

Link Copied

9 Replies

CheePin_C_Intel

Employee

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

05-13-2020
11:09 AM

234 Views

Hi,

As I understand it, you have some inquiries regarding to the data format for the FFT. For your information, by default, the data format configuration in the FFT = Fixed Point. With Fixed Point, the FFT will treat the input and output data as normal binary data without sign. Note that after the FFT, there will be bit grow. So, you will ensure you have sufficient output width.

Please let me know if there is any concern. Thank you.

Best regards,

Chee Pin

JWall40

Beginner

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

05-14-2020
09:03 PM

234 Views

So using fixed point number format means that the FFT cannot deal with negative numbers and will treat all values as unsigned fixed point with no scale factor. So just whole, positive numbers?

So to see a correct display of my output values in signal tap, I should set the bus display format to unsigned decimal?

Many thanks

Jack

CheePin_C_Intel

Employee

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

05-15-2020
06:24 AM

234 Views

JWall40

Beginner

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

05-20-2020
09:02 PM

234 Views

Hi Chee

In that case, do you have any clue why my FFT might be outputting such strange values?

I've configure the FFT for fixed point representation, have given lots of extra bits to the output for bit grow (12 bits in, 22 bits out) and have no error flags with all ready/valid outputs working as expected.

But despite a reasonably clean sine input signal, my FFT outputs either near maximum or near minimum out put value seemingly at random (data in and out of the FFT displayed as unsigned line chart).

The output of the FFT always looks different every time, but always just contains a seemingly random array of near min and near max values.

The input is a 1Khz sine wave sampled at approximately 83KHz

Any suggestions are very much appreciated.

Many thanks

Jack

CheePin_C_Intel

Employee

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

05-22-2020
10:18 AM

234 Views

Hi Jack,

Thanks for your update. By merely looking at the FFT output, it is rather difficult for me to tell if they are expected without a reference for comparison. Just to check with you on the following:

- What is your expected output from the FFT?
- Just wonder if you have had a chance to run a Modelsim simulation for comparison?
- One thing that you can try is to connect the output of the FFT to an iFFT to see if you can recover back similar shape of input waveform to FFT.

Please let me know if there is any concern. Thank you.

JWall40

Beginner

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

05-25-2020
10:30 PM

234 Views

Hi Chee,

- Given that my input is a sine wave of 1KHz, with a DC offset, sampled at approximately 83KHz, I would expect the real output of the FFT to look like this:

2. I have tried to run a modelsim simulation but I am yet to successful simulate the FFT IP Core, I get errors when loading the simulation and the FFT outputs never even change state

3. This would be very interesting but my data out of the ADC is fixed point and ifft only supports floating point data. I cannot seem to find a way of using my fixed point ADC data in a floating point FFT system?

Kind regards

Jack

CheePin_C_Intel

Employee

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

05-27-2020
07:40 AM

234 Views

Hi Jack,

Thanks for your update. Sorry as for the delay. I was out for the last few days due to Public Holidays.

Regarding your latest inquiry on iFFT, please see my response as following:

3. This would be very interesting but my data out of the ADC is fixed point and ifft only supports floating point data. I cannot seem to find a way of using my fixed point ADC data in a floating point FFT system?

[CP] For iFFT, it also support Fixed Point. Mind further elaborate on the floating point data only support?

For your information, not sure if you have come across the following simple example design which demonstrate a C10GX Cosine -> FFT -> iFFT -> Cosine data for your reference:

You can try to see if it is helpful.

Thank you.

CheePin_C_Intel

Employee

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

07-08-2020
02:29 AM

228 Views

Hi Jack,

Just to follow up with you on this. Thank you.

CheePin_C_Intel

Employee

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

07-22-2020
11:23 PM

203 Views

Hi,

As I understand it, it has been some time since I last heard from you. This thread will be transitioned to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.

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

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