E C E 431 Lecture Notes - Lecture 1: Frequency Domain, Radian, Discrete-Time Fourier Transform

23 views3 pages
Page:
of 3
1
Period 1: Introduction
Table of Contents
Set up workspace ................................................................................................................ 1
Problem 1 .......................................................................................................................... 1
Problem 2 .......................................................................................................................... 1
Problem 3a ......................................................................................................................... 2
Problem 3b ........................................................................................................................ 2
Problem 4 .......................................................................................................................... 2
Set up workspace
Note that the double percent sign creates a "cell" that is used by MATLAB to group your commands and,
e.g., create a table of contents when publishing.
Comment lines that are contiguous with the cell title show up as text in the published output. Other com-
ment lines show up as comment lines in the code.
% close all open figure windows - nice when rerunning the file
close all
% clear all variables from the workspace
clear
Problem 1
This problem is all text answers - no code - so type your answers in using comment lines contiguous with
the cell title.
a)Aditya, Shreya, Thomas
b) Aspect I like - Flexible Aspect I dislike - Lecture doubts cannot be discussed immediately
c) A, AB
Problem 2
Complex number arithmetic
%Running the following matlab code
%a=5-4i,b=3+2i
%x=abs(a*b)
%y=angle(conj(a))
%z=abs(b)^2-abs(a)^2
find more resources at oneclass.com
find more resources at oneclass.com
Period 1: Introduction
2
%2a) 23.0868
%2b) 0.6747 radian
%2c) -28
Problem 3a
Comments and text answers here
h[n] = 2delta[n]?2delta[n?2] Converting to frequency domain H[omega] = 2 DTFT(delta[n])-2
DTFT(delta[n-2]) H(omega) = 2-2e^(-j*omega)
Problem 3b
h[n] = ... h[n] = h1[n]*h2[n] h[n] = 2(delta[n]-delta[n-2])*0.5(delta[n-3]) h[n] = delta[n]*delta[n-3]-
delta[n-2]*delta[n-3] h[n] = delta[n-3]-delta[n-5]
Problem 4
Comments here
a = [1 -1 0.9]; % difference equation parameters in vector a, b
b = 1;
x = [zeros(1,20),1, zeros(1,200)]; % input to system should be an
impulse
% range of interest is n= -20 to 200, put impulse at n = 0
y = filter(b,a,x);
n = -20:200;
figure
stem(n,y)
xlabel('Time')
ylabel('Amplitude')
title('Impulse Response')
find more resources at oneclass.com
find more resources at oneclass.com
Period 1: Introduction
3
Published with MATLAB® R2015b
find more resources at oneclass.com
find more resources at oneclass.com