Peak Detection Algorithm for FPGA LabView

I am in the process of migrating my Labview software of a fiber optic sensor to an FPGA using a single board RIO.  However, my program uses the pre-built Peak Detector VI, which contain some floating point math.  I was wondering if there were any existing peak detection algorithms out there that uses the fixed-point math, required in the operation of the FPGA.  Thanks in advance for your time and consideration. 

mdnb2,
Here is a document on our website that talks about Peak Detection Using LabVIEW and Measurement Studio, though it references the VIs that are not available in FPGA, it has interesting information on peak detection in general.
As far as writing your own algorithm, here is how I would start writing one. Basic Steps :
1.) Search the array samples to find the top X number of points and their locations.
2.) Filter out multiple samples on the same peak by removing points close to other points by witdth of Y samples.
3.) Filter out low peaks by comparing the all remaining peaks to each other.
Ben Sisney
FlexRIO V&V Engineer
National Instruments

Similar Messages

  • Peak detection function for sawtooth waveform not working properly

    I am using peakdetector function for finding peaks in a sawtooth wave. The peaks it detects is 2 units higher then the actual peak. But when i do the same thing for sine wave it detects the peaks properly.
    Can anyone please tell me why am I having this problem and how to resolve it? Any help would be greatly appreciated. Thanks in advance 

    With that line i got a sawtooth wave having 10 cycles. It dtects  all the 10 peaks but at an amplitude 2 units higher the the actual peak. I have attached a picture of what I got... 
    Attachments:
    sawtooth.jpg ‏206 KB

  • How to use peak detection in labview to detect peaks from data acquisition information

    Hi
    I am a university engineering student who is working in a team to develop a coin detector, its purpose is to recognize different coinage and detect fakes.
    For this we are using LabVIEW 8.5.1. I am relatively new to labview and have had no experience of using to before. We are trying to integrate four voltage signals produced by an electromagnet, straingauge, optical sensor and a proximity sensor. We have already developed signal conditioning for these tests and now wish to put them into labview.
    Our plan is to use peak detection on each of the tests so that labview can detect peaks which correspond to different coin types, provided they meet set criteria for each coin. Then to combine these either using logic or mathscript to produce a Boolean output for each coin.
    One of our advisors helped us develop a peak detection program for a simple simulated sine wave however we are struggling to adapt this for data acquisition information and itegrate it with mathscript and to be honest it does not make much sense. I have attached the program below. Thanks in advance for your assistance. 
    Attachments:
    Strain 2.vi ‏25 KB

    Chris,
    Here are several ways to help  you get started with peak detection:
    1. On your functions palette, you can search for "peak detect" and you'll find several different variations of VIs that will do peak detection.
    2. You may also want to take a look at this tutorial: Peak Detection Using LabVIEW and Measurement Studio
    3. There's an example in the example finder called "Peak detection and display" that will probably be useful. 
    Hope this helps, 
    Misha

  • Peak detection in a xy graph

    Hi,
    I have plotted the spectral data in XY graph indicator using a .txt file. Now I need to detect the peaks present in this spectrum, their locations and amplitude. I have used Peak Detector .vi in the code. However, it is not generating relevant peaks but displaying approximated values with wrong locations(x values). Is there a better and accurate way to detect the peaks? Please refer attachments for the code.
    Let me know.
    Thank you.
    Attachments:
    data1.txt ‏28 KB
    read_spectrum_1.vi ‏62 KB

    Have you read the LabVIEW Help file (when looking at the BD, type Ctrl-H, then go to the "Detailed help" at the bottom of the popup) about the peak detection function?
    "Locations contains the index locations of all peaks or valleys detected in the current block of data. Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array.
    To view the locations in terms of time, use the following equation.
    Time Locations[i] = t0 + dt*Locations[i] ...
    ... This Peak Detector VI is based on an algorithm that fits a quadratic polynomial to sequential groups of data points. The number of data points used in the fit is specified by width."
    Your input data is so noisy that getting as results the actual points from this function that visually seem to be "peaks" is virtually impossible. Not to mention that there is such an offset at the begining of the data that you are getting gazillions of false positives here. You really need to clean things up before you let LabVIEW loose (at least the Peak Detector VI) on it if you want meaningful answers.
    BTW, setting "the threshold slightly below [7379.18]" would not necessarily result in a peak depending on your definition of "slightly," because your data has no points below 180.041, making the highest possible peak 7199.139.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Peak Detection with Base package

    Hello,
    I'm constrained by a budget so I can't purchase the analysis package
    just for peak detection. Does anyone have any hints on how to search a
    1-D array for peaks without using the pre-made VI's? I've been pulling
    my hair out over this one for a week!
    Thanks in advance.

    Labviewguru wrote in message news:<[email protected]>...
    > Jason,
    >
    > I would suggest looking online for a "peak detection" algorithm.
    > There are a number of ways to do it. The LabVIEW peak detector using
    > a least squares quadratic fit to find the peaks, with a filter of
    > amplitude and width. This can also be done much simpler ways. You
    > can try applying a smoothing filter (use a moving or windowed average)
    > and then look for peaks that way.
    >
    > Please post if you need more assistance. Also, what are you trying to
    > do with the peak detection. This would be helpful in providing
    > further assistance.
    >
    > Good luck
    Labviewguru
    Thanks for the advice. Yeah, the NI home page tells me that th
    ey use a
    least square quadratic fit to find the peaks. I'm not sure on how to
    implement that. I'll do a web search on that one. I'm not dealing with
    a very noisy signal so I don't think that I need to do a moving
    average. The amplitude filter seems pretty easy, I just compare each
    point to a preset threshold. However my peaks are composed of more
    than one sample so each peak gives me a bunch of "true" values. I only
    want one count per peak. The way I thought of doing it was using
    hysteresis and starting a subroutine when the upper limit boolean went
    hi, then resetting the subroutine when the lower limit boolean went
    hi. So essentially i need to have labview look for a high, THEN look
    for a low, THEN reset over and over again until the sample array is
    finished. I'd love to work on this for days but I've already put too
    much thought into it.

  • Fetch and peak detection all channels of PXI-5105 with 4M record... HELP!

    Dear collegaues!
    Please help me to improve performance my application, see attachment, and sorry for my English.
    So, my task is to fetch and peak detection all (eight) channels of PXI-5105 with 4M record and sample rate 4M with loop 1 sec...
    Inputs of all my channels are wiring to NaI detectors with 0,5...1 microsec of pulse width (really) and freq from 0 kHz to no more than 40 kHz.
    Why I've selected 4M record and 4M sample rate namely? Answer is that I've tested PXI-5105 previously by generator 40 kHz and 0,5 microsec width pulse. It is working fine and peak detection indicate for me 40000 pulses/sec. If I set lower than 4M record and 4M sample rate it is no working. In my honest opinion 4M record and 4M sample rate are very min settings.
    In the present time peak detection working only 6 channels... When I've connected to diagram more than 6 "peak detector.vi" - I see the error "...out of memory...".
    Please advise me, what is to be done for that is all working fine.
    Solved!
    Go to Solution.
    Attachments:
    consumer-producer7.vi ‏44 KB

    What you are running into is an out of memory error in LabVIEW.  You have enough onboard memory to capture 4M samples per channel on the digitizer.  The issue is with fetching and manipulating that data in your LabVIEW application.  You will want to step back and take a look at how you are handling your data to understand why that is happening.
    1) 4M samples/ch = 4M Samples x 2Bytes/sample/ch = 8M Bytes/ch
    2) Expanding to 8 channels creates 64M Bytes of data in the raw binary format
    3) You are scaling your data by fetching in a 1D WDT format.  This stores each sample in a 32 bit double, expanding the memory to 256M Bytes (in addition to timing information)
    4) By splitting up the array of waveforms and branching data it you can easily create copies of this data, and if your consumer loop is not completed with the last data, you may be trying to capture a whole new set, creating yet another copy.
    So you can see that while you have 1.5GB of controller memory, when dealing with large arrays of data you can easily eat up that memory.  There are several things you can try to make your application more efficient.  You could work with an unscaled binary data format, you can wire the array of waveform directly to the peak detect vi (instead of creating 8 copies, you will have a single copy with arrays of output) or you could revisit the record size you have chosen (experimenting with your threshold and width settings might help you to get the results you want with smaller record lengths).
    -Jennifer O.

  • Does anyone know why the waveform peak detect function provides accurately the position of the peaks but not the value?

    Does anyone know why the waveform peak detect function provides accurately the position of the peaks but not the value?
    I have been looking at my data at the position indicated by the function as a peak, and it is correct at that place the wave has its peak, but the value provided by the function is higher than the actual value at that point.
    Attachments:
    Test.jpg ‏53 KB

    The help makes it clear that the VI will make a quadratic fit to the data, so the locations are not integers (i.e. not aligned with you exact data). From that analysis, the peak is between two of your points, and slightly above the neighboring data.
    See the coercion dot. Make the "locations" array DBL (Why did you change it to I64, that makes no sense at all!)
    Quote from the help:
    "Locations contains the index locations of all peaks or valleys detected in the current block of data. Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the input data but may be at fractions of an index and at amplitudes not found in the input array."
    All clear?
    LabVIEW Champion . Do more with less code and in less time .

  • Peak detection for a noisy signal offline

    Dear LabView experts...!
    I am trying to find the peaks in my Signal offline . I like to find out the amplitude,location of the peaks and manipulate it. But the signal has noise and if i try to feed in this signal to a peak detector it gives false results as taking the small noise peaks . i like to get the large peaks (3 peaks in the given data ) .
    Please help me out to detect these peaks.
    When i used a peak detector.vi for a simulated noise less data its works fine. I am using LabVIEW 7.1.
    Expecting your reply.
    Solved!
    Go to Solution.
    Attachments:
    forumpeak.vi ‏207 KB
    Forumdata.txt ‏753 KB

    Why such a slow sample frequency? A technique that I have used is to sample with a higher rate than needed and then average x samples together. As an example. Use 140 Hz as sample rate and then average every down every 20 sample to one , and present the result as 7 Hz samples.
    Message Edited by Coq Rouge on 04-13-2010 02:12 PM
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • The labview 7.1 can programing for fpga?

    The labview 7.1 can programing for fpga our I need buy the labview 8 fpga?
    How much the software labview 8 and the fpga targets?

    Hi RN,
    LabVIEW 7.1 can be used with LabVIEW FPGA 1.1.  LabVIEW 8 (the version currently sold) works with LabVIEW FPGA 8.0, which you can find more information on at http://www.ni.com/fpga/ .  There are several options for FPGA targets, and you can find information on these at http://www.ni.com/fpga/hardware_targets.htm .
    Best regards,
    David H.
    Systems Engineer
    National Instruments

  • Looking for function or vi to calculate 1/2 power points of data obtained from peak detection vi

    I am analyzing vibration data and need a function or vi that will operate on peak data returned from the LabView Peak detection function and provides 1/2 power points or sideband frequencies. These are needed to compute a "Q" factor. So far I have not been able to find anything.
    Thanks, Fran

    The sound and vibration toolset may help here.  there are several vibration level measurements including peak.  With the advanced FFT functions in the Sound and Vibration tools, the zoom FFT can be used to identify and find sidebands and associated amplitudes. 
    here is a link to the manual
    http://digital.ni.com/manuals.nsf/websearch/1F8691E94728BDF5862570490058C3B2
    here is a link to the toolset
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/10521
    please note the bullets on the above page (about half way down) noting peak detection, etc.
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

  • Can anyone provide me the suitable material for labview fpga &labview real time??

    Message Edited by Sithu on 05-27-2008 04:32 AM

    The following link includes training material for both LabVIEW Real-time and LabVIEW FPGA.
    http://zone.ni.com/devzone/cda/tut/p/id/6929
    If you are new to LabVIEW you should start from the LabVIEW Basics material available at the following link.
    http://cnx.org/content/col10241/latest/
    KostasB
    NIUK Applications Engineering

  • Looking for VCDIFF (RFC 3284) algorithm implemented in LabVIEW

    Hello forum,
    I am looking to see if anyone knows of a publicly available implementation of the VCDIFF binary differencing algorithm in native LabVIEW (G) ? 
    Here is a link to a paper on the RFC 3284 standard for those interested: http://tools.ietf.org/html/rfc3284
    There are a number of open source implementations in C/C++, but I would like to locate one in LabVIEW if possible.
    Regards!

    Implementing binary algorithmes in LabVIEW and especially compression algorithmes, while possibe is not a very smart idea. Aside from possible perfomance problems when you start to shuffle around on bit level, there is also the issue about how to proof the correctness of your implementation. Those open source C/C++ solutions have been used, peer reviewed and what else many times and all that has uncovered various flaws and bugs during the process.There is only a very small adience that will go and use your LabVIEW algorithme and even a much smaller one who is able to do any significant form of peer review.
    So all in all you are likely to end up with a somewhat to almost working implementation that nobody is going to use, for the gain of bragging that you did it in LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Genetic algorithm for use within LabVIEW

    I want to use a genetic algorithm to optimise a control system.  I was going to use MatLab because I can write the GA with that, but I cannot get it running fast enough with my C-DAQ.  The alternative is to use LabView, but I could not write a GA VI.  Do you know of a GA for use in LabVIEW?

    Hi Jack@Newcastle,
    Take a look at the following example of Genetic Algorithm implemented in LabVIEW (https://decibel.ni.com/content/docs/DOC-13699).It should give you an idea how to write your own code.
    Regards,
    Edvin

  • Calculating BPM using either Peak Detection point by point or FFT

    Hi Guys
    Im new to Labview and have absolutely no idea on programming and stuff. Im doing a project on Heart Rate monitor.
    I'm using labview to read the analog input to an Arduino Mini. In my attached VI im using Peak Detection Point by point to calculate the BPM but it doesnt seem to work. I took references from several VIs to arrive at my VI. 
    My instructor told me I could try using FFT to calculate the BPM as well but Im not sure how to carry it out in Labview.
    Hope you guys can help me with this.
    Thanks alot!
    Attachments:
    heart signal.jpg ‏43 KB
    Heart Monitor.vi ‏24 KB

    Ok, we have some problems here.
    1.  The Data Bits property is the number bits for a single character that is being transmitted.  You should not use that.  Since you are using an Arduino, it should be sending the termination character.  So just tell the VISA Read to read maximum number of bytes you expect from a single message or just some large number (like 25).  The VISA Read will stop reading the port when it encounters the termination character.
    2. The String Subset is not doing anything.  Just remove it.
    3.  You should move your  Wait to be outside of the case structure.  As is currently written, if you are not taking readings you will use up all of your CPU.
    4.  You should have labels for all of your controls and indicators.
    5.  Your time calculation is completely wrong.  You want to subtract the time of the previous peak from the current peak.  I recommend you use a Feedback Node to do this.
    Here's a slightly cleaned up version of your code.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Heart Monitor_BD.png ‏42 KB

  • Peak detection in certain frequency

    Hello everyone.
    I am a rookie of labview, and I want to realize a program.
    The program reads in data and then do FFT transform.
    After getting FFT waveform, I want to search the waveform for peak in certain frequency, say 0.4~0.6Hz,
    and then output its magnitude.
    I have done the FFT part, but I have no idea about peak detection in certain frequency.
    Please help me! Thanks!

    Isnt this what you want ?
    Regards
    Asad Tirmizi
    Design Engineer
    Institute of Avionics and Aeronautics
    " Its never too late to be, what u want to be"
    Using LabVIEW 8.2
    Attachments:
    FFT min max.vi ‏111 KB

Maybe you are looking for

  • Script to change photo caption in iWeb to iPhoto comment text

    Hi, Does any body know, how I could automatic replace the caption of the photos I have imported from iPhoto with the Media Browser to iWeb with the comment text I have in iPhoto for every photo? It should be just a script, which gets told the album a

  • Required Fields in a block?

    I am creating a sign in sheet using Livecycle.  I want to make certain fields required if the user starts filling in that block of fields. This is what it looks like: First Name Last Name Email Degree Address City, State, Zip First Name Last Name Ema

  • File Upload File Renaming

    I was wondering if anyone knows how to set up a trigger to automatically rename a file on upload to change spaces into underscores using DToolbox image and resize feature. An example is from "My picture.jpg" to "My_picture.jpg". I also wonder if this

  • Unable to update database after delete table content

    in my project i import .dmp file ..& create userto access database tables...but whn i deleet record from tab....it is deleted...but in actual proect database it not reflect remains as it is ....so wht shold i do plz giv solution

  • How to install facebook  or twitter  widget in Oracle WebCenter Sites?

    Hi All, I have Installed Oracle Webcenter sites on WebLogic Server. Its working fine and I am able to access avisports and FirstSiteII. Now I want to integrate with facebooK and Twitter Widgets.i am following http://docs.oracle.com/cd/E29495_01/doc.1