Está en la página 1de 10

Laboratorio 4

Convolución de señales en MATLAB


1. SEAN LAS SEÑALES
y = 1 + square(2πt)
v = e-t
z = 1 + sawtooth(2πt)

PASO 1. Hallar la
convolución de
x(t) = y(t) * z(t):

T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(y,z);
subplot(1,3,1)
plot(y);
grid on;
axis ([0 40 0 3]);
subplot(1,3,2)
plot(z);
grid on;
subplot(1,3,3)
plot(x);
grid on;

PASO 2. Hallar la convolución


de x(t) = v(t) * z(t)

T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(v,z);
subplot(1,3,1)
plot(v);
grid on;
subplot(1,3,2)
plot(z);
grid on;
subplot(1,3,3)
plot(x);
grid on;
PASO 3. Hallar la convolución

De x(t) = v(t) * y(t)

T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(v,y);
subplot(1,3,1)
plot(v);
grid on;
subplot(1,3,2)
plot(y);
axis([0 40 0 3]);
grid on;
subplot(1,3,3)
plot(x);
grid on;

PASO 4. Hallar la convolución


De x(t) = y(t)*y(t)

T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(y,y);
subplot(1,3,1)
plot(y);
grid on;
axis ([0 40 0 3]);
subplot(1,3,2)
plot(y);
grid on;
axis ([0 40 0 3]);
subplot(1,3,3)
plot(x);
grid on;

PASO 5. Hallar la convolución


De x(t) = z(t)*z(t)
T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(z,z);
subplot(1,3,1)
plot(z);
grid on;
subplot(1,3,2)
plot(z);
grid on;
subplot(1,3,3)
plot(x);
grid on;
PASO 6. Hallar la convolución
De x(t) = v(t)*v(t)

T = 0.05;
t = [-0.5:T:0.5];
y = 1 + square(2*pi*t);
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
x = conv(v,v);
subplot(1,3,1)
plot(v);
grid on;
subplot(1,3,2)
plot(v);
grid on;
subplot(1,3,3)
plot(x);
grid on;

PASO 6. Hallar la convolución


x(t) = [ v(t) * z(t) ] * z(t)

T = 0.05;
t = [-0.5:T:0.5];
z = 1 + sawtooth(2*pi*t);
v = exp(-t);
n = conv(v,z);
x = conv(n,z);
subplot(1,3,1)
plot(n);
grid on;
subplot(1,3,2)
plot(z);
grid on;
subplot(1,3,3)
plot(x);
grid on;

2. PROGRAMACIÓN EN SEÑALES BASICAS

Paso 7: Escalón Unitario


t = -5:.001:5;
f = ustep(t);
plot(t,f,'LineWidth',5,'Color','r');
axis([-5 5 -1 2]);
hold on
plot([-5 5],[0 0]);
plot([0 0],[-1 2]);
xlabel('Variable independiente t');
ylabel('u(t)')

Paso 8: Pulso Unitario

t = -5:.001:5;
f1 = ustep(t-2).*ustep(t+2);
f2 = ustep(t-2).*ustep(2-t);
f3 = ustep(t+2).*ustep(2-t);
subplot(1,3,1);
plot(t,f1,'LineWidth',3,'Color','b');
axis([-5 5 -1 2]);
hold on
title(' u(t-2) u(t+2) ');
subplot(1,3,2);
plot(t,f2,'LineWidth',3,'Color','g');
axis([-5 5 -1 2]);
hold on
title(' u(t-2) u(2-t) ');
subplot(1,3,3);
plot(t,f3,'LineWidth',3,'Color','r');
axis([-5 5 -1 2]);
hold on
title(' u(t+2) u(2-t) ');
Paso 10: Impulso

t = -5:.001:5;
delta1 = udelta(t);
plot(t,delta1);

Paso 11: Rampa


t = -10:.01:10;
x = 2*uramp(t) - 2*uramp(t-2)
- uramp(t+1) + uramp(t-3);
plot(t,x,'Color','g');

3. CONVOLUCION DE SEÑALES BASICAS

Paso 12: Convolución de un impulso y una exponencial

t = 0:0.001:3;
f = ustep(t-1).*ustep(2-t);
plot(t,f,'LineWidth',3,'Color','r');
title('Gráfica de la función escalón unitario u(t)');
xlabel('Variable independiente t');

figure
axis([0 3 0 1.5]);
hold on;
plot([0 3],[0 0]);
plot([0 0],[0 1.5]);
ylabel('u(t)');
t = -3:0.001:3;
x = (exp(-abs(t)).*ustep(t+2).*ustep(2-t));
plot(t,x);
axis([-2 2 0 1.5]);

figure
v = conv(f,x);
plot(v)
Tarea
Realizar todos los problemas hechos en clase en MATLAB.

1.- Hallar la convolución: y(t) = x(t) * h(t)

Si h (t) = {0,totro
, 0<t<3
valor
x(t) = {0,1,−1<t<1
otro valor

subplot(1,3,1)
t = 0:0.001:3;
ht = uramp(t).*ustep(3-t);
plot(t,ht,'LineWidth',3,'Color','r');
title('Funcion Rampa');
axis([-1 3 0 3]);
subplot(1,3,2)
hold on;
t = -1:0.001:1;
xt = ustep(t+1).*ustep(1-t);
plot(t,xt);
title('Funcion Escalon Unitario');
axis([-1 3 0 3]);
subplot(1,3,3)
v = conv(ht,xt);
plot(v)
title('x(t) * h(t)');
2.- Hallar la convolución: y(t) = x(t) * h(t)

Si: x(t)= r(t).u(1-t) y h(t) = u(t-2)u(4-t)

subplot(1,3,1)
t = 0:0.001:1;
xt = uramp(t).*ustep(1-t);
plot(t,xt,'LineWidth',3,'Color','r');
title('Funcion Rampa');
axis([0 4 0 3]);
subplot(1,3,2)
hold on;
t = 2:0.001:4;
ht = ustep(t-2).*ustep(4-t);
plot(t,ht);
title('Funcion Escalon Unitario');
axis([0 4 0 3]);
subplot(1,3,3)
v = conv(xt,ht);
plot(v)
title('x(t) * h(t)');

3.- Hallar la convolución: y(t) = x(t) * h(t)


Si x(t) = e-t.u(t+2)u(2-t) y h(t) = u(t-1).u(2-t)
subplot(1,3,1)
t = -2:0.001:2;
xt = exp(-abs(t)).*ustep(t+2).*ustep(2-t);
plot(t,xt,'LineWidth',3,'Color','r');
title('Funcion exponencial de -2 a 2');
axis([-2 2 0 2]);
subplot(1,3,2)
hold on;
t = 1:0.001:2;
ht = ustep(t-1).*ustep(2-t);
plot(t,ht);
title('Funcion Escalon Unitario');
axis([-2 2 0 2]);
subplot(1,3,3)
v = conv(xt,ht);
plot(v)
title('x(t) * h(t)');
4.- Hallar la convolución: y(t) = x(t) * h(t)

Si x(t) = e-t.u(t)u(2-t) y h(t) = δ(t)

subplot(1,3,1)
t = -1:0.001:2;
xt = exp(-t).*ustep(t).*ustep(2-t);
plot(t,xt,'LineWidth',3,'Color','r');
title('Funcion exponencial de 0 a 2');
axis([-1 2 0 2]);
subplot(1,3,2)
hold on;
t = -1:0.001:2;
ht = udelta(t);
plot(t,ht);
title('Funcion Escalon Unitario');
axis([-1 2 0 2]);
subplot(1,3,3)
v = conv(ht,xt);
plot(v)
title('x(t) * h(t)');

5.- Hallar la convolución: y(t) = x(t) * h(t)

Si: x(t) = u(t).u(1-t) y h(t) = u(t).u(1-t)


subplot(1,3,1)
t = -1:0.001:2;
xt = ustep(t).*ustep(1-t);
plot(t,xt,'LineWidth',3,'Color','r');
title('Función Escalón Unitario');
axis([-1 2 0 2]);
subplot(1,3,2)
hold on;
t = -1:0.001:2;
ht = ustep(t).*ustep(1-t);
plot(t,ht);
title('Función Escalón Unitario');
axis([-1 2 0 2]);
subplot(1,3,3)
hold on;
v = conv(xt,ht);
plot(v)
title('x(t) * h(t)');

También podría gustarte