Simulation with Matlab

matlab simulations for radar systems design pdf and matlab simulations for radar systems design code
NancyWest Profile Pic
NancyWest,Germany,Professional
Published Date:12-07-2017
Your Website URL(Optional)
Comment
SGN-1158 Introduction to Signal Processing, short version Lecture: Introduction to DSP simulations in MATLAB Konstantin Rykov konstantin.rykovtut.fi • Why you’re at this lecture/lab? • Do not fear MATlab. It’s your friend • MATlab is a tool • Where I can use MATlab? Examples • I’m afraid of program languages… • THE MAIN IDEA OF THE LECTURE 11.9.2012 2 Сontents BASICS OF MATLAB • Mainwindow. How to make m-file? How to save m-file? • Some basic hints • Main MATLAB objects (commands, variables…) • Main operation symbols • Operation symbols MATLAB IS AN ADVANCED CALCULATOR • Complex numbers • HELP • Vectors • Matrices 2D GRAPHS • Main MATLAB functions for plotting graphs • General rules of forming graphs • Main tools of staging graphs • Controlling graph properties • LineSpec parameters OUTER FUNCTIONS IN MATLAB 11.9.2012 3 Сontents DISCRETE SIGNALS IN MATLAB • Sequences • Unit sample sequence, unit step sequence, discrete exp • Discrete complex harmonic signal • Functions max, sum and prod • Generation of signals: rectpuls, tripuls, gauspuls, sinc, square, sawtooth, diric • Functions rand(1,N) and randn(1, N) • TASK: Open MATLAB 11.9.2012 4 BASICS OF MATLAB The main MATLAB window 11.9.2012 5 Some basic hints • help name (for example: help cos) • ; blocks automatically output of the variables • % makes a comment • to comment a few rows hold Ctrl+R • to uncomment a few rows Ctrl+T • Always use: clc,clear all; close all; TASK • Type in Editor: • =============== • My MATlab Crib • =============== • Use CTRL+R to comment it • clc; clear all; close all; 11.9.2012 6 Main MATLAB objects • Commands (clc, help, demo) • Constants (10, -17.28, 5+3j, 1e-6, 102) • Standard const (pi, 1i, eps) • Variables – MATlab object, which might change it’s value during simulation. All variables are MATRIXES in MATlab • Functions (sin(X), exp(X), log10(X), sqrt(X), abs(X), real(X), imag(X)) • Expressions – is a sum of constants, functions, variables, which are summed by operational symbols (x+sin(a)-sqrt(pi);) 11.9.2012 7 Main operation symbols Symbol Operation + Summation - Difference Multiplication of matrixes . Multiplication of elements / Right division .’ Transposing 11.9.2012 8 MATLAB IS AN ADVANCED CALCULATOR Complex numbers Use MATLAB as calculator to find answers 11.9.2012 9 Use help to find what these commands do • abs • angle • exp • conj 11.9.2012 10 Type and simulate • z=3+4i • r=abs(z) • fii=angle(z) • rexp(ifii) • zk=conj(z) • zzk-r2 • What the command format does? 11.9.2012 11 Vectors • Type a=2 4 5 7 and b=-1 4 -2 1 • Find a+b, 2a-2b • What happens if you type a’ and b’ • ab; a’b; ab’; a’b’; • -1:10; 0:2:100; 1:-0.25:-2 • Form vectors a=(7,8,9,…,22); b=(0,2,4,…,100); c=(100,95,90,…,35) • What did you get a(3)? a(3 5 7)? a(3:7)? a(3:end)? 11.9.2012 12 Matriсes A=-7 5 -9; 2 -1 2; 1 -1 2; 11.9.2012 13 Task • Calculate: 3A-5C, 7A+2B, CA, CD’ • Find out commands: zeros(n), zeros(m,n), ones(n), ones(m,n), size(D), zeros(size(D)), diag(1 2 3 4), eye(n) • What happens A,B and A;B? • Try to find an easy way to build a 78-matrix whose other entries are zeros, but in its diagonal and its last column are 5s NOTE: Transpose of a matrix is obtained with command – ’ • row with A(i,:) and column with A(:,j) 11.9.2012 14 • Determine whether the given sets of vectors are linearly independent/dependent: W1=1 2 3, W2=2 1 5, W3=-1 2 -4, W4=0 2 -1 • Use MATLAB to to choose randomly three three column vectors in The MATLAB commands to choose these vectors are: • y1=rand(3,1) • y2=rand(3,1) • y3=rand(3,1) HINT check the command rref 11.9.2012 15 2D GRAPHS Main MATLAB functions for plotting graphs Function Meaning plot (x1, y1, x2, y2,…) Linear graphics stem Sequence graphs stairs Stairs graphs loglog Both Logarithmic axis Im and Re semilogx Logarithmic Re axis semiloxy Logarithmic Im axis 11.9.2012 16 General rules of forming graphs • figure – making a new window for a graph • subplot (n,m,p) – drawing a few graphs in one window: n – colum, m – row, p – ordinal number of the graph • hold on – plotting another graph at the same picture • hold off • For more information help graph2d 11.9.2012 17 Generate x=1 20 3 15 18; Use functions and tell what is the difference: • plot • stem Generate x1=0:pi/8:8pi. What we have done? Generate y(t)=sin(x). Use functions to plot graphs: • plot • stem • stairs • HINT: use command figure or function subplot(n,m,p) 11.9.2012 18 Use semilogx, semilogy, loglog to plot graphs of the following functions: 1. y=3x5 2. y=3(5x-2) 3. y=log10(3x4) • Use subplot command into 33-subplot as described bellow ‘case (1) semilogx’ ‘case (1) semilogy’ ‘case(1) loglog’ ‘case (2) semilogx’ ‘case (2) semilogy’ ‘case(2) loglog’ ‘case (3) semilogx’ ‘case (3) semilogy’ ‘case(3) loglog’ • Consider again y=3x5. Use plot(x,log10(y)) and compare its plot with semilogy plot. What is the difference and similarity between them? 11.9.2012 19 Main tools of staging graphs Function grid title(‘text’) xlabel (‘text’) ylabel (‘text’) Legend (‘funct1’,’funct2’,..,Pos) axis(XMIN XMAX YMIN YMAX) xlim (XMIN XMAX) ylim (YMIN YMAX) Pos (-1, 0, 1,…,4) TRY THEM 11.9.2012 20