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

Showing results for

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- AI Engine, DSP IP and Tools
- :
- Re: Axes for FFT

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

Highlighted

ravics

Observer

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

08-26-2010 03:50 AM

9,577 Views

Registered:
08-26-2010

( SysGen) FFT o/p (xk_re) plotting on Wavescope. Need to extract points & plot so have taken o/p of FFT Core to WORKSPACE.

The x-axis shows the simulation time specified in the Simulink Model. How can I change it to frequency domain?

I want the exact values of the frequency.

1 Solution

Accepted Solutions

Highlighted

ywu

Xilinx Employee

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

09-14-2010 07:20 PM

7,559 Views

Registered:
11-28-2007

RIght, System Generator doesn't have a log10 block readily available. If you do some research you will probably find some algorithms for log10 calculation that you could implement in other building blocks in System Generator.

Cheers,

Jim

Jim

16 Replies

criley

Xilinx Employee

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

08-26-2010 10:10 AM

9,567 Views

Registered:
08-16-2007

Re: Axes for FFT

Highlighted
##

Jump to solution

ticktack

Explorer

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

08-26-2010 02:15 PM

9,557 Views

Registered:
08-14-2007

Re: Axes for FFT

*try spectrum scope*

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

08-26-2010 05:07 PM - edited 12-11-2011 11:38 AM

9,555 Views

Registered:
11-28-2007

Re: Axes for FFT

First of all I would suggest you grab a textbook or google FFT to get basic understanding of how FFT works.

A few points:

* FFT results are complex, so you will need to use both xk_re and xk_im outputs.

* You can never get the exact frequency of your input frequency using FFT. FFT puts the input signal into different "frequency bins". The width of each bin is the sampling frequency divided by the transform size (width=Fs/N). This is where xk_index output comes into play. xk_index=0 represents the first frequency bin (0 to Fs/N), xk_index=1 represents the 2nd frquency bin (Fs/N to 2*Fs/N), and so on. So you will need to use xk_index output to figure out the input frequency. E.g. if you see a big spike at xk_index = 5, then the input has a frequency component in the bin [5*Fs/N 6*Fs/N).

* If your input is a real signal, the FFT output is symmetric. So you can discard the output from N/2 to N.

@ravics wrote:

( SysGen) FFT o/p (xk_re) plotting on Wavescope. Need to extract points & plot so have taken o/p of FFT Core to WORKSPACE.

The x-axis shows the simulation time specified in the Simulink Model. How can I change it to frequency domain?

I want the exact values of the frequency.

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

ravics

Observer

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

08-26-2010 11:54 PM - edited 08-27-2010 12:02 AM

9,546 Views

Registered:
08-26-2010

Re: Axes for FFT

Thanks Jim.

My xk_index values are NOT consecutive values (like +001, +002)..I'm however able to find the approximate frequency using xk_index value.

Since FFT results are complex should both real & imaginary components be considered for obtaining the FFT points? Is any manipulation of xk_re & xk_im (like adding the two) necessary to extract FFT points?

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

08-27-2010 08:44 AM

9,526 Views

Registered:
11-28-2007

Re: Axes for FFT

By default, the xk_index is in bit reverse order. You can change it to "natural order" (check the properties window of the FFT block) and then xk_index will come out sequentially.

You will need to check the magnitude of xk_re and xk_im (the real and imaginary part of the complex output). As I suggested, it'd be beneficial to go back to a textbook and go over the FFT stuff.

@ravics wrote:

Thanks Jim.

My xk_index values are NOT consecutive values (like +001, +002)..I'm however able to find the approximate frequency using xk_index value.

Since FFT results are complex should both real & imaginary components be considered for obtaining the FFT points? Is any manipulation of xk_re & xk_im (like adding the two) necessary to extract FFT points?

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

ravics

Observer

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

08-28-2010 02:10 AM

9,506 Views

Registered:
08-26-2010

Re: Axes for FFT

Thanks Jim.

I would like to know how the fft o/p can be scaled to obtain dB scale on y-axis.

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

08-30-2010 08:27 PM

9,466 Views

Registered:
11-28-2007

Re: Axes for FFT

In hardware or software?

@ravics wrote:

Thanks Jim.

I would like to know how the fft o/p can be scaled to obtain dB scale on y-axis.

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

ravics

Observer

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

08-30-2010 10:20 PM

9,463 Views

Registered:
08-26-2010

Re: Axes for FFT

Software.

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

08-31-2010 03:39 AM

9,453 Views

Registered:
11-28-2007

Re: Axes for FFT

It's easy in software, but I will leave it to you to figure out what "dB" is and go from there.

@ravics wrote:

Software.

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

ravics

Observer

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

09-01-2010 05:54 AM

6,382 Views

Registered:
08-26-2010

Re: Axes for FFT

Do i need to use Cordic Log block to scale?

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

09-08-2010 07:25 AM

6,351 Views

Registered:
11-28-2007

Re: Axes for FFT

If you're only instersted in log scale in SW, you can simply use the log function in Matlab.

If you need to implement it in HW, you could use the Cordic Log block. Keep in mind though the Cordic core calculates natural logarithm (base e) not the log10 (base 10).

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

ravics

Observer

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

09-09-2010 03:51 AM

6,337 Views

Registered:
08-26-2010

Re: Axes for FFT

Thanks Jim.

So there's no other way to find log base 10 using System Generator which could be implemented in H/W?

Highlighted

ywu

Xilinx Employee

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

09-14-2010 07:20 PM

7,560 Views

Registered:
11-28-2007

RIght, System Generator doesn't have a log10 block readily available. If you do some research you will probably find some algorithms for log10 calculation that you could implement in other building blocks in System Generator.

Cheers,

Jim

Jim

Highlighted
##

Jump to solution

bin2599

Adventurer

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

10-30-2010 09:02 PM

6,103 Views

Registered:
09-10-2008

Re: Axes for FFT

Jim,

I just ran my 256 pts fft and I am getting out 256 bins. Shouldn't I expect only 128 bins from 256 pts fft? what's the other 128 bins?

b

Highlighted
##

Jump to solution

ywu

Xilinx Employee

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

11-01-2010 08:53 AM

6,094 Views

Registered:
11-28-2007

Re: Axes for FFT

If your input is real, you only need to look at 128 bins. The other half is just the image of the first half, which you can ignore.

Cheers,

Jim

Jim

Highlighted
##

Jump to solution
Could you please explain to me how could i find the approximate frequency of my spectrum using Xk_index ? i tried to find a way but i failed . My point size is 512 so the Xk_index is 9 bins , i just want to know how to find the freq bu this index .

mohamed.shfat

Observer

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

11-23-2016 03:39 AM

1,435 Views

Registered:
10-16-2016

Re: Axes for FFT