|
Lookup table generation tool
EDIT: I had earlier attached a .xls file, but I just tried to open it and got garbly-gook. Here it is zipped up; this should work better. Also, In the example I've attached, it's just a linear transformation (y=x) and is basically useless as is. But you can change the spreadsheet formulas to generate whatever lookup table you like.
If you've been generating lookup tables for your program, you know that it's not much fun to have to manually type all of the raw values into your code.
I generate all of my lookup tables in Excel, and I wrote this Excel macro to export the data to a text file so that it's much easier to just cut and paste the lookup table declarations from the text file into the C code.
Enable macros when you open up the .xls file, and use the Excel spreadsheet/math functions to create your lookup table. Then just specify the filename and hit the Export button. If you want to customize the VBA code for the macro, from Excel just go to View-Toolbars-Visual Basic and then click on the Visual Basic Editor button. The VBA code is pretty self-explanatory.
Maybe this will save you a few minutes of tedious typing...
EDIT: I had earlier attached a .xls file, but I just tried to open it and got garbly-gook. Here it is zipped up; this should work better. Also, In the example I've attached, it's just a linear transformation (y=x) and is basically useless as is. But you can change the spreadsheet formulas to generate whatever lookup table you like.
Last edited by WillyC : 30-01-2004 at 17:06.
Reason: .xls file viewing problem
|