MATLAB is working with vectors and matrices, using different operators and functions.

Similar documents
Channel Decoding in Wireless Communication Systems using Deep Learning

Getting To Know Matlab

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

FACULTY OF ENGINEERING LAB SHEET INFORMATION THEORY AND ERROR CODING ETM 2126 ETN2126 TRIMESTER 2 (2011/2012)

Modulation and Coding. Laboratory. Channel Coding Hamming code

EE 387 course information

DCN Questions CHAPTER 1:- NETWORKING FUNDAMENTALS

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

How to program with Matlab (PART 1/3)

Chap 1. Digital Computers and Information

Chapter 1 Introduction to MATLAB

Describe the two most important ways in which subspaces of F D arise. (These ways were given as the motivation for looking at subspaces.

CDS Computing for Scientists. Final Exam Review. Final Exam on December 17, 2013

MATLAB Introduction to MATLAB Programming

Introduction to MATLAB

Performance Evaluation of Transcoding and FEC Schemes for 100 Gb/s Backplane and Copper Cable

Introduction to Matlab

Objectives. Connecting with Computer Science 2

Mini-Project System Simulation over AWGN Using BPSK Modulation

INTRODUCTION TO COMPUTERS

CHAPTER 6 PILOT/SIGNATURE PATTERN BASED MODULATION TRACKING

Class #15: Experiment Introduction to Matlab

ECE Lesson Plan - Class 1 Fall, 2001

All MSEE students are required to take the following two core courses: Linear systems Probability and Random Processes

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano

LDPC Simulation With CUDA GPU

What is KNIME? workflows nodes standard data mining, data analysis data manipulation

T325 Summary T305 T325 B BLOCK 4 T325. Session 3. Dr. Saatchi, Seyed Mohsen. Prepared by:

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

OUTLINES. Variable names in MATLAB. Matrices, Vectors and Scalar. Entering a vector Colon operator ( : ) Mathematical operations on vectors.

Mathematical Experiments with Mathematica

Review of Number Systems

CDS Computing for Scientists. Midterm Exam Review. Midterm Exam on October 22, 2013

Polar Codes for Noncoherent MIMO Signalling

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

AC : INCORPORATING SYSTEM-LEVEL DESIGN TOOLS INTO UPPER-LEVEL DIGITAL DESIGN AND CAPSTONE COURSES

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

Introduction to MatLab. Introduction to MatLab K. Craig 1

ARRAY VARIABLES (ROW VECTORS)

CS1302 / Computer Networks

MATLAB. Devon Cormack and James Staley

CHAPTER 6 A SECURE FAST 2D-DISCRETE FRACTIONAL FOURIER TRANSFORM BASED MEDICAL IMAGE COMPRESSION USING SPIHT ALGORITHM WITH HUFFMAN ENCODER

Documentation of DaTrAMo (Data Transfer- and Aggregation Module)

User s Guide. LA5034 Operation Manual

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to.

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Compression. storage medium/ communications network. For the purpose of this lecture, we observe the following constraints:

3 Using Simulation Variables

Stonelaw High School. Computing Science. BGE - Computer Systems

A New Compression Method Strictly for English Textual Data

Project 1. Implementation. Massachusetts Institute of Technology : Error Correcting Codes Laboratory March 4, 2004 Professor Daniel A.

Mid Sweden University Dept. of IT and Media (ITM) Magnus Eriksson Tel , Jan 2009.

Network Media and Layer 1 Functionality

)454 : 4(% #(!2!#4%2 3%4!.$ "!3)# %,%-%.43 -!.-!#().%,!.'5!'% )454 Recommendation : INTERNATIONAL TELECOMMUNICATION UNION

Computer Project: Getting Started with MATLAB

The Gray Code. Script

Introduction to MATLAB

Performing Matrix Operations on the TI-83/84

Digital Fundamentals

IEEE 802.3ap Codes Comparison for 10G Backplane System

2.0 MATLAB Fundamentals

Chapter 16 Identification Numbers Understand the purpose of a check digit. Know what a bmod

CMSC 2833 Lecture 18. Parity Add a bit to make the number of ones (1s) transmitted odd.

A brief introduction to SCILAB

AN INTRODUCTION TO MATLAB

Practical 4: The Integrate & Fire neuron

TUTORIAL MATLAB OPTIMIZATION TOOLBOX

SLCD1-IC Serial LCD Processor

MATLAB INTRODUCTION. Matlab can be used interactively as a super hand calculator, or, more powerfully, run using scripts (i.e., programs).

CS/EE 260. Digital Computers Organization and Logical Design

DIGITAL SYSTEM DESIGN

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

King Fahd University of Petroleum & Minerals. Electrical Engineering Department. EE 575 Information Theory

Vector: A series of scalars contained in a column or row. Dimensions: How many rows and columns a vector or matrix has.

Evaluating the Impact of Signal to Noise Ratio on IEEE PHY-Level Packet Loss Rate

Studies on fade mitigation control for microwave satellite signal propagation

Introduction. Matlab for Psychologists. Overview. Coding v. button clicking. Hello, nice to meet you. Variables

HCTL-2017 Quadrature Decoder/Counter Interface ICs

B.E. ELECTRONICS & COMMUNICATION ENGINEERING SEMESTER - VII EC WIRELESS COMMUNICATION

BINARY SYSTEM. Binary system is used in digital systems because it is:

Performance Analysis of Gray Code based Structured Regular Column-Weight Two LDPC Codes

Multi-Hop Virtual MIMO Communication using STBC and Relay Selection

P( Hit 2nd ) = P( Hit 2nd Miss 1st )P( Miss 1st ) = (1/15)(15/16) = 1/16. P( Hit 3rd ) = (1/14) * P( Miss 2nd and 1st ) = (1/14)(14/15)(15/16) = 1/16

P( Hit 2nd ) = P( Hit 2nd Miss 1st )P( Miss 1st ) = (1/15)(15/16) = 1/16. P( Hit 3rd ) = (1/14) * P( Miss 2nd and 1st ) = (1/14)(14/15)(15/16) = 1/16

On the Optimizing of LTE System Performance for SISO and MIMO Modes

Physical Layer Part 3

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

Matlab Tutorial. The value assigned to a variable can be checked by simply typing in the variable name:

Digital Image Processing

Project: IEEE P Working Group for Wireless Personal Area Networks (WPANs)

Prof. Manoochehr Shirzaei. RaTlab.asu.edu

MATLAB GUIDE UMD PHYS401 SPRING 2011

Chapter 4: Implicit Error Detection

Pretty Good Privacy (PGP

Appendix) Specifications of Monitor & Control Rev. 4.0 July 13, 2016

Introduction to MATLAB

Midterm Exam 2B Answer key

PART 1 PROGRAMMING WITH MATHLAB

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

Transcription:

INTRODUCTION TO COMMUNICATIONS BASICS OF MATLAB MATLAB is working with vectors and matrices, using different operators and functions. The vectors are indexed starting with 1 not 0. A line-vector is introduced using SPACE or COMMA as separators: >> a = [1 2 3 4 5] [ENTER] 1. Write this command in Command Window. What is the displayed result? For a column-vector, SEMI-COLON is used as separator: >> b = [1; 2; 3; 4; 5] [ENTER] 2. Launch this command. Compare the two vectors, a and b. In the same way, a matrix is written. The rows are separated by SEMI-COLON: >> m = [1 2 3 4 5; 2 3 4 5 6; 3 4 5 6 7] [ENTER] 3. Write the matrix above in the Command Window. How many rows and columns has this matrix? If we don t want to display the result of a command, a semi-colon is written at the end. For example: >> p=3*a; [ENTER] 4. Launch the command from above. What content is displayed after it? Remark: The vector p was calculated by the program, but it was not displayed. If you want to display a variable, you have to write its name and then press ENTER key. Pay-attention: MATLAB is case-sensitive! >> p [ENTER] 1

You can request many variables to be displayed writing all the elements separated by comma after the prompter and pressing ENTER key (comments begin with %): 5. Try to display a, the first value of b, one element from m and the vector a transposed. >> a, b(1), m(2,3), a' % a' is the transposed of a [ENTER] 6. How many elements are displayed by running this command? Remark: Many commands can be written on the same line of the program, separated by commas or semi-colons. MATLAB uses arithmetical and logical operators: +, -, *, /, NOT, AND, OR. 7. Let us multiply two vectors, a and b: >> c=a*b; [ENTER] Let s show c: >> c [ENTER] 8. Try to display C (capital letter). What message do you get? The length of a vector is read with the MATLAB function length(vector). Usually, the arguments of a MATLAB function are written after its name, in round paranthesis. Another MATLAB function used to get the number of rows and columns of a matrix is size. 9. Run the following commands: >> L = length(a) [ENTER] >> s = size(m) [ENTER] MATLAB uses different statements: if, for, while. for i =1:5 k(i) = a(i)^2; % raise all the elements to the power of 2 end 10. Run the command above in Matlab window and display k. 2

The commands can be nested. for end i =1:s(1) for j=1:s(2) if m(i,j) == 2 m(i,j)=0; end end 11. Run the commands from the previous example. Display matrix m. MATLAB allows new functions to be defined by users. A new function is saved as a file with the extension.m, having the same name as the function itself. Do not use the same names as an existing MATLAB function. In order to call a new function, the folder containing it must be specified: >> cd < path to the user s folder > The function is written accordingly to the following template: function [output arguments] = name (input arguments separated by comma) % comments commands 12. Create a new function and save it on d:\, in your work directory. Launch in MATLAB the help command with your function s name: >> help <name> Do you get your comments? Apply the function created by you on a set of numerical arguments. Check if the result is correct. IN CONCLUSION: MATLAB can be used to test and to implement different coding and decoding algorithms used by telecommunication systems. 3

LABORATORY : INTRODUCTION IN COMMUNICATIONS DISCRETE INFORMATIONAL SOURCE ANALYSIS 1. Create a 2-3 pages text file (<name>.txt) with at least 1000 characters. 2. Read and display the file in MATLAB command window, using the functions: fopen, fread, setstr. 3. Use length function to find out the total number of characters. 4. What type of values does MATLAB read? (binary, hexadecimal, decimal) What code is used by Matlab to convert characters in numerical format? 5. What are the minimum and maximum values for your own file? Use the following functions: min, max. How many bits are used to encode characters? How many characters can be encoded by this code? 6. Create a vector (nc) in order to store the number of appearances of each numerical value (from 1 to 128 or 256). Use ones function to initialize the vector. 7. Use sum function to calculate the total number of cases nt analyzed by yourselves. Create the probability vector prob. 8. Represent the histogram of nc vector using bar function. Use clf function to clear the image. 9. What can you notice analyzing the histogram? What is the value that the maximum sample corresponds to? Choose a threshold value (v) to compare the samples with. Which are the first 20 to 25 significant samples of this histogram? Complete Table 1. Crt. No. Table 1: The most significant characters of the informational source Character ASCII Code No. of appearences Probability 1

10. Calculate the probability of a non-significant character (different from the ones in Table 1) and complete the probability vector with this value. Check the sum of this vector. This step completes the modelling process of the discrete informational source. 11. Calculate the entropy of the informational source: h = - prob(i)*log 2 (prob(i)), 12. Design the lossless compression code using the obtained source model. Complete Table 2. Table 2. Code Table Crt. No. Character Probability Code Word Length (bits) Calculate the average length of code words, the redundancy, the efficiency and the compression rate of the designed code. 2

LABORATORY: INTRODUCTION TO COMMUNICATIONS ENCRYPTION TECHNIQUES. RSA ALGORITHM OBJECTIVE: IMPLEMENT AND TEST THE RSA ENCODING AND DECODING ALGORITHMS PROCEDURE: 1. Create a text file (.txt) containing the first names of the team members (use space as word separator). 2. Open the file in MATLAB (use fopen). Display the file identifier (fid). 3. Read the file in MATLAB (use fread). Display the vector f, containing the decimal ASCII character codes. 4. Display the content of the file in MATLAB (use setstr) 5. Choose a pair of distinct prime numbers (p, q) that will be used for RSA code design. the numbers will be chosen so that the code can process individually each byte, character-by- character. 6. Deduce the encryption and decryption keys: (e,n),(d,n). **** If d = e, change the pair of numbers (p,q). 7. Implement the RSA encoding algorithm (the spaces between words are not encrypted). 8. Encode vector f using your encryption key. Display the coded vector (c). Display the encrypted characters, corresponding to the coded vector (c). 9. Implement the RSA decoding algorithm. 10. Decrypt c using your decryption key (denote the decrypted vector as v). Display the decrypted text. CONCLUSIONS: What difficulties did you meet by implementing the RSA encryption and decryption algorithms? Make some comments and recommendations.

LABORATORY INTRODUCTION TO COMMUNICATION MEASURING TELECOMMUNICATION CABLES Objective: Measure the characteristic impedance (Zc) and the attenuation (a) of the cable for different cable types: UTP, FTP, thin coaxial, thick coaxial. Procedure: Long enough cables (> 10 meters) must be used. For each test cable, follow the steps: 1. Connect the conductor wire and the ground of the cable to the signal generator. Select 1 MHz rectangular signal to be generated. 2. Connect the same wires to the 2-channel oscilloscope. 3. The other end of the cable is unloaded in order to get total reflection of the transmitted wave. 4. Display the transmitted wave combined with the reflected wave at the input of the cable. Remark the delay between them. Explain the reflection phenomenon. How does the reflected wave change when the cable is short-circuited. Draw on your papers the displayed waveforms on the oscilloscope. 5. Measure the delay between the two waves (adjust the time base of the oscilloscope). 6. Measure the voltage levels of the transmitted wave and of the received signal. 7. Estimate the cable length. 8. Calculate the primary parameters (R, L, G, C), the characteristic impedance (Zc) and the cable attenuation (a) per meter. 9. Compare the result with the nominal parameters of the cable (written on the cable). 10. Why do these different values occur? Which values are correct, the measured or the nominal ones?

LABORATORY Introduction to Communications Digital Modulation Techniques Objective: Analyze some well-known digital modulation techniques (state diagram, BER, SNR) Procedure: 1. Start MATLAB. 2. Use specific Matlab functions in order to generate different modulated signals and their corresponding transmitted state diagram. Run the following scripts with a different number of states (M = 4; 8; 16; 32): Create PSK Constellation Scatter Plot M = 16; x = [0:M-1]; scatterplot(pskmod(x,m)); Create QAM Constellation Scatter Plot M = 16; x = [0:M-1]; y = qammod(x,m); scale = modnorm(y,'peakpow',1); y = scale*y; % Scale the constellation. scatterplot(y); % Plot the scaled constellation. Draw one state diagram of each type and map the states with bit sequences. 2. Display the same state diagrams at the receiver considering a communication channel affected by additive white Gaussian noise (AWGN) and different values of the received SNR (15; 12; 9; 6; 3 db). % Create a random digital message M = 16; % Alphabet size x = randint(5000,1,m); % Message signal % Use QAM modulation. y = qammod(x,m); % Transmit signal through an AWGN channel. ynoisy = awgn(y,15,'measured');

% Create scatter plot from noisy data. scatterplot(ynoisy); Repeat the simulation for received PSK modulated signals. Complete the following table: TABLE 1. Is it possible to decide what type of modulation is received and to distinguish the number of states? SNR (db) 15 12 9 6 3 32QAM 16QAM 8QAM 4QAM 32PSK 16PSK 8PSK QPSK 3. Start BER tool: >> bertool For digital modulation techniques (PSK, FSK, QAM), with a different number of states (2, 4, 8, 16, 32), plot BER, considering coherent and non-coherent demodulators, eventually with Hamming or Reed-Solomon pre-coding blocks. Two channel types are considered: (1) AWGN channel (2) Rayleigh fading channel If it is necessary, change the SNR range from 0:18 db to 0: 30dB or 0:60dB. Write in a table the values of SNR corresponding different values of BER: 10^-2, 10^-4, 10^-6, 10^-8. Compare modulation techniques with the same number of states. Analyze the quality of service (QoS). TABLE 2. SNR db values Log BER 32QAM 16QAM 8QAM 4QAM 32PSK 16PSK 8PSK QPSK -2-4 -6-8 CONCLUSIONS: Which modulation is more performant for transmission by AWGN channel? What about fading channel? What is the goal of error-correcting coding techniques?