LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete entries from array closer than speicified resolution

Solved!
Go to solution

For example I have the following array:

 

[1k, 2k, 3k,     23k, 24k, 25k, 26k,          51k, 52k, 54k, 56k,                 76k, 78k]

 

For Example Resolution is 10k

I want to process the array in a way so that it returns an array with frequencies-closer-than-resolution deleted while among the closer-than-resolution-frequencies only retain the highest and delete the others.

 

In the above array I have seperated the elements to indicate the group of frequencies forming 'closer-than-resolution-frequencies'  for example 1k, 2k, 3k are closer-than-resolution-frequencies

 

The resultant array should look like.

 

[3k,           26k,           78k]

 

In the above example there are 3 group of frequencies for ilustration purpose, but it could be any number.

 

Rounding off the array and deleting the duplicates brings it closer to the result but this adds an error equal to the Resolution.

0 Kudos
Message 1 of 7
(2,735 Views)

Hi Reeves,

 

Are you asking how to process the array in the manner you've described above? You should be able to do so using the various array functions in LabVIEW, which are located on the block diagram under Programming>>Array. You can find quite a bit of useful information about how to use these functions in the LabVIEW help. If you want to return only the highest frequencies, I would sort the array, and then start at the high frequency end of the array and loop through all values, pulling out those that meet your criteria.

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 2 of 7
(2,696 Views)

Thank you Dan for your reply.

 

I am afraid the problem is not that simple. ()

 

See I have an array with frequencies lying in groups. The purpose is to seperate out those groups of frequencies into seperate arrays.

 

For example I have an array with frequencies lying in three groups i.e.

 

[1k, 3k, 4k,  15k, 16k, 19k, 20k,  53k, 54k, 55k]

 

A parameter lets call it 'peak resolution', will help us make the groups. If the difference in any two frequencies is less than peak resolution, they are considered to be in one group and are suppose to be added to a seperate array of that group. In the same manner each group frequencies are seperated out in seperate arrays.

 

The most important point here is grouping the frequencies according to the peak resolution parameter.

 

The output should be the following three arrays

 

[1k, 3k, 4k]

[15k, 16k, 19k, 20k]

[53k, 54k, 55k]

 

After getting these arrays I can perform any function on the elements to get the highest peak, average peak, lowest peak, etc. (This last sentence is for clarification and not the part of my query)

 

 

Regards,

Reeves

 

Labview 8.6

0 Kudos
Message 3 of 7
(2,681 Views)

Sorry I missed 'the most important point' ! 🙂

In the above message the peak resoution value assumed was 5k

0 Kudos
Message 4 of 7
(2,679 Views)
Solution
Accepted by topic author Reeves7

Hope this helps.

array.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 5 of 7
(2,664 Views)

Kudos for the reply! 🙂

 

But I guess you have higher version of labview than 8.6 that is why you posted only the image format. I will remake in my labview and test and I will get back to you.

0 Kudos
Message 6 of 7
(2,647 Views)

Nice solution dude!

I had to make some modifications to the VI to make it work for isolated frequencies case in the start, end and in between.

Also I had to figure out the False cases as they were not in the image but they were kinda simple 😉

 

Thanks

0 Kudos
Message 7 of 7
(2,637 Views)