Home
Lab memo lab 2 - ISY: Communication Systems
Contents
1. quit True elif cmd 0 n SNRdB eval cmd 1 tb noise set_amplitude 10 SNRdB 20 0 else print Invalid command You may want to add a suitable print statement above the if statement to inform the user about the changes in the user interface This assumes that you have created the attribute noise of the class as self noise and it should be a set_amplitude object Note that it is imporant that the division is by the float 20 0 and not by the integer 20 Otherwise you will get into trouble for integer SNR values 4 4 Optional Increasing the Data Rate Double the data rate by changing the transmitter and receiver to use QPSK instead of BPSK The following can come in handy j complex 0 1 constellation 1 j 1 j 5 Resources e Online USRP FAQ http gnuradio org redmine wiki gnuradio UsrpFAQIntro e Firas Abbas Hamza The USRP under 1 5X Magnifying Lens http gnuradio org redmine attachments 129 USRP_Documentation pdf Third party documentation of USRP e GNU Radio C block documentation file usr local gnuradio 3 3 0 share doc gnuradio 3 3 0 html index html e OpenRD C block documentation file usr local openrd doc index html e Firas Abbas Simple Gnuradio User Manual http rapidshare com files 72169239 Simple Gnuradio User Manual v1 0 pdf Third party documentation of GNU Radio This one is a bit out of date but still useful A printed copy is available at the lab desk
2. changes to files there That directory will be updated for the next occation If you are not following these instructions in CommSys research lab Open a terminal Create a directory labfolder somewhere and cd into it If you have done Lab 1 you should already have that directory Download and extract the accompanying lab files by executing the following commands wget http www commsys isy liu se SDR labs gr lab2 tar gz tar zxf lab2 tar gz cd lab2 All files needed in this lab are now in the directory lab2 that you just created 4 Data Transmission Full synchronization is assumed in many communications courses given at LiU and at other univer sities That is also the assumption in the lectures and tutorials in TSKSO1 Digital Communication The reason for that is that syncronization provides problems and solutions enough to form a full course by itself It is a significant problem in engineering reality though In this lab we have real signals and there is no artificial syncronization of senders and receivers Instead our senders and receivers must include tricks to achieve an approximate syncronization which then contains frequency correction and bit syncronization We also need to know where data starts Our data will be grouped into frames and the sender prepends each frame by a pseudo noise sequence that marks the beginning of the frame The receiver knows that pseudo noise sequence and correlates the received bit stream by
3. that sequence A large correlation marks with high probability that we have found the start of a frame This is frame syncronization The receiver then continues to detect the whole frame and then waits for the next frame The absolute phase will be unknown in the receiver but will essentially be unchanged from symbol to symbol Therefore we will use differential PSK in the communication systems in this lab That simply means that the phase difference between adjacent symbols carry the information This is described in more detail below Details about how and why this kind of syncronization works is discussed in the follow up course TSKS04 Digital Communication Continuation Course 4 1 Noise Free Transmission Link In the following let M be the size of the modulation scheme used and let k log M be the number of bits per symbol The simple data transmitter is shown in Figure 1 It consists of a data source generating a stream of data vectors that are all equal Each data vector is framed with a simple correlation sequence at the beginning then converted to a stream of bits The stream of bits is packed to a number of bits per sample corresponding to the chosen modulation then differentially encoded mapped to a complex symbol and then passed through a root raised cosine shaping filter The signal is finally modulated to the carrier frequency by the USRP pr data_source_counter pr framer_simple_vbb pyblk
4. Software Defined Radio Lab 2 Data modulation and transmission Version 0 2 Anton Blad and Mikael Olofsson November 16 2012 1 Introduction In this lab you will build a transmitter and corresponding receiver for simple DBPSK modulated data framed with a correlation sequence in the beginning The receiver prints the estimated SNR of the received data as well as the computed bit error rate You will then modify the transmitter to include an AWGN channel model and verify that the measured SNR and bit error rate correspond to the theoretical values You will further modify the system to use DQPSK modulation instead of DBPSK 2 Preparations Read this memo through Then determine suitable values of the parameters that are mentioned in Section 4 2 3 Setup The following hardware is needed for this lab e A computer with USB 2 0 e A USRP1 with an LFTX LFRX daughterboard pair at the A side e An oscilloscope with two channels You need GNU Radio installed The lab is tested and ensured to work with GNU Radio 3 3 0 and assumes that it is installed in usr local gnuradio 3 3 0 3 1 Initialization If you are doing this lab in CommSys research lab Log in to one of the lab computers as the user SDR lab user Your lab teacher will give you the password Your lab computer is prepared with all needed files in the directory home sdrlabuser labfolder lab2 Open a terminal and cd to that directory You do not need to worry about making
5. es the variable frame_size in the python code deframe pr deframer_simple_vbb Remove the pseudo noise sequence from the start of the frame and output only the infor mation bits Uses the variables frame_size and corrseq in the python code rxdecap pyblk rxframe_decap_b Remove meta data header from frame Uses the variable data_size in the python code rxv2s pr pvec_to_stream Map data to stream of bits Uses the variable data_size in the python code The white blocks in Figure 2 perform analysis of the received signal and present that in the GUI In order to provide reference data a copy of the data generation chain in the transmitter is also included in the receiver Also the fftsink and constsink instances are used to visualize the spectrum and constellation of the received signal Finally the symbol estimates are fed to an SNR estimation block The main loop of the program prints the estimated SNR and computed bit error rate regularly Those blocks perform the following operations in somewhat rough order symscale not explicitly called that in the Python code gr multiply const_cc An amplifier Adjust signal levels sigview pygui signal_viewer Present the signal in the GUI Uses the variables usb_rate and samples_per_symbol in the python code snrest gr probe_mpsk_snr_c Estimate the SNR of an MPSK signal using the Squared Signal to Noise Variance SNV technique assuming an AWGN channel This is done by computin
6. g the running average of the signal mean and noise variance This SNR estimator is inaccurate below about 7dB SNR symrate pr rate_estimate Estimate the symbol rate datarate pr rate_estimate Estimate the bit rate refdata pr data_source_counter Generate a sequence of known data the same data as the sender uses The reason for this is so that we can check the error rate by comparing this data to the received data Uses the variable data_size in the python code refdecap pyblk txmeta_decap_b Remove meta data header from packet Uses the variable data_size in the python code refv2s pr pvec_to_stream Convert frames to a stream of bits Uses the variable data_size in the python code berest pr ber_estimate_b Estimate the bit error rate BER 4 2 Bulding a Noise Free Transmission Link Use the files psk_tx py and psk_rx py as stubs for building the flowgraphs in Figures 1 and 2 respectively Design the transmitter and receiver according to the following requirements e Use a USRP transmitter interpolation rate of 128 and a receiver decimation rate of 64 e The usable data rate shall be at least 180 kb s Remember that the correlation sequence adds some overhead e Use differential BPSK modulation e Use a correlation sequence of 64 bits defined in the stub files e Use root raised cosine filters with an excess bandwidth of 0 35 e For the timing recovery to work the number of samples per symbol must be at lea
7. hapes the signal to increases the spectral roll off of the modulation More about this in TSKSO4 Uses the variables samples_per_symbol and rrctaps in the python code txscale gr multiply_const_cc Amplify the signal to fit the USRP signal levels u usrp sink_c Send the sampled complex baseband signal to the USRP transmit chain resulting in the physical output signal Uses the variable usrp_interp in the python code On the receiver side the structure is shown in Figure 2 The baseband processing includes an au tomatic gain control followed by the gr_mpsk_receiver_cc block that does frequency correction and timing recovery The output of the block contains complex symbol estimates The symbol estimates are decoded and unpacked to a bit stream A frame correlator searches for the corre lation sequence and frame sync samples the frame when the correlation sequence is found The correlation sequence is removed the header is stripped from the data vectors and the resulting data stream is fed to a bit error rate computation block gr multiply_const_cc _ pygui signal_viewer symscale Poe sigview usrp source_c gr multiply_const_cc 8r agc_ec u rxscale age gr diff_phasor_cc gr mpsk_receiver_cc gr fir_filter_ccf S lt diffdec recv Tre gr p
8. robe_mpsk_snrc j pr rate_estimate snrest gr constellation_decoder_cb symrate 5 constdec gr delay pr frame_correlator_simple_bb delay framecorr r frame_sync_bb pr deframer_simple_vbb i framesync deframe pr rate_estimate pr pvec_to_stream pyblk rxframe_decap_b lt datarate rxv2s rxdecap pr ber_estimate_b 0 pr pvec_to_stream berest HS refv2s pr data_source_counter pyblk txmeta_decap_b refdata refdecap Figure 2 Simple receiver for differential PSK modulated data Compare Figure 2 to the stub file psk_rx py The pink blocks in Figure 2 constitute the actual signal path Those blocks perform the following operations in somewhat rough order u usrp source_c Receive the complex baseband signal from the USRP receive chain which is a sampled and demodulated version of the physical input signal Uses the variable usrp_decim in the python code rxscale gr multiply_const_cc An amplifier Adjust signal levels age gr agc_cc Automatic gain control Make sure that the output has the desired amplitude rre gr fir_filter_ccf Again a root raised cosine filter Matched filter to the root raised cosine filter of the sender This block allows for decimation down sampling as well but that is not used here Uses the variable rrctaps in the python code recv gr mpsk_receiver_cc Performs mpsk detection including carrier syncronization and symbol timing recovery Uses a Costas loop for phase and frequency recove
9. ry and a method called Mueller and Muller for timing recovery To some extent these things are covered in the course TSKS04 Digital Communication Continuation Course Outputs a sequence of most likely signal points Both those recovery methods need a bunch of parameters Uses the variables mod_order costas_alpha costas_beta costas_fmin costas_fmax mm_mu mm_gainmu mm_omega mm_gain_omega and mm_omega _rel in the python code Those starting with costas are parameters to the Costas loop and those starting with mm are parameters to the Mueller and Muller method diffdec gr diff_phasor_cc Differential decoder Uses the phase difference between two symbols to determine the output symbol out i infi conj in i 1 Outputs a sequence of complex numbers whose arguments are differences of arguments of consecutive symbols i e a sequence of M PSK symbols where the differential encoding has been removed constdec gr constellation_decoder_cb Maps signal points on bits Uses the variable constpoints in the python code framecorr pr frame_correlator_simple_bb Correlates the received stream of bits with a the known pseudo noise sequence to find the start of a frame Uses the variables frame_size corrseq and ncorr_req in the python code delay not explicitly called that in the Python code gr delay Delay the signal by one sample framesync pr frame_sync_bb Sample frames when correlation sequence is found Us
10. st 4 e Use the following parameters for the mpsk_receiver block costas_alpha 0 1 costas_beta 0 25 costas_alpha costas_alpha costas_fmin 0 1 0 1 costas_fmax mmmu 0 5 mm_gainmu 0 01 mm_omega samples_per_symbol mm_gain_omega 0 25 mm_gain_mu mm_gain_mu mm_omega_rel 0 005 Adjust the number of required correct bits in the frame correlator such that the probability of a false positive correlation assuming random data is at most 1076 and the probability of a successful correlation is at least 99 9 for an SNR of 5 dB You may use octave or matlab and the bundled cseq m for this To design the root raised cosine wave shaping filters use the function gr firdes root_raised_cosine This function requires both the sampling frequency and the symbol rate but depends in reality only on the relation between the two For a given number of samples per symbol samples_per_symbol1 the parameters for the root raised cosine filters can be determined according to the following guidelines for the transmitter e gain 1 0 e sampling_freq samples_per_symbol e symbol_rate 1 e alpha 0 35 e ntaps 11 samples_per_symbol For the receiver use instead the following gain samples_per_symbol sampling freq samples_per_symbol symbol_rate 1 alpha 0 35 ntaps 11 samples_per_symbol Run the transmitter and receiver and verify that the transmission is flaw less and tha
11. t the rate corresponds to the expected 4 3 Simulating a Channel GNU Radio provides complete channel models for both AWGN and different fading channels However in this lab you will build your own channel model using a noise source and an adder Implement an AWGN channel according to Figure 3 and insert it before the shaping filter in the transmitter This placement adds the distortion to the symbols rather than the samples which would be more appropriate However it assures that all the added noise is in the same band as the signal rather than spread out over the whole spectrum gr add_cc add gr noise_source_c noise Figure 3 A simple implementation of an AWGN channel The parameter of the noise source can be set through the set_amplitude function This sets the standard deviation if Gaussian noise is specified In your program you should be able to specify the desired SNR of the channel assuming a unit signal energy and the noise source should be set accordingly Your transmitter code already acknowledges the commandline command q to quit the program We now want your receiver also to acknowledge the commandline command n SNR where SNR should be the wanted Signal to noise ratio expressed as a number in dB Adjusting the if statement near the bottom of the transmitter code to something similar to the following should give you the opportunity to set the SNR via the commandline if cmd 0 q
12. txmeta_decap_b src framer decap gr chunks_to_symbols_bc gr diff_encoder_bb pr pvec_to_stream symmap diffenc v2s gr interp_fir_filter_ccf gr multiply_const_cc usrp sink_c rre txscale u Figure 1 A transmitter for differential PSK modulated data Compare Figure 1 to the stub file psk_tx py The blocks perform the following operations in order src pr data_source_counter Generate data blocks of known data The reason that we want to transmit known data is to give us the possibility to check if the received data is correct Uses the variable data_size in the python code framer pr framer_simple_vbb Prepend each data block by a pseudo noise sequence Uses the variables frame_size and corrseq in the python code decap pyblk txmeta_decap_b Remove meta data header from packet Uses the variable frame_size in the python code v2s pr pvec_to_stream Convert frames to a stream of bits Uses the variable frame_size in the python code diffenc gr diff_encoder_bb Differential encoder y n a n y n 1 mod M The result are the symbol indices Uses the variable mod_order in the python code symmap gr chunks_to_symbols_bc This block maps symbol indices on the actual symbols which are complex numbers Uses the variable constpoints in the python code rre gr interp_fir_filter_ccf An FIR filter that also upsamples interpolates the signal This is a so called root raised cosine filter which s
Download Pdf Manuals
Related Search
Related Contents
TEFAL ME71013E Instruction Manual 大和市生ごみ処理容器等設置費補助金交付要綱 平成20年1月30日 Samsung Galaxy K zoom Bruksanvisning iTest - Bilt System 1. - Vivitek カタログはこちらから DIESEL WATER/TRASH/ CHEMICAL PUMPS LED-Fahrradleuchten-Set Copyright © All rights reserved.
Failed to retrieve file