07-23-2012 08:40 AM
Hi all,
i have a source that gives me input pulses of different height, what i need is to plot the distribution of these pulse heights in sbRIO FPGA.
In the FPGA i have to detect peaks, counting them relating to their height and delivering in output the number of occurrences to produce a "heights spectrum"
Is there some code examples of how to implement an algorithm in LabView FPGA to perform this type of task?
Thanks in advance.
MR
07-23-2012 07:25 PM - edited 07-23-2012 07:25 PM
When you say height, are you referring to amplitude? You might check out the Amplitude and Levels VI. Not sure if this really answers your question.
07-24-2012 02:27 AM
yes amplitude of pulses:
i've seen on the web this type of task is often referred as PHA (Pulse height analyzer) or MCA (multichannel analyzer)
but also on this forum i haven't found any example of code implemented in FPGA to perform pulse height analysis and storing...
07-24-2012 11:33 AM
I have not used PHA or MCA before but the Amplitude and Levels Express VI can output the Negative peak and Positive peak of an input signal. This would be the first thing I would try. This however only gives the max and mins and not the everything in between. Might be able to do some creative programming to continually update output these values and store them.
07-24-2012 11:42 AM - edited 07-24-2012 11:44 AM
Do you have images that show the type of data that you're acquiring? I think that actual separation of the values into separate bins should be straight forward once a peak has been detected, however analysis of the waveform to determine what counts as a peak and what doesn't, especially if these peaks change in height, may not be as straight forward.
Finding a peak?
Initially, I'd imagine implementing a buffer (FIFO) of your measured AI data to create a sliding window of your acquired waveform. The buffer would need to be large enough to contain the maximum sized 'peak' you're expecting at your desired sample rate, then use differentiation to infer the rate of change between the 'peak' value in the buffer and the rest of the values. You'd probably need to find the rate of change before the peak value and after it.
Placement?
If you find a peak and it meets your rate of change requirements, you should be able to take that value, then based on whether certain bits are set in the data you should be able to place it in an appropriate bin. This will be the implementation that would save you the most gates, but it's probably not the most robust implementation.
07-24-2012 01:03 PM
Maybe something like this might work if you could somehow use it to measure the height of every pulse instead of just the max pulse.
07-25-2012 07:59 AM
Thank you, but the problem is if i want to implement this code in fpga target vi express elements are no longer available..
07-25-2012 09:06 AM
This might work for you depending on how you have your data coming in. You can get the Y component of the waveform into a 1D array and search it for the height of the pulse.
07-31-2012 04:07 AM
Thank you very much lacVIEW,
i think vi you have done is exactly what i need, but the problem is that i have to implement this on FPGA, so i can't use all subvi available on normal PC o RT development...
07-31-2012 09:37 PM
I am sorry, as I am not well versed in FPGA systems. What is the data type that you are acquiring or as Alex mentioned "Do you have images that show the type of data that you're acquiring?"