Descarga la aplicación para disfrutar aún más
Vista previa del material en texto
DE LA CRUZ GONZALES AARON JESUS 16130101 LABORATORIO 2 Pregunta 1 a) IMPULSO UNITARIO function iu=iu(t) iu=1.*(t>-eps)-1.*(t>eps); end Primero usaremos el caso discreto: t=-10:10; y=iu(t); stem(t,y),grid on,axis equal Por último, usaremos el caso continuo: t=-10:0.005:10; y=iu(t); plot(t,y),grid on, axis equal b) ESCALÓN UNITARIO function eu=eu(t) eu=1.*(t>=0); end Primero usaremos el caso discreto: t=-10:10; y=eu(t); stem(t,y),grid on,axis equal Por último, usaremos el caso continuo: t=-10:0.005:10; y=eu(t); plot(t,y),grid on, axis equal c) FUNCION RAMPA: function fr=fr(t) fr=t.*(t>=0); end Primero usaremos el caso discreto: t=-10:10; y=fr(t); stem(t,y),grid on,axis equal Por último, usaremos el caso continuo: t=-10:0.005:10; y=fr(t); plot(t,y),grid on, axis equal Pregunta 2 a) Usando zeros y ones: n = input('Para n sea 0.1 o 0.01: '); a = zeros(1,7); b=ones(1,7); c = zeros(1,67); d=ones(1,67); if n ==0.1 t = -1:0.1:1; u = [a,b,a]; elseif n==0.01 t = -1:0.01:1; u = [c,d,c]; end plot(t,u),grid on,ylim([-3 3]) title('Funcion compuerta unitaria de ancho 1') b) Utilizando la función escalón unitario: t=-10:0.005:10; y=eu(t+1)-eu(t-1); plot(t,y),grid on, axis equal Pregunta 3: a) Onda cuadrada: A = 5; Fs = 10000; f = 1/2; T = 5*(1/f); c = 50; t = 0:1/Fs:T-1/Fs; x=A*square(2*pi*f*t,c); plot(t,x), grid on, ylim([-7 7]) b) Señal diente de sierra: t=0:0.00001:0.25; f=20; x=5*sawtooth(2*pi*f*t); plot(t,x),grid on axis([-0.05 0.3 -6 6]) Pregunta 4: fm=100; tm=1/fm; t=0:tm:12; y=10*exp(-t)-5*exp(-0.5*t); plot(t,y),grid on,zoom xon Pregunta 5: fm=100; tm=1/fm; t=0:tm:12; y=10*exp(-t)+5*exp(-0.5*t); plot(t,y),grid on,zoom xon Pregunta 6: Usaremos a=1 y a=5 (Dato del problema) Para a=1: fm=20; tm=1/fm; t=0:tm:5; f=1; a=1; x=exp(-a*t).*cos(2*pi*f*t); plot(t,x), grid on Para a=5: fm=20; tm=1/fm; t=0:tm:5; f=1; a=5; x=exp(-a*t).*cos(2*pi*f*t); plot(t,x), grid on Como Podemos observer, la función se Vuelve cada vez mas amortiguada. Pregunta 7: function h=h(t) h=eu(t+2)-fr(t+1)+fr(t)+eu(t)-fr(t-1)+fr(t-2); end Procedemos a graficar h(t): t=-5:0.005:5; y=h(t); plot(t,y),grid on A partir de aqui resolveremos los incisos: a) h(t+1): t=-5:0.005:5; y=h(t+1); plot(t,y),grid on b) h(t/2-2): t=-10:0.005:10; y=h(t/2-2); plot(t,y),grid on c) h(1-2t): t=-10:0.005:10; y=h(1-2*t); plot(t,y),grid on e) 4 h(t/4) t=-10:0.005:10; y=4*h(t/4); plot(t,y),grid on axis([-10 10 -0.5 4.5]) e) 0.5 h(t)*u(t)+h(-t)*u(t) clear,clc t=-5:0.5:10; h1=h(t); h2=h(-t); u=eu(t); c=0.5*conv(h1,u,'same')+conv(h2,u,'same'); plot(t,c),grid on f) h(t/2)*(t+1): clear,clc t=-6:0.005:6; h=h(t/2); d=iu(t+1); c=conv(h,d,'same'); plot(t,c),grid on axis([-7 5 -0.1 1.1])
Compartir