321 | | = Next: Capture waveform and record to file & add time-domain plot of waveform = |
| 320 | == Capture waveform and record to file & add time-domain plot of waveform == |
| 321 | |
| 322 | * Now record the received signal to an OCTAVE / MATLAB file. |
| 323 | From node1-1 transmit a waveform with the following attributes |
| 324 | {{{ |
| 325 | root@node1-1:~/uhd/host/build/examples# ./tx_waveforms --wave-freq 1e6 --wave-type SINE --freq 5000e6 --rate 8e6 --ampl 0.5 |
| 326 | }}} |
| 327 | |
| 328 | On node1-2, use the rx_sample_to_file utility to dump the received samples into a file. |
| 329 | {{{ |
| 330 | root@node1-2:~/uhd/host/build/examples# ./rx_samples_to_file --freq 5000e6 --rate 8e6 --type float |
| 331 | }}} |
| 332 | |
| 333 | The samples will be recorded into the file ''usrp_samples.dat''. Upload this file into octave and plot the time-domain samples. |
| 334 | On node1-2, start up octave |
| 335 | {{{ |
| 336 | root@node1-2:~/uhd/host/build/examples# octave |
| 337 | GNU Octave, version 3.2.4 |
| 338 | Copyright (C) 2009 John W. Eaton and others. |
| 339 | This is free software; see the source code for copying conditions. |
| 340 | There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or |
| 341 | FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. |
| 342 | |
| 343 | Octave was configured for "i686-pc-linux-gnu". |
| 344 | |
| 345 | Additional information about Octave is available at http://www.octave.org. |
| 346 | |
| 347 | Please contribute if you find this software useful. |
| 348 | For more information, visit http://www.octave.org/help-wanted.html |
| 349 | |
| 350 | Report bugs to <bug@octave.org> (but first, please read |
| 351 | http://www.octave.org/bugs.html to learn how to write a helpful report). |
| 352 | |
| 353 | For information about changes from previous versions, type `news'. |
| 354 | |
| 355 | octave:1> |
| 356 | }}} |
| 357 | |
| 358 | From the Octave prompt verify received signal in the file |
| 359 | {{{ |
| 360 | octave:5> c=read_float_binary('usrp_samples.dat'); |
| 361 | octave:6> creal = c([1:2:length(c)]); |
| 362 | octave:7> cimage = c([2:2:length(c)]); |
| 363 | octave:8> subplot(211) ; plot(creal(100:230)) ; title('real') ; axis([0 140 -0.010 0.010]) ; |
| 364 | octave:9> subplot(212) ; plot(cimage(100:230)) ; title('imag') ; axis([0 140 -0.010 0.010]) |
| 365 | }}} |
| 366 | |
| 367 | A window should pop up from the |