File: gen_cordic_consts.py

package info (click to toggle)
uhd 3.7.2-1%2Bbpo70%2B1
  • links: PTS
  • area: main
  • in suites: wheezy-backports
  • size: 491,920 kB
  • sloc: ansic: 51,090; cpp: 42,636; xml: 19,627; vhdl: 14,556; tcl: 6,633; python: 5,870; ada: 2,760; sh: 2,533; makefile: 610; pascal: 230; csh: 224; perl: 11
file content (10 lines) | stat: -rwxr-xr-x 195 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env python

import math

zwidth = 16

for i in range(17):
    c = math.atan (1.0/(2**i)) / (2 * math.pi) * (1 << zwidth)
    print "`define c%02d %d'd%d" % (i, zwidth, round (c))