Anda di halaman 1dari 29

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

CURSO: Lab. Int. a las Telecomunicaciones


PROFESOR: Ing. Sixto Llosa P.
TIPO DE INFORME: Informe Final
TEMA: PROCESAMIENTO DE SEALES Y
FUNCIONES PERIDICAS USANDO MATLAB
ALUMNO:
Carhuaricra Janampa, Joel Jhonatan
CODIGO: 13190084
HORARIO: Miercoles 10-1pm

Ciudad Universitaria-Lima 5 de Abril del 2016

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

LAB N1:
PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS
USANDO MATLAB

I.

Objetivo

Simular e investigar en forma experimental el procesamiento de seales


usando los comandos e instrucciones del software Matlab, desarrollando los
ejercicios propuestos en funcin de los ejercicios planteados

II.

Equipos y materiales
1. Matlab versin 7.12.0 (R2011a)
2. Manual de Matlab

III.

Marco terico

El procesamiento de seal es la aplicacin de una serie de operaciones


lgicas y matemticas a un conjunto de datos provenientes de una seal, y
todo ello mediante la ayuda de un ordenador.
Los objetivos de este procesamiento pueden ser diversos. Por ejemplo,
aadir una informacin a una seal portadora para que sea transmitida y se
pueda recuperar ms tarde en otro lugar (transmisin de radio o una
conversacin telefnica) o en otro momento (por ejemplo una fotografa
tomada con una cmara digital o unos datos registrados en el disco duro del
ordenador). Tambin nos puede interesar procesar una seal de voz para
averiguar quin es el locutor que habla (reconocimiento de locutor) o qu
palabras pronuncia (reconocimiento de palabras). O quiz para proteger
informacin sensible (encriptacin), o para detectar piezas defectuosas,
mediante imgenes, en una cadena de montaje (deteccin, clasificacin,
control de calidad).
Fijmonos que en el mundo tecnolgico en el que vivimos estamos rodeados
de sistemas de procesamiento de datos, con mltiples objetivos y con
ventajas muy grandes para todos: identificamos los productos del
supermercado con un cdigo de barras que es ledo por una luz lser;
pagamos el peaje de la autopista sin ni siquiera tener que bajar el cristal de
la ventanilla; podemos presenciar la gestacin de nuestro hijo gracias a
modernas ecografas, o nos ahorramos penosos esfuerzos fsicos en la
industria del automvil gracias a precisos autmatas que procesan y
ejecutan complicadas tareas.

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

IV.

Procedimiento

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

1.3.

CONSTRUCCIN DE ARRAYS

Accediendo a los arrays individuales utilizando subndices, es decir, x(1)


o x(3), as como tambin y(5).

Accediendo a un bloque de elementos:

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2. ESCRIBIR EN EL BLOCK DE NOTAS O DEPURADOR DEL MATLAB LOS


SIGUIENTES EJERCICIOS Y COPIAR EN EL PROGRAMA PRINCIPAL, PARA
GRAFICAR LAS FUNCIONES PERIDICAS:
2.1. GRAFICA DE FUNCIONES TRIGONOMTRICAS
FIGURA 1

FIGURA 2

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

FIGURA 3

FIGURA 4

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

FIGURA 5

FIGURA 6

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.2.

GRFICA DE SEALES DISCONTINUAS:

LA IDEA ES MULTIPLICAR AQUELLOS VALORES EN UN ARRAY QUE DESEA


MANTENER POR UNOS, Y MULTIPLICAR LOS OTROS VALORES POR CEROS.

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.3.

MANIPULACIN DE GRFICOS: SE PUEDE AADIR LINEAS


A UNA GRAFICA

EXISTENTE USANDO hold. CUANDO FIJA hold on, MATLAB NO


ELIMINA LAS CURVAS O GRAFICA EXISTENTES. CUANDO SE METEN
LAS NUEVAS ORDENES plot FIJANDO hold off , SE LIBERA LA VENTANA
DE LA FGURA ACTUAL PARA NUEVAS GRFICAS. LA ORDEN hold SIN
ARGUMENTOS CONMUTA EL VALOR DE hold.
CON HOLD ON

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

CON HOLD OFF

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.4.

SUBDIVISION DE VENTANA DE GRFICAS (m,n,p)

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

UNA VENTANA DE FIGURA, PUEDE MANTENER MS DE UN CONJUNTO


DE EJES. LA ORDEN subplot(m,n,p) subdivide de la ventana de la
figura actual en una matriz mxn de las reas de representacin
grfica y escoge como activa el rea p-sima la subgrfica se
numeran de izquierda a derecha a lo largo de la fila superior, luego la
segunda fila.

V.

Cuestionario

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

1. Cambie el valor de la variable en cada uno de los ejercicios y


desarrolle nuevas aplicaciones, por lo menos 2 ejercicios adicionales
de cada uno de los ejercicios planteados como ejemplo.

1.- Desarrolle en el programa principal del matlab los siguientes


ejemplos y anotar sus resultados
1.1 FUNCIONES MATEMATICAS
>> x= sqrt(2)/2
x =0.7071
>> y= asin(x)
y = 0.7854
>> y_deg=y*180/pi
y_deg =45.0000
>> x= sqrt(3^2+4^2)
x =5
>> y= rem(23,4)
y =3
>> x= 2.6 , y1=fix(x),y2=floor(x), y3=ceil(x), y4=round(x)
x =2.6000
y1 =2
y2 =2
y3 =3
y4 =3
-------------------------------------------------------->> x= sqrt(9)/2
x =1.5000
>> y= asin(x)
y =1.5708 - 0.9624i
>> y_deg=y*180/pi
y_deg =90.0000 -55.1428i
>> x= sqrt(12^2+5^2)
x =13
>> y= rem(34,6)
y=4
>> x= 3.5 , y1=fix(x),y2=floor(x), y3=ceil(x), y4=round(x)
x =3.5000
y1 =3
y2 = 3
LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

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

1.2 NMEROS COMPLEJOS:


%EJERCICIO 1 EC. GENERAL DE 2DO GRADO DE SOLUCIN REAL
>> a= 1 ; b= 5 ; c=6
>> x1= (-b +sqrt(b^2-4*a*c))/(2*a)
x1 =-2
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 =-3
>> a*(-2)^2+b*(-2)+c
ans =0
>> a*(-3)^2+b*(-3)+c
ans =0
----------------------------------------------->> a= 1 ; b= 7 ; c=6
>> x1= (-b +sqrt(b^2-4*a*c))/(2*a)
x1 =-1
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 =-6
LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

>> 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

%EJERCICIO 2 EC. GENERAL DE 2DO GRADO DE SOLUCION COMPLEJA


>> a =1 ; b = 2 ; c= 2
x1= (-b +sqrt(b^2-4*a*c))/(2*a)
x1 = -1.0000 + 1.0000i
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 =-1.0000 - 1.0000i
>> a*(-1.0000 + 1.0000i)^2+b*(-1.0000 + 1.0000i)+c
ans = 0
>> a*(-1.0000 - 1.0000i)^2+b*(-1.0000 - 1.0000i)+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

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

ans =0
>> a*(-2.0000 - 3.0000i)^2+b*(-2.0000 - 3.0000i)+c
ans =0
------------------------------------------------

>> a =1 ; b = 2 ; c= 5

x1= (-b +sqrt(b^2-4*a*c))/(2*a)


x1 =-1.0000 + 2.0000i
>> x2 =(-b -sqrt(b^2-4*a*c))/(2*a)
x2 =-1.0000 - 2.0000i
>> a*(-1.0000 - 2.0000i)^2+b*(-1.0000 - 2.0000i)+c
ans =0
>> a*(-1.0000 + 2.0000i)^2+b*(-1.0000 + 2.0000i)+c
ans =0
%EJERCICIO 3 EXPRESION EN NUMEROS COMPLEJOS
>> c1 = 1-2i
c1 =1.0000 - 2.0000i
>> c1 = 1-2j
c1 =1.0000 - 2.0000i
>> c2= 3*(2-sqrt(-1)*3)
c2 =6.0000 - 9.0000i
>> c3= sqrt(-2)
c3 =0.0000 + 1.4142i
>> c4= 6+sin(.5)*i
c4 =6.0000 + 0.4794i
>> c5= 6+sin(.5)*j
c5 =6.0000 + 0.4794i
------------------------------------------------

>> 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

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

>> c2= 4*(1-sqrt(-1)*4)


c2 =4.0000 -16.0000i
>> c3= sqrt(-3)
c3 = 0 + 1.7321i
>> c4= 6+cos(.5)*i
c4 =6.0000 + 0.8776i
>> c5= 6+cos(.5)*j
c5 =6.0000 + 0.8776i
------------------------------------------------

>> c1 = 2-i
c1 =2.0000 - 1.0000i

>> c1 = 2-j
c1 =2.0000 - 1.0000i

>> c2= 1*(2-sqrt(-1)*1)


c2 =2.0000 - 1.0000i

>> c3= sqrt(-4)


c3 =0 + 2.0000i

>> c4= 1+sin(.5)*i


c4 =1.0000 + 0.4794i

>> c5= 1+sin(.5)*j


c5 =1.0000 + 0.4794i

%EJERCICIO 4 FORMA POLAR, USANDO REAL, IAG. ABS. Y ANGLE


>> c1=1-2i
c1 =1.0000 - 2.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

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

>> 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

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

>> real_c1=real(c1)
real_c1 =1

>> imag_c1=imag(c1)
imag_c1 =-1.7321

1.3 CONSTRUCCION DE ARRAYS


>> x=[0 .1*pi .2*pi .3*pi .4*pi .5*pi .6*pi .7*pi .8*pi .9*pi pi]
x=
Columns 1 through 8
0 0.3142 0.6283 0.9425
Columns 9 through 11
2.5133 2.8274 3.1416

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

2.-Escribir ene l block de notas o depurar del matlab los siguientes


ejercicios y copiar en el programa principal, para graficar las
funciones peridicas.
2.1 GRAFICAS DE FUNCIONES TRIGONOMTRICAS

%figure(1)
x=linspace(0.4*pi,60);
LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

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)

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

%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

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

%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

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.2 GENERACIN DE SEALES DISCONTINUAS

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')

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

EJM 1 GENERACIN DE SEALES DISCONTINUAS

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')

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

EJM 2 GENERACIN DE SEALES DISCONTINUAS

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')

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.3 MANIPULACION DE GRAFICOS

x=linspace(0,6*pi,60);
y=sin(x);
z=cos(x);
plot(x,y)
hold on
plot(x,z,'m')
hold off

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2.4 SUBDIVISION DE VENTANAS DE GRAFICOS

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)')

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

2. Explique las funciones de cada una de las principales instrucciones y


comandos utilizado en los ejercicios anteriores.

Comandos Utilizados
COMANDOS
num

Numerador de una funcin

den

Denominador de una funcin

tf
zpk
tf2zp
step
r=roots(c)
y=linspace(a,
b,n)
plot(y)
plot(x,y)

Crea un modelo de la funcin transferencia.


Crea un modelo zero/polo/ganancia.
Convierte la funcin transferencia polinmica
en la funcin transferencia cero/polo/ganancia.
Se obtiene la grfica de la respuesta temporal
de una funcin de transferencia.
Calcula el vector columna de las races del
polinomio c.
Crea un vector con 100 o n valores igualmente
espaciados entre a y b.
Dibuja el vector y considerado como abscisas
su ndice. Si y es complejo es equivalente a
dibujar plot (real(y),image(y)).
Dibuja un vector de abscisas x y ordenadas
y.

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

PROCESAMIENTO DE SEALES Y FUNCIONES PERIDICAS USANDO MATLAB

plot(x,y,z)

figure(h)

Realiza el grfico con el estilo indicado en z.


Para ello z debe ser una cadena de caracteres
formada por uno o ningn elemento de las tres
columnas.
Crea la figura como un objeto de nombre h y la
sita como figura corriente.

LAB. INT. A LAS TELECOMUNICACIONES

UNMSM-FIEE 2016-1

Anda mungkin juga menyukai