]> git.zerfleddert.de Git - proxmark3-svn/blob - fpga/tests/plot_edgedetect.py
fix incorrect variable name
[proxmark3-svn] / fpga / tests / plot_edgedetect.py
1 #!/usr/bin/env python
2 #-----------------------------------------------------------------------------
3 # Copyright (C) 2014 iZsh <izsh at fail0verflow.com>
4 #
5 # This code is licensed to you under the terms of the GNU GPL, version 2 or,
6 # at your option, any later version. See the LICENSE.txt file for the text of
7 # the license.
8 #-----------------------------------------------------------------------------
9 import numpy
10 import matplotlib.pyplot as plt
11 import sys
12
13 if len(sys.argv) != 2:
14 print "Usage: %s <basename>" % sys.argv[0]
15 sys.exit(1)
16
17 BASENAME = sys.argv[1]
18
19 nx = numpy.fromfile(BASENAME + ".time")
20
21 def plot_time(dat1):
22 plt.plot(nx, dat1)
23
24 sig = open(BASENAME + ".filtered").read()
25 sig = map(lambda x: ord(x), sig)
26
27 min_vals = open(BASENAME + ".min").read()
28 min_vals = map(lambda x: ord(x), min_vals)
29
30 max_vals = open(BASENAME + ".max").read()
31 max_vals = map(lambda x: ord(x), max_vals)
32
33 states = open(BASENAME + ".state").read()
34 states = map(lambda x: ord(x) * 10 + 65, states)
35
36 toggles = open(BASENAME+ ".toggle").read()
37 toggles = map(lambda x: ord(x) * 10 + 80, toggles)
38
39 high = open(BASENAME + ".high").read()
40 high = map(lambda x: ord(x), high)
41 highz = open(BASENAME + ".highz").read()
42 highz = map(lambda x: ord(x), highz)
43 lowz = open(BASENAME + ".lowz").read()
44 lowz = map(lambda x: ord(x), lowz)
45 low = open(BASENAME + ".low").read()
46 low = map(lambda x: ord(x), low)
47
48 plot_time(sig)
49 plot_time(min_vals)
50 plot_time(max_vals)
51 plot_time(states)
52 plot_time(toggles)
53 plot_time(high)
54 plot_time(highz)
55 plot_time(lowz)
56 plot_time(low)
57
58 plt.show()
Impressum, Datenschutz