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

Similar Messages

  • EOF detection in "Read From Spreadsheet File"

    Hi folks, I need help in detecting EOF in a "Read From Spreadsheet File". I' d like to stop a while loop by wiring the EOF? indicator to the stop condition, but this doesn't work. For design resons I can't substitute the while loop with a for loop and I DO need the while loop. I read something about creating custom EOF detection but I'm wondering why the builtin function in the vi doesn' t work and if there isn't some simple solution. Many thanks, hazibuli  

    I'm guessing that you want to process one line at a time from the spreadsheet.  Use Read From Spreadsheet File to read in the entire spreadsheet as Dennis says.  Then wire the 2D output to a For Loop with indexing enabled.  Each iteration of the For Loop will allow you to process one line at a time.  When the last line is processed, the For Loop will exit automatically.  Here is an example to get string length of each element in a spreadsheet. Message Edited by tbob on 03-15-2010 09:46 AM

  • Peak detection thresholding

    I devised an laser interferometer which measures the amplitude of a vibrating object. The vibration is in microns and around 100 kHz. I am planning to make a program that analyze that look like carrier wave, the peaks inside the wave envelope are counted. At each node or at minimum or which I call the turning point of vibration, theres an abrupt change of amplitude. I want it that after the turning point is detected, it will return and start counting the next set of wave. 2 set of waves corresponds for one period of vibration. I am having problem on on detecting the peaks then start counting the next group of wave.
    After this, I am planning to create a spectrum analyzer, the next problem is to translate each group in a sign wave so that it will be easier to fourier transform. I am using Labview 5.0 and 7.0. It would be either one of this version I will be using for this application. Around 100kHz (rise and fall) frequency of vibration, is it capable of measuring this freq range?

    Hi Emta,
    There isn't anything in Measurement Studio explicitly set up for On the
    Fly filtering - however you can call these analysis functions whenever
    you want on whatever dataset you have available. So as you bring in
    your data you can certainly apply whatever filters you would like and
    get results on-the-fly. It's all dependant on how and when you apply
    the analysis to your acquired data.
    Hope this helps Emta, let me know if you have any more questions.
    Dan Weiland
    Applications Engineer
    National Instruments
    Dan Weiland

  • How to detect threshold voltage from xy graph?

    I am making labview program for analysing VI characteristic of diode. I want to show forwardbiased breakdown voltage automatically in xy graph or textbox. Is there any method for detecting breakdown voltage either through graph or some mathematical coding???

    Something like this?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Threshold.png ‏12 KB

  • Peak detection with two thresholds

    Dear colleagues!
    Excuse me, but I need example or any help for peak detection with two thresholds. Namely two adjustable thresholds with standard peak detector for creating a detection's bandwith or range. 
    Peak detector have only one level threshold... But why only one...
    Solved!
    Go to Solution.

    If I understand correctly, you want to set two thresholds as shown in the image below.
    The top peak is easy, so no need to go into details for that one.
    The peak for the second threshold (red) will be a bit more difficult to do.
    You would need to filter out the signals that cross the top threshold (blue).  This would be done by identifying the values as they cross the top threshold boundary.  You would then need to build a "window" around them (we'll come back to this one).
    You would need to define a range of valid values for the 2nd peak, which are from the bottom threshold to the top threshold. Search for the number of values that cross the top threshold plus one.  The "plus one" is the one you will want to search. With all the other peaks that you do not want, you can create windows around them.  The remaining one is the peak of interest.
    Message Edited by Ray.R on 10-23-2009 08:21 AM
    Attachments:
    2Thresholds.PNG ‏6 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

  • 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

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

  • 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

  • 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

  • Threshold detector vi?

    Is there a vi that detects threshold as aposed to peak. My application has two wavelets produced by echo's from the interior of a gun barrel. These waves change in amplitude therefore the peak detection doesn't work becase the threshold setting must be variable. I belive that a threshold detector vi would do the trick.
    Thanks a ton
    Mark
    Mark Mutton
    Electrical Engineer

    Here's the VI I use (and a picture of it as well). To add an indicator to the connector pane, right click on the icon and select Show Connector. With the wiring tool, click on an empty terminal and then click the indicator. Be sure to save the modified VI as a new name and in a new location.
    Message Edited by Dennis Knutson on 09-16-2005 11:28 AM
    Attachments:
    All Trigger Detection for 1 Channel.vi ‏101 KB
    All Trigger Detection.JPG ‏80 KB

  • Peak detection in C

    Hi All,
    I am looking at implementing or using the peak detection function in C. I require the same in C since, I would be later porting this application on microcontroller.
    However, the function implemented in LabVIEW calls the lvanlys.dll for performing the peak or valley detection. Hence, I would not be in position to use the same and later port it on the controller.
    Essentially I am looking for similar function inputs (threshold and width) implemented in C.
    Thanks in advance.
    Regards.

    http://www.nr.com/
    http://en.wikipedia.org/wiki/Numerical_Recipes
    Numerical Recipes in C. The Art of Scientific Computing, 2nd Edition, 1992, ISBN 0-521-43108-5.
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

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

  • Waveform peak detection ...Please have a look

    Hi folks,
               I am trying to acquire 2 signals and then detect the peaks of each of them and divide the peaks and display it in a waveform chart.But my Peak detection doesnt work at all...I tried plugging in values from 3 to 10000 but it just doesnt work...Please have a look at my VI and feel free to point out any errors in my VI..
    Thanks
    Attachments:
    slope 2 channels3.vi ‏51 KB

    Hi,
    Had a look at ur VI
    tell me, do u need a single peak for every iteration or a series of peaks above a certain threshold?
    If it is a single peak for each acquired waveform , then extract y array from the waveform cluster( you have already done it in ur VI) and connect it  to 'find array min max' function found in array functions palette and u get the single peak for each waveform.
    If it is a series of peaks u are interested in, then compare all these values inside a for loop.
    Index each element inside a 'for' loop, check it for threshold using a conditional case structure and put it inside a shift register.
    regards
    Dev

  • 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

Maybe you are looking for

  • Mac doesn't seem to want to be turned off

    Processor 2 x 2.66 GHz Dual-Core Intel Xeon Memory 3 GB 667 MHz DDR2 FB-DIMM Mac OS X 10.5.5 I've had my Mac Pro for 1,5 years now and I never really had any issues with it. But the last few days it's behaving strangly. - When I try to turn off the c

  • Tried updating phone it crashed and wont turn on or be recognized by computer

    Phone ******, wont turn on and not recignized by computer after trying to install update.

  • Setting items values programmatically

    Hello, I'd like to set some items to some values contained in the DB. The trick is that the item names are also specified in the DB. For example I could have a table with 2 columns: item_name | item_value VAR_A | XYZ VAR_B | ABC I'd like to set :VAR_

  • Calling workflow from a form

    I need to call a workflow in the QuestionLibrary form so that I can save the question and answer in another external resource, after the user modifies the answer to the question. Other option is to create a complete workflow to replace the change que

  • Downgrade not succesfull

    First of all, let me start by saying that I am really annoyed by this 3.0 upgrade.... It has done nothing but complicate my iPod Touch's functionality. To name a few problems: can't set up my email account (doesn't detect it eventhough my wifi connec