LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Function question?

Solved!
Go to solution

Hello!

 

I try to understand a program run. This program make difference between clap or knock. But I don't understand Split 1D Array Index input data, it works only if I set up 500. What does it make exactly?

 

I can read the help funciton. (Divides array at index and returns the two portions with the element of index at the beginning of second subarray.) But I don't understand.

 

How is it work? And what does it portion?

 

I attach a picture below.

 

Thank you your answear!

 

question.jpg

0 Kudos
Message 1 of 6
(890 Views)

Hi laszlo,

 


@laszlobango wrote:

I can read the help funciton. (Divides array at index and returns the two portions with the element of index at the beginning of second subarray.) But I don't understand.


SplitArray doesn't "divide", it splits an array!

 

Example:

Splitting an array consisting of several chars like "ABCDefgh" (each char an element) with an index of 4 will give outputs of "ABCD" and "efgh". You could easily test this on your own with a simple test VI with only a SplitArray function in its block diagram…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(883 Views)

Thank you the answer!

 

But I don't understand why it works well If I set up  500? Whats the problem with 100 or 400 or 1000? ( I'm full beginner)

 

I tried my program, and it shows good results with this set up only. If it's less or more than it coulden't make difference between clap or knock.

 

And it is what i don't understand.

 

 

0 Kudos
Message 3 of 6
(865 Views)
Solution
Accepted by topic author laszlobango

You are sampling a sound at regular time intervals, so the index could be interpreted as the time elapsed after the start of acquisition - actually it's 500 times the acquisition period.

It seems that "time" 100 is too early and "time" 1000 is too late. The LabVIEW function in itself works in any case. It's the nature of the signal that apparently makes 500 the right choice.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(858 Views)

Thank you!

 

It's okay for me.

 

And every situation i should make tests before find the good index? Or do you know better way?

 

 

0 Kudos
Message 5 of 6
(853 Views)
Solution
Accepted by topic author laszlobango

Of course you must consider every different case separately. You should be guided by the consideration of the signal to be analyzed, i.e. the physics of the phenomenon when possible. Other parameters can be relevant: for example, if you double the acquisition frequency the right choice would be 1000.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 6
(837 Views)