Matlab A#01_Solutions - stem(nx,x) title( 'Plot of x[n]' )...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
%Matlab HW #1 Solutions %TA Jonathan Ashdown %1) w = [0 -1 -1 2 2 1 1 0 0]; w = fliplr(w) w = -w nw = [-4:1:4] subplot(3,1,1), stem(nx,x), title( 'signal x[n]' ); subplot(3,1,2), stem(nx_neg,x_neg), title( 'signal x[-n]' ); subplot(3,1,3), stem(nw,w), title( 'signal w[n]' ); % 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
x3 = [1 1 1 0]; h3 = [3 1 1]; nx3 = [-3:1:0]; nh3 = [-1 0 1]; y3 = conv(h3,x3); ny3 = [-4 -3 -2 -1 0 1]; subplot(3,1,1), stem(nx3,x3), title( 'signal x3[n]' ); subplot(3,1,2), stem(nh3,h3), title( 'signal h3[n]' ); subplot(3,1,3), stem(ny3,y3), title( 'signal y3[n]' ); %3
Background image of page 2
x = [0 -1 -1 2 2 1 1 0 0]; nx = [-3 -2 -1 0 1 2 3 4 5]; ev_x = 0.5*(x +fliplr(x)); od_x = 0.5*(x - fliplr(x)); sum = ev_x + od_x; subplot(411)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: stem(nx,x) title( 'Plot of x[n]' ) subplot(412) stem(nx,ev_x) title( 'Even Part of x[n]' ) subplot(413) stem(nx,od_x) title( 'Odd Part of x[n]' ) subplot(414) stem(nx,sum) title( 'Sum of Odd and Even part should equal x[n]. ..IT DOES!!' ) % 4 %4(a) By Hand %4(b) figure(1); syms t ; q = (t+2)*heaviside(t+2) - t*heaviside(t) - 2*(t-2)*heaviside(t-2) + 2*(t-3)*heaviside(t-3) subplot(211) ezplot(q,[-5 5]) title( 'x(t)' ) %4(c) d = diff(q) %MATLAB Output: %heaviside(t+2)+(t+2)*dirac(t+2)-heaviside(t)-t*dirac(t)-2*heaviside(t-2)-%(2*t-4)*dirac(t-2)+2*heaviside(t-3)+(2*t-6)*dirac(t-3) %4(d) subplot(212) ezplot(d,[-5 5]) title( 'dx(t)/dt' )...
View Full Document

This lab report was uploaded on 04/10/2008 for the course ECSE 2410 taught by Professor Wozny during the Spring '07 term at Rensselaer Polytechnic Institute.

Page1 / 4

Matlab A#01_Solutions - stem(nx,x) title( 'Plot of x[n]' )...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online