Señales y sistemas
PRESENTACIÓN DE RESULTADOS
PRÁCTICA 2
Grupo: JB4
%Ejercicio 1
function [ y,ini_y ] = convolucion( x,ini_x,h,ini_h )
% x: vector con losvalores de la secuencia x
% ini_x: instante de comienzo de x
% h: vector con los valores de la secuencia h
% ini_h: instante de comienzo de h
% y: resultado de la convolución de x con h
% ini_y:instante de comienzo de y
ini_y=ini_x+ini_h;
y=conv(x,h);
a=length(x);
b=length(h);
c=a+b-1;
d=ini_y:ini_y+c-1;
stem(d,y);
end
%1.1
x1=[3 3 3 3 3 3 3 3 3 3];
h1=[3 3 33 3 3 3 3 3 3];
figure(1);
convolucion(x1,-2,h1,-7);
title('y1[n]');
%1.2
x1=[3 3 3 3 3 3 3 3 3 3];
x2=[2 2 2 2 2 2 2 2 2];
figure(2)
convolucion(x1,-2,x2,-2);title('y2[n]');
%1.3
x1=[3 3 3 3 3 3 3 3 3 3];
x2=[2 2 2 2 2 2 2 2 2];
x3=[3 3 3 3 3 3 3 3 3];
x = convolucion(x3,-4,x1,-2);
figure(3);
convolucion(x,-6,x2,-2);title('y3[n]');
%1.4
n = 0:8;
x4= [zeros(1,0) ones(1,9) zeros(1,0)];
X=(2.*exp(0.5*j*n)).*x4;
reX=real(X);
imX=imag(X);
figure(4);
convolucion(reX,0,imX,0);title('y4[n]');
%Ejercicio 2
%2.1
n = 0:25;
a=[1];
b=[1 0 -0.5];
res= [1 zeros(1,25)];
h=filter(b,a,res);
subplot(211);
stem(n,res);
subplot(212);
stem(n,h);
title('y[n]');Es estable porque es absolutamente sumable.
%2.2
n = 0:25;
a=[1 1];
b=[0.25 -0.5 0.5 -0.25];
imp= [1 zeros(1,25)];h=filter(b,a,imp);
subplot(211);
stem(n,imp);
subplot(212);
stem(n,h);
Estable.
%Ejercicio 3
a=[1 -1/2];
b=[0 0 2];
n=0:15;
imp=[1 zeros(1,15)];s1=filter(b,a,imp);
f=[ones(1,10) zeros(1,6)];
x=cos(2/5*pi*n).*f;
s=convolucion(x,0,s1,0);
title('s[n]');
s2=[2 0 0 -2 1];
v=convolucion(s,0,s2,0);
title('v[n]');
Regístrate para leer el documento completo.