EE 4365 Introduction to Wireless Communications MATLAB® Demonstration—Part 1 Jiawei Liu (T.A.)
Lecture Outline Introduction to MATLAB® Review of Probability Theory Common pseudo random sequence generators in MATLAB® Example: Generating Binary Pseudo Random Sequences
Introduction to MATLAB® Widely used high-level programming language in both academia and industry Numerous toolboxes for many applications such as signal processing, communications, biology and finance The data structure mainly built on arrays or vectors Brilliant for visualization
Why MATLAB in EE 4365 Communications systems can be easily modeled through MATLAB and Simulink MATLAB has a large library to facilitate signal processing, including powerful tools to visualize signals MATLAB is easy to learn and great for pedagogical purpose MATLAB will be continuously used throughout this course to illustrate key ideas and concepts
How To Get MATALB®
Navigate through MATLAB The user interface Command Window Semicolon, ctrl+c Editor Getting help MATLAB’s powerful built-in help system Useful commands: doc, help function name (e.g., help plot), lookfor keyword (e.g., lookfor gaussian) MATLAB Central _mlc _mlc
Navigate through MATLAB (Continued) Our goal is to – Generate signals that transmitted in communication systems – Simulate signal processing with these signals like real communications systems Living in the digital world – Any signals in MATLAB must be digitized – Signals are represented as a sequence of numbers or samples Working with vectors and matrices – Vectors are simply sequence of numbers
How to Generate Vectors & Signals in MATLAB Colon operator : [ ] operator :
How to Generate Vectors & Signals in MATLAB (Continued) ones(n) – Create array of ones Zeros(n) – Create array of all zeros d=size(X) - Return the dimension of array X Y=sign (X) – Return 1 if x is greater than 0; 0 if x equals 0; -1 if x is less than 0
Illustration: Amplitude Modulation
A Brief Review of Probability Theory
Conditional Probability
Random Variables A random variable assigns numbers to outcomes in the sample space of an experiment Discrete or Continuous
Continuous RVs
Common PDFs
Common PDFs (Continued)
Discrete Random Variables
Discrete Random Variables (Continued)
Expectation and Variance of R.V.s
Random Sequence Generation
Random Sequence Generation (Continued) randi – create uniformly distributed pseudorandom integers randi([a,b],n,1) – generate an n-by-1 column vector of uniformly distributed random integers from the sample interval [-5,5] binornd(N,p) – generate binomial random numbers after N trials with the probability of success for each trial, p
Random Sequence Generation (Continued) y = randsample(n,k,true,w) – generate weighted random numbers with weight vector w. p=randperm(n) – returns random permutation of the integers from [1,n] random – general random number generation function m.html m.html
Illustration: Generate binary pseudo random sequences Generate equally likely independent binary bit stream of bit -1 and +1 with length N=100
Illustration: Generate binary pseudo random sequences (Continued) Generate a N=100 bits long independent binary bit stream of -1 or +1 with probability of bit +1 =3/4
Recommended Reading How to Generate Signals – cialcharacters.htmlSpecial Characters cialcharacters.html Array vs. Matrix Operations – _prog/array-vs-matrix-operations.html _prog/array-vs-matrix-operations.html MATLAB Tutorial – Documents of each function introduced