for Brilliant Answers

profilea-3zef
matlab_project.pdf

EEGR 221 MATLAB Project 2 Fall 2016 Due date: 10/24/2016

Part I. Convolution

a. Plot the following signals

x1(t) = u(t+2)-u(t-2)

x2(t) = u(t+1)-u(t-5)

x3(t) = (2t+1)[u(t+1)-u(t-4)]

x4(t) = (t+2)[u(t-2)-u(t)]+ (2-t)[u(t)-u(t-2)]

for the time span of -10 to 10 seconds.

b. Use ‘conv’ command in MATLAB and compute and plot the following signals:

y1= x1(t)*x2(t)

Solve this problem by hand and compare your results. Submit your hand calculation along with

your report.

c. Use ‘conv’ command in MATLAB and compute and plot the following signals:

y2= x2(t)*x3(t)

Solve this problem by hand and compare your results. Submit your hand calculation along with

your report.

d. Use ‘conv’ command in MATLAB and compute and plot the following signals:

y2= x4(t)*x1(t)

Solve this problem by hand and compare your results. Submit your hand calculation along with

your report.

.

Part II. Fourier Series

Use the following code to create x(t) as a periodic signal.

clc clear all close all t = linspace(-1,6); x = t.*(heaviside(t)-heaviside(t-1)) + (t-2).* (heaviside(t-2)-heaviside(t-3))+(t-

4).*(heaviside(t-4)-heaviside(t-5)); plot(t,x) axis([-1 6 -0.5 1.5]); xlabel('time, t') ylabel('Magnitude') title('x(t)')

Continue coding and compute and plot the truncated Fourier series expansion of this signal for N =

1, 5, 10, 25, 50, 100. Superimpose the original signal onto the estimated signal. Compare the

figures and discuss your observations. Signal x(t) is shown below. Plot the truncated F.S.

expansion of the signal on this plot by using ”hold on” command.

Hint: Compute the FS coefficients (ck) by hand and plug the coefficients in the FS expansion and

plot it in MATLAB. Attach your hand written solutions to your report as well.

Work with your assigned teammate. Online submission before midnight on the 24th.

Good luck,

-1 0 1 2 3 4 5 6 -0.5

0

0.5

1

1.5

time, t

M ag

ni tu

de

x(t)