Changes between Version 16 and Version 17 of Tutorials/k0SDR/Tutorial05


Ignore:
Timestamp:
Jun 15, 2015, 10:31:34 PM (9 years ago)
Author:
stojadin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial05

    v16 v17  
    5858
    5959}}}
     60
     61=== Performing the experiment using OEDL ===
     62
     63OEDL can be used to automatically perform the experiment. The OEDL code for the experiment is shown below.
     64
     65{{{
     66defProperty('rx_freq', "800e6", "")
     67defProperty('rx_rate', "5e6", "")
     68defProperty('rx_gain', "20", "")
     69defProperty('recv_oml_output_type', "vector", "")
     70defProperty('recv_oml_servername', "file", "")
     71defProperty('tx_freq', "798e6", "")
     72defProperty('tx_rate', "5e6", "")
     73defProperty('tx_gain', "20", "")
     74defProperty('tx_module', "foo", "") # using a random name for an unexisting module
     75defProperty('rx_module', "foo", "") # so that no module is started, but it can be added later by setting this property
     76defProperty('del_rx_module', "foo", "")
     77
     78require './wiserd.rb'
     79
     80defGroup('sender', "node1-1") do |node|
     81  node.addApplication("test:app:wiserd") do |app|
     82    app.setProperty('--uhd_tx_freq', property.tx_freq)
     83    app.setProperty('--uhd_tx_rate', property.tx_rate)
     84    app.setProperty('--uhd_tx_gain', property.tx_gain)
     85    app.setProperty('--addmodule', property.tx_module)
     86  end
     87end
     88
     89defGroup('receiver', "node1-2") do |node|
     90  node.addApplication("test:app:wiserd") do |app|
     91    app.setProperty('--uhd_rx_freq', property.rx_freq)
     92    app.setProperty('--uhd_rx_rate', property.rx_rate)
     93    app.setProperty('--uhd_rx_gain', property.rx_gain)
     94    app.setProperty('--recv_oml_output_type', property.recv_oml_output_type)
     95    app.setProperty('--recv_oml_servername', property.recv_oml_servername)
     96    app.setProperty('--addmodule', property.rx_module)
     97    app.setProperty('--delmodule', property.del_rx_module)
     98  end
     99end
     100
     101onEvent(:ALL_UP_AND_INSTALLED) do |event|
     102  wait 10
     103  info "Starting the Receiver"
     104  group("receiver").startApplications
     105  info "Starting the Sender"
     106  group("sender").startApplications
     107  wait 8
     108  property.tx_module = "waveform"
     109  property.rx_module = "fftmovingavgoml"
     110  for i in 798..802
     111    property.tx_freq = "#{i}e6"
     112    wait 1
     113  end
     114  property.del_rx_module = "fftmovingavgoml"
     115  group("sender").stopApplications
     116  group("receiver").stopApplications
     117  Experiment.done
     118end
     119}}}
     120
     121This experiment consists of a receiver centered at 800 MHz, with the bandwidth of 5 MHz, and the transmitter that runs for 5 seconds, transmitting a SINE waveform centered at frequencies of 798, 799, 800, 801 and 802 MHz for 1 second each. The code needs to be saved in a file named ''experiment.rb''. It's assumed that the Wiserd application definition for OEDL is available in the file named ''wiserd.rb''. After imaging the nodes and making sure they are turned on, the experiment can be run using the command
     122
     123{{{
     124omf exec experiment.rb
     125}}}