Matlab real e imaginario
n=-3:3;
h=[zeros(1,3),1/2.*ones(1,1),-1/2.*ones(1,1),zeros(1,2)];
Subplot(3,1,1);stem(n,h);
axis([-3 3 -2 3]);
grid on;
[pic]
%grafica de x[n]= e^ j(pi/4)n
x=exp(((pi/4).^[-3:3]).*j)
Subplot(3,1,2);stem([-3:3],real(x));
hold on;
stem([-3:3],imag(x),'r');
[pic]
%convolucion de x[n] con h[n]n=-6:6;
y=conv(x,h);
subplot(3,1,3);
stem(n,y);
grid on;
[pic]
%parte real
x=exp(((pi/4).^[-3:3]).*j)stem([-3:3],real(x));
[pic]
%parte imaginaria
z=exp(((pi/4).^[-3:3]).*j)
stem([-3:3],imag(z),'r');
[pic]
%real e imaginaria[pic]
%convolución parte real en una grafica y parte imaginaria en otra
n=-6:6;
y=conv(x,h);
subplot(2,1,1);
stem(n,y);grid on;
n=-6:6;
r=conv(z,h);
subplot(2,1,2);
stem(n,r);
grid on;
[pic]
EJERCICIO DE CLASE
%grafica dex[n]=u[n-3]-u[n+5]
n=-10:10;
x=[zeros(1,5),-1.*ones(1,8),zeros(1,8)];
Subplot(3,1,1);
stem(n,x);
axis([-10 10 -2 2]);
grid on;%grafica h[n]=u[n](1-a^n) si a=2
b=1+(-2).^[0:5];
h=[zeros(1,10),b.*ones(1,6),zeros(1,5)];
subplot(3,1,2);
stem(n,h);axis([-10 10 -32 20]);
grid on;
%convolucion
n=-20:20;
y=conv(x,h);
subplot(3,1,3);
stem(n,y);
grid on;
[pic]
Regístrate para leer el documento completo.