0% found this document useful (0 votes)
73 views

Lab1 Signal Processing

The document discusses an introductory lab session on MATLAB. It includes exercises to familiarize students with basic MATLAB operations like creating variables, matrices and vectors, performing element-wise operations, indexing and plotting functions. The exercises cover topics like creating and manipulating matrices and vectors, plotting graphs, and generating trigonometric and other periodic signals.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Lab1 Signal Processing

The document discusses an introductory lab session on MATLAB. It includes exercises to familiarize students with basic MATLAB operations like creating variables, matrices and vectors, performing element-wise operations, indexing and plotting functions. The exercises cover topics like creating and manipulating matrices and vectors, plotting graphs, and generating trigonometric and other periodic signals.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

People’s Democratic Republic of Algeria

Ministry of Higher Education and Scientific Research

University of Kasdi Merbah Ouargla

Faculty of New Information and communication


Technologies

Department of Electronics and Telecommunications

Level : 3rdyear Telecommunications

Module: Signal Processing

First name and Family name : Speciality : Group :


Ghedeir Ahmed Boutheina Telecommunication 03
Khemgani Amina
Ladjilat safa

Lab 1 : Getting started with Matlab

I – Objective of the Lab :


The purpose of this lab session is to familiarize you with the Matlab
software, which will be used for all signal processing lab session

II – Introduction :
In this lab work we sine how to use the Matlab software and how to
create the scalar variables and matrix with their operations in addition to
that we sine how to generate a function and draw their graphics
Answer :
Exercise 1:

1 – Enter the following variables into Matlab:

These variables represent:

● a is a vector variable

● B is a row vector

● c is column vector

● D is a matrix
2 – Create the matrix A:

3- Display the 2nd element of the diagonal of the matrix D and then the
1st row of A:

4 – Create the following vector V1,V2,V3,V4:


5 – We consider the following variables:
6 – calculate 2x,A+B,Ay,A2,2y and y2:
7 – Comparaison of the code A*B,A.*B,A^2,A.^2: The code A.*B multiplying
an element by an element with addition (element by element multiplication)

The code A*B multiplying the elements of the row of the matrix A by the column elements
of the matrix B

The code A.^2 Square element by element

The code A^2 this is equivalent to A*A

8 – Test the following codes:


Exercise 2 :

Let A=[1:4;5:8;9:12;13:16]

1 – The result of the instruction A(10:-1:5) is :

2 – To create a vector containing the element of A in the following


order : 16 12 8 4 15 11 …… we create the instruction : A(16:-1:1)
3 – The result of the instruction [A(1,),5] is : the 1st row of the matrix
plus the element 5:

4 – To create a vector containing the element of A in the following


order : 1 2 3 4 …… we create the instruction A(:)’
5 – The result of the diag(diag(A)) is a diagonal matrix :

Exercise 3:

1 - Define the vectors x=(1,2,3,4,5) and y=(23,54,12,85,45)

Plot y versus x
Plot x versus y

Comparison : plot y versus x is the invers of plot x versus y

2 – Draw the function f(x)=x2 on [-10,10]:


3 – Generate two periods (2π×2) of the signals x(t)=cos(t) and
y(t)=sin(t):

4 – Visualize on the same figure the four signals cos(t),sin(t),log(t) and


exp(t):

5 – Put a title, legends , grids :

You might also like