UNMSM-FIEE 2016-1
LAB N1:
PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS
USANDO MATLAB
I.
Objetivo
II.
Equipos y materiales
1. Matlab versin 7.12.0 (R2011a)
2. Manual de Matlab
III.
Marco terico
UNMSM-FIEE 2016-1
IV.
Procedimiento
UNMSM-FIEE 2016-1
1.3.
CONSTRUCCIN DE ARRAYS
UNMSM-FIEE 2016-1
FIGURA 2
UNMSM-FIEE 2016-1
FIGURA 3
FIGURA 4
UNMSM-FIEE 2016-1
FIGURA 5
FIGURA 6
UNMSM-FIEE 2016-1
2.2.
UNMSM-FIEE 2016-1
2.3.
UNMSM-FIEE 2016-1
UNMSM-FIEE 2016-1
2.4.
UNMSM-FIEE 2016-1
V.
Cuestionario
UNMSM-FIEE 2016-1
UNMSM-FIEE 2016-1
y3 = 4
y4 =4
-------------------------------------------------------->>x= sqrt(16)/2
x =2
>>y= asin(x)
y =1.5708 - 1.3170i
>>y_deg=y*180/pi
y_deg =90.0000 -75.4561i
>>x= sqrt(13^2-5^2)
x =12
>>y= rem(45,8)
y =5
>>x= 4.2 , y1=fix(x),y2=floor(x), y3=ceil(x), y4=round(x)
x =4.2000
y1 =4
y2 =4
y3 =5
y4 =4
UNMSM-FIEE 2016-1
>> a*(-1)^2+b*(-1)+c
ans =0
>> a*(-6)^2+b*(-6)+c
ans =0
----------------------------------------------->> a= 1 ; b= 2 ; c=1
>> x1= (-b +sqrt(b^2-4*a*c))/(2*a)
x1 =-1
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 =-1
>> a*(-1)^2+b*(-1)+c
ans =0
>> a =1 ; b = 4 ; c= 13
>> x1= (-b +sqrt(b^2-4*a*c))/(2*a)
x1 =-2.0000 + 3.0000i
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 = -2.0000 - 3.0000i
>> a*(-2.0000 + 3.0000i)^2+b*(-2.0000 + 3.0000i)+c
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
ans =0
>> a*(-2.0000 - 3.0000i)^2+b*(-2.0000 - 3.0000i)+c
ans =0
------------------------------------------------
>> a =1 ; b = 2 ; c= 5
>> c1 = 2-2i
c1 =2.0000 - 2.0000i
>> c1 = 2-2j
c1 = 2.0000 - 2.0000i
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
>> c1 = 2-i
c1 =2.0000 - 1.0000i
>> c1 = 2-j
c1 =2.0000 - 1.0000i
>> c1=1-2j
c1 = 1.0000 - 2.0000i
>> mag_c1=abs(c1)
mag_c1 =2.2361
>> angle_c1=angle(c1)
angle_c1 =-1.1071
UNMSM-FIEE 2016-1
>> deg_c1=angle_c1*(180/pi)
deg_c1 =-63.4349
>> real_c1=real(c1)
real_c1 =1
>> imag_c1=imag(c1)
imag_c1 =-2
------------------------------------------------
>> c1=1-1i
c1 = 1.0000 - 1.0000i
>> c1=1-1j
c1 =1.0000 - 1.0000i
>> mag_c1=abs(c1)
mag_c1 =1.4142
>> angle_c1=angle(c1)
angle_c1 =-0.7854
>> deg_c1=angle_c1*(180/pi)
deg_c1 =-45
>> real_c1=real(c1)
real_c1 =1
>> imag_c1=imag(c1)
imag_c1 =-1
------------------------------------------------
>> c1=1-sqrt(3)*i
c1 = 1.0000 - 1.7321i
>> c1=1-sqrt(3)*j
c1 =1.0000 - 1.7321i
>> mag_c1=abs(c1)
mag_c1 =2.0000
>> angle_c1=angle(c1)
angle_c1 =-1.0472
>> deg_c1=angle_c1*(180/pi)
deg_c1 =-60.0000
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
>> real_c1=real(c1)
real_c1 =1
>> imag_c1=imag(c1)
imag_c1 =-1.7321
1.2566
1.5708
1.8850
x=
Columns 1 through 7
0 0.3142 0.6283 0.9425 1.2566
Columns 8 through 11
2.1991 2.5133 2.8274 3.1416
1.5708
1.8850
2.1991
>> x=(0:0.1:1)*pi
x=linspace(0,pi,11)
x=
Columns 1 through 7
0 0.3142 0.6283 0.9425 1.2566
Columns 8 through 11
2.1991 2.5133 2.8274 3.1416
1.5708
1.8850
>> y=sin(x)
y=
Columns 1 through 8
0 0.3090 0.5878 0.8090
Columns 9 through 11
0.5878 0.3090 0.0000
0.9511
1.0000
0.9511
0.8090
%figure(1)
x=linspace(0.4*pi,60);
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
y=sin(x);
plot(x,y)
z=cos(x);
%figure(2)
%se agrega a la cdigo de la fig.1
plot(x,z,x,y)
UNMSM-FIEE 2016-1
%figure(3)
%se agrega al cdigo de la fig.2
plot(x,y,x,y,'+')
%figure(4)
%se agrega al cdigo de la fig.3
plot(y,z)
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
%figure(5)
%se agrega al cdigo de la fig.4
plot(x,y,x,2*y.*z,'--')
grid
xlabel('Variable independiente x')
ylabel('Variables dependientes')
title('2sin(x)cos(x)sin(2x)')
%figure(6)
%se agrega al cdigo de la fig.5
plot3(y,z,x),grid
LAB. INT. A LAS TELECOMUNICACIONES
UNMSM-FIEE 2016-1
x=linspace(0,16,100);%crear datos
y=sin(x);%calcular seno
z=(y>=0).*y;%fija a cero los valores negativos
de seno(x)
z=z+0.5*(y<0);%si seno(x) es negativo sumar
0.5
z=(x<=14).*z;%fijar a cero os valores
mayores que x=8
plot(x,z)
xlabel('x'),ylabel('z=f(x)')
title('Seal discontinua')
UNMSM-FIEE 2016-1
x=linspace(0,20,100);%crear datos
y=sin(x);%calcular seno
z=(y>=0).*y;%fija a cero los valores negativos
de seno(x)
z=z+0.4*(y<0);%si seno(x) es negativo sumar
0.4
z=(x<=14).*z;%fijar a cero los valores
mayores que x=8
plot(x,z)
xlabel('x'),ylabel('z=f(x)')
title('Seal discontinua')
UNMSM-FIEE 2016-1
x=linspace(0,15,175);%crear datos
y=cos(x);%calcular coseno
z=(y>=0).*y;%fija a cero los valores negativos
de seno(x)
z=z+0.2*(y<0);%si seno(x) es negativo sumar
0.2
z=(x<=14).*z;%fijar a cero los valores
mayores que x=8
plot(x,z)
xlabel('x'),ylabel('z=f(x)')
title('Seal discontinua')
UNMSM-FIEE 2016-1
x=linspace(0,6*pi,60);
y=sin(x);
z=cos(x);
plot(x,y)
hold on
plot(x,z,'m')
hold off
UNMSM-FIEE 2016-1
x=linspace(0,4*pi,60);
y=sin(x);
z=cos(x);
a=2*sin(x).*cos(x);
b=sin(x)./(cos(x)+eps);
subplot(2,2,1)%Selecciona la subgrafica
superior izquierda
plot(x,y),axis([0 4*pi -1 1]),title('sin(x)')
subplot(2,2,2)%Selecciona la subgrafica
superior derecha
plot(x,z),axis([0 4*pi -1 1]),title('cos(x)')
subplot(2,2,3)%Selecciona la subgrafica
inferior izquierda
plot(x,a),axis([0 4*pi -1 1]),title('2sin(x)cos(x)')
subplot(2,2,4)%Selecciona la subgrafica
inferior derecha
plot(x,b),axis([0 4*pi -40
40]),title('tg=sin(x)/cos(x)')
UNMSM-FIEE 2016-1
Comandos Utilizados
COMANDOS
num
den
tf
zpk
tf2zp
step
r=roots(c)
y=linspace(a,
b,n)
plot(y)
plot(x,y)
UNMSM-FIEE 2016-1
plot(x,y,z)
figure(h)
UNMSM-FIEE 2016-1