5 views

Uploaded by lulu1990

matlab

- A Matlab Primer
- Introduction to MATLAB
- Matllab Tut
- matlab
- honors final paper
- Getting Started With MATLAB - David Hart
- matlab
- Data Structures and Algorithms Assignment
- Notes for Multivariate Statistics with R
- Algorithm Analysis - Max Alekseyev
- MatlabSimulinkIntro
- NTU102S207_CS01L02
- matlab vs C
- MatLabSlides.pdf
- DSP1
- Assignment Array 1&2D
- Session for R
- Matlab Short 152
- MELJUN CORTES Numerical Algorithm
- 1. Low-Complexity Modem Design for GFDM

You are on page 1of 3

Page 1

LABORATORY INSTRUCTION

ELCE 402: Digital Signal Processing Laboratory (DSPL)

Introduction to Matlab and DSPL

OBJECTIVES

To perform an overview of the Matlab tools and commands commonly used in the DSPL.

To perform an overview of the course (attendance, evaluation, reports, office hours, etc.)

NOTE: More preliminary information about Matlab can be found in Matlab_introduction.pdf file (it is

uploaded to Moodle).

MATLAB FOR SIGNAL PROCESSING OVERVIEW

The following summarises briefly some of the commonly used Matlab commands.

Help and utilities

Explanation of the utiility and usage of a Matlab function can be accessed by typing

help <name_of_function> (for example help size)

doc <name_of_function>, or

edit <name_of_function>

If everything fails, you can use why command to get instantaneous answer to your questions

Before proceeding with the exercises, create a script called myscript.m and type your code

therein.

Data generation and representation

An example of a real and complex number

x = 2.1; y = 2.1 + j*3.3;

Row vector (X) versus column vector (Y)

X = [1 4 6]; Y = X.;

An example of 2x3 matrix declaration

Y = [1 4 6; 5 6 9];

Indexing in Matlab starts from 1 (not from 0!) so, for example, in the matrix above Y(2,1) = 5.

Exemplary sinusoid generation

x = -pi:0.01:pi;

y = cos(x);

Other useful functions: real, imag, size, length, colon operator (:), ones,

zeros, eye, randn, clear, whos.

ELCE 402 Digital Signal Processing Laboratory Introduction

Page 2

Exercise: For a few selected functions above do the following: (1) find out how to use it; (2) Write an

exemplary application and examine the results. Use the example signals above as the argument of the

functions.

Example - function real: Type help real, read the documentation, generate a complex number

y (see above) and execute a command real(y). Comment on the result.

Arithmetic matrix operations

If X and Y are matrices of the same size addition, subtraction and element-by-element multiplication

or division can be performed as follows

X+Y, XY, X.*Y, X./Y

Matrix multiplication, X * Y requires that number of columns of X and rows of Y are the same

whereas matrix left division X\Y is used in Gaussian elimination.

Other useful operations: sum, *, ^, &, ||, <, >, ==

Exercise: Practice the use of the operations above in the same way as in the previous exercise, using

the vectors and matrices defined previously. Demonstrate the working examples to the lab instructor.

Graphics

Typically the signals processed in the laboratory will be 1-D or 2-D (images) and can be visualized in a

following way

figure, plot(x, y)

title(my plot), xlabel(x), ylabel(y),

or (in case of images)

figure, imagesc(Y)

Other useful functions: stem, bar, stairs, axis, subplot, grid, legend,

close all

Exercise: Plot any of the vectors and sinusoids from the previous exercises on the same figure. Attach

titles, labels and a legend explaining the plot contents. Make sure the plot is self-explanatory!

Functions* (Optional)

M-file can also contain a user defined function. In this case it has to begin with a function declaration

in a first line, for example

function y = arraymean(x)

% Computes the scalar mean of an array x

y = mean(x(:));

end

ELCE 402 Digital Signal Processing Laboratory Introduction

Page 3

Other useful commands: if, else, for, case, while, end

Exercise: Write a function that computes the energy of the signal. Test it on the signals defined

previously.

Publishing

Command publish provides a convenient way of documenting the experiments or simulations in

Matlab.

Exercise: Run command publish('myscript.m') and examine the results in the current

directory).

REFERENCES

[1] S.K. Mitra, Matlab Introduction (uploaded to Moodle)

[2] MATLAB online help http://www.mathworks.com/help/matlab/index.html

- A Matlab PrimerUploaded byyousaf khalid
- Introduction to MATLABUploaded bytausif87
- Matllab TutUploaded byAmatou Arrahmen
- matlabUploaded byTigabu Yaya
- honors final paperUploaded byapi-284297723
- Getting Started With MATLAB - David HartUploaded byapi-3696482
- matlabUploaded byhmirfan81
- Data Structures and Algorithms AssignmentUploaded byVibhu Mittal
- Notes for Multivariate Statistics with RUploaded byAhmed Assal
- Algorithm Analysis - Max AlekseyevUploaded byuserscrybd
- MatlabSimulinkIntroUploaded bybdeepesh
- NTU102S207_CS01L02Uploaded byHerol
- matlab vs CUploaded bySagar Verma
- MatLabSlides.pdfUploaded byDanilo Pequeno
- DSP1Uploaded byTariq Khan
- Assignment Array 1&2DUploaded byNiti Arora
- Session for RUploaded byanksagascribd
- Matlab Short 152Uploaded byBadran Al Ibrahim
- MELJUN CORTES Numerical AlgorithmUploaded byMELJUN CORTES, MBA,MPA
- 1. Low-Complexity Modem Design for GFDMUploaded byWilly Arroyave
- Experiment #1Uploaded byabdala67
- Lab1Uploaded byRadu Niculae
- Representing Data rUploaded bytnylson
- DSP LAB 2Uploaded bySBILALAHMED
- Empezamos La PruebaUploaded byjuan_pcn
- Introduction Tom at Lab DocUploaded bysdfssadfgdsgfdg
- Introduction Matlab LanguageUploaded bymnbv01
- Maxima Book Chapter 7Uploaded byprakush_prakush
- Slope Intercept Form CalculatorUploaded byRam Singh
- LFCH10Uploaded bysadsad

- Switch DebouncingUploaded byeyesboxcc2
- C4 Probe Card Space Transformer TechnologyUploaded bycivicblade
- Computer FundamentalsUploaded byBenjie Reyes Lizo
- Secret History of the MongolsUploaded byQuinn Comendant
- Power Quality Through DpfcUploaded byradhika dora
- 81-105Uploaded byapi-3738859
- Natural Semantic MetalanguageUploaded byCihud AiiuuWardani
- Catalog ITEM.pdf4a3667894b315Uploaded byDomokos Levente
- HBD856-DUploaded byalways75
- Jigsaw Order Flow Trading ManualUploaded bymoby_rahman
- AFE Week 1 HandoutUploaded bymariah.hafeez4474
- yüzey gerilimi nasıl ölçülürUploaded byYaşar Cenik
- 001-YianatosUploaded byDaniel Alejandro Jara Painean
- APAC Cassette Brochure FinalUploaded byAnonymous 5wiGNlpq6
- Selection of Capillary Tube for Refrigeration SystemUploaded byInternational Journal of Engineering Inventions (IJEI)
- 126911200 Welding Inspection Questions WisUploaded byBhavani Prasad
- 50318_01aUploaded bymusmansuhail6953
- 08_Achtziger_Gollwitzer_Sheeran_Implem.intentions_and_sh.pdfUploaded byAman Gujar
- Bio Mechanics of ThrowingUploaded byOnwaree Ing
- ReadmeUploaded byBrandon E. Paul
- IC Transistors ResistorsUploaded byKarthik Koneru
- aml715-40.pptUploaded byamr hassan
- ENGLEZA_GIMNAZIUUploaded byDan-Alex Si Ioana Botar
- Domain of a CompositionUploaded bysteph
- 1195 Specification for Bitumen Mastic for FlooringUploaded byRakesh Ranjan
- Artigo de Rhea, Criação Do Effect SizeUploaded byLevy
- Electrical DesignUploaded byKrishna Adina
- Godrej Infotec Placement Paper | Freshers ChoiceUploaded byfresherschoice
- OpenFoam SolversUploaded by문정은
- 141746949-ISA-774101-Final-Draft-06-22-2010Uploaded byGrant Douglas