LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup Tables for text

Hi I had a table for frequencies for various notes on a guitar and needed to convert to an actual note eg. 82.41 corresponding to an E2 and so on. I also wanted to make sure that no matter what values were supplied, it would round to the nearest number and then spit out the note corresponding to that number or frequency. I tried using 1D lookup tables for this purpose but found that I could not input alpha- numeric characters for the LUT Data - the values (notes) to be outputted.
 
Any suggestions? Or is there some other way I should be looking at. I only chose this way because it seemed to be quite efficient rather than writing a long if.
 
Thanks
-Karan
0 Kudos
Message 1 of 3
(2,536 Views)
Use two matching lookup tables (the frequencies must be sorted in increasing order), DBL for the frequencies and string for the notes. Get the fractional index of the frequency using "threshold array", roud the index to the nearest integer, and index into the notes array.
 
 
There are many other possibilities....
 

Message Edited by altenbach on 03-10-2007 12:16 PM

Message Edited by altenbach on 03-10-2007 12:20 PM

0 Kudos
Message 2 of 3
(2,529 Views)

Thanks..... that helped a lot.

-Karan

0 Kudos
Message 3 of 3
(2,511 Views)