Вы находитесь на странице: 1из 9

1.

4 Utilice MATLAB para graficar las señales

a) 𝑥(𝑡) = 𝑢(𝑡 + 1) − 2𝑢(𝑡 − 1) + 𝑢(𝑡 − 3)

t=[-2, -1,-1, 1, 1, 3, 3, 4]
x=[0 , 0, 1, 1,-1,-1, 0, 0]
plot(t,x,)
axis([-2 4 -2 2])
xlabel ('Time (seg) ' )
ylabel('x(t)')

b) 𝑥(𝑡) = (𝑡 + 1)𝑢(𝑡 − 1) − 𝑡𝑢(𝑡) − 𝑢(𝑡 − 2)


t=[-1,0,1,1,2,2,4];
x=[0,0,-1,1,1,0,0];
plot(t,x);
axis([-1 3 -2 2])
xlabel ('Tiempo (seg) ' )
ylabel('x(t)')
c) 𝑥(𝑡) = 2(𝑡 − 1)𝑢(𝑡 − 1) − 2(𝑡 − 2) + 2(𝑡 − 3)𝑢(𝑡 − 3)

t1=[0 1];
x1=[0 0];
t2=1:.01:2;
x2=2*(t2-1);
t3=[2 3];
x3=[2 2];
t4=3:.01:5;
x4=2*t4-4;
t=[t1 t2 t3 t4];
x=[x1 x2 x3 x4];
plot(t,x)
axis([0 5 -1 7])
xlabel ('Tiempo (seg) ' )
ylabel('x(t)')

1.5 Utilice MATLAB para graficar las siguientes señales, sobre el intervalo de −1 ≤ 𝑡 ≤ 5

a) 𝑥(𝑡) = 𝑒 −𝑡 𝑢(𝑡) + 𝑒 −𝑡 [exp(2𝑡 − 4)]𝑢(𝑡 − 2) − 𝑒 4−𝑡 𝑢(𝑡 − 4)


t1=[-1 0 0];
x1=[0 0 1];
t2=0:0.01:2;
x2=exp(-t2);
t3=2:.01:4;
x3=exp(t3-4);
t4=[4 5];
x4=[0 0];
t=[t1 t2 t3 t4];
x=[x1 x2 x3 x4];
plot(t,x);
axis([-1 5 -.5 1.5])
xlabel('Tiempo (seg)')
ylabel('x(t)')
𝜋 3𝜋
b) 𝑥(𝑡) = cos 𝑡 [𝑢 (𝑡 + ) − 2𝑢(𝑡 − 𝜋)] + (cos 𝑡)𝑢 (𝑡 − )
2 2

t1=-1:.05:pi;
x1=cos(t1);
t2=pi:.05:3*pi/2;
x2=-cos(t2);
t3=[3*pi/2 5];
x3=[0 0];
t=[t1 t2 t3];
x=[x1 x2 x3];
plot(t,x);
axis([-1 5 -1.5 1.5])
1.7 Verifique las gráficas de los incisos (a) a (i) mediante MATLAB,con el comando stem,
stem(n,x,’filled’) .Etiquete sus ejes de manera apropiada.

a) 𝑥[𝑛] = función escalón unitario 𝑢[𝑛] de tiempo discreto

for n=1:5;
u(n)=0;
end;
for n=6:21;
u(n)=1;
end;
n=-5:15;
stem(n,u,'filled')
axis([-5 15 0 2])
xlabel('n')
ylabel('u[n]')

b) 𝑥[𝑛] = función rampa unitario 𝑟[𝑛] de tiempo discreto

for n=1:5;
x(n)=0;
end;
for n=6:21;
x(n)=n-6;
end;
n=-5:15;
stem(n,x,'filled')
xlabel('n')
ylabel('r[n]')
c) 𝑥[𝑛] = (0.5)𝑛 𝑢[𝑛]
for n=1:5;
x(n)=0;
end;
for n=6:21;
x(n)=.5^(n-6);
end;
n=-5:15;
stem(n,x,'filled')
xlabel('n');
ylabel('x[n]')
d) 𝑥[𝑛] = (−0.5)𝑛 𝑢[𝑛]
for n=1:5;
x(n)=0;
end;
for n=6:21;
x(n)=(-.5)^(n-6);
end;
n=-5:15;
stem(n,x,'filled')
xlabel('n')
ylabel('x[n]')

e) 𝑥[𝑛] = 2𝑛 𝑢[𝑛]

for n=1:5;
x(n)=0;
end;
for n=6:21;
x(n)=2^(n-6);
end;
n=-5:15;
stem(n,x,'filled')
xlabel('n')
ylabel('x[n]')
f) 𝑥[𝑛] = 𝑠𝑒𝑛(𝜋𝑛/4)
n=-5:15;
x=sin(pi*n/4);
stem(n,x,'filled')
xlabel('n')
ylabel('x[n]')
𝜋𝑛
g) 𝑥[𝑛] = 𝑠𝑒𝑛 ( 2 )
n=-5:15;
x=sin(pi*n/2);
stem(n,x,'filled')
xlabel('n')
ylabel('x[n]')

h) 𝑥[𝑛] = (0.9)𝑛 [𝑠𝑒𝑛(𝜋𝑛/4) + 𝑐𝑜𝑠 (𝜋𝑛/4)]

n=-5:15;
x=(.9.^n).*(sin(pi*n/4)+cos(pi*n/4));
stem(n,x,'filled')
xlabel('n')
ylabel('x[n]')
1, − 4 ≤ 𝑛 ≤ 4
i) 𝑥[𝑛] = {
0, 𝑒𝑛 𝑜𝑡𝑟𝑜 𝑐𝑎𝑠𝑜

u(1)=0;
for n=2:10;
u(n)=1;
end;
for n=11:21;
u(n)=0;
end;
n=-5:15;
stem(n,u,'filled')
axis([-5 15 0 2])
xlabel('n')
ylabel('x[n]')

Вам также может понравиться