

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Project; Professor: Shaw; Class: Linear Systems II; Subject: Electrical Engineering; University: Wright State University-Main Campus; Term: Spring 2009;
Typology: Study Guides, Projects, Research
1 / 3
This page cannot be seen from the preview
Don't miss anything!
EE 322/522 Linear Systems II
Computer Project 2: Convolution and Simulation of Linear Systems
Due Date: May 5, 2009
x t ( ) 2*( ( - 0.05) - u t u t ( - 0.64)),
t
Both the input signal and the impulse response are to be sampled with a sampling interval of T=0.01s.
(a) INPUT GENERATION:
The input is sampled from t = 0 and exactly 64 samples are collected. Hand-calculate the number of zeros at the beginning of the input and the number of ones. Then use the MATLAB commands "ones" and "zeros" to create the input sequence, x(n). Note that, N1 = 64.
Examples:
v1 = zeros(1,4); % Creates a row vector with 4 zeros, i.e., v1 = [0 0 0 0]
v2 = ones(1,5); % Creates a row vector with 5 ones. i.e., v2 = [1 1 1 1 1]
v3 = [v1 v2]; % Concatenates v1 and v2 to form a larger row vector v3. % In this case, v3 = [0 0 0 0 1 1 1 1 1].
v3 = [zeros(1,4) ones(1,5)] ; % Is equivalent to the previous three commands.
length(v3); % Will return the length of the vector v3. % In this case, the result is 9.
x = [-1 3 -5 4 2 4];
then, x(1) =-1, x(2)=3, and so on. The m th through n th members of a sequence can be addressed by x(m:n). In the above example, x(1:3) = [-1 3 -5] and x(4:6) = [4 2 4].
(b) IMPULSE RESPONSE GENERATION
Generate the finite length impulse response sequence h(n).
Example:
define the desired time-vector,
t=1:0.1:10; % Generates a time base from 1 to 10, in increments of 0.1. % In this case, t=[1 1.1 1.2 1.3 .... 9.9 10].
Then, generate the signal (^) f t ( )as follows,
f=3exp(-10t); % Will return a sequence of the corresponding function
% values, i.e., [3e-10 3e-11 3e-100 ]
stem(t,f,'fill') % NOTE: t and f MUST have the same lengths.
(c) Use the MATLAB command "conv" to obtain the output, y(n). Use,
y = conv(h,x);
You can verify this by,
N1 = length(x) % The variable N1 is assigned the length of x N2 = length(h) % The variable N2 is assigned the length of h N = length(y) % The variable N is assigned the length of y
Then, generate the plots of x(1:N1), h(1:N2), y(1:N). [3 plots]
Note: You must first generate the longer time-scale required for plotting y. Use,
t=0:0.01:0.01*(N-1); % Creates the maximum time-scale needed
stem(t(1:N1),x,'filled') % Plots the input. Uses only the first N1 of t stem(t(1:N2),h,'filled') % Plots the impulse response. Lengths = N stem(t,y,'filled') % Plots the output. Both t and y have same lengths