| 2 | |
| 3 | [[TOC(Tutorials/k0SDR*)]] |
| 4 | |
| 5 | === Description === |
| 6 | This tutorial demos capturing spectrum data using the Zynq-based WISER platform on ORBIT. |
| 7 | |
| 8 | === Hardware / Software Resources utilized === |
| 9 | 1. An SB6 node with WISER platform connected to it. |
| 10 | 2. ''wiser_sb6_zedboard.ndz'': disk image. |
| 11 | |
| 12 | === Set up === |
| 13 | * Follow the [wiki:Tutorials/k0SDR/Tutorial13 start-up instructions] to set up the load the node image and FPGA images. |
| 14 | |
| 15 | |
| 16 | * After the set-up is complete, ssh into node1-1 and build the wiserd application |
| 17 | {{{ |
| 18 | root@node1-1:~# cd wiserd |
| 19 | root@node1-1:~/wiserd# make clean |
| 20 | root@node1-1:~/wiserd# make |
| 21 | g++ -Wall -g -O -std=gnu++0x -c -o channel_status.o channel_status.cpp |
| 22 | g++ -Wall -g -O -std=gnu++0x -c -o consumer_moving_average.o consumer_moving_average.cpp |
| 23 | g++ -Wall -g -O -std=gnu++0x -c -o fft_movavg_dc.o fft_movavg_dc.cpp |
| 24 | g++ -Wall -g -O -std=gnu++0x -c -o fft_movavg_oml.o fft_movavg_oml.cpp |
| 25 | g++ -Wall -g -O -std=gnu++0x -c -o fft_movavg_udp.o fft_movavg_udp.cpp |
| 26 | g++ -Wall -g -O -std=gnu++0x -c -o fft_pow_udp.o fft_pow_udp.cpp |
| 27 | g++ -Wall -g -O -std=gnu++0x -c -o fft_sigpower_oml.o fft_sigpower_oml.cpp |
| 28 | g++ -Wall -g -O -std=gnu++0x -c -o main.o main.cpp |
| 29 | g++ -Wall -g -O -std=gnu++0x -c -o radio.o radio.cpp |
| 30 | g++ -Wall -g -O -std=gnu++0x -c -o recv_consumer_factory.o recv_consumer_factory.cpp |
| 31 | g++ -Wall -g -O -std=gnu++0x -c -o recv.o recv.cpp |
| 32 | g++ -Wall -g -O -std=gnu++0x -c -o signal_from_file.o signal_from_file.cpp |
| 33 | g++ -Wall -g -O -std=gnu++0x -c -o time_samples_to_file.o time_samples_to_file.cpp |
| 34 | g++ -Wall -g -O -std=gnu++0x -c -o tran_consumer_factory.o tran_consumer_factory.cpp |
| 35 | g++ -Wall -g -O -std=gnu++0x -c -o tran.o tran.cpp |
| 36 | g++ -Wall -g -O -std=gnu++0x -c -o usrp.o usrp.cpp |
| 37 | g++ -Wall -g -O -std=gnu++0x -c -o waveform.o waveform.cpp |
| 38 | g++ -Wall -g -O -std=gnu++0x -c -o zynq.o zynq.cpp |
| 39 | g++ -L/usr/local/lib channel_status.o consumer_moving_average.o fft_movavg_dc.o fft_movavg_oml.o fft_movavg_udp.o fft_pow_udp.o fft_sigpower_oml.o main.o radio.o recv_consumer_factory.o recv.o signal_from_file.o time_samples_to_file.o tran_consumer_factory.o tran.o usrp.o waveform.o zynq.o -o wiserd -lboost_system -lboost_random -lboost_thread -lboost_program_options -lboost_iostreams -lpthread -llog4cxx -luhd -loml2 -locomm -lfftw3f -lreadline |
| 40 | }}} |
| 41 | |
| 42 | === Start spectrum sensing === |
| 43 | |
| 44 | * Run the wiserd application with the following arguments. |
| 45 | {{{ |
| 46 | root@node1-1:~/wiserd# ./wiserd --zynq_rx_freq 820e6 --zynq_rx_gain 10 --zynq_fft_bins 256 --zynq_fft_scaling 170 --zynq_avg_window 256 |
| 47 | linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b |
| 48 | |
| 49 | Zynq constructed |
| 50 | zynq_fft_bins 8 |
| 51 | zynq_fft_scaling 170 |
| 52 | zynq_rx_freq 820000000 |
| 53 | zynq_rx_gain 10 |
| 54 | Ready! |
| 55 | Zynq thread started |
| 56 | > |
| 57 | }}} |
| 58 | |
| 59 | * The Zynq parameters passed to the FPGA to configures the RF hardware and FFT engine \\ |
| 60 | a) '--zynq_rx_freq 820e6' ----> sets Rx center frequency. Range of values: [400M 4000M] \\ |
| 61 | b) '--zynq_rx_gain 10' -------> sets Rx amplifier gain. Range of values: [5.0 20.0] \\ |
| 62 | c) '--zynq_fft_bins 256' -----> sets FFT size. Range of values must be power of 2: [8 256] \\ |
| 63 | d) '--zynq_fft_scaling 170' --> sets FFT stage scaling. \\ |
| 64 | e) '--zynq_avg_window 256' ---> sets time averaging across bins. Range of values: [1 256] \\ |
| 65 | |
| 66 | Note: the sampling rate not configurable and fixed at 30Msps. |
| 67 | |
| 68 | * From wiserd enable FFT engine and start streaming frequency bins from the FPGA to host |
| 69 | {{{ |
| 70 | > --fft_engine 1 |
| 71 | }}} |
| 72 | |
| 73 | * The FFT bin data is collected in binary file name ''zynq_rx_fft.bin'' |
| 74 | |
| 75 | * From wiserd disable FFT engine and stop streaming data to host |
| 76 | {{{ |
| 77 | > --fft_engine 0 |
| 78 | }}} |
| 79 | |
| 80 | * To view a water fall image collected rx spectrum data, run the fPlot script in octave. A sample image is shown below with a tone at 10MHz generated from a USRP. |