diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/a.out | bin | 0 -> 16872 bytes | |||
-rw-r--r-- | tools/lookuptablemaker.c | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tools/a.out b/tools/a.out Binary files differnew file mode 100755 index 0000000..95fb169 --- /dev/null +++ b/tools/a.out diff --git a/tools/lookuptablemaker.c b/tools/lookuptablemaker.c new file mode 100644 index 0000000..f16420a --- /dev/null +++ b/tools/lookuptablemaker.c @@ -0,0 +1,29 @@ +// Example sine lut generator +#include <stdio.h> +#include <math.h> + +#define M_PI 3.1415926535f +#define SIN_SIZE 512 +#define SIN_FP 12 + +int main() +{ + int ii; + FILE *fp= fopen("sinlut.c", "w"); + unsigned short hw; + + fprintf(fp, "//\n// Sine lut; %d entries, %d fixeds\n//\n\n", + SIN_SIZE, SIN_FP); + fprintf(fp, "const short sin_lut[%d]=\n{", SIN_SIZE); + for(ii=0; ii<SIN_SIZE; ii++) + { + hw= (unsigned short)(sin(ii*2*M_PI/SIN_SIZE)*(1<<SIN_FP)); + if(ii%8 == 0) + fputs("\n\t", fp); + fprintf(fp, "0x%04X, ", hw); + } + fputs("\n};\n", fp); + + fclose(fp); + return 0; +} |