0% found this document useful (0 votes)
91 views2 pages

HW3 Matlab

This document provides instructions for homework questions in an ECE440 signals and systems course. Students are asked to write MATLAB code to generate and analyze various sequences, save their code and results in a PDF file, and submit via Blackboard. The questions involve generating sequences using Dirac delta and cosine functions, manipulating sequences using shifting and multiplication, convolving sequences, and analyzing the effect of a convolution kernel. Students are reminded to include titles, axes labels and comments in their code and plots.

Uploaded by

MaharshiGohel
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)
91 views2 pages

HW3 Matlab

This document provides instructions for homework questions in an ECE440 signals and systems course. Students are asked to write MATLAB code to generate and analyze various sequences, save their code and results in a PDF file, and submit via Blackboard. The questions involve generating sequences using Dirac delta and cosine functions, manipulating sequences using shifting and multiplication, convolving sequences, and analyzing the effect of a convolution kernel. Students are reminded to include titles, axes labels and comments in their code and plots.

Uploaded by

MaharshiGohel
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/ 2

ECE440 Fall 2021 HW-3

Solve the following questions using MATLAB.


The questions must be implemented as script (.m) files, create a PDF file
to include all your plot results. Your results (.m file and PDF) should be
neatly and completely written up and handed in via Blackboard.
Note:
• A plot should have a title, name & index for both horizontal and vertical
axis,
• Please have comment lines for your code / algorithm.

Q1(P2.1) Generate the following sequences using the basic MATLAB signal
functions and the basic MATLAB signal operations discussed in chapter 2 of the
reference book. Plot the signal using the stem function.
(1) 𝑥1 (𝑛) = 3𝛿(𝑛 + 2) + 2𝛿(𝑛) − 𝛿(𝑛 − 3) + 5𝛿(𝑛 − 7), −5 ≤ 𝑛 ≤ 15.
Hint : you can generate each sequence manually or implement and invoke functions such
as impseq() from the reference book to get the each sequence and results.

(2) 𝑥5 (𝑛) = 5[cos(0.49𝜋𝑛) + cos(0.51𝜋𝑛)] , −200 ≤ 𝑛 ≤ 200,

Q2(P2.4) Let x(n) = {2 ,4, -3, 1 (↑) , -5, 4, 7}. Generate and plot the samples (use
the stem function) of x3(n).
x3(n) = x(n + 3) × x(n - 2) + x(1 - n) × x(n + 1)
Hint: you may want to implement and invoke sigfold(), sigshift(), sigmult() and
sigadd().

1
Q3(P2.15) Calculate the convolution y(n) = x(n) ∗ h(n) of the following two
sequences,
x(n) = {2, -4, 5, 3 , -1, -2, 6}, h(n) = {1, -1 , 1, -1, 1}
↑ ↑
(a) use the Matlab function conv(.),
(b) use the conv_m(.) function from the reference book,
(c) apply subplot to show your results from (a) and (b), verify the sequences
has the same shape,
(d) what is the difference between these two functions?

Q4. Bonus
Step1: Create a 25-point sequence (array with 1 row) n, from 0 to 24,
Step2: Create a 25-point sequence : x(n) = cos [2πn×(0.2)]
Step3: Create a sequence h(n):
0.5, 𝑓𝑜𝑟 𝑛 = 1
ℎ(𝑛) = {0.5, 𝑓𝑜𝑟 𝑛 = 2,
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Step4: Calculate the convolution between h(n) and x(n), plot your result with the
stem function.
Step5: Discussion: by checking either the math or your plot results between in
input and output, can you explain what the function for sequence h(n)?

You might also like