-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·50 lines (29 loc) · 874 Bytes
/
Copy pathplot.py
File metadata and controls
executable file
·50 lines (29 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
import csv
import numpy as np
from matplotlib import pyplot as plt
plt.close('all')
plt.figure(figsize=(10,5))
for infile in ('850-950.csv', '900-930.csv'):
d = np.loadtxt(infile, delimiter=',')
f = d[:, 0] / 1e6
mag = d[:, 1]
plt.plot(f, mag)
plt.grid(True)
plt.xlabel('Frequency (MHz)')
plt.ylabel('dB (arbitrary reference)')
plt.xticks(np.arange(850, 950, step=5), rotation=45)
plt.title('Spectrum survey\nAverage power')
plt.savefig('average_850-950.pdf')
plt.figure(figsize=(10, 5))
infile = '900-930.csv'
d = np.loadtxt(infile, delimiter=',')
f = d[:, 0] / 1e6
mag = d[:, 1]
plt.plot(f, mag)
plt.grid(True)
plt.xlabel('Frequency (MHz)')
plt.ylabel('dB (arbitrary reference)')
plt.xticks(np.arange(900, 931, step=5), rotation=45)
plt.title('Spectrum survey\nAverage power')
plt.savefig('average_900-930.pdf')