- Community Home
- :
- Discussion Forums
- :
- Most Active Software Boards
- :
- LabVIEW
- :
- fft on FPGA

Turn on suggestions

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

Showing results for

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

Highlighted

01-17-2018 01:09 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Labels:

Hi,

I am curretly calculating the FFT on the FPGA using the FFT Express VI . After computing the FFT I want to determine the frequency of the signal using the Magnitude spectrum plot, all the processing has to be done on the FPGA without sending the data to the PC . Any ideas how to go about implementing this. I checked several example codes for FFT but all of them seem to be using the DMA FIFO for analyzing data on the PC . However, for my application the entire processing needs to be carried out on the FPGA. Any help on this would be really appreciated .

Thank you.

Regards

01-18-2018 08:03 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You say you want to compute "the frequency of the signal" after you do the FFT. Do you understand Frequency-Domain analysis? Do you know that the magnitude of the FFT signal is the amplitude of that frequency component of the signal? So unless you are dealing with a pure sinusoid that has been sampled at an appropriate (higher) sampling frequency, there won't be a single "frequency" in the FFT. However, surely the FPGA could find the magnitudes of the frequency components and compute, say, the frequency at which the __maximum__ appears (or some other computation you'd like to make) ...

Bob Schor

01-18-2018 10:17 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

Yes I want to find the frequency at which the maximum occurs , by observing the magnitude spectra plot on the FPGA(not on the cRIO/PC). Is there any reference VI for the same?

Thank you.

01-22-2018 10:24 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Am I not correct that cRIOs do not have a display? I'm even more certain that the FPGA subset does not have an associated display ... However, you should be able to "do math" on an FPGA and, say, "find the maximum" ...

Bob Schor

01-22-2018 03:36 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@Bob_Schor wrote:

Am I not correct that cRIOs do not have a display? I'm even more certain that the FPGA subset does not have an associated display ... However, you should be able to "do math" on an FPGA and, say, "find the maximum" ...

Newer cRIOs running the embedded Linux RT do have a display. But an FPGA does not have a display, it is essentially a programmable IC, it has no operating system and no display. You could potentially drive one through several communications but you probably don't want that. If you have a cRIO with a display then this should be pretty easy. If you have an embedded target without a display it will not be easy to drive a display. What hardware do you have? What method of displaying it do you intend on using?

Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord

Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.

Checkout and help contribute to the community driven LabVIEW Wiki.

01-22-2018 01:51 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Depending on your configuration a spectrum will contain a fixed number of samples which are streamed out. For arguments sake lets say it is 128.

So to pick out the maximum value you can have some sort of pt by pt maximum detection that resets every 128 samples. At the end of each 128 it can put the maximum index somewhere depending on what needs it.

To convert the index to frequency you then need to know the sampling rate and size but if it is being used on the FPGA directly you may be able to avoid this step anyway.

The FFT block is not straightforward to use and uses a lot of space. So beware, there is a reason there aren't a lot of examples, it often complicates things a lot more than doing it on the host. It should provide you with valid flags to know when to reset the maximum tracker (don't have LV in front of me at the minute).

James Mc

========

CLA and cRIO Fanatic

My writings on LabVIEW Development are at devs.wiresmithtech.com

========

CLA and cRIO Fanatic

My writings on LabVIEW Development are at devs.wiresmithtech.com

03-11-2018 11:06 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

Thanks a lot for the prompt responses. I apologize for the delay in response as was working on something else. Will definitely check and get back on this.

Thanks

Regards

03-12-2018 03:58 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You have to be aware that the index of the maximum magnitude will not give you a very accurate value for your frequency measurement. If your measurement time is T0, the frequency result uncertainty will be +/- 0.5/T0. This may or may not be good enough for your application.

Also if your signal is relatively clean (looks 'more or less' like a sine tone) you can probably achieve the same accuracy by simply counting the number of zero-crossing during the T0 measurement time. This is a lot 'cheaper' than an using an FFT. Another advantage is that it is easy (and free) to increase the measurement time (T0), something that is very demanding (if at all possible) when you use and FFT.

Alternatively if your signal is clean you can also improve the result resolution by performing interpolation around the zero crossing, However your signal has to be 'clean' in the sense that no other tones or noise significantly affect the location of the zero crossing. You can improve your signal quality with for example appropriate pre-filtering.

The best method to choose therefore depends on the type of signal you are dealing with. Questions to consider include:

- Do you know the frequency of interest with a specific uncertainty (like 12345.678 Hz +/- 1000 Hz)?

- What result accuracy do you need?

- Can you freely choose the measurement time T0?

- Does your signal have unwanted zero crossing caused by other tones or noise? If so can this issue be removed (or at least reduced) using appropriate filtering?

Then there are other method you can use to improve your measurement accuracy like frequency domain interpolation, but let's hear what your requirements are before moving in that direction.