LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

accessing array elements

Solved!
Go to solution

No,UliSmiley Sad

ecg1.vi doesnt work,pls help me to find it??

thanks

0 Kudos
Message 31 of 58
(2,204 Views)

Hello tinamoli,

 

some things you should think of

- if you wire the whole Array to 'Array Max&Min', you can't be sure to find the first R peak. Maybe peak #10 is a little bit higher than all others due to noise, so you will miss nine peaks.

- In the for loop you check a double precision value to be equal to 0.5. In a real signal it is not very likely to find that exact value (due to noise, once again). You should check for greater or equal / less or equal.

 

To find peaks in your signal you should have a look at 'Peak detector' from 'Signal Processing' --> 'Signal Operation'. This function can give you the locations of peaks.

 

Hope this helps.

Uli

 

0 Kudos
Message 32 of 58
(2,185 Views)

ok UliB,

 

How to be sure that the first peak is find?

In the vi below i dont understand whats mean by location?

also by this i cant determin the index for each peak?

i connect the Min&Max to the peak detector which gives me the wrong index due to the peak detector value,which is extracted from array,and not the array it self.

 

please,tell me what to do?

0 Kudos
Message 33 of 58
(2,175 Views)

hello Uli,

I wish if you answered meSmiley Sad

 

if possible just you modify ecg1.vi.........

0 Kudos
Message 34 of 58
(2,144 Views)

Hello tinamoli,

 

I'm sorry, but I can't answer every day in the forum and I have no real solution to your problem, but I can show you a possible way to the solution.

I have created a VI, which shows how the 'Peak Detection' (PD) and 'Threshold Peak Detection' (TPD) are working.

 

As input I use three gaussian monopulse peaks with offset and noise (I don't have ecg express VI).

 

White is the input signal.

Red the result from Array Max&Min. Maximum at peak #3, so 2 peaks are undetected. (see message #32)

Green is the result from 'Peak Detector' with threshold=1.0. All values are above the threshold. As this function uses interpolation, you will not find the locations and amplitudes in the input array.

Blue is the result from 'Threshold Peak Detector' with threshold=1.0. This function gives you the first element higher than threshold.

 

You can use TPD to find the beginning of the R-pulses (maybe threshold=0.6). If you use the array elements from1st R-pulse to the 2nd R-pulse ('Array Subset'), you can use 'Array Max & Min' to find the maximum value and index of 1st R-pulse.Then use array elements from 2nd R-pulse to 3rd R-pulse to find max and index of 2nd R-pulse. ..... and so on.

If you need to find T-pulse, you can use array elements from 1st R-pulse to 2nd R-pulse again. Start at the first element and go through the elements ('For Loop'). If you are sure the values are under a certain level (e.g. 0, in any case below T-pulse level) you can use TPD again to find elements above a threshold (maybe 0.4). Perhaps you will find more than 1 value, because P-pulse and beginning of R-pulse are belonging to the array subset.

 

I hope you understand what I try to say. You have to split the input into small pieces and analyse every piece for its own. I believe there are better or faster solutions, but this is the way I would go.

 

Uli

Message Edited by UliB on 10-23-2008 10:14 PM
Download All
0 Kudos
Message 35 of 58
(2,136 Views)

UliB wrote:

[...]

If you need to find T-pulse, you can use array elements from 1st R-pulse to 2nd R-pulse again. Start at the first element and go through the elements ('For Loop'). If you are sure the values are under a certain level (e.g. 0, in any case below T-pulse level) you can use TPD again to find elements above a threshold (maybe 0.4). Perhaps you will find more than 1 value, because P-pulse and beginning of R-pulse are belonging to the array subset.

[...]


Maybe you don't need to go through the elements to be sure the values are under a certain level.

You could use TPD a second time with a lower threshold on the subarray R1-R2. I think you will get the first index from the 1st R pulse, 2nd index might be from T-pulse, 3rd index->P-pulse, 4th index -> 2ndR-pulse. This is just a guess, you have to look in the results and have to choose a good threshold value.

 

Uli

0 Kudos
Message 36 of 58
(2,121 Views)

Thanks UliB,

 

 always i learn too many things from the Vi you send to me,these are all improving steps for me as beginner,may be you dont know how much i learn from you!!!!

 anyway thanks a lot.

I am studying the compare_80.Vi ,and i am going to try the method you suggested to me,

but,

there is two things is entering the loop,one input(that can be ecg samples) but the other one which you bundle ,can you tell me whats this one?

 

again thank you,

0 Kudos
Message 37 of 58
(2,099 Views)

tinamoli wrote:

[...]

there is two things is entering the loop,one input(that can be ecg samples) but the other one which you bundle ,can you tell me whats this one?


Hello tinamoli,

 

this is for the XY-Graph. I bundle two empty arrays as x and y values. Then I initialize the four shift registers. In every case one shift register gets the new plot data. After the while loop I build an array to get a multiplot XY Plot.  

 

Uli

Message Edited by UliB on 10-27-2008 09:34 AM
0 Kudos
Message 38 of 58
(2,090 Views)

Hello UliB,

 

With some modification in compare_80.vi  ,successfully  I could calculate the time between two successive  R_peak which yield one of the ECG parameter, really thanks .

 BUT,

Regarding to the peak detector in compare_80.vi ;is it possible to have a range for threshold value ,for example i adjust the threshold in the range of ( 0  to 0.2)?

which show me the peaks within this range?

 

with hope that you accept my best wishes and thanks .

Message Edited by tinamoli on 10-27-2008 08:16 AM
0 Kudos
Message 39 of 58
(2,077 Views)

Hello UliB,

 

regarding to last message,

clarifying:

i just asked about how we can have window detector,which i thought if having a range for threshold,then we can have a window of detected peak within that range.

i hope i could prove the mean,

 

i am looking forward for your reply pls?

thanks,

0 Kudos
Message 40 of 58
(2,035 Views)