Peak detection and appropriate response

I have been working on a wireless vital sign monitor. I have signals coming through 8 bits A/D entering the microcontroller and serially sent to Labview where i do my analysis.
I am trying to implement the below algorithm:
1) Detect the peaks above 3 volts (my range of signals is between 0-5 V) for an interval of 6 seconds.
2) For every time I detect a peak, increment counter (Counter starts at 0 and ends at 6)
3) Multiply the total number of detected peaks by 10 which gives beats / minute.
I was initailly trying to accomplish this using the microcontroller (Basic Stamp 2) but have not been succesfull and am therefore wondering if there is an easier way to do this in Labview.
I want to accomplish this in real time. Can anyone suggest an approach??
Thanks

There are two vis that can be combined :
- the threshold peak detector (in the Analyse/Signal processing/Time domain sub-palette), gives the number of peaks above a threshold value, in an array of data;
- the DataqueuePtbyPt in the Analyse/Point by Point/Other functions sub palette) that builds a queue (array) of a given length. This second vi can be used to collect points from your microcontroller ADC.
Have a look at the attached vi.
CC
Chilly Charly    (aka CC)
         E-List Master - Kudos glutton - Press the yellow button on the left...        
Attachments:
Beat Count2.zip ‏23 KB

Similar Messages

  • 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

  • How to create a VI that detects and records responses from user

    Does anyone has experience in creating a VI that allows the user to e.g., watch a video or series of images, pause or rewind video etc. and the VI records the duration of all pauses or user responses.

    avenue wrote:
    How to create a VI that detects and records responses from user
    You definitely need to check what 'EVENT STRUCTURE' is and how to use it... because thats needed to write such code.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • 2 Channel peak detection and value look up

    Hi all,
    I have 2 different sin waves going into channel 1 and channel 2 of an oscilloscope. What I'm trying to do is:
    1. From Channel 1's input determine the time when peak values occur and save them to an array
    2. Then find out what channel 2's voltage output is at times determined from step 1. 
    I started doing this project by only using 1 channel where I was able to extract the y data as well as plug it into peak detection.vi. 
    However after I merge the two channels together and proceed like I did with 1 channel  labview shows disconnected wires due to data incompatability. 
    Any help would be greately appreciated on how I can locate channel 1's peak times and plug those time values to determine output values for channel 2.
    Attached is
    1. The single channel peak detection (which works)
    2. 2 channel peak detection (the .vi I need help on)
    Attachments:
    Single Channel Peak Detection.vi ‏33 KB
    2 channel peak detection.vi ‏22 KB

    The VI is broken because you are connecting an array of waveforms with VI's that are asking for a single waveform.  You need to use Index Array to break out one or the other waveform to feed to the other VI's.

  • Peak Detection and Integratio​n

    I have been trying to design a reliable way to detect and integrate seven reactor zone temperature profiles. First, I tried to modify the peak 3.0 example to suit my needs, but alas, it does not work as envisioned (i.e it never detects the correct baseline with my data but it works with the peak 3.0 data set). Does anyone know of a reliable way to detect and integrate peaks of varying length in Labview? I will attach a copy of my vi in hopes of a solution. I attached a Savinsky-Golay smoothed experimental data set of one reactor zone. Thanks for your time!
    Attachments:
    Peaks_Example_3.0(modified).vi ‏137 KB
    time_peak3data_exp_data_.txt ‏38 KB

    In general, I've found working with either the 1st or 2nd derivatives to be more reliable when doing peak searches.
    2006 Ultimate LabVIEW G-eek.

  • Block Peak Detection and Display

    I am doing a project on a spike check automation program in Labview. I am trying to detect the peaks and valleys from a probe test on a wafer.The probes are attached to the wafer and connect to an oscilloscope. Right now finding the peaks and valleys are done manually but take a lot of time from one pin.
    My program has to optimally run for 20 seconds and, at every interval, of let’s say 20microseconds, has to take the worst case scenario for the peaks and take the screenshot from the oscilloscope and save it until the worst case scenario in the next block on 20 microseconds until the 30 seconds are up.
    I am using LV 2010 and I don’t have experience with LV before. I have researched and found a VI called waveform peak detector which seems helpful but I am not sure how to save a screenshot at each interval or block.  
    I am also unsure on what to put in a loop so my program can run continuously for 30 seconds without stopping.  I also have the instrument drivers for my particular oscilloscope so I can control the scope from my computer and LV program.
    Any help is appreciated and thanks in advance for your assistance. 

    Share for care... oops share for cure...!!
    please share your code or more info..!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • 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

    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)

  • Regrading peak detection Vi input

    I would like to use this peak detection but i would like to remove the signal source and use my own input instead. Could anyone teach me how to do it? thanks^^
    Attachments:
    Peak Detection and Display1.vi ‏37 KB

    The input to the peak detector VI is a simple DBL array.  I would recommend you use Peak Detector.vi instead of the unexposed subVI in your code (from the biomed toolkit?).
    Where are you getting your data?  How you get from there to the peak detector will depend on this, since your data type could be dynamic data type, waveform, or simple array.  When in doubt, search the LabVIEW help first.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • What does the community recommend as an appropriate response in light of reports that "an estimated 600,000 or more Macs are currently compromised and part of a massive botnet thanks to the Flashback Trojan."  Is Apple taking steps to mitigate the threat?

    What does the community recommend as an appropriate response in light of reports that "an estimated 600,000 or more Macs are currently compromised and part of a massive botnet thanks to the Flashback Trojan."  Is Apple taking steps to mitigate the threat?
    See article in PC World at:  http://www.pcworld.com/businesscenter/article/253403/mac_malware_outbreak_is_big ger_than_conficker.html
    I have a MacBookPro and my wife has an iMac. I assume both are equally vulnearble.
    MLSCOS

    There are checks one can perform to see
    1: If any of their machines have been seen on the Flashback botnet
    http://public.dev.drweb.com/april/
    2: Terminal commands to see if their machine is infected (use copy and paste, then press enter)
    https://www.f-secure.com/v-descs/trojan-downloader_osx_flashback_i.shtml
    3: Preventative methods to avoid becoming infected.
    Update Java via Software Update.
    Disable Java in all your web browsers preferences (notice Java is not Javascript)
    Check your status of all browser plug-ins
    https://www.mozilla.org/en-US/plugincheck/
    Firefox + NoScript add-on + Temp Allow All Button on Firefox's toolbar to turn on scripts only on sites you trust.
    Learn how to make bootable clones, this way a complete erase can occur and a reverse clone done.
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents
    4: Resources if one is infected
    Data Recovery, wiping entire machine, reinstalling OS X, returning clean files, etc.
    https://discussions.apple.com/community/notebooks/macbook_pro?view=documents

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

  • How to measure error on peak detect?

    Hello!
    I'm using the vi Waveform Peak Detect to find peaks in some signals that we analyze at the lab where i work. However, i must know also what's the error on the measure. Anyone knows if there is a vi that measures peak AND the error on the values found? Or at least a mathematical way to find the error myself?
    Thanks!

    This is not an simple question to answer. When you search for the peak value of a signal you have to make some assumptions about that signal. For example if your signal looks like [1, 1, -1, -1, 1, 1, -1, -1, ...], it may be difficult to define its peak value.
    The first approach is, that your signal is a square wave of amplitude 1.0 and normalized frequency = 0.25. It this case the peak value is also 1.0
    But the same signal could be the result of the sampling of a pure sine tone of amplitude 1.4142 (SQRT(2)). if you sample your sine tone at 45, 135, 225 and 315 degrees of phase, you get the same sequence of samples. In this case you would like your peak result to be 1.4142.
    So the error can be as big a 41% (3 dB). This is of course an extreme situation, and
    in most case the error is much smaller.
    In general, the higher the relative bandwidth of your signal is (the ratio between the signal bandwidth and the used sample rate), the most uncertain is your result. So if you want to "stay in control" you need to make sure your signal is sampled at a rate that is high enough to give a good representation of your original analog signal.
    As an option, you may want to re-sample your signal (to a higher rate) using an appropriate algorithm. The new resampling VIs offer various interpolation algorithm that you can experiment with, depending on the nature of your signal. The peak detection VI will then do the work for you.

  • 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

  • Problem in implements ADF Faces: Detecting and handling user session expiry

    Hello everybody
    I´m trying to implement a method to handle user session expiry as explained by frank nimphius in his blog.
    http://thepeninsulasedge.com/frank_nimphius/2007/08/22/adf-faces-detecting-and-handling-user-session-expiry/
    I have implemented the class bellow and add the filters in web.xml. However when I add the JavaServer Faces Servlet to sign the filter, my hole application get nuts. I try to publish the applicatoin in the OAS and it seems that it already starts expired.
    Someone konw what I´m doing wrong?
    I use the filter
    <filter>
    <filter-name>ApplicationSessionExpiryFilter</filter-name>
    <filter-class>adf.sample.ApplicationSessionExpiryFilter</filter-class>
    <init-param>
    <param-name>SessionTimeoutRedirect</param-name>
    <param-value>SessionExpired.jspx</param-value>
    </init-param>
    </filter>
    then I add
    XML:
    <filter-mapping>
    <filter-name>ApplicationSessionExpiryFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    package adf.sample;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    this is the class
    public class ApplicationSessionExpiryFilter implements Filter {
    private FilterConfig _filterConfig = null;
    public void init(FilterConfig filterConfig) throws ServletException {
    _filterConfig = filterConfig;
    public void destroy() {
    _filterConfig = null;
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    String requestedSession = ((HttpServletRequest)request).getRequestedSessionId();
    String currentWebSession = ((HttpServletRequest)request).getSession().getId();
    boolean sessionOk = currentWebSession.equalsIgnoreCase(requestedSession);
    // if the requested session is null then this is the first application
    // request and "false" is acceptable
    if (!sessionOk && requestedSession != null){
    // the session has expired or renewed. Redirect request
    ((HttpServletResponse) response).sendRedirect(_filterConfig.getInitParameter("SessionTimeoutRedirect"));
    else{
    chain.doFilter(request, response);
    I'm really having trouble controlling user sessions. if someone know where I can get materials to learn how to implements session in Jdev ADF + BC, I´m very grateful.
    Thank you Marnie

    The class works fine.. the issue is when I add the this code into web.xml
    <filter-mapping>
    <filter-name>ApplicationSessionExpiryFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    bellow the web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>CpxFileName</param-name>
    <param-value>userinterface.DataBindings</param-value>
    </context-param>
    <filter>
    <filter-name>ApplicationSessionExpiryFilter</filter-name>
    <filter-class>view.managedBean.ApplicationSessionExpiryFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>ApplicationSessionExpiryFilter</filter-name> ==> the problem occurs when I try to add this code
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>1</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/pain</mime-type>
    </mime-mapping>
    </web-app>
    By the way, how can I post code on the forum properly?

Maybe you are looking for

  • Sequence of services

    Can anyone list out the sequence of services which needs to start for  planning. I am talking about enterprise performance management(Classic) not about epma. Every time i asks about this question people are responding to it thinking about epma.

  • Query about decimal point field in mapping

    hi, In interface one field is supposed , Both dollars and cents will be formatted with an implied decimal point before the last  two digits in the data.  for exm : input is -620.27. then output should be -000062027. Maximum length of the field is 10.

  • How to check Variable Names

    Hi All, I am checking in CMOD include.  It has lot of code. Example:  When 'ZFISPER' . I think that is Variable Technical name. How to check that variable and in Which Query it is. Please let me know... Thanks in advance.. KN

  • Interface to Class casting

    Hi all, can you help me to cast these objects: I have an interface java.security.Principal, I have a class that implements this interface - org.apache.catalina.realm.GenericPrincipal. and I have a method getUserPrincipal of HttpServletRequest that ac

  • Dreamweaver CS3 trial question

    First and only to make sure I don't come out looking totally stupid, is the Dreamweaver CS3 compatible with Vista? If so, why can I NOT use it? I click the I want to try for 30 days and it gives me an error. I also tried the Photoshop CS3 trial a few