-
Notifications
You must be signed in to change notification settings - Fork 1
/
dual_record_data.py
executable file
·74 lines (65 loc) · 2.74 KB
/
dual_record_data.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Mon Dec 16 18:24:05 2013
##################################################
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import time
import wx
class top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 25e6
self.lo_off = lo_off = 0
self.gain = gain = 28
self.freq_l2 = freq_l2 = 1.22760e9
self.freq_l1 = freq_l1 = 1.57542e9
##################################################
# Blocks
##################################################
self.uhd_usrp_source_0 = uhd.usrp_source(
device_addr="addr0=192.168.10.3,addr1=192.168.10.2",
stream_args=uhd.stream_args(
cpu_format="sc16",
otw_format="sc8",
channels=range(2),
),
)
self.uhd_usrp_source_0.set_clock_source("gpsdo", 0)
self.uhd_usrp_source_0.set_time_source("gpsdo", 0)
self.uhd_usrp_source_0.set_clock_source("mimo", 1)
self.uhd_usrp_source_0.set_time_source("mimo", 1)
self.uhd_usrp_source_0.set_samp_rate(samp_rate)
self.uhd_usrp_source_0.set_center_freq(uhd.tune_request(freq_l1, lo_off), 0)
self.uhd_usrp_source_0.set_gain(gain, 0)
self.uhd_usrp_source_0.set_antenna("RX2", 0)
self.uhd_usrp_source_0.set_center_freq(uhd.tune_request(freq_l2, lo_off), 1)
self.uhd_usrp_source_0.set_gain(gain, 1)
self.uhd_usrp_source_0.set_antenna("RX2", 1)
self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_int*1, "/media/is4s/512GB_SSD/usrp_l2.dat", False)
self.blocks_file_sink_1.set_unbuffered(False)
self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_int*1, "/media/is4s/512GB_SSD/usrp_l1.dat", False)
self.blocks_file_sink_0.set_unbuffered(False)
##################################################
# Connections
##################################################
self.connect((self.uhd_usrp_source_0, 0), (self.blocks_file_sink_0, 0))
self.connect((self.uhd_usrp_source_0, 1), (self.blocks_file_sink_1, 0))
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
tb = top_block()
tb.start()
time.sleep(180)
#tb.wait()
tb.stop()