diff options
| author | rimio <vasi.vilvoiu@gmail.com> | 2019-01-08 18:30:03 +0200 |
|---|---|---|
| committer | rimio <vasi.vilvoiu@gmail.com> | 2019-01-08 18:30:03 +0200 |
| commit | 85acad49b42bf3734249dae13429a26395a68a03 (patch) | |
| tree | 01361d557a2b80752f399e27fc6f38fd0757f5f0 /util/genluts.py | |
| parent | a7d5e7ca20c959b739d80f96362f326a5848cdb3 (diff) | |
Start encoder
Diffstat (limited to 'util/genluts.py')
| -rw-r--r-- | util/genluts.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/util/genluts.py b/util/genluts.py new file mode 100644 index 0000000..fcaead9 --- /dev/null +++ b/util/genluts.py @@ -0,0 +1,30 @@ +import sys +import numpy as np + +f = open('src/luts.c', 'w') + +# header +f.write('/*\n') +f.write(' * Copyright (c) 2018 Vasile Vilvoiu (YO7JBP) <vasi.vilvoiu@gmail.com>\n') +f.write(' *\n') +f.write(' * libsstv is free software; you can redistribute it and/or modify\n') +f.write(' * it under the terms of the MIT license. See LICENSE for details.\n') +f.write(' */\n\n') +f.write('#include "luts.h"\n\n') + +x = np.linspace(0.0, 2 * np.pi, num=1024, endpoint=False) +sn = np.sin(x) + +# SSTV_SIN_INT10_INT8 +f.write('int8_t SSTV_SIN_INT10_INT8[1024] = { ') +for s in sn * 127: + f.write(str(int(np.around(s))) + ', ') +f.write('};\n\n') + +# SSTV_SIN_INT10_INT16 +f.write('int16_t SSTV_SIN_INT10_INT16[1024] = { ') +for s in sn * 32767: + f.write(str(int(np.around(s))) + ', ') +f.write('};\n\n') + +f.close()
\ No newline at end of file |
