From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-31-2014 10:58 PM
helo everyone
i'm rai
i have some problem, i can not find peak value and valley value from my signal, maybe can you help me?
how to find peak value and valley value with using peak detector ?
11-01-2014 01:28 AM
What problems are you having with finding the peaks/valleys? Your VI does not have any data in it and your description doesn't say.
It looks like you found peakDetector PtByPt.vi -- you'll probably want to use peakDetector.vi instead (not "point to point").
Please run your VI , right click on the graph, and say "data operations >> make current values default", and then repost your VI with more details of the peak finding problem. We'll be able to the the signal you're trying to analyze.
11-01-2014 02:14 AM
thank you, my data from the acquisition of SpO2 sensor using arduino. I've been able to obtain the data SpO2.
I need to know the value of peaks and valleys for find the value of the ratio.I still have not been able to obtain niali peaks and valleys.
and i have not understandwhat you mean?
Will you help me
11-01-2014 03:47 AM
11-01-2014 09:06 AM
my block diagram
I obtained the data in realtime using SpO2 sensor
11-01-2014 01:31 PM - edited 11-01-2014 01:37 PM
Here's the deal You're trying to use the peak detector function on an array of data containing only one data point. The analog read outputs a single point in this case and you're turning it into an array (of one point) using the initialize array function. All of the wires that I've turned green in the first attachment contain one data point.
Second issue is that multiplying a 1D array of any length by a 1D array of length 1 (your 10000 scaling factor) will yield a 1D array of length 1. In your case, that's another reason the peak detectors are not finding anything.
The simplest (but not the best) way to get your VI to work, given what you have, is to use the data you're storing in the chart. It acts like a FIFO buffer of finite length (1024 samples unless you've changed that). What I've done in the second screenshot is to use the history to feed all of your subsequent calculations. Beware, the chart will remember history from run to run, too, so you might find peaks from the last time you ran the program unless you empty the history at each run.
Again, this is not the ideal solution but it should get you past the peak detect issue and you can work on a better data storage option at your leisure.
I see that you're also finding peaks in the first while loop. It has the same issue and a similar solution would work here, too.
11-01-2014 01:32 PM
Are you running those pieces of code in parallel intentionally? Or, did you have a linear order you wanted to run the code?
As a general rule, don't ever wire right to left. It makes your code a mess and much harder to debug.
In the lower right corner it appears you have code that doesn't have anything wired as an input. This means it will run independent of the other code you have in the loop. You cannot tell when it'll run. This creates something of a race condtion. This may, or may not, pose a problem in your application.
Did you try changing the VI as suggested to get away from the point by point implementation?
11-02-2014 01:17 AM
thank you very much for your suggestion.
i can find peak and valley value but ratio between peak and valley very small. it make me difficult to calculate spo2. do you know, how to find the value of the average peak and valley then stored temporarily after the complete data obtained stored data taken to calculate sppo2 ?
11-02-2014 03:47 AM
Given the way your code is laid out and me not knowing how much data you're going to take before you analyze it, I'm going to suggest you write your individual analog samples to file as soon as they are taken.
Open a file outside the outer while loop and pass the refnum in to the inner loop. Set the file position to 0 bytes from the end and write your analog sample with every iteration. When the sampling is done (outer while loop exits) read the data back from the file and do your analysis.
11-02-2014 08:36 AM
i can't undestand with your suggestion, maybe you have some exampel for record data such as i want