02-05-2013 04:22 AM
Hello All,
I have amplitude values from a SpecAn, thats been put into an array, how would i go about extracting a range of values then place them into another array, but i would still like to keep its orignal index number. As i would want to manipulate that later on, could that be put into the second array also. If so how would i go about doing that.
Any feedback is welcomed
02-05-2013 04:55 AM
02-05-2013 08:40 AM
Hello GerdW,
since then i have managed to get both amplitude and frequency into one array what i would like to do now is compare each element and see if they fit in a band if so place into another array, please could you share any ideas as to how to tackle this N.B using 8.6.
02-05-2013 08:42 AM
02-05-2013 08:56 AM
Hello Gerd,
Thanks for that still have problems with that, because am only expecting 4 element to be passed, i find out what am doing wrong
Thanks
Thomas
02-05-2013 08:57 AM
02-05-2013 09:18 AM
am trying to create a band pass with amplitude values between 0 and -38 then the values that fall into that range into another array with its frequency also.
Kind Regards
Thomas
02-05-2013 12:36 PM
Ugh, too many code optimizations to be had...
What's up with the 10 ms wait? Why do you have the "0" constant wired as an output of the bottom for loop? Why not autoindex the top for loop, make your frequency calculations based on the size of the array and not some hard-coded number?
In fact, the bottom for loop need not exist. Feed the entire array into the in range/coerce and use the resulting array of "In Range?" booleans to cut out the chunk from your array of freq/data? (And make sure you actually want the -38 NOT to be included.)
Actually, I guess all of the above can be done all at once if you're sneaky.
02-06-2013 02:50 AM
Hello Bill,
yes your right the bottom loop is not needed, the wait was so I can see what the code was doing while it was executing.
Am sure there is a more elegant of writing this code and that is why am here on this forum to get serious help and advice
Thanks
Thomas
02-06-2013 02:58 AM
Hello Bill,
also i do not want to force any of the values into range and how will boolean pass any value i want to keep into another array please read carefully as to what i am trying to do
Kind Regards
Thomas