Advanced Digital Design Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Information Technology University

Advanced Digital System Design Fall 2019


Assignment 1.1

Date of Launch: 11th Sep 2019 Maximum Marks: 60


Due Date: 20th September 2019 Due Time: 23:59hours
Instructor: Dr. Rehan Hafiz TA: Muhammad Usama Manzoor
Important Instructions:
• This is an individual assignment. Each student must work alone, without help from any other person.
Plagiarism is NOT allowed. Copying material from the web or from documents and submitting it for this
assignment without giving credit/reference is plagiarism. Copied assignment will be marked ZERO.
• 10 marks/day will be deducted in case of late submission after due date.
• Add your WORD FILE (with your code and outputs copy-pasted into it) and your MATLAB script
files to a zip file and upload on Google Classroom. You must name your files
YourName_RollNumber_A1.1.docx and YourName_RollNumber_A1.1.zip. You must include:
o All script files
o Screenshots of any results (Resulting matrices etc.)
o Answer to any subjective question asked in the Assignment
o References

Question # 01 (30 Marks)


Review the MATLAB command for different kinds of linear 1-D Convolution
including those of type full, same and valid from the official Mathworks website.
a) Use the MATLAB command conv to convolve the input u = [5 1 2 3 4 1 11] with
the filter v = [1 2 4 2 1] to find the convolution output w = u*v of types:
a. Full [5 Marks]
Out = [5 11 24 21 25 26 37 37 50 23 11]
b. Valid [5 Marks]
Out = [25 26 37]
c. Same [5 Marks]
Out = [24 21 25 26 37 37 50]
b) What is the formula for computing the size of convolution outputs of type full?

What is the padding/truncation strategy for obtaining outputs of type valid and
same? [5 Marks]
In same convolution, central part of the full convolution is returned which has
same length as input signal. Input signal is padded with (f-1)/2 zeros, where f is
filter length.
In valid convolution, no padding is done. Signal is convolved with the other
signal and result is returned. In other words, valid convolution is part of full
convolution which is computed without padding.

c) Write your own MATLAB code to do the same convolution operation of type full
(without using the conv command). Extra credit will be awarded to those whose
code can work on inputs and filters of arbitrary length. [10 Marks]
Written in file myconv.m

Question # 02 (30 Marks)


Review the MATLAB command for 2-D Convolution and the different kinds of output
shapes you can obtain (full, same and valid) from the Mathworks website. Edit the
given MATLAB script file Q2.m to answer the following. Note that convolution also
involves flipping the filter appropriately.
a) Use the given MATLAB script file and the conv2 command to convolve the
input A with the filter f to find the outputs
a. O1 of shape full [5 Marks]

b. O2 of shape same [5 Marks]

c. O3 of shape valid [5 Marks]


b) Write your own MATLAB code to do the same 2-D convolution operation with
output shape of type full (without using the conv2d command). Extra credit
will be awarded to those whose code can work on inputs and filters of
arbitrary length. [15 Marks]
Written in file myconv2d.m

You might also like