Skip to content

Commit d8eda90

Browse files
committed
fft_* fix some bugs, cleanup
1 parent fadb1fa commit d8eda90

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

fft_peak_detection.py

100644100755
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
#!/usr/bin/env python3
2+
13
import numpy
2-
import matplotlib.pyplot as plt
34
from scipy import signal
45

56
from p25_control_demod import p25_control_demod
7+
from moto_control_demod import moto_control_demod
8+
from edacs_control_demod import edacs_control_demod
69
from redis_channelizer_manager import redis_channelizer_manager
710

811

912
from config import rc_config
1013

11-
import time, uuid
14+
import time
15+
import uuid
16+
import json
17+
import logging
1218
import argparse
1319

20+
21+
with open('config.logging.json', 'rt') as f:
22+
config = json.load(f)
23+
24+
logging.config.dictConfig(config)
25+
1426
overseer_uuid = '%s' % str(uuid.uuid4())
1527
site_uuid = '876c1a54-8183-4134-a41c-67a5b6121fcd'
1628

@@ -23,7 +35,7 @@
2335

2436

2537
rcm = redis_channelizer_manager(index=args.index)
26-
38+
time.sleep(0.5)
2739
with open('/tmp/fft_source_%s' % args.index, 'rb') as fh:
2840
data = numpy.fromfile(fh, numpy.float32)
2941

@@ -61,18 +73,14 @@
6173
print('Peak %s' % int(frequency))
6274
demods[frequency] = p25_control_demod({
6375
'type': 'p25',
64-
'id': 'c4fm',
76+
'id': 'p25',
6577
'modulation': 'C4FM',
6678
'default_control_channel': 0,
67-
'channels': { 0: frequency},
79+
'channels': { 0: frequency, 1:frequency},
6880
}, site_uuid, overseer_uuid, rcm=rcm)
6981
demods[frequency].start()
7082

71-
# plt.axvline(line, alpha=0.5, color='r')
72-
# plt.text(line, .5, frequency, rotation=90)
73-
#else:
74-
# plt.axvline(line, alpha=0.5, color='g')
75-
time.sleep(10)
83+
time.sleep(30)
7684
offsets = []
7785
for frequency in demods:
7886
thread = demods[frequency]
@@ -92,8 +100,8 @@
92100
thread.keep_running = False
93101
with open('fft.scan.output', 'a') as f:
94102
f.write('%s %s %s\n' % (frequency, offset, detail))
95-
96-
print('offset average for %s: %s' % (args.index, sum(offsets)/len(offsets)))
103+
if len(offsets) > 0:
104+
print('offset average for %s: %s' % (args.index, sum(offsets)/len(offsets)))
97105
#plt.plot(data)
98106
#plt.axhline((data_average*2))
99107
#plt.show()

fft_vector.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import sys
1717
import signal
1818
from argparse import ArgumentParser
19-
from gnuradio.eng_arg import eng_float, intx
20-
from gnuradio import eng_notation
2119
from gnuradio import zeromq
2220

2321
import argparse

0 commit comments

Comments
 (0)