EEE362_462
EEE362_462
Instructions
1. Due Date: 11/05/2023 (23:59)
2. Submit a typed Lab assignment in PDF. The assignment should have a cover page with the
following information:
➢ Name of the university
➢ Name of the school
➢ Course code and name
➢ Lab assignment number
➢ Your name and student number
➢ Due date of assignment
3. Submit MATLAB M-files of the code used to generate the results. The M-files should include
the following information:
➢ Course code and name
➢ Lab assignment number
➢ Your name and student number
➢ Well written comments to explain the code
4. Use your name and assignment number to name your PDF and M-file as shown below.
Naming format: Chisala_Kabanda_Lab_1
1 Prerequisites
➢ Knowledge of MATLAB functions (built-in and user-defined)
2 Theory
2.1 The fliplr Function
Folding is an operation in which each sample of 𝑥(𝑛) is flipped around 𝑛 = 0 to obtain a folded
sequence 𝑦(𝑛).
𝑦(𝑛) = {𝑥(−𝑛)} (1)
In MATLAB, this operation is implemented by fliplr(x) function for sample values and by -fliplr(n)
function for sample positions.
2.2 The stem Command
In MATLAB, the stem command is used to plot a set of discrete numbers (or discrete-time signals).
The command displays data values as a stem, that is, a small circle at the end of a line connecting it to
the horizontal axis. The circle can be open (default) or filled (using the option ’filled’).
2.3 Unit Sample Sequence Function
The unit sample sequence 𝛿(𝑛 − 𝑛0 ) can be implemented over a finite interval 𝑛1 ≤ 𝑛 ≤ 𝑛2 , where
𝑛1 < 𝑛0 < 𝑛2 , using the user-defined function:
function [x,n] = impseq(n0,n1,n2)
n = [n1:n2];
x = [(n - n0) == 0];