Changes between Version 12 and Version 13 of Tutorials/k0SDR/Tutorial05


Ignore:
Timestamp:
May 27, 2015, 7:06:21 PM (9 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial05

    v12 v13  
    1 == USRP2 configuration and data collection with OEDL script ==
     1== USRP2 configuration and OML data collection with wiserd ==
    22
    33[[TOC(Tutorials/k0SDR*)]]
    44
    55=== Description ===
    6 In this tutorial we'll demonstrate exactly what the title says.
     6We'll use the nodes on sandbox 3 to transmit a predefined waveform and receive the spectrum data into an OML file.
    77
    88=== Hardware / Software Resources utilized ===
    9  1. 3 grid nodes with a USRP2 connect via Ethernet.
    10  2. ''ubuntu-12-04-uhd-daemon.ndz'': node image with all the pre-compiled software required to configure the USRPs.
    11  3. ''uhd_exp1.rb'' - OEDL script executed on the console. This script configures the USRPs for data collection at specified frequencies, sampling rate, etc...
    12  4. ''uhd_daemon'' - a node background process that bridges the gap between OMF commands and USRP2.
     9 1. Grid nodes with a USRP2 connect via Ethernet.
     10 2. ''ubuntu-14-04-64bit-sdr.ndz'': disk image loaded onto nodes.
     11 3. [http://wiser.orbit-lab.org/wiki/wiser/mSoftware/aWiserd Wiserd] - interface to configure and stream data to/from USRPs.
    1312
    14 === Set up ===
    15  * To get started first make a reservation on the [https://www.orbit-lab.org/schedule/ Orbit Scheduler].
     13=== Transmit predefined tone ===
     14To get started load ''ubuntu-14-04-64bit-sdr.ndz'' onto node1-1 and node1-2. Then turn both nodes on.
    1615
    17  * Let's pick 3 nodes with a USRP2. For a current list of nodes with USRPs, go to the [https://www.orbit-lab.org/schedule/ Orbit Scheduler], click on ''Status Page'' under ''Quick Links''. Select the ''Grid'' Tab and filter by ''SDR'' and USRP_N210 or SBX. This will give a topology list of nodes (below) that can be used with the OMF commands:
     16
     17Set up node1-1 to configure transmit a predefined sine wave
    1818{{{
    19 [node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org,
    20 node2-1.grid.orbit-lab.org,node2-2.grid.orbit-lab.org,node2-19.grid.orbit-lab.org,node2-20.grid.orbit-lab.org,
    21 node19-1.grid.orbit-lab.org,node19-19.grid.orbit-lab.org,node19-20.grid.orbit-lab.org,node20-1.grid.orbit-lab.org,
    22 node20-19.grid.orbit-lab.org,node20-20.grid.orbit-lab.org,node1-1.sb3.orbit-lab.org,node1-2.sb3.orbit-lab.org]
     19node1-1> wiserd
     20> set --uhd_tx_freq 700e6 --uhd_tx_rate 5e6 --uhd_tx_gain 20
     21> set --tran_wavetype SINE --tran_wavefreq 1e6 --tran_amplitude 0.5
     22> add --waveform
    2323}}}
    2424
    25  * After logging into grid console, make sure all nodes are turned off
     25At this point the node1-1 should be transmitting a tone at 1MHz from the 700MHz center frequency.
     26From node1-2, use the UHD spectrum utility to verify the waveform
    2627{{{
    27 nilanjan@console.grid:~$ omf tell -a offh -t node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org
     28node1-2> cd uhd/host/build/examples/
     29node1-2> ./rx_ascii_art_dft --freq 700e6 --rate 5e6 --gain 20 --ref-lvl -40
    2830}}}
    2931
    30  * Verify state of node before continuing. Make sure all nodes are in the POWEROFF state.
     32=== Record spectrum data to an OML file ===
     33Now let's use wiserd to record this spectrum data into a local
    3134{{{
    32 nilanjan@console.grid:~$ omf stat -t node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org
     35node1-2> wiserd
     36> set --uhd_rx_freq 700e6 --uhd_rx_rate 5e6 --uhd_rx_gain 20 --recv_running_time 2000
     37> set --recv_numbins 256 --recv_avgwinlen 5 --recv_oml_servername file --recv_oml_output_type vector
     38> add --fftmovingavgoml --timed
    3339}}}
    3440
    35  * Image nodes
     41Wiserd should record spectrum data to ''file'' for 2000ms and then stop recording.
     42
     43The recorded file can ve very large so a short snippet is shown below
    3644{{{
    37 nilanjan@console.grid:~$ omf load -i ubuntu-12-04-uhd-daemon.ndz -r 20 -t node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org
     45protocol: 5
     46domain: spectrum
     47start-time: 1432751617
     48sender-id:
     49app-name: spectrum
     50schema: 0 _experiment_metadata subject:string key:string value:string
     51schema: 1 _client_instrumentation measurements_injected:uint32 measurements_dropped:uint32 bytes_allocated:uint64 bytes_freed:uint64 bytes_in_use:uint64 bytes_max:uint64
     52schema: 2 spectrum_data sampling:int32 cfreq_MHz:double gain_dB:int32 FFTLength:int32 FFTNum:string FFTBins:[double]
     53content: text
     54
     550.805870        2       1       5000000 700000000.000000        20      256     ---     256 0.00642503052949905 0.00640759989619255 0.00715913623571396 0.00693625304847956 0.00609686318784952 0.00611346587538719 0.00733797857537866 0.00742206443101168 0.00644569378346205 0.00748523231595755 0.00655230600386858 0.006748684681952 0.00692673865705729 0.00592925120145082 0.00748975854367018 0.00621710997074842 0.00608090776950121 0.0055550062097609 0.0057487809099257 0.00720828492194414 0.00618668925017118 0.00473179295659065 0.006808090955019 0.00687119970098138 0.005494792945683 0.00755641097202897 0.0063415477052331 0.00596773438155651 0.00671912264078856 0.00726061593741179 0.00553654972463846 0.00698605040088296 0.00529543263837695 0.00783630926162004 0.00672802329063416 0.00635359063744545 0.00666496902704239 0.00626690546050668 0.00589855946600437 0.00733701791614294 0.00885633658617735 0.00691640749573708 0.00642102723941207 0.00926791410893202 0.00719658425077796 0.00593259138986468 0.00634927907958627 0.00793861877173185 0.0070486469194293 0.008316645398736 0.00513946730643511 0.00822983402758837 0.00626416876912117 0.00688301119953394 0.00707513466477394 0.0092685641720891 0.00870540831238031 0.00925131514668465 0.0262136552482843 0.00431728875264525 0.00578053155913949 0.0068720756098628 0.00764161115512252 0.00618286710232496 0.00673849601298571 0.006247628480196 0.00722268223762512 0.00629418436437845 0.00773267960175872 0.0074175582267344 0.00646864250302315 0.00801937561482191 0.00764140486717224 0.00779543584212661 0.0079394802451133^@ 0.00697977934032679 0.00779644120484591 0.00789852533489466 0.00959375221282244 0.00706543261185288 0.00814522616565228 0.00915447436273098 0.00844117812812328 0.00785306375473738 0.00716404151171446 0.00879248790442944 0.0101312343031168 0.00902777351438999 0.00988549832254648 0.00871223211288452 0.00874703098088503 0.0101676043123007 0.0103123057633638 0.00945603661239147 0.0100027937442064 0.0096791498363018 0.00998857151716948 0.0117274457588792 0.0101575655862689 0.0124989086762071 0.01237382367253^@ 0.0133225293830037 0.0146061507984996 0.0208994746208191 0.0468954369425774 0.122245348989964 0.0262875147163868 0.0151699390262365 0.0129134533926845 0.0126580595970154 0.0127546470612288 0.0141236884519458 0.0128746386617422 0.0113462153822184 0.0139725683256984 0.0149048119783401 0.012725941836834 0.0142481597140431 0.014576974324882 0.0165196731686592 0.0166050866246223 0.0181233920156956 0.0182002373039722 0.0205240771174431 0.0182637479156256 0.0225130878388882 0.0199225898832083 0.022662311792373^@ 0.0272368285804987 0.0229660626500845 0.0206097178161144 0.0252554770559072 0.0277251955121756 0.027890432626009 0.03005550801754 0.0291061010211706 0.0328644625842571 0.0377240218222141 0.0371225923299789 0.0430551692843437 0.0448992624878883 0.0500019602477551 0.055297739803791 0.0620570369064808 0.0687699541449547 0.0800459012389183 0.096101202070713 0.119709715247154 0.151971653103828 0.222265601158142 0.395731300115585 1.8209445476532 0.701657652854919 0.293412864208221 0.186001688241959 0.135782465338707 0.107891581952572 0.0872630029916763 0.0756658166646957 0.0643373876810074 0.0577538087964058 0.053208451718092 0.0474477596580982 0.043580025434494 0.0416424460709095 0.0350464805960655 0.034961711615324 0.0329569280147552 0.0307744555175304 0.0304238144308329 0.0277519728988409 0.026080325245857^@ 0.0244618654251099 0.0233206581324339 0.023502279073 0.0213998667895794 0.0197461675852537 0.0213919542729855 0.0210770349949598 0.0178680755198002 0.0188288316130638 0.0168855395168066 0.0173622630536556 0.0162709001451731 0.0161915346980095 0.01674560084939 0.0157821383327246 0.0147516150027514 0.0129792336374521 0.01588449254632 0.0135742779821157 0.0144895184785128 0.0126562193036079 0.0140249133110046 0.0127318147569895 0.0125512164086103 0.0115098562091589 0.0102976094931364 0.0142459943890572 0.0123602850362659 0.0110908718779683 0.0117047075182199 0.0108433095738292 0.0113961454480886 0.00989516265690327 0.0109618585556746 0.00892620161175728 0.0101382881402969 0.00846627354621887 0.0101864114403725 0.00957665219902992 0.00926020089536905 0.00821538269519806 0.00760462647303939 0.010831995867192^@ 0.00874793529510498 0.00983591936528683 0.0086268512532115 0.00901609845459461 0.00873745605349541 0.00801646523177624 0.00832579005509615 0.00826011598110199 0.00759589159861207 0.00800738204270601 0.00827436801046133 0.00850967969745398 0.00803695525974035 0.00859370641410351 0.00757377874106169 0.00678808754310012 0.00810458604246378 0.00828907825052738 0.0073024220764637 0.00828505866229534 0.00829954538494349 0.00789687223732471 0.00625459849834442 0.00735813518986106 0.00677822157740593 0.00603437423706055 0.00656507024541497 0.00717219989746809 0.00768232485279441 0.00599283492192626 0.00739502254873514 0.00717072654515505 0.00757684791460633 0.00703901331871748 0.00658791046589613 0.00659507792443037 0.00577279180288315 0.00665358593687415 0.00633173156529665 0.00557167362421751 0.00851421989500523
     56
     570.806104        2       2       5000000 700000000.000000        20      256     ---     256 0.00689565530046821 0.00628861784934998 0.00648185843601823 0.00669795507565141 0.00584999099373817 0.00637592282146215 0.00665496429428458 0.00677516451105475 0.00625768397003412 0.00584975723177195 0.0060897353105247 0.00563886109739542 0.00706819351762533 0.00657628104090691 0.00634182989597321 0.00633346568793058 0.0062954961322248 0.00681345677003264 0.00627884548157454 0.00565372034907341 0.00675516203045845 0.00734227616339922 0.00573072256520391 0.0063943974673748 0.00608528079465032 0.00676710763946176 0.00617225747555494 0.00553606916218996 0.00660644983872771 0.0063962722197175 0.00743097579106688 0.00628956127911806 0.00731373578310013 0.00724115874618292 0.00646150950342417 0.0066513828933239 0.00803750939667225 0.00523182982578874 0.00641514360904694 0.00818850565701723 0.00636473763734102 0.00712296459823847 0.00614004954695702 0.00618369597941637 0.00591028016060591 0.00637322664260864 0.00655190274119377 0.00639662798494101 0.00541317230090499 0.00741449510678649 0.00761738698929548 0.0070836590602994 0.00605544168502092 0.00635870546102524 0.00694706430658698 0.00656211003661156 0.00666100438684225 0.00627775583416224 0.0116550819948316 0.0100514981895685 0.00824615824967623 0.00756618101149797 0.0078535033389926 0.0101745296269655 0.00904152821749449 0.00695109087973833 0.00740401213988662 0.00704846531152725 0.0077576725743711 0.0071131675504148 0.00850622821599245 0.00610636034980416 0.00661058444529772 0.00847268849611282 0.007558090146631 0.00893115531653166 0.00833071861416101 0.00715811923146248 0.00823779869824648 0.0089316014200449 0.00595288490876555 0.00747732911258936 0.00831372570246458 0.00861002039164305 0.00799854192882776 0.00973799638450146 0.00850083213299513 0.00773866334930062 0.00879448000341654 0.00807567313313484 0.0105824302881956 0.00920506287366152 0.00788669660687447 0.00895833969116211 0.0112238116562366 0.0100678941234946 0.0103527856990695 0.0104455724358559 0.012177424505353 0.0112529918551445 0.0102290874347091 0.0135061638429761 0.0147446822375059 0.018596475943923 0.0414362847805023 0.114830479025841 0.025530856102705 0.0190154518932104 0.0155481668189168 0.0143186058849096 0.0138343144208193 0.014024967327714 0.0143188638612628 0.0134244654327631 0.0132367964833975 0.0148129807785153 0.0141275357455015 0.0152805019170046 0.0149390399456024 0.0163573995232582 0.0169974658638239 0.0169846024364233 0.0175251290202141 0.0187166798859835 0.0194499474018812 0.0228170566260815 0.0220983885228634 0.0203606244176626 0.0218033343553543 0.0210654400289059 0.0256397034972906 0.0221499484032393 0.0251883305609226 0.0291288048028946 0.0301742143929005 0.0299053974449635 0.031312745064497 0.0336895957589149 0.0370108000934124 0.0393577739596367 0.0433414280414581 0.0476785935461521 0.0539706349372864 0.0592275373637676 0.0678910464048386 0.0782939940690994 0.0912498533725739 0.113576114177704 0.150473922491074 0.212990492582321 0.384159237146378 1.74912762641907 0.685468077659607 0.285425901412964 0.179363623261452 0.131207302212715 0.104474768042564 0.0858906656503677 0.074637807905674 0.0646835714578629 0.0561635978519917 0.050263948738575 0.0462885685265064 0.0413284674286842 0.0397013314068317 0.0344642288982868 0.0322929508984089 0.0317045971751213 0.0295128636062145 0.0287306308746338 0.0286615248769522 0.023568470031023 0.0228897500783205 0.0226257108151913 0.0222484599798918 0.022429320961237 0.0206066872924566 0.0198463629931211 0.020149877294898 0.017288027331233 0.0161423590034246 0.0164039433002472 0.0163881666958332 0.0164083652198315 0.0157671608030796 0.0150078013539314 0.0146695794537663 0.0149738965556026 0.0142870601266623 0.0128184454515576 0.0130452159792185 0.0135776726529002 0.0117092151194811 0.0125469844788313 0.0118800457566977 0.0131193473935127 0.0124220326542854 0.0114703755825758 0.0109820328652859 0.011516802944243 0.0124680511653423 0.0113629531115294 0.0102917654439807 0.0101364348083735 0.00984693318605423 0.0115289557725191 0.0102153364568949 0.0101874768733978 0.00997439958155155 0.00883135385811329 0.0104001071304083 0.00914312619715929 0.00772677874192595 0.0100395102053881 0.00981313176453114 0.00869345106184483 0.00866962410509586 0.0086707565933466 0.00890628155320883 0.00784013234078884 0.00858987402170897 0.00826080795377493 0.00816309545189142 0.00844899006187916 0.00860675703734159 0.00816098414361477 0.00893862452358007 0.00668511306867003 0.00604773685336113 0.00760708004236221 0.00612658727914095 0.00698500219732523 0.00720309559255838 0.00738290185108781 0.00822578091174364 0.00712159927934408 0.00688611064106226 0.00610087253153324 0.00795015413314104 0.00696648936718702 0.00737108662724495 0.00663621257990599 0.00606435863301158 0.0070930584333837 0.00753137096762657 0.00686082383617759 0.00658690463751554 0.00619596661999822 0.00581462075933814 0.00712865078821778 0.00663717556744814 0.0064032943919301 0.00607451144605875 0.00634610885754228 0.00608755415305495 0.00666977930814028
     58
    3859}}}
    39 
    40  * After nodes are imaged, verify that nodes are in POWEROFF state. Otherwise issue the following to turn them off for a reboot
    41 {{{
    42 nilanjan@console.grid:~$ omf tell -a offh -t node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org
    43 }}}
    44 
    45  * Turn nodes back on and verify they are in POWERON state
    46 {{{
    47 nilanjan@console.grid:~$ omf tell -a on -t node1-1.grid.orbit-lab.org,node1-2.grid.orbit-lab.org,node1-19.grid.orbit-lab.org,node1-20.grid.orbit-lab.org
    48 }}}
    49 
    50  * Download the OEDL experiment script [http://www.orbit-lab.org/raw-attachment/wiki/Tutorials/GNURadio/OmfExperiment1/uhd_exp1.rb uhd_exp1.rb] to your local directory on the console. Executing this script will command one USRP2 to transmit a carrier frequency at random frequency offsets while commanding the others to continually take FFT snapshots and record the measurements to an database file.
    51    The contents of the uhd file is shown with additional comments:
    52 {{{
    53 nilanjan@console.grid:~/UHD$ cat uhd_exp1.rb
    54 defProperty('freq',  1500e6, "Starting rx frequency")
    55 defProperty('dwell', 3, "Number of seconds at each frequency step")
    56 
    57 defGroup('txnode', 'node2-2.grid.orbit-lab.org') { |n|
    58 }
    59 
    60 defGroup('rxnode', 'node1-1.grid.orbit-lab.org,node20-20.grid.orbit-lab.org') { |n|
    61 }
    62 
    63 onEvent(:ALL_UP) do |event|
    64   info "Give machines some time to warm up"
    65   wait 4
    66 
    67   info "activate"
    68   allGroups.uhd.u0.activate                         # starts UHD daemon
    69   wait 3
    70 
    71   info "set tx parameters"
    72   group("txnode").uhd.u0.txfreq = property.freq     # set tx frequency (Hz)
    73   group("txnode").uhd.u0.txrate = "8e6"             # set tx sampling rate
    74   group("txnode").uhd.u0.txgain = "30"              # set tx gain (dB)
    75   group("txnode").uhd.u0.txampl = "0.7"             # set tx wavform amplitude
    76   #group("txnode").uhd.u0.txwavefreq = "1e6"
    77   group("txnode").uhd.u0.txwavetype = "CONST"       # set type of waveform to transmit = {CONST, SINE, RAMP}
    78   group("txnode").uhd.u0.transmit                   # start transmitting
    79 
    80   group("rxnode").uhd.u0.rxfreq = property.freq     # set rx frequency
    81   group("rxnode").uhd.u0.rxrate = "8e6"             # set rx sampling rate
    82   group("rxnode").uhd.u0.rxgain = "25"              # set rx gain
    83   group("rxnode").uhd.u0.numbins = "128"            # number of fft points
    84   group("rxnode").uhd.u0.avgwinlen = "32"           # set averaging window size for each fft bin across time.
    85   group("rxnode").uhd.u0.omlfile = "spectrum.grid"  # oml database file name to store fft data
    86   group("rxnode").uhd.u0.omlserver = "idb2:3003"    # oml server
    87   group("rxnode").uhd.u0.record                     # start recording
    88 
    89   (0..30).each { |i|                                # set up loop   
    90     offset = (rand()*4).to_f                        # find next transmit frequency
    91     cf = property.freq + (offset*1e6)
    92     group("txnode").uhd.u0.txfreq = cf              # set new transmit frequency
    93     wait property.dwell                             # wait for a few seconds
    94   }
    95 
    96 
    97   allGroups.uhd.u0.stop                             # stop transmitting and stop recording
    98   allGroups.uhd.u0.deactivate                       # stop UHD daemon
    99 
    100   info "Finish it."
    101   Experiment.done
    102 end
    103 }}}
    104 
    105 
    106 === Execute script and view recorded data ===
    107 
    108  * To run the experiment script:
    109 {{{
    110 nilanjan@console.grid:~/UHD$ omf exec uhd_exp1.rb
    111 }}}
    112 
    113  * Once the script finishes, check the contents of the database file. The data should be recorded in ''spectrum.grid.sq3'' on the oml server ''idb2''.
    114 {{{
    115 nilanjan@console.grid:~/UHD$ ssh idb2
    116 nilanjan@idb2:~$ cd /var/lib/oml2
    117 nilanjan@idb2:/var/lib/oml2$
    118 nilanjan@idb2:/var/lib/oml2$ ls -l spectrum.grid.sq3
    119 -rw-r--r-- 1 oml2 oml2 753561600 May 14 10:41 spectrum.grid.sq3
    120 }}}
    121 
    122  * Dump the contents of ''spectrum.grid.sq3'' to have a quick look inside the sql file.
    123 {{{
    124 nilanjan@idb2:/var/lib/oml2$ sqlite3 spectrum.grid.sq3 ".dump"
    125 PRAGMA foreign_keys=OFF;
    126 BEGIN TRANSACTION;
    127 CREATE TABLE _senders (name TEXT PRIMARY KEY, id INTEGER UNIQUE);
    128 INSERT INTO "_senders" VALUES('node20-20',1);
    129 INSERT INTO "_senders" VALUES('node1-1',2);
    130 CREATE TABLE _experiment_metadata (key TEXT PRIMARY KEY, value TEXT);
    131 INSERT INTO "_experiment_metadata" VALUES('start_time','1369071050');
    132 CREATE TABLE "spectrum_data" (oml_sender_id INTEGER, oml_seq INTEGER, oml_ts_client REAL, oml_ts_server REAL, "samplin
    133 g" INTEGER, "cfreq_MHz" REAL, "gain_dB" INTEGER, "FFTLength" INTEGER, "FFTNum" TEXT, "FFTBins" BLOB);
    134 INSERT INTO "spectrum_data" VALUES(1,1,0.534819999709725,211.009485,7692307,1500000000.0,25,128,'---',X'84B7C43E2146863DC912F53CC851933CF23EA93CCEC6AC3CEFF5EE3C7578D83CE054723C8C1D873C9F57F73C72CD1F3DF7C1BD3C7D75CC3CD972FA3C1A5B053DB973133DA6541E3D5ED0563DD8F0563DFA9E4B3D256B883DF368B03D02F2B43D77C1F53D403B2F3E2654A23E021EE33F690FFB3E7C7A613E7F6B093E49EFC93DA880AA3D78298B3DC5E1663D98FC483DCECC203D7755253D2BD7FE3CA74AEB3C5C8AF03C8453EE3C5F05D73CD289B63C4F51BD3C71A3BE3C5927983C2E6B8E3C6EFE753C19A3853CADAF7E3CBD118D3CFE1A963C99776F3CCC9E7F3CB610853CFE5A593C10E36B3C7365733C5EAC503CFA39353CA4CA763CC498213C44A11A3C07F1243CAEE5473CA26A483C6C603D3CFE6A483C6A9C113C9DCD0C3C1481413C3274C63B8B6A3F3C2701E33B506B6F3C3C9DDC3B05131B3CC50E1B3CB49D723C446E023C224B713C6E0FF33BFE68FD3B63FC0E3C3E33C43B9F8B973CB3A6733A992C813C76474E3C2DA1FC3A6DA70A3CCC66103CAA0A013C14874C3C24C4913AA335383C8472993CAA53BD3BEA0CA43B0846CB3CEBAF3B3CC2F1463C1AC0963CDD26553BF2C79C3A040E983CF4C8713C16F0AC3CF198233C98AA3B3C4E6D8D3C7CFEA13C7193723C317DFF3BA24DF93B17851D3CB140BE3C76979C3C31F39A3C41D05A3B56C5873C6D537F3C1540963CACF4F13CFB52DE3C6630093D5304343D');
    135 }}}
    136 
    137  * The magnitude value of the fft bins are stored in binary format. The first entry of the db file is shown above. So when dumping the file contents the fft bins data is shown as consecutive ASCII representation of the binary floating point numbers. The 1st is 84B7C43E <==> 0.38421, the 2nd bin is 2146863D <==> 0.065563, etc...
    138 
    139  * To quickly visualize the fft data we can download and compile the following code (it's also in the attachment).
    140 {{{
    141 nilanjan@console.grid:~/UHD$ wget http://www.orbit-lab.org/raw-attachment/wiki/Tutorials/GNURadio/OmfExperiment1/sq3_parse.cpp
    142 nilanjan@console.grid:~/UHD$ gcc sq3_parse.cpp -o sq3_parse -lsqlite3
    143 nilanjan@console.grid:~/UHD$ ./sq3_parse spectrum.grid.sq3 > db_dump.dat
    144 }}}
    145 
    146 * Parse the database file, load octave for a quick plot.
    147 {{{
    148 nilanjan@console.grid:~/UHD$ ./sq3_parse spectrum.grid.sq3 > db_dump.dat
    149 nilanjan@console.grid:~/UHD$ octave
    150 octave:1> w = dlmread('db_dump.dat',',');
    151 octave:2> a = w(:,[9:136]);
    152 octave:3> imagesc([1:size(a,2)] , [1:size(a,1)] , 10*log(sqrt(a)/1000));
    153 octave:4> colorbar()
    154 }}}
    155   || [[Image(random_tx.png, width=500px)]] ||