]> rtime.felk.cvut.cz Git - fpga/pwm.git/blob - even.py
use of incremental encoder index signal for phase table alignment
[fpga/pwm.git] / even.py
1 #!/usr/bin/python
2
3 from __future__ import with_statement
4 import os, sys, re, string
5
6 if __name__ == '__main__':
7
8     f_in=open('sin1000.lut','r')
9     f_out=open('sin500.lut','w')
10     decim_factor=2
11     decim_cnt=0
12
13     for line in f_in:
14         if decim_cnt==0:
15            f_out.write(line)
16         decim_cnt=decim_cnt+1
17         if decim_cnt==decim_factor:
18             decim_cnt=0
19     f_in.close
20     f_out.close
21
22
23           
24
25