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
Similar Messages
-
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 KBWhat 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. -
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. -
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?
ERBHi
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 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 KBChris,
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 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. -
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 KBOnce 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 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 -
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 KBI 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 -
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--> valleysI 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) -
I have a waveform that I need to detect peaks & valleys on. I use the peak detector VI.
Attached is my VI with an indicative array of values that I will
encounter. The peak detector correctly finds the 3 peaks but doesn't
find the 2 valleys in the middle - I don't undertand why.
Those are the 2 I'm most interested in - the first & last are just tails of the waveform.
Any help would be greatly appreciated,
thanks
ak
Attachments:
peak detect.vi 22 KBIf I open your vi and set the peak threshold and valley threshold to 100, the peaks and valleys seem to be found.
Randall Pursley -
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. -
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 KBHi 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 -
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 KBOk, 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 -
Oracle 10g 10.2.0.3.0 takes 100% CPU
Hi,
We are using Web sphere commerce server (IBM) with Oracle 10g. we are currently in development phase. what ever execute (jobs) small job like uploding 100 records, CPU takes 100%. the process can't complete, it goes on.
System Details
2 CPU and 8 GB RAM Intel Based system
OS: Redhat server 5.1
SQL> show sga
Total System Global Area 2097152000 bytes
Fixed Size 1262740 bytes
Variable Size 251661164 bytes
Database Buffers 1828716544 bytes
Redo Buffers 15511552 bytes
shared_pool_size big integer 112M
java_pool_size big integer 112M
PGA and SGA
pga_aggregate_target big integer 200M
sga_target big integer 2000M
Pls could any one help on this. is it correct values SGA has or what could be the issue.
Thanks
Regards
Settu GopalSettu Gopal wrote:
Hi,
We are using Web sphere commerce server (IBM) with Oracle 10g. we are currently in development phase. what ever execute (jobs) small job like uploding 100 records, CPU takes 100%. the process can't complete, it goes on.Settu,
in addition you might want to trace the session to find out what it is waiting for. In 10g you can use the DBMS_MONITOR package to enable the tracing, and then use the "tkprof" utility as outlined in the article to get the trace file generated analyzed.
You can also use the V$SESSION view (BLOCKING_SESSION_STATUS, BLOCKING_SESSION, BLOCKING_INSTANCE) to find out if the session is blocked for any reason, although it shouldn't consume CPU in that case.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Maybe you are looking for
-
I upgraded to iTunes 11 and I got all of the songs on my families' other computers. We all share the same AppleID, that's why this happened in the first place; but, I do not want their songs on my computer, how can I disable this without deleting the
-
Tuxedo 8.0 32-bit on Solaris 8 64-bit ( boot-mode)
Hi: i have questions : I have Tuxedo 8.0 32-bit product, i'll need run on solaris 8 ( 64-bit boot-mode ) . Is there Problems wiht that??? My hardware is : Sun Microsystems sun4u Sun Enterprise 420R (2 X UltraSPARC-II 450MHz) System clock frequency: 1
-
10.5.1 Broken Mail Server - virtual host configuration
Hi, I have been trying to set up my mail server (new 10.5.1 build) to run with virtual hosts. I read pterobyte's tutorial ( Making Virtual Mail Users in OS X 10.4/10.5 Server) and implemented his suggested workarounds. However, it doesn't seem to hav
-
AE ppoe mode in AE only allows macbook pro and iMac to connect to internet but not ipad
I just upgraded to 20MB DSL line and got a new Qwest Q1000 modem connected to an A Extreme. Since Qwest now has PPPoE, I set the Q1000 modem to bridge mode and turned off Wifi. Then I Set the AEx router to ppoe mode, entered my username and password
-
Having issues with loading web pages after using migration assistant
Last week my old macbook pro died and i purchased a new 13" mbp. I brought it home the first day i bought it and just turned it on and started playing with it and the internet was blazing fast, no issues at all. I then brought it back to the apple st