12-03-2011 04:04 AM
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.
Solved! Go to Solution.
12-05-2011 02:23 PM
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
12-07-2011 12:16 AM
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
12-07-2011 12:19 AM
Sorry I missed 'the most important point' ! 🙂
In the above message the peak resoution value assumed was 5k
12-07-2011 05:20 AM
12-07-2011 10:32 PM
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.
12-08-2011 02:33 AM
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