52 | | defProperty('rxfreq', 2400e6, "Starting rx frequency") |
53 | | defProperty('rxstep', 10e6, "Rx frequency increments") |
54 | | defProperty('nfreq', 10, "Number of frequency steps") |
55 | | defProperty('dwell', 10, "Number of seconds at each frequency step") |
| 52 | defProperty('freq', 1500e6, "Starting rx frequency") |
| 53 | defProperty('dwell', 3, "Number of seconds at each frequency step") |
| 54 | |
| 55 | defGroup('txnode', 'node2-2.grid.orbit-lab.org') { |n| |
| 56 | } |
| 57 | |
| 58 | defGroup('rxnode', 'node1-1.grid.orbit-lab.org,node20-20.grid.orbit-lab.org') { |n| |
| 59 | } |
| 60 | |
| 61 | onEvent(:ALL_UP) do |event| |
| 62 | info "Give machines some time to warm up" |
| 63 | wait 4 |
| 64 | |
| 65 | info "activate" |
| 66 | allGroups.uhd.u0.activate # starts UHD daemon |
| 67 | wait 3 |
| 68 | |
| 69 | info "set tx parameters" |
| 70 | group("txnode").uhd.u0.txfreq = property.freq # set tx frequency (Hz) |
| 71 | group("txnode").uhd.u0.txrate = "8e6" # set tx sampling rate |
| 72 | group("txnode").uhd.u0.txgain = "30" # set tx gain (dB) |
| 73 | group("txnode").uhd.u0.txampl = "0.7" # set tx wavform amplitude |
| 74 | #group("txnode").uhd.u0.txwavefreq = "1e6" |
| 75 | group("txnode").uhd.u0.txwavetype = "CONST" # set type of waveform to transmit = {CONST, SINE, RAMP} |
| 76 | group("txnode").uhd.u0.transmit # start transmitting |
| 77 | |
| 78 | group("rxnode").uhd.u0.rxfreq = property.freq # set rx frequency |
| 79 | group("rxnode").uhd.u0.rxrate = "8e6" # set rx sampling rate |
| 80 | group("rxnode").uhd.u0.rxgain = "25" # set rx gain |
| 81 | group("rxnode").uhd.u0.numbins = "128" # number of fft points |
| 82 | group("rxnode").uhd.u0.avgwinlen = "32" # set averaging window size for each fft bin across time. |
| 83 | group("rxnode").uhd.u0.omlfile = "spectrum.grid" # oml database file name to store fft data |
| 84 | group("rxnode").uhd.u0.omlserver = "idb2:3003" # oml server |
| 85 | group("rxnode").uhd.u0.record # start recording |
| 86 | |
| 87 | (0..30).each { |i| # set up loop |
| 88 | offset = (rand()*4).to_f # find next transmit frequency |
| 89 | cf = property.freq + (offset*1e6) |
| 90 | group("txnode").uhd.u0.txfreq = cf # set new transmit frequency |
| 91 | wait property.dwell # wait for a few seconds |
| 92 | } |
62 | | |
63 | | onEvent(:ALL_UP) do |event| |
64 | | info "Give machines some time to warm up" |
65 | | wait 4 |
66 | | |
67 | | allGroups.uhd.u0.activate # starts uhd_daemon |
68 | | wait 3 |
69 | | |
70 | | group("rxnode").uhd.u0.rxrate = "8e6" # set receive chain sampling rate |
71 | | group("rxnode").uhd.u0.rxgain = "20" # set receive chain gain (dB) |
72 | | group("rxnode").uhd.u0.numbins = "128" # set size of fft |
73 | | group("rxnode").uhd.u0.avgwinlen = "32" # set averaging window size for each fft bin across time. |
74 | | |
75 | | group("rxnode").uhd.u0.omlfile = "spectrum.grid" # oml database file name to store fft data |
76 | | group("rxnode").uhd.u0.omlserver = "idb2:3003" # oml server |
77 | | |
78 | | group("rxnode").uhd.u0.record # start recording thread |
79 | | |
80 | | (0..property.nfreq).each { |i| # set up loop |
81 | | cf = property.rxfreq + (property.rxstep*i) # compute next carrier frequency |
82 | | group("rxnode").uhd.u0.rxfreq = cf # set receive chain carrier frequency (Hz) |
83 | | |
84 | | wait property.dwell # wait for number of seconds before computing next frequency |
85 | | } |
86 | | |
87 | | group("rxnode").uhd.u0.stop # stop recording thread |
88 | | |
89 | | allGroups.uhd.u0.deactivate # stop uhd_daemon |
90 | | |
91 | | |
92 | | info "Finish it." |
| 98 | info "Finish it." |
117 | | }}} |
| 123 | PRAGMA foreign_keys=OFF; |
| 124 | BEGIN TRANSACTION; |
| 125 | CREATE TABLE _senders (name TEXT PRIMARY KEY, id INTEGER UNIQUE); |
| 126 | INSERT INTO "_senders" VALUES('node20-20',1); |
| 127 | INSERT INTO "_senders" VALUES('node1-1',2); |
| 128 | CREATE TABLE _experiment_metadata (key TEXT PRIMARY KEY, value TEXT); |
| 129 | INSERT INTO "_experiment_metadata" VALUES('start_time','1369071050'); |
| 130 | CREATE TABLE "spectrum_data" (oml_sender_id INTEGER, oml_seq INTEGER, oml_ts_client REAL, oml_ts_server REAL, "samplin |
| 131 | g" INTEGER, "cfreq_MHz" REAL, "gain_dB" INTEGER, "FFTLength" INTEGER, "FFTNum" TEXT, "FFTBins" BLOB); |
| 132 | INSERT INTO "spectrum_data" VALUES(1,1,0.534819999709725,211.009485,7692307,1500000000.0,25,128,'---',X'84B7C43E2146863DC912F53CC851933CF23EA93CCEC6AC3CEFF5EE3C7578D83CE054723C8C1D873C9F57F73C72CD1F3DF7C1BD3C7D75CC3CD972FA3C1A5B053DB973133DA6541E3D5ED0563DD8F0563DFA9E4B3D256B883DF368B03D02F2B43D77C1F53D403B2F3E2654A23E021EE33F690FFB3E7C7A613E7F6B093E49EFC93DA880AA3D78298B3DC5E1663D98FC483DCECC203D7755253D2BD7FE3CA74AEB3C5C8AF03C8453EE3C5F05D73CD289B63C4F51BD3C71A3BE3C5927983C2E6B8E3C6EFE753C19A3853CADAF7E3CBD118D3CFE1A963C99776F3CCC9E7F3CB610853CFE5A593C10E36B3C7365733C5EAC503CFA39353CA4CA763CC498213C44A11A3C07F1243CAEE5473CA26A483C6C603D3CFE6A483C6A9C113C9DCD0C3C1481413C3274C63B8B6A3F3C2701E33B506B6F3C3C9DDC3B05131B3CC50E1B3CB49D723C446E023C224B713C6E0FF33BFE68FD3B63FC0E3C3E33C43B9F8B973CB3A6733A992C813C76474E3C2DA1FC3A6DA70A3CCC66103CAA0A013C14874C3C24C4913AA335383C8472993CAA53BD3BEA0CA43B0846CB3CEBAF3B3CC2F1463C1AC0963CDD26553BF2C79C3A040E983CF4C8713C16F0AC3CF198233C98AA3B3C4E6D8D3C7CFEA13C7193723C317DFF3BA24DF93B17851D3CB140BE3C76979C3C31F39A3C41D05A3B56C5873C6D537F3C1540963CACF4F13CFB52DE3C6630093D5304343D'); |
| 133 | }}} |