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

EEE362_462

This document outlines the lab assignment for EEE 362/462 - Digital Signal Processing at Mulungushi University, due on 11/05/2023. It includes instructions for submission, prerequisites, and theoretical concepts related to MATLAB functions like fliplr and stem. The assignment consists of several questions requiring the generation and plotting of discrete-time signals using MATLAB code.

Uploaded by

mwilamuta2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

EEE362_462

This document outlines the lab assignment for EEE 362/462 - Digital Signal Processing at Mulungushi University, due on 11/05/2023. It includes instructions for submission, prerequisites, and theoretical concepts related to MATLAB functions like fliplr and stem. The assignment consists of several questions requiring the generation and plotting of discrete-time signals using MATLAB code.

Uploaded by

mwilamuta2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Mulungushi University

School of Engineering and Technology

EEE 362/462 – Digital Signal Processing

Lab Assignment Two

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];

2.4 Unit Step Sequence Function


The unit step sequence 𝑢(𝑛 − 𝑛0 ) can be implemented over a finite interval 𝑛1 ≤ 𝑛 ≤ 𝑛2 , where 𝑛1 <
𝑛0 < 𝑛2 , using the user-defined function:
function [x,n] = stepseq(n0,n1,n2)
n = [n1:n2];
x = [(n - n0) >= 0];
Questions
1. A discrete-time signal is defined as
𝑛
1 + , −3 ≤ 𝑛 ≤ −1
𝑥(𝑛) = { 3
1, 0≤𝑛≤3
0, elsewhere
(a) Use the stem command and the stepseq function to generate and plot the sequence 𝑥(𝑛) given
below over the interval −5 ≤ 𝑛 ≤ 5. Add ‘Question One (a)’ as the title and label the
horizontal axis as 𝒏 and the vertical axis as 𝒙(𝒏). The plot should have black filled stems.
(b) Use to the stem command and the fliplr, and stepseq functions to generate and plot the
sequence 𝑥(−𝑥 + 4) below over the interval −5 ≤ 𝑛 ≤ 5. Add ‘Question One (b)’ as the title
and label the horizontal axis as 𝒏 and the vertical axis as 𝒙(−𝒏 + 𝟒). The plot should have
black filled stems.
2. Use the stem command and the fliplr and impseq functions to generate and plot the even and odd
sequences of 𝑥(𝑛) given below over the interval −5 ≤ 𝑛 ≤ 5.
𝑥(𝑛) = { 2, 3, 4, 5, 6, }

Add ‘Question Two (even)’ and ‘Question Two (odd)’ as the title, respectively, and label the
horizontal axis as 𝒏 and the vertical axis as 𝒙𝒆(𝒏) and 𝒙𝒐(𝒏), respectively. The plots should have
black filled stems.
3. A discrete-time signal is given by
𝑥(𝑛) = {−3, −2, −1, 0, 1 ,2, 3, 4, 4, 4, 4, 4, 4, 4}

Use the stem command and the impseq and stepseq functions to generate 𝑥(𝑛) and plot the
sequence 𝑥(2𝑛) from 𝑥(𝑛). Add ‘Question Three (2n)’ as the title and label the horizontal axis
as 𝒏 and the vertical axis as 𝒙(𝟐𝒏). The plot should have black filled stems.
Note: All the calculations should be done by the MATLAB code.

You might also like