Graph peak detection problem

For surface analysis of a sample, I did signal processing and peak detection using inbuilt peak detector .vi . But the problem is in shown peak/valley location... I have attached the screenshot of one run. See there are some peaks(valleys) which are fairly away from the actual graph. I am confused. What might be the reason of this fault? Any idea?
red blocks--> peaks
green blocks--> valleys 

I have used the peak detection function in several application. The peak detections will sometimes be inaccurate in amplitude. The reason for this is as I think covered by Kolan and Alain S. I have found the that the locations is more accurate than the amplitudes parameter. So use the locations parameter to pick values from your wave data. This will improve your accuracy
Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)

Similar Messages

  • Problem in peak detection

    Respected sir/madam,
    i am actually processing human radial artery pulse signal... i acquired that signal and linearised that by using filter...
    there is a problem in peak amplitude detection and location...by manually we can say there is more number of peaks ..but peak detector shows only 25 peak's amplitude and their locations...i can't understand about locations that shows..i attached the data which is in .lvm extension and the vi
    please help me to rectify the problem..
    thank you
    Attachments:
    Untitled 2.vi ‏100 KB
    Untitled 2.vi ‏100 KB

    Once again the Dynamic Data Type (DDT) generated by the Express VIs hides the real problem.
    The data segments are too short to reliably detect the peaks - not every segment has a peak and some peaks may be partly in one segment and partly in the next. By combining all the data into one waveform before filtering and peak detecting, it is possible to get reliable matching between the "eyeball" peak detector and the software peak detector.
    Note that the large transients at the beginning of the data set are detected as peaks. These transients are due to the real transient in the data and the transients of the filters. I did not attempt to remove them. You could use Array Subset with either manual selection of the end of the transient or some automated process based on the larger amplitude and lower frequency of the transient compared to the real signal.
    There is  a lot of "stuff" in this VI - things I tried and did not remove and multiple ways of doing things.  The enabled diagrm of the Diagram Disable structure has a constant with the data from your file so that I did not need to read and process the file repeatedly while working on the filters and peak detector.
    Comments in no particular order regarding what I did and how the posted VI works.
    1. The DDT data from Read from Measurement File.vi is converted to an array of waveforms. The Waveform data type is well docmuented and the internal data structure is readliy accessible.
    2. Each element of the array of waveforms from Read from Measurement File.vi is appended to the corresponding element from the previous iteration to form one array of waveforms containing all the data in the file. This is displayed on Array of Waveform, Array of Waveform 4, and Signals total. Note that these are graphs, not charts.  The data is also put into 2D arrays as Array of Waveform 2 and Array of Waveform 3.
    3. I do not have Advanced Peak Detector PtByPt.vi, but I think the data is not truly point by point so this may be a poor choice.
    4. I used the standard filter VIs (rather than Express VIs) to stay away from DDT. The outputs are slightly different, but the Express VIs do not give you complete control or knowledge of what the filter setup is. I used Butterworth filters for both filters and adjusted the cutoff frequencies slightly to get similar waveforms.
    5. I used the standard Peak Detector.vi from the Signal Processing >> Signal Operations palette. It reliably finds 104 peaks over a wide range of widths and some variation in thresholds.  That count includes the transients at the beginning as mentioned above.
    The .2 VI contains all the junk code I described above. The .3 VI is a cleaned up version.
    Lynn
    Attachments:
    Untitled 2-9.2.vi ‏760 KB
    Untitled 2-9.3.vi ‏183 KB

  • 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 Detect

    Hello,
    I am trying to make a heart rate monitor using LabVIEW and arduino. The basic hardware uses an LED and a photocell. You place your finger on the LED, with the photocell above, and the photocell detects changes in the amount of light in your finger whenever your heart beats.
    My design work okay and is able to detect changes in light. However, I am having trouble calculating those changes and converting the data into a heart rate. One of the problems is the peak detect, into which you set a threshold value and the detector looks for amplitudes above or below that value. The problem is, the amount of light coming through one's finger varies wildly, so even though a pulse is clearly observable, you can't just set a value for the threshold to look for.
    I tried to solve this by making the threshold vary, so that it would be slightly below the average, however my code still fails to detect a pulse. Does anyone have any idea how I could resolve this issue, or if there is a better method than using the default peak detect?
    I have attached a copy of my code, and would be very grateful if anyone could provide input. Thank you very much!
    Solved!
    Go to Solution.
    Attachments:
    A-LV HR Prototype.vi ‏982 KB

    For example, here it detected a significant drop in light intensity 6 times over a 6 second period, so BPM should be 60, but it doesn't display anything.
    Other times the BPM shoots up to 200 in a second then just stays there. I can't figure out why, or if there's a better way to do it.
    Attachments:
    HR Graph.png ‏122 KB

  • Peak detection

    Hello,
    I am currently using Labview 8.0. In that i am facing problems in detecting the peaks of an acquired waveform graph. I tried using the threshold peak detector.vi in the function palette but it doesnot work for me.I also tried filtering the waveform and detecting the peaks but still there was no result. I have uploaded the text file of my waveform here. Can anyone tell me how to detect the peaks of this waveform.
    Regards,
    Nitzy
    Attachments:
    hhaft.TXT ‏723 KB

     I guess the "Peak Detection and Display" example will give you a push in the right direction. But I have to admit I did not look at your example file
    Here is some useful tips for the Labview beginner (we have all been there some time)
    1)Then starting a new Labview session enable context help (Ctrl+h). Do not be afraid to use the detailed help option
    2)Then stuck, go to help in the toolbar then select find examples
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Need Help with peak detection

    Hello,
    I am in need of some help using the peak detection. I have an array of values that I need to find the centroid (peak) of. I am only interested in finding the centroid of a large peak. The problem I keep having is that the peak detection VI finds every little peak above the threshold when I really want the overall average peak. Please look at the graph in the picture file to see what I mean.You can see that the main peak has jagged edges. The peak detection in Labview will find every one of these jagged edges and report the location back as a peak. I am only interested in the overall shape of the peak. How can I filter out the multiple peaks and only report the centroid of the desired shape? There is an example program in the labview package called "advanced peak detection point by point" but I cannot figure out how to employ it in this application.
    Thanks in advance for any help.
    -Mark
    Attachments:
    Array values.PNG ‏9 KB

    If I were you, I wouldn't even use peak detection.
    The point of peak detection is to find multiple peaks, like in a sine wave, etc.
    If you just want the maximum:
    Just use 'Array Max & Min'
    The 'max value' equates to your y-value.
    The 'max index' can be used to find your x-value
    Message Edited by Cory K on 05-07-2009 11:52 AM
    Cory K
    Attachments:
    Peak.PNG ‏3 KB

  • Peak detection/DAQ

    Hi! I am new in LabView.
    I try to solve a problem with a peak detection in signal. I use BNC-2110.
    This is my input signal - graph above show just digitized signal, and graph under - signal with "mean".
    I have found 2 suitable .VI. They found peaks, but in simulate signal. I have try to change this program for using DAQ-Date as input signal. But it was not successful, I have become many errors etc.
    Can you advise me, where is a problem?
    With best regards, Alex
    Attachments:
    Signal.PNG ‏78 KB
    Peaks_ermitteln2.vi ‏49 KB
    peakxmpl.llb ‏40 KB

    I now about this peak detectors, but they show very many peaks instead of 1
    And in this Program (peaks_ermittlen) it was very good realized. But I don't understand, how can I change the type of Input Signal.
    In this pic I have to draw, what i measure must - Time between 2 peaks
    With best regards, Alex
    Attachments:
    Unbenannt.PNG ‏48 KB

  • 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 (threshold detector) from spreadsheets.

    Hello!
    I am working on VI that reads two signals, detects peaks that are above a specific treshold and then estimates time difference between these peaks in samples and in seconds.
    Recently I have obtained two waveforms using an oscilloscope in a laboratory. Then I saved these two graphs in a spreadsheet in Excel format (first number is time, second is amplitude). Time difference between them is really small, just a few nanoseconds according to the oscilloscope. I think treshold should be 0.3.
    My question is how to make Threshold Detector.vi read values from two excel files? Or maybe I need to use another instrument for this purpose. I am quite confused.
    I attached all materials I have.
    Any help is highly appreciated!
    Thank you.
    Attachments:
    Inception 2.vi ‏55 KB
    position S1-S2a.jpg ‏3004 KB

    I tried Read From Spreadsheet File.vi, but have not got any positive result. Probably it reads my spreadsheets, but peak detection does not work properly. When I set up any threshold in Threshold Detector.vi that is more than zero (for example, 0.01), final results turn to zero. The same occurs when indexes in Index Array  are not zeroes. 
    I attached my vi saved for LV2009. Please, have a look.
    Thanks.
    Attachments:
    Inception 2.vi ‏49 KB
    Peak detection.jpg ‏108 KB

  • Peak detection( take 100 ms samples?)

    Hi...
    I have a problem using peak detection under Analysis=>waveform monitoring.
    I want to get the real data (ECG data), and detect the peak of the data. Then i want to store the index of the peak into array so that i can measure the time difference between two peaks.
    my problem is that when i use peak detection, i cannot get the result as above mentioned. Before this i have tried to test the peak detector and found that if it will detect the peak for 100 ms time interval only. SO if i have waveform with f=100 Hz, then it will detect only 10 peaks..Is it correct that this vi takes 100 ms sample for detection? *correct me if i'm wrong
    And since i want to get the real data from ECG hardware, is there any method to measure index of the occurence of all peaks and store it into array? (not only for 100 ms)
    -I saw the formula in peak detector help :
    To view the locations in terms of time, use the following equation.
    Time Locations[i] = t0 + dt*Locations[i]
    What does [i] here represent?
    Thanks for the help...
    Regards,
    Rismi *newbie...:d

    Hi...
    Thanks, now i can understand about peak detection for simulate signal...
    Then if i use this vi to detect peak of ECG data(data from DAQ or recorded data)..This vi will detect the locations of peak of current block of data. what "current block of data" in this case represents..??
    i attach my simple program to detect the index of peak of my data. But i cannot get my desired result. And when i detect the number of the peak, the values is either 0 or 1. I don't know how to fix this problems.Can anyone give me advice?
    Attachments:
    retrieveSunday22.vi ‏161 KB

  • Peak Detection Specifics

    A part of a fatigue testing data acquisition program requires peak detection. I've read the other peak questions on here, but mine seems to be different.
    Each cycle, I collect n points. Within that, there are x peaks. The data between peaks 1 and 2 is extracted, potentially saved to disk, and always inserted into a circular buffer. This continues for each peak found. Of course, there is always data left after the last peak that does not get included into a cycle. So, I shift register it back to the next data collection loop, and append it to the beginning of the next set of data.
    My problem is that peak detect doesn't seem to find the peak if it's the first point in a data set. This seems to happen regardless of settings that I use. I c
    an't change threshold values, and any width seems to have the same result - skipping the first point. Consequently, all the data that got held over from the last cycle gets discarded because the first peak is ignored.
    Anyone have any ideas? I'm reinitializing the peak detection system each cycle because if I don't, it screws up the location indicies. I may put together a picture later, the whole problem makes more sense graphically.
    Thanks!

    The peak detection requires a peak (data on both sides of peak). Since the first point of the data does not have points on the other side of the peak... I would suggest that you keep more points before the peak as your remainder waveform and it will then pick up the peak. The number will depend upon your peak width spec.
    Stu
    Stu McFarlane
    Viewpoint Systems, Inc.

  • Peak detect error

    Hey guys.
    I have a problem with my peak detect on a Power spectrum signal. from http://www.ni.com/white-paper/4278/en/ I know that 
    I would like to have f = 1 meaning that the frequency at which the acquired time-domain signal was sampled (Fs) has to be equal to the number of points in the acquired time-domain signal (N). 
    When i try to do this the peak detect returns the error 20013 the width must be greater than zero and smaller than sample rate.
    this makes no sens to me ? 
    When i have Fs = N x 10 it runs. 
    I have added the VI that i have problems with ! if you need the whole project I will gladly add that to.
    Attachments:
    Both sensors.zip ‏329 KB

    Hi Genex,
    instead of that huge VI you should attach a smaller one, that demonstrates the problem! Right now we would need your DAQ setup to generate a signal to be able to try that VI...
    So please:
    Generate some typical waveforms, make them default in a waveform control and attach a VI with those waveforms and a typical call (with all your parameters) of PeakDetector!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Detection problems in IE?

    I discovered last night that the Javascript Flash detection
    is no longer working in Internet Explorer on either of my
    computers. The script cannot recognize that I have Flash installed.
    I'm not sure exactly when it quit working, but I went back and
    looked at sites I haven't touched in months that WERE working, and
    it doesn't work on any of them now. I recently did a Windows update
    on both computers so it's possible something happened, but I
    haven't been able to find any info online about any issues. If I
    disable Flash detection, everything runs fine, so my Flash
    component itself seems to work properly.
    On this computer, I have Internet Explorer 6.0.2900... and
    the Shockwave Flash object lists file Flash9.ocx. I tried updating
    to the most recent version of Flash on my laptop and that didn't
    fix the detection problems.
    I'm using the standard script detection from Flash
    Professional 8.0. The problem seems to be with the lines:
    set swControl =
    CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
    if (IsObject(swControl)) then
    The If statement is returning false for every version. Anyone
    have any ideas about what could be causing this?
    Edit: Ok, if I change the line above to:
    set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash")
    Then the IsObject() function returns true. And the line below
    that:
    swVersion = swControl.GetVariable("$version")
    seems to return the correct version.
    So far, in my testing, this actually seems to work. (Although
    I can't be sure if it works on browsers that aren't broken the way
    mine seems to be.) So did something happen that suddenly makes IE
    not allow you to create the object using the version number? And do
    you NEED to use the version number?

    Sounds like there may be a problem with your install ..
    perhaps you have two
    different play version on your PC (eg you've installed a
    newer version, but
    old one didn't fully uninstall itself).
    One possible solution (if that is the case) is to run the
    uninstall utility
    from Adobe, then search your harddrive for any files matching
    *flash*.ocx ..
    and if they are actually flash players (look at properties
    version info tab
    to ensure they are macromedia/adobe flash player ocx's -
    don't want to kill
    something to do with flash memory (say)) then delete them.
    Also kill off
    the c:\windows\system\macromed\flash folder .. so then you
    have no flash
    player ocx left. Then go to the Adobe web site and
    re-download/install the
    latest Flash Player. NOTE: if you do this, be very careful
    you only delete
    things that can safely be deleted without causing problems
    elsewhere.
    Jeckyl

  • Peak Detection and Display of TDMS file of 4 channels

    The Peak Detection and Display sample VI in the NI Example finder is exactly what I am looking for but I would like to use a recoded TDMS file as its input. The TDMS file is a 4 channel data file.
    Does someone have an example code on how to do this?
    ERB 

    Hi
    I found an example in exampler finder called Read Channel Groups (TDMS).vi, which seems to plot data for four channels written in a TDMS file.
    Its also attached.
    Kind Regards, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!
    Attachments:
    Read Channel Groups (TDMS) forum.vi ‏20 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