LOGO GNU Radio CENG - 5931 Signal Sources By:- Surendra Babu Donepudi UHCL ID : 1004771 Contents 1 GNU Radio 2 Programming Languages 3 Signal Sources 4 Types of Signal Sources 5 Conclusion What is GNU Radio ? • • • GNU radio is a free/open-source software toolkit for building software radios, in which software defines the transmitted waveforms and demodulates the received waveforms. It turns radio hardware problems into software problems. GNU Radio provides the signal processing runtime and processing blocks to implement software radios using readily-available, low-cost external RF hardware and commodity processors. Architecture of GNU Radio Programming Languages in GNU Radio There are two programming languages used in GNU Radio, C++ and Python C++ Extensive library of signal processing blocks Performance-critical modules Python Environment for composing blocks Glue to connect modules Non performance-critical modules Signal Processing Blocks Signal sources gnuradio.gr.glfsr_source_b Galois LFSR pseudo-random source. gnuradio.gr.glfsr_source_f Galois LFSR pseudo-random source generating float outputs -1.0 - 1.0. gnuradio.gr.lfsr_32k_source_s LFSR pseudo-random source with period of 2^15 bits (2^11 shorts) gnuradio.gr.null_source A source of zeros. gnuradio.gr.noise_source_c random number source gnuradio.gr.noise_source_f random number source gnuradio.gr.noise_source_i random number source gnuradio.gr.noise_source_s random number source gnuradio.gr.sig_source_c signal generator with gr_complex output. gnuradio.gr.sig_source_f signal generator with float output. gnuradio.gr.sig_source_i signal generator with int output. gnuradio.gr.sig_source_s signal generator with short output. Signal sources gnuradio.gr.vector_source_b source of unsigned char’s that gets its data from a vector gnuradio.gr.vector_source_c source of gr_complex’s that gets its data from a vector gnuradio.gr.vector_source_f source of float’s that gets its data from a vector gnuradio.gr.vector_source_i source of int’s that gets its data from a vector gnuradio.gr.vector_source_s source of short’s that gets its data from a vector gnuradio.gr.file_descriptor_source Read stream from file descriptor. gnuradio.gr.file_source Read stream from file. gnuradio.gr.message_source Turn received messages into a stream. gnuradio.gr.udp_source Read stream from an UDP socket. gnuradio.gr.wavfile_source Read stream from a Microsoft PCM (.wav) file, output floats. Types of signal sources Signal sources can be divided into 7 sub groups they are: • • • • • • • Sinusoidal and constant sources Noise sources Null sources Vector sources File sources Audio source USRP source Sinusoidal and constant sources Block : gr.sig_source_X. Usage: gr.sig_source_c [f, i, s] ( double sampling_freq, gr_waveform_t waveform, double frequency, double amplitude, gr_complex [float, integer, short] offset ) The suffix X indicates the data type of the signal source. It can be ‘c’ (complex), ‘f’ (float), ’i’ (4 byte integer) or ‘s’ (2 byte short integer). Contd….. The waveform argument indicates the type of the wave form. gr_waveform_t is an enumeration type defned in gr_sig_source_waveform.h. Its value can be: gr.GR_CONST_WAVE gr.GR_COS_WAVE gr.GR_SIN_WAVE When you use gr.GR_CONST_WAVE, the output will be a constant voltage, which is the amplitude plus the offset. Noise sources Block : gr.noise_source_X. Usage: gr.noise_source_c [f, i, s] ( gr_noise_type_t type, float amplitude, long seed ) The suffix ‘X’ indicates the data type of the signal source. It can be ‘c’ (complex), ‘f’ (float), ‘i’ (4 byte integer) or ‘s’ (2 byte short integer). Contd….. The type argument indicates the type of the noise. gr_noise_type_t is an enumeration type defined in gr_noise_type.h. Its value can be: GR_UNIFORM GR_GAUSSIAN GR_LAPLACIAN GR_IMPULSE Choosing GR_UNIFORM generates uniformly distributed signal between [-amplitude, amplitude]. GR_GAUSSIAN gives us normally distributed deviate with zero mean and variance amplitude2. GR_LAPLACIAN and GR_IMPLUSE represent a Laplacian distribution and a impulse distribution respectively. All these noise source blocks are based on the pseudo random number generator block gr.random. Null sources Block: gr.null_source. Usage: gr.null_source ( size_t sizeof_stream_item ) gr.null_source produces constant zeros. The argument sizeof_stream_item specifies the data type of the zero stream, such as gr_complex, float, integer and so on. Vector sources Block: gr.vector_source_X. Usage: gr.vector_source_c [f, i, s, b] ( const std::vector< gr_complex > & data, bool repeat = false ) (gr_complex can be replaced by float, integer, short, unsigned char) The suffix ‘X’ indicates the data type of the signal source. It can be ‘c’ (complex), ‘f’ (float), ‘i’ (4 byte integer), ‘s’ (2 byte short integer), or ‘b’ (1 byte unsigned char). These sources get their data from a vector. The argument repeat decides whether the data in the vector is sent repeatedly. As an example, we can use the block in this way in Python: src_data = (-3, 4, -5.5, 2, 3) src = gr.vector_source_f (src_data) File sources Block: gr.file_source Usage: gr.file_source ( size_t itemsize, const char * filename, bool repeat ) gr.file_source reads the data stream from a file. The name of the file is specified by filename. The first argument item size determines the data type of the stream, such as gr_complex, float, unsigned char. The argument repeat decides whether the data in the file is sent repeatedly. As an example, we can use the block in this way in Python: src = gr.file_source (gr.sizeof_char, "/home/dshen/payload.dat", TRUE) Audio source Block: gr.audio_source Usage: gr.audio_source (int sampling_rate) audio_source reads data from the audio line-in. The argument sampling_rate specifies the data rate of the source, in samples per second. USRP source Block: usrp.source_c [s] Usage: usrp.source_c (s) ( int unsigned int int ncha int mux int mode which_board, decim_rate, = 1, = -1, =0) when we design a receiver using GNU Radio, i.e. working on the RX path, probably we need the USRP as the data source. The suffix ‘c’ (complex), or ‘s’ (short) specifies the data type of the stream from USRP. which_board specifies which USRP to open, which is probably ‘0’ if there is only one USRP board. decim_rate tells the digital down converter (DDC) the decimation factor D. Contd….. • Mux sets input MUX configuration, which determines which ADC(or constant zero) is connected to each DDC input . `-1' means we preserve the default settings. • Mode sets the FPGA mode, which we seldom touch. The default value is 0,representing the normal mode. • Quite often we only specify the first two arguments, using the default values for the others. For example: usrp_decim = 250 src = usrp.source_c (0, usrp_decim) Conclusion • Signal sources are used to generate the required signals in the program. • Software radio is a revolution in radio design due to its ability to create radios that change on the fly, creating new choices for users. • GNU Radio is widely used in hobbyist, academic and commercial environments to support wireless communications research as well as to implement real-world radio systems. References • http://gnuradio.org/redmine/wiki/gnuradio • http://gnu.ist.utl.pt/software/gnuradio/doc/group__block.html • http://www.snowymtn.ca/GNURadio/GNURAdioDoc-9.pdf • http://www.reynwar.net/gnuradio/sphinx/gr/index.html • http://www.wu.ece.ufl.edu/projects/softwareRadio/documents /Project%20Report_James%20Chen.pdf LOGO Thank You !