fix: usage and sample text of hf mf cwipe
[proxmark3-svn] / fpga / tests / plot_edgedetect.py
CommitLineData
3b2fee43 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#-----------------------------------------------------------------------------
9import numpy
10import matplotlib.pyplot as plt
11import sys
12
13if len(sys.argv) != 2:
14 print "Usage: %s <basename>" % sys.argv[0]
15 sys.exit(1)
16
17BASENAME = sys.argv[1]
18
19nx = numpy.fromfile(BASENAME + ".time")
20
21def plot_time(dat1):
22 plt.plot(nx, dat1)
23
24sig = open(BASENAME + ".filtered").read()
25sig = map(lambda x: ord(x), sig)
26
27min_vals = open(BASENAME + ".min").read()
28min_vals = map(lambda x: ord(x), min_vals)
29
30max_vals = open(BASENAME + ".max").read()
31max_vals = map(lambda x: ord(x), max_vals)
32
33states = open(BASENAME + ".state").read()
34states = map(lambda x: ord(x) * 10 + 65, states)
35
36toggles = open(BASENAME+ ".toggle").read()
37toggles = map(lambda x: ord(x) * 10 + 80, toggles)
38
39high = open(BASENAME + ".high").read()
40high = map(lambda x: ord(x), high)
41highz = open(BASENAME + ".highz").read()
42highz = map(lambda x: ord(x), highz)
43lowz = open(BASENAME + ".lowz").read()
44lowz = map(lambda x: ord(x), lowz)
45low = open(BASENAME + ".low").read()
46low = map(lambda x: ord(x), low)
47
48plot_time(sig)
49plot_time(min_vals)
50plot_time(max_vals)
51plot_time(states)
52plot_time(toggles)
53plot_time(high)
54plot_time(highz)
55plot_time(lowz)
56plot_time(low)
57
58plt.show()
Impressum, Datenschutz