How to calculate the slope of a signal to find its peak

I have acquired a ECG signal through the DAQ. Actually I have to calculate the slope of the ECG signal in order to find the R-peak. By finding the slope of R- wave which will be greater than the slope of T-wave, I could differentiate between R-wave and T-wave as it looks similar for some patients. Can any one of you guide me in finding the slope of the incoming signal and then detect the R-wave.
Thank you. 

sorry, I do not have version 7.1, so I am attaching it in LV8.0 and a picture of the block diagram.  Maybe someone can convert it for you, or that you can see enough to recreate the code from my pics... not too much going on.  Hope this works for you.
Message Edited by Stradis on 10-11-2007 04:21 AM
Paul <--Always Learning!!!
sense and simplicity.
Browse my sample VIs?
Attachments:
trigger to sample.png ‏10 KB
trigger to sampleWithSlope.vi ‏288 KB

Similar Messages

  • Using DIAdem, how to get the slope of a signal (Linear or non-linear​)

    Rate of rise or rate of fall on a temperature signal, I'm trying to include the slope in my report using DIAdem,
    I couldn't find , Is there a slope function?
    or a way to do that
    Thanks
    Solved!
    Go to Solution.

    Hi amat,
    You can get the slope fit calculation from the built-in function "ANALYSIS >> Curve Fitting >> Calculate Regression".  If you want to fit only a subset of the data, you will need to extract that subset of data to a new data channel and then run the approximation calculation on the new channel.
    Here is a script I have created to do the range extraction and statistics/slope calculation automatically.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Selected Region Stats.zip ‏5 KB

  • How to calculate the Processing time for material based on its route ?

    Hello experts,
    I would like to calculate the Scheduled in-house production time based on route.
    Actually this is done in the prod. route in tcode CA02. (via menu Extras => scheduling => schedule).
    After getting the schedule table press the 'scheduling results' button I received the Processing time, Setup and teardown time,... Scheduled in-house production time.
    So I'm looking for a function or any tool to use it in report.
    thanks,
    Eli

    hi,
    from routing screen,extras>scheduling>schedule(give a variant name)>scheduling results>update material master.this writes the info in the temp file.use tcode CA96 to update material master.this updates lot size dependent in house production time in work scheduling view of material master and  deletes the lot size independent inhouse prod, time in MRP2 view.this tool gives more accurate results  for your  inhouse prod. time.
    > Hello experts,
    > I would like to calculate the Scheduled in-house
    > production time based on route.
    > Actually this is done in the prod. route in tcode
    > CA02. (via menu Extras => scheduling => schedule).
    > After getting the schedule table press the
    > 'scheduling results' button I received the Processing
    > time, Setup and teardown time,... Scheduled in-house
    > production time.
    > So I'm looking for a function or any tool to use it
    > in report.
    >
    > thanks,
    > Eli

  • I would like to know how to calculate the slope of a xy-graph in different zones of the curve. .

    Is it possible to do it by graphically selecting the segment of the xy-graph curve?

    I think you can incorperate Nadav's suggestion and the attached VI to find a solution. You may want to add another cursor to the xy plot to establish your region of interest for the dervative.
    Jeremy
    Attachments:
    lv61_derivative_on_a_waveform_graph_and_xy_plot.vi ‏60 KB

  • How can I calculate the slope of an isometric torque curve with a trigger and time increments of 0-30ms, 0-50ms, 0-100ms etc....

    I am analyzing isometric muscle contractions of the quadriceps and want to calculate the rate of force development (not just peak torque) for the torque-time curve.  I want to set a trigger so that the slope of the torque curve is calculated when 7 newton-meters is reached.  From there I'm trying to calculate the slope in time increments of 0-30ms, 0-50ms, 0-100ms, etc....My data is sampled at 2000 Hz and written in text files.  Below is a copy of the VI I have developed so far.  I am very new to programming with LabVIEW but can definitely see its potential!  Any advice would be greatly appreciated. 
    Attachments:
    Dissertation Isometric RFD.vi ‏14 KB

    Fiddler918,
    When trying to implement something like this in LabVIEW, it is often helpful to think about how you would program this function in a traditional text-based language.  Try and break the problem down.  You need to locate the data point in your array that is 7 Nm or greater.  At this point, you will need to grab the data points that are 60 indices (for the 30ms gap, assuming your points are equally spaced 0.5 ms apart), 100 indices (for the 50 ms gap), and 200 indices (for the 100ms gap) ahead of this point in your data file, and calculate the slope using pairs of data points.  
    Here is a general description of a possible implementation of this code:
    You can wire the appropriate column of the data array into a For Loop on the block diagram and have it auto index through the points.  If you right click on the Use the Greater or Equal? function to generate a Boolean that will be true when you want to exit the For Loop.  Right-click on the border of the For Loop and select Conditional Terminal.  This will cause a small stop sign to appear.  If you wire the Boolean to the conditional terminal, the loop will stop at the value that is greater than or equal to 7 Nm.  If you wire the Loop Iteration terminal out of the For Loop to the right, this will give you the index of the value in the column that you’re interested in.  Having this value, you can then use the Array functions to grab the specific data points you need, and numeric functions to perform the necessary math.
    If any of this didn't make sense, the LabVIEW help files are a great resource to use.
    Here is a link to some video tutorials of the LabVIEW programming environment.  They may help you in the development of your code.
    http://www.ni.com/academic/students/learnlabview/
    Regards,
    Jared R.
    Precision DC Product Support Engineer
    National Instruments

  • How to calculate the RMS level of a signal with its spectral representation

    hi!
    how to calculate the RMS level of a signal with its spectral representation
    thanks

    1. Find the length, N, of the spectral signal.
    2. Convolve the magnitude of the signal with itself.
    3. Take the Nth element of the resulting signal
    4. Take the square root.
    5. This should be the RMS value of your signal.
    Randall Pursley
    Attachments:
    RMS.bmp ‏616 KB

  • In labview,how to calculate the parameters of the bilinear model that simulates the generation electroencephalogram?

    Dear Sir or madam:
    I have collected a lot of electroencephalogram data, which looks like a continuous sine wave plus a noise signal. what i want to do now is to fit the data with the bilinear model as the attached jpg file. the problem is the parameters of the model are changing with the evolution of the signal. would someone like to tell me how to calculate the parameters in the bilinear model?
    thank you very much
    Attachments:
    Bilinear_Model.jpg ‏33 KB

    I can point you in the right direction, but probably not answer your question really well. If you have the pro or full distribution of LabVIEW, you can use the curve fitting VIs to match any set of data to a theoretical curve. The curve fitting Express VI may do all you need to do (use the nonlinear option). To get the signal evolution, break your data into pieces and process each. If you need to average a bit, you can use a sliding window of your data for each analysis, moving the window less than the window width for each analysis.
    There are a plethora of curve fitting techniques built into LabVIEW - matrix operations, linear and log linear fits, Levenberg-Marquardt methods, downhill simplex, etc. You will probably need to experiment a bit to get a stable
    algorithm for your case. Check your literature for ways other people have done this. There may be an easy, stable method out there.
    If you are unfamiliar with curve fitting techniques, or you do not have the pro or full versions of LabVIEW, I would recommend "Numercial Recipes in C" by Press et. al., published by Cambridge University Press. The chapter on Modeling of Data will get you going. The rest of the book will provide any background you need.
    This was a very general answer. If you need something more specific, let me know. Be aware that this type of problem usually requires some trial and error to get right. The answers should be tightly scrutinized before being believed.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to calculate the phase difference between two square wave (acquired from two channel in one DAQ)

    Hello everyone ,
     I need a quickly help that as below :
    I am trying use PCI-6220 to acquired six signals from one rotation encoder (channel A, channel B,channel Z ,and their non-signals) .The encoder out signals will be square wave and 4000pulses per revolution. I set it rotation at 300rpm speed. I need show every square wave of six out channels in waveform and measure the A-B phase difference to check if the value is correct (designed value should be 90deg) .
    I have no idea how to measure or calculate the phase difference of two square wave base on synchronizate to acquire these two square wave from two channel on the PCI-6620....
    Anyone can give a idea how to calculate the phase difference with two square wave ?
    Thank a lot and Thanks again...
    Tim

    Tim,
    Here is a simple rising edge detector for one channel.
    Lynn
    Attachments:
    Rising edge.vi ‏15 KB

  • How to calculate the time between start trigger,first scan and first A/D in DAQ

    Environment: Labview 6.1, N6052E DAQ board(max scan rate=333KHz, max channel rate=333KHz, settling time=3.5usec+1LSB)
    I am using external scan clock 10K scan/s collecting data on 16 AI channels, and external channel clock 200KHz.
    Could show me how to calculate the time betweent he start trigger, the first scan and the first A/D conversion?
    Thanks

    I read the one you give to me. still cannot work out. I am using Labview 6.1 DAQ vi, including AI config.vi. clock config.vi, AI control.vi, AI read.vi, working on colect data on 16 AI channels. So I belong to SCAN function and external scan and sampling timing, right?
    But it says the T1 and T2 are determined by external signals. How can I calculate that?
    T1=1/10KHz or T1=1/160Khz?
    T2=1/200KHz?
    Is the above correct?

  • SCB68 how to calculate the correct resistor

    Hi,
    sorry I am a new NI user.
    I didn't understand how to calculate the correct resistor to apply in scb68 in order to obtain a differential signal.
    My application requires an acquisition of a differential voltage channel of 0-5V.
    Can I use the ach+ and ach- channels without change anything on scb68?
    if no, how can I find correct settings?
    I read on scb68 manual page 5-2 "Conditioning Analog Input Channels" but I didn't understand wot to do.
    thank you
    Sarah

    Hi,
    Last question first; the cable impedance is at higher frequencies. So with you (almost) DC application don't worry about this cable impedance.
    I would choose resistors of 100k as the lowest value as bias resistors.
    You mentioned the power consumption of your sensor (transmitter ?) Does this mean that the sensor is powered through the same lines ?
    I don't know how you want to 'cascade' your sensors depends on your sensors. Normally you measure each sensor with a different input.
    Can you post (or link to) the datasheet of the sensor ?
    Message Edited by K C on 12-12-2007 10:44 AM

  • How to calculate the unit for RATE?

    Hey All,
    I am not sure if there is something standard for this or not.
    I am calculating the 'Rate' by using 'Value/Amount' and 'Quantity' as follows -
    Rate == Value /  Quantity
    I need to calculate the unit for the rate as below -
    Rate unit == Value unit (Currency) /  Quantity unit (Base_uom) 
    (for example -
    if value is 1000 USD and quantity is 10 TO then Rate should come out as 100 USD / TO)
    Could anyone please suggest how to calculate the unit in this case?
    Many Thanks!
    Tanu

    Hi,
    Go through the below link it may give some idea
    http://help.sap.com/saphelp_nw04/Helpdata/EN/19/1d7abc80ca4817a72009998cdeebe0/content.htm
    Regards,
    Marasa.

  • How to calculate the Current APC (Acquisition and Production Cost)

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”.
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic.
    Please help me.
    Thanks in advance,
    Satish

    Hi,
    you'll find the logic in fm FI_AA_VALUES_CALCULATE
    A.

  • How to calculate the Current APC

    Hi,
    Please help me how to calculate the Current APC.
    The Current APC (Acquisition and Production Cost) is a calculated value based on Previous Year Acquisition balance plus any value changes up to the time of the report.
    The Asset History Report (RAGITT_ALV01) calculates the Current APC value &
    The Current APC can also be found in the Asset Explorer (transaction code AW01N) under Country Book 10/ Posted Values tab then the line “Acquisition Value” and column “Posted values”. 
    Thanks in advance,
    Satish

    Hi,
    I suppose that the calculation of Current APC (Acquisition and Production Cost) is getting done in the GET statements in the report RAGITT_ALV01, but unable to find the actual logic where it is being done.
    Please help me.
    Thanks in advance,
    Satish

  • How to calculate the Daily Call Volume

    Hello,
    Can anyone please advise how to calculate the daily call volume in a contact center - the counts of the calls terminated in ICM ?
    Is there any webview report or a SQL query which provides the count ?
    Many thanks in advance for the help!
    Thanks & Regards,
    Naresh

    The ICM software generates a Termination_Call_Detail record for each call that arrives at the peripheral. From This report you can get the number of calls to ICM as well as the call details.
    To get the report run this sql query
    select * from dbo.t_Termination_Call_Detail where convert (varchar(10), DateTime, 101) = '12/03/2010'

  • How to calculate the variance in PO price history?

    hi
    i hav standard report ME1P, since i need to do some modifications in this program i copied to Y prgrm,,,'
    im getting all the values properly...
    but my prblm is im not getting how to calculate the variance? im not getting the logic behid it...
    can anybody expln me in breif plz....
    Regards
    Smitha

    Hi Venu,
    there is another way as well, however, you won't be able to see Variance and Variance% as a saperate keyfigure which is not under the period. Thats the reason I didn't mention it earlier.
    What you can do is, Drag the period to the columns, Now create a structure that has the two keyfigures std price, moving price. Here if you add Variance and Variance%, Then these CKF's would come under period as well, which you don't need. And the system won't allow you to add these CKF's outside this structure. The reason being because the interpretation of the data then wouldn't make any sense here. You can create a new structure as well with these CKF's but they would become a subpart of your previous structure.
    choose the required characteristics in the Rows section. Save it.
    Let us know, Sorry man, can't help u much at this problem.
    regards,
    Sree.

Maybe you are looking for