LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

searching an array by sections

Hi all

I have recorded real world data. The data is a sinusoidal waveform that each pulse is a different length with each peak and troff being of different amplitudes.
I have got a zero crossing vi that searches the array and finds each zero crossing and returns the index of that zero crossing. So you end up with an array of certain points of the original array to calculate pulse widths of each individual pulse.
Now I know where each pulse starts and ends (crosses the zero and re-crosses the zero) I want to search for the highest absolute amplitude out of this section. Once this is done I will them search the next pulse and so on. This will then tell me the maximum amplitude from each individual pulse.
It sounds simple but I'm struggling.

If anyone has got any information on how I can do this it would really help
0 Kudos
Message 1 of 9
(3,732 Views)

Since you know how long the waveform is, use the Get Waveform Subset VI in the Waveform palette. Then use the Waveform Min Max VI in the Waveform >> Analog Wfm palette

0 Kudos
Message 2 of 9
(3,722 Views)

when you want to find picks there is problem 
sometimes some pick are not picks that you want 
picks vi work base on mathematic differential equation and some times it could find the pick that is just pick of noise 
in this vi the pick that are in range up to 60 % of max pick selected 

0 Kudos
Message 3 of 9
(3,692 Views)

Sounds like you have most of the logic down in your head. This will get you most of the way there, but you have to put in your own data and zero crossings. It will give you the peak between each zero crossing. So if you put in 10 crossings, you'll get 9 peaks back, I hope this is what you expect.

 

Max Of Pulse.png

0 Kudos
Message 4 of 9
(3,638 Views)

@Gregory wrote:

Sounds like you have most of the logic down in your head. This will get you most of the way there, but you have to put in your own data and zero crossings. It will give you the peak between each zero crossing. So if you put in 10 crossings, you'll get 9 peaks back, I hope this is what you expect.

 

Max Of Pulse.png


Just a bit off there Gregory

Try a bit simpler solution since the number of "Crossings" is discoverable

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 9
(3,618 Views)

Nice Jeff, I like the For loop. When you say "off" do you mean "more complex than it needed to be" or "not giving a correct result"?

0 Kudos
Message 6 of 9
(3,608 Views)

@JÞB wrote:

Try a bit simpler solution since the number of "Crossings" is discoverable

Capture.PNG


Jeff, I think you are missing a Subtract right before the Array Subset since the bottom input is supposed to be a Length and not and final index.

Spoiler
Just being thorough

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 9
(3,602 Views)

Jeff, I think you are missing a Subtract right before the Array Subset since the bottom input is supposed to be a Length and not and final index.

 

Yes Tim, Thanks.  I rushed.

 

@ Gregory that "off" was looking at two issues.  1 if no zero crossings are seen the while loop is a poor choice (You get a array of[0] out vice the correct empty array) a for loop is the only way to solve that.   2 the abs val serves no purpose there (but probably does for the case where there are zero crossings in the data) better to abs val the array once outside the loop rather than abs val each chunk.

 

Spoiler
Just being thourough- it was some nice code with an edge case that could blow-up

"Should be" isn't "Is" -Jay
Message 8 of 9
(3,582 Views)

I see, both good points, thanks 🙂

0 Kudos
Message 9 of 9
(3,570 Views)