UNIVERSIDAD AUTONOMA METROPOLITANA …148.206.53.84/tesiuami/UAM3917.pdf · 2004-03-08 ·...

59
UNIVERSIDAD AUTONOMA METROPOLITANA - IZTAPALAPA DIVISION : CBI INGENIERIA ELECTRONICA PROYECTO TERMINAL I1 ESQUEMAS DE MODULACION ANALOGICA Y DIGITAL Acesor : /' / Integrantes : Tobias Granados Morales Pedro I. Zayas Pdrez

Transcript of UNIVERSIDAD AUTONOMA METROPOLITANA …148.206.53.84/tesiuami/UAM3917.pdf · 2004-03-08 ·...

UNIVERSIDAD AUTONOMA METROPOLITANA - IZTAPALAPA

DIVISION : CBI

INGENIERIA ELECTRONICA

PROYECTO TERMINAL I1

ESQUEMAS DE MODULACION ANALOGICA Y DIGITAL

Acesor : /' /

Integrantes : Tobias Granados Morales

Pedro I . Zayas Pdrez

INTRODUCCION

El concepto de modulación en comunicación electrónica es tan importante hoy en dia, que se

hacen incluso estudios especiales para su mejor aprovechamiento. Si la modulación no existiera

sería muy difícil imaginarse como el hombre se comunicaría a distancia.

Basicamente la mudulación es el proceso por el cual una señal de baja frecuencia, es impresa

sobre otra señal de mucho mds alta frecuencia. La señal de baja frecuencia es llamada

moduladora

y la de alta frecuencia es llamada portadora, ya que esta es la que se encarga de "transportar .'

el

mensaje.Si esto no fuera así,entonces se necesitarían antenas de kilometros de largo para poder

transmitir dicho mensaje.

Existen varios tipos de modulación. tanto aneloaico como diaital:

En los analógicos estan la amplitud modulada y frecuencia modulada.

Amplitud modulada : Aquí la amplitud de la portadora varía segun varie el mensaje, por 10 tanto

es propensa a ruido. Dentro de esta modalidad existen varios tipos de modulación como son :

AM comercial, AM doble banda lateral, AM banda lateral unica, AM banda lateral residual.

Frecuencia modulada : en este tipo de modulación lo que varia es la frecuencia de la portadora,

este tipo de modulación es muy imporante en comunicación de voz ya que es menos propensa al

ruido, porque su amplitud permanece constante.

Existen otros tipos de modulación como la modulación digital que en la actualidad se ha vuelto

tan

importante para el proceso de datos,telefonía,voz,video,etc.

Dentro de esta categoria se encuentran varios tipos de modulación digital tales como ASK,

FSK,

PSK, QPSK, QASK,etc. Dependiendo de la necesida,se elige que tipo de modulación usar,por

ejemplo para modem's se utiliza mucho FSK.

En este programa mostramos algunos de los diferentes tipos de modulación tanto andlogica

como

digital, mostramos grdficamente como se vería en el tiempo la seilal y tambien mostramos su

grafica en frecuencia, es decir su ancho de banda. Tambien incluimos una pequeña intruducción

teórica y explicación de los diferentes tipos de modulación.

MODO DE USAR EL PROGRAMA

La forma de usar este programa es muy sencilla.lnicialmente muestra una advertencia para el

uso de cierto tipo de monitor. Inmediatamente despues aparece una pequeña animación de

adorno, posteriormente oprimiendo cualquier tecla aparece el menu del tipo de modulación que

se desee observar, habiendo ya seleccionado el tipo de modulación entonces aparece otro menú,

el cual es una derivación del anterior, y asi sucesivamente hasta que se encuentra la última

indicación.

Como va apareciendo cada menú se va preguntando Io que se desea hacer. Por lo tanto el

programa no tiene ninguna opción de ayuda extra, ya que su funcionamiento es de forma

anidada .

* * * * * * * * * * * * * * librerias y bibliotecas usadas en el programa * / include<stdio.h> include<math.h> include<stdlib.h> include<graphics.h> include <conio.h> include <ctype.h>

fiefine RAD 57.29578 / * CTE. PARA LOS CALCULOS DE LAS SENOIDES * / nt graphmode;/* variables para detectar el tipo de tarjeta para los graficos * / nt graphdriver = DETECT;

nt maxxlmaxylpunt med; nt c; / * variable para el uso de los menus * / nt x; / * VARIABLE PARA LA SIGNAL NO PERIODICA DE A.M. * / nt k; / * Variable para ask * / nt Errorcode; / * variable para detectar graficos * / *******************

MENSAJES PARA LOS MEWS EN PANTALLA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

har analog [I = MODULACION ANALOGICA. .< A > l l;

har digita [I = Ir MODULACION DIGITAL.. . .< D > l l;

har salir[] = I I SALIR.. . . . . . . . . . . . . . .<ESC >

har amp [I = AMPLITUD MODULADA. . . . . < A > ' I ;

har frec [I = I I FRECUENCIA MODULADA . . . < F > ";

har dbl [I = I I DOBLE BANDA LATERAL. . . < D > ; har blu [I = BANDA LATERAL UNICA. . . < U > ; har blr [I = BANDA LATERAL RESIDUAL< R > I f ;

har amc [I = AM COMERCIAL. . . . . . . . . . < C > II ;

har m t[1 = I f MODULACION EN TONO.. . . . .< T > I 1 ;

har mIa[] = MODULACION NO PER1ODICA.c A > I 1 ;

har teo [I = II TEORIA. . . . . . . . . . . . . . . . . . < E > I 1 ;

har ma-uno [I = INDICE MAYOR A UNO. . . . < A > 'I ; har me-uno [I = INDICE MENOR A UNO. . . . < E > I' ; har ig uno[] = INDICE IGUAL A UNO. . . . < I > 'I ; -

har graf tie [I = GRAFICA EN TIEMPO. . . . . < T > I I ; har graf-frec [I = I I GRAFICA EN FRECUENCIA. < F > ; har an banda [I = I I ANCHO DE BANDA. . . . . . . . < B > 'I ; -

******** MENSAJES PARA LA MODULACION DIGITAL * * * * * * * * * * * * * * /

har fsk[] - " MODULACION FSK. . . . . . . . . . < F > ' I ;

har psk[l har ask [I - 'I MODULACION ASK. . . . . . . . . . < A > ' I ;

har qpsk [I har geom [I - - " FORMA GEOMETRICA. . . . . . . . < G > I r ;

-

- - MODULACION PSK. . . . . . . . . . < P > ' I ;

-

- - I' MODULACION QPSK. . . . . . . . . < Q > ' I ;

har dig[] - I t Modulacion Digital har df sk [I - - Digital FSK har dask [I - Digital ASK har dpsk [I - - I1 Digital PSK har dqpsk [I - - Digital QPSK

-

-

I1 . I

II . I

I I . I

I I . I

11 . I

har mens [I = "Modulacion de A.M. I I I . har DBL [I = "doble banda lateral 11 I . har DBLN [I = "doble banda lateral no periodical!; nar DBLT [I = "doble banda lateral en tono I ! ;

har BLU [ I = "banda latera unica I I I . har BLUN [I = "banda lateral unica no periodicall; har BLUT [I = "banda lateral unica en tono har BLR [I = "banda lateral residual (BLR) 11 I . har BLRN [I = "BLR no periodica" ; har BLRT [I = "banda lateral residual en tono har AMCO [ 3 = "comerical 11 r . har AMCN [ ] = "comercial no periodica 11 I . har AMCT [ I = "comercial en tono I I I . har IMEU [ ] = Ilcomercial en tono con indice c 1 I ! ;

har IMAU [ I = "comercial en tono con indice > 1 I ! ;

har IUNO [ I = "comercial en tono con indice = 1 I ! ;

har espacio[] = I I I . har men1 [ I - en tono. I I I . har men2 [ I - en tono con indice menor a uno I ! ;

har inm [ I - - en tono con indice mayor a uno"; har iil [ I - en tono con indice igual a unoll; har nop [ I - - de una funcion no periodica I r ;

har menf m [ I - - modulacion de FM II I .

- -

-

* FUNCIONES DE LOS MENUS EN PANTALLA * /

Did marco(void); / * dibuja un marco para las graficas */ Did menul(int 1,int t,int r,int b,char *analog,char *digita,char *salir,

int *c,int c1,int c2,int c3,int color); oid menu2 (int 1,int t,int r,int b,char *espacio,char *mens,

char *aux,char *an,char *di,char *sa,int *c, int c1,int c2,int c3,int c4,int color,int ~012);

oid menu3(int 1,int t,int r,int b,char *Atchar *B,char *C, char *D,char *E,char *F,char *G,int *c,int cl, int c2,int c3,int c4,int c5,int c6,int c7,int color,int ~012);

oid mensaje(void); / * Esta funcion da el primer mensaje en pantalla * / oid mensage2(void); / * Esta funcion da el segundo mensaje en pantalla * / oid animacion(void);/* funcion que hace una animacion * / oid analogica(void); / * funcion de modulacion analogica * /

oid amp1 mod(void); / * funcion de amplitud modulada * / oid teo %l(void); / * funcion de la teoria de A.M.*/ oid do " ba la(void) ; / * funcion de doble banda lateral * / ********** FUNCIONES DE BANDA LATERAL UNICA . . . . . . . . . . . . . . . . . . . . oid ba la un(void); / * funcion de banda lateral unica * / oid t " _ b 1-u(void); / * teoria de banda lateral unica * / oid m blu np(void) ; / * modulacion no periodica de blu * / oid mt blÜAM(void); / * modulacion en tono de blu * / oid g " t bluN(void); / * grafica en tiempo de BLU no periodica * / / * ****** / oid g " F bluN(void); / * grafica en frecuencia de BLU no periodica * / oid a " _ g f blu(void); / * auxiliar de BLU en frecuencia no periodica*/ oid g " F bluT(void); / * grafica en frecuencia de BLU en tono * / * * * * * * * * FUNCIONES DE BLR . . . . . . . . . . . . . . . . . . . . oid ba la re(void); / * funcion de banda lateral residual * / oid t " _ b 1-R(void); / * teoria de BLR * / oid m - blR - np(void); / * modulacion BLR no periodica * /

Did mt blRAM(void) ; / * modulacion BLR en tono * / Did g F blRn(void); / * grafica en frecuencia de BLR no periodica * / 2id g-F-blUT(void) " ; /* grafica en frecuencia de BLR en tono * / 2id agf - blrN(void); / * auxiliar de BLR en frecuencia no periodica * / A-********* FUNCION DE AM COMERCIAL . . . . . . . . . . . . . . . . . . . . . . . Did am comer(void); / * Am comercial * / Did m co AMT(void); / * Am comercial en tono * / Did t " am com(void); / * teoria de AM comercial * / Did m co amn(void); / * funcion de AM comercial no periodica * / Did g-t " amcn(void); / * grafica en tiempo de AM comercial no periodica * /

- -

* Funciones para las graficas de AM comercial no periodica*/

Did Did Did Did Did 2id

Did Did Did Did Did

* * * Did Did Did Did Did aid Did Did oid Did Did Did Did

Did aid

oid oid oid oid oid oid

mod VOZ l(int a,int b,int ang1,int ang2,int *xO,int color 1 ; mod-vozTvoid) ; vozpor (int i , int j , int ind) ; port voz (void) ; mod - - no p (void) ; m n p a(void); / * fin de las funciones de AM no periodica en tiemPo*/ -"

g-F- AMcn(void); / * grafica en frecuencia de AM comercial no periodica * / men " 1 am(void); / * funcion de AM comercial en tono menor que uno * / may - _ 1 am(void); / * funcion de AM comercial en tono mayor que uno * / t " i ma - l(void);/* teoria AM comercial en tono ind > uno * / ind - _ 1 am(void); / * funcion de AM comercial de indice igual a uno en tono*/

FUNCIONES PARA LAS GRAFICAS DE INDICE DE AM EN TONO ***** / intim uno(void); / * GRAFICA EN TIEMPO EN AM IND MENOR A UNO*/ mo - am-m " l(int color); / * MODULADORA DE INDICE MENOR A UNO EN AM*/ PO a am m l(int i,int j,int ind); / * PORTADORA AUX. DE INDICE MENOR A UNO po-am m-lTvoid); / * PORTADORA DE INDICE MENOR A UNO EN AM*/ g r i m void); /*GRAFICA EN FRECUENCIA CON IND. MENOR QUE UNO*/

m -" i i l(int color); / * Dibuja la moduladora de ind. igual a 1 * /

p-1 " i 2(void); / * toda la portadora de ind. igual a uno * /

m " _ i m l(int color); / * dibuja la moduladora de ind. mayor a uno*/

"

-" g-t- i - l(void); /*Dibuja toda la grafica de ind. igual a 1 * /

P-1- ' i - l(int i,int j,int ind);/* parte de la portadora igual a 1*/

5J-t- i - m - l(void); /*Dibuja la signal en tiempo para ind. mayor a uno*/

P-+- ' m - l(int i,int j,int ind); /*portadora de ind. mayor a uno*/ P-1- m - un(void); /*portadora auxiliar de ind. mayor a uno * / m no_pam(void);/* modulacion no periodica de AM * / axdblnp(void);/*auxiliar de graf. en frecuencia de AM DBLPS no periodica*/

mt AM(void) ; / * modulacion en tono de am * / t db la(void); / * teoria de doble banda lateral * / gIt - _ am n(void); / * grafica en tiempo de am no periodica * /

g-t-mtAM(void);/* grafica en tiempo modulacion en tono de am * / 9-f-a m - n(void); / * grafica en frecuencia de am no periodica * /

g-f-m tAM(void); / * grafica en frecuencia modulacion en tono de am*/

******* FUNCIONES PARA LA FM . . . . . . . . . . . . . . . . . . . . . .

oid frec mod(void); / * FUNCION PARA LA FM * / oid teo Tm(void); / * Teoria de la FM en general * / oid mt Fm(void);/* funcion para la modulacion en tono de FM*/ oid te-fm - _ np(void); / * Teoria de fm de un tono * /

Did g " _ t t fm(void); / * Grafica completa de la signal en FM * / Did mod fm(void) ; / * Moduladora de Fm en tiempo*/ Did port fm(void); / * Portadora de FM en tiempo*/ Did mod frec(void);/*Grafica de FM en tiempo*/ Did mod-aux(int a,int b,int xaux,int des);/* graf. auxiliar de FM en tiempo*/ Did g " _ f-t FM(void) ; / * Funcion que dibuja el espetro de Fm en tono * / Did FM no pe(void); / * funcion de FM no periodica * / *void " f-fmno(void) ;* / / * Grafica en frecuencia de FM * /

3id digital(void); / * FUNCION DE ANALISIS DIGITAL * / 3id TE0 DIG(void) ; / * Funcion de teoria digital * / Did mod-ask(void) ; / * Modulaion ASK * / 3id m d-ask(void) ; / * Funcion para la ASK en tiempo * / >id m fsk(int *k,int A,int B,int ang1,int ang2,int color); /*auxiliar de m d a Did G F ASK(void) ; / * Funcion que dibuja la grafica del espectro de ASK *T 3id ask no p(void); / * Auxiliar del espectro de ASK * / 3id teo-ask(void) - ; / * Teoria de ASK * /

"

- "

3id mod fsk (void) ; /* Modulacion FSK * / Did G T-FSK(void); / * Grafica en tiempo la FSK * / 3id aux fsk(int *k,int A,int ang1,int ang2,int color); / * Aux. de FSK * / 3id ES =K(void) ; / * Dibuja el espectro de FSK * / 3id AUK FSK(void); / * Auxilia al espectro de FSK * / 3id teo-fsk(void); - / * Funcio de teoria de FSK * /

"

3i.d mod psk(void) ; / * Modulaion PSK * / Did g t-psk(void); / * Funcion que dibuja la grafica en tiempo de PSK * / aid au-t-psk(int *k,int A,int B,int ang1,int ang2,int color);/* Aux. de PSK en aid g " f psk(void); / * Grafica en frecuencia de PSK * / 3id psk auxf(void); / * Aux de PSK en frec. * / Did TEO-PSK(void) - ; / * Teoria de PSK * /

"

aid mod qpsk(void); / * Modulaion QPSK * / aid g-tzqpsk (void) ; / * grafica en tiempo QPSK * / 3id TE0 QPSK(void) ; / * Teoria qpsk * / *void gzf - qpsk(void);*/ / * Grafica en frecuencia QPSK * /

Did main (void) { clrscr ( 1 ; mensaje ( ) ; mensage2 0 ; animacion ( ) ; do

c . menu1(20,10,53,16,analog,digita,salir,&c,65,68,27,3~; switch (c)

{ case 65 : analogicao;

case 68 : digital 0 ;

case 27 : exit(1);

break;

break;

1

q 1 while (c ! = 2 7 ) ;

1 / * FIN DE PROGRAMA PRINCIPAL * / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION ANALOGICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2id analogica (void)

m e n u 1 ( 2 0 , 1 0 , 5 3 , 1 6 , a m p , f r e c , s a l i r , & c , 6 5 , 7 0 , 2 7 , 2 ) ; switch (c)

{ case 65 : ampl mod0 ;

case 7 0 : frec modo;

case 2 7 : c = 7 7 ;

brear;;

break;

break ;

/ * * * * * FIN DE FUNCION ANALOGICA ********** /

t****** FUNCION DE AMPLITUD MODULADA ************* / 2id ampl mod ( 1

{ -

do { menu3(20,10,53,18,mens,teo,dbl,bl,blu, blr,amc,salir,&c,69,

switch (c) 6 8 , 8 5 , 8 2 , 6 7 , 2 7 , 2 7 , 4 , 1 4 ) ;

{ case 69 : teo A M O ; / * funcion de la teoria de A.M.*/

case 6 8 : do ba la();

case 85 : ba la-un ( ) ;

case 8 2 : ba la re ( ) ;

case 6 7 : am comer();

case 2 7 : c = 2 7 ;

break ;

break;

break;

break;

break;

break;

1 1

1 while(c ! = 2 7 ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE DOBLE BANDA LATERAL

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . oid do " ba la(void)

menu2(20,10,53,16,DBL,mens,teo,m a,m t,salir,&c,27,65,84,69,0,14); switch (c)

- -

{ . .

case 69 : t db-lao; / * teoria * / case 65 : m no Pam();/* modulacion no periodica * /

case 84 : mt A M O ; / * modulacion en tono * /

case 27 : c = 77;

break;

bye aE ;

break;

break;

k * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FUNCION DE MODULACION NO PERIODICA DE AM DOBLE BANDA LATERAL k * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /

{ 2id m " no pam(void)

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , D B L N , m e n s , g r a f - tie,salir,graf frec,espacio,

switch (c) &c,27,27,84,70,15,0);

-

{ case 84 : g-t- amen();/* grafica en tiempo es la misma que * /

case 70 : g-f-am-n(); / * grafica en frecuencia * /

case 27 : c = 27;

break; / * AM comercial * /

break;

break;

1 1

while(c ! = 27) ; 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

GRAFICA EN FRECUENCIA DE DOBLE BANDA LATERAL NO PERIODICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3id g f am n(void)

int ind, cont; initgraph(&graphdriver, &graphmode, ' I . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( 1 ; setcolor (15) ; setlinestyle (O, Ox3ff , 1) ; outtextxy(maxx/2-20,20,~10F(w) O ! ! ) ;

outtextxy(3*maxx/4,maxy-25,"fc") ; outtextxy(maxx/4-4,maxy-25,"-fc") ; outtextxy(maxx-25,maxy/2-30, I1w1l) ; outtextxy(maxx-25,maxy-30t "w") ; outtextxy(maxx/2-20,maxy/2+10,"0F(w) O " ) ; outtextxy(20,30, "MAGNITUD DEL ESPECTRO EN") ; / * Mensaje especial * /

{ - - -

outtextxy(20,40, "FRECUENCIA DE UNA FUNCION") ; outtextxy(20,50,~rN0 PERIDICA DOBLE BANDA LATERAL") ; outtextxy(maxx/2+20,50, "MAGNITUD DEL ESPECTRO") ; outtextxy(maxx/2+20,maxy/2+50, "ESPECTRO TRASLADADO") ; outtextxy (20 , maxy/2+50 , "OBSEVAMOS QUE EN EL ESPECTRO" ) ; outtextxy(20,maxy/2+60, "TRASLADADO NO HAY PORTADORA") ; setcolor (15) ; moveto(maxx/2,30); lineto(maxx/2,maxy/2.0-30); /*DIBUJA EL EJE Y DE LA PRIMERA GRAFICA * / moveto(20,maxy/2-30) ; lineto(maxx-30,maxy/2-30); / * DIBUJA EL EJE X DE LA la GRAFICA*/ moveto(maxx/2,maxy/2.~+30) ; lineto(maxx/2,maxy -30); /*DIBUJA EL EJE Y DE LA 2a GRAFICA * / moveto(20,maxy -30); lineto(maxx-30,maxy -30); / * DIBUJA EL EJE X DE LA 2a GRAFICA*/ cont = (maxy-30) - (3*maxy/4+30) ; for(ind =l;ind c=cont;ind + = 6 )

{

}

putpixel(maxx/4,maxy-30-ind,15); putpixel(3*maxx/4,maxy-30-indr15);

axdblnp ( 1 ; setcolor (O) ; outtextxy (maxx/2 ,maxy-lO, Ilpresionar una tecla") ; getch ( ) ; closegraph ( 1 ;

1 k************** AUX. DE GRAFICA EN FRECUENCIA DBLPS NO PER. * * * * * * * * / Yroid axdblnp (void)

{ double y1 , x1 ; int i,y2,y; rnoveto(maxx/2-30,maxy/2-30) ; setcolor (14 ) ; for(i=O;i<=180;i += 10.0)

{ y1 = 15*sin(i/~~~) - I.~*cos(~*~/RAD) ; x1 =(int)20*i/RAD + maxx/2 -30; y = maxy/2-(int)yl -45; lineto (x1,y) ;

} setcolor (15) ; outtextxy(maxx/2,maxy/2 - 2 0 , 11011) ; outtextxy(maxx/2,maxy -20, 1 1 0 1 1 ) ; outtextxy(x1,y +IO, Irfrnl1) ; outtextxy(maxx/2-50,maxy/2 -20,11-fm11) ; setcolor (14) ; moveto(maxx/4-30,maxy-30) ; for(i=O;i<=180;i += 10.0)

{ y1 = 15*sin(i/~~~) - I~*cos(~*~/RAD) ; x1 =(int)20*i/RAD + maxx/4 -30; y = maxy-(int)yl -45; lineto (XI, y) ;

1 setcolor (15) ; outtextxy(3*maxx/4-55,maxy - 21,11fc-fm11) ; setcolor (14 ) ; moveto(3*maxx/4-30,maxy - 30) ; for(i=O;i<=180;i += 10.0)

{ y1 = 15*sin(i/~) - I~*cos(~*~/RAD) ; x1 =(int)20*i/RAD + 3*maxx/4 -30; y = maxy -(int)yl -45; lineto (x1 , y) ;

1 setcolor (15) ; outtextxy(x1,y +lo, llfc+fmll) ;

}

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCIO DE MODULACION EN TONO DE AM DOBLE BANDA LATERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

( lid mt AM(void) -

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , D B L T , m e n s , g r a f tie,salir,graf frec,espacio,

switch(c) &~,27,27,84,70,5,15);

- -

{ case 84 : intim uno();/* grafica en tiempo es la misma * /

break: / * de indice menor a uno * / case 70 : g-f-mtAMO; / * grafica en frecuencia * /

break; case 27 : c = 27;

break; 1

1 while(c ! = 27) ;

}

k * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FUNCION DE GRAFICA EN FRECUENCIA DE AM EN TONO DBLPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2id g f mtAM(void)

int y1 , y2 , ind; { "

initgraph (&graphdriver , &graphmode , I' . . \\bgi ) ; maxx = getmaxxo ; maxy = getmaxy ( 1 ; marco ( ) ; setcolor (15) ; moveto (maxx/2 , 40) ; lineto(maxx/2,maxy/2); /*DIBUJA EL EJE Y DE LA SEGUNDA GRAFICA * / moveto(20,maxy/2) ; ~ineto(maxx-20,maxy/2); / * DIBUJA EL EJE X DE LA SEGUNDA GRAFICA*/ setcolor (14 ) ; moveto(maxx-ll*maxx/l6,maxy/2); / * dibuja las bandas laterales * / lineto(maxx-ll*maxx/16,9*maxy/20); moveto(maxx-3*maxx/l6,maxy/2); lineto(maxx-3*maxx/l6,9*maxy/20); moveto(maxx-13*maxx/l6,maxy/2); lineto(maxx-13*maxx/l6,9*maxy/20) ; moveto(maxx-5*maxx/l6,maxy/2); lineto(rnaxx-5*maxx/l6,9*maxy/20); y1 = maxy/4 - (maxy-7*maxy/8); / * contadores para las portadoras * / y2 = maxy-7*maxy/8 - (maxy-7*maxy/8)+1; for(ind = y2;ind e= y1;ind +=6)

{

1 putpixel ( (maxx-maxx/4) , (maxy-5*maxy/8+ind) , 15) ; putpixel((maxx-3*maxx/4),(maxy-5*maxy-5*maxy/8+ind),l5);

setcolor (15) ; outtextxy (maxx-maxx/$ , maxy/2+5 , I1wc1l ) ; outtextxy(maxx-3*maxx/4-6,maxy/2+5,"-Wc~1) ; outtextxy(maxx-3*maxx/16,maxy/2+5, (Wc+Wm) ; outtextxy(maxx-5*maxx/16-30,maxy/2+5,"(Wc-Wm~~~~; outtextxy(maxx-13*maxx/16-50,maxy/2+5,"- (Wc+Wm) " ) ; outtextxy(maxx-ll*maxx/16,maxy/2+5, 1 1 - (Wc-Wm) I ! ) ; outtextxy(30,3*maxy/4, IIEspectro de AM DBL en tono") ; outtextxy(30,3*maxy/4+10,"Wc es la frecuencia de la portadora I ! ) ;

outtextxy(30,3*maxy/4+2O,~~Wm es la frecuencia de la moduladora ! I ) ;

outtextxy(maxx/2-2,2O,"F(w) I t ) ; outtextxy(maxx/2-3,maxy/2+5,"0") ; outtextxy(max~-20,maxy/2, "w") ; setcolor ( O ) ; outtextxy(maxx/2,maxy-10,"Presionar cualquier tecla"); getch ( 1 ; closegraph ( ) ;

} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION DE BANDA LATERAL UNICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid ba la un(void) {

- _

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , B L U , m e n s , t e o , m a,m t , s a l i r , & c , 2 7 , 6 5 , 8 4 , 6 9 , 1 5 , 4 ) ; switch (c)

- -

{ case 69 : t b-1-u 0 ; /* teoria * / case 6 5 : m blu np();/* modulacion no periodica * /

case 84 : mt bluAM(); /* modulacion en tono * /

case 27 : c = 77;

break;

break:

break ;

break;

1 1

1 while (c ! = 77) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE BLU NO PERIODICA

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2id m blu np(void) {

- -

do r . m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , ~ ~ ~ ~ , m e n s , g r a f t i e , sa l i r ,gra f_ f rec ,espac io ,

&c,27,27,84,70,2,14); -

switch (c) {

case 84 : g-t- amen();/* grafica en tiempo es la misma * / break; / * de AM comercial * /

case 70 : g-F- bluN(); / * grafica en frecuencia * /

break;

break; case 27 : c = 27;

1 1

while(c ! = 27) ; I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

GRAFICA EN FRECUENCIA DE BLU NO PERIODICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

)id g F bluN(void)

int ind,cont; initgraph (&graphdriver, &graphmode, I r . . \\bgi") ; maxx = getmaxxo ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; outtextxy(20,30, IIESPECTRO DE BANDA LATERAL UNICA") ; outtextxy(20,40, "DE UNA FUNCION NO PERIODICA") ; outtextxy(2O,maxy/2+2O,~~fm ES LA FRECUENCIA MAXIMA DE"); outtextxy(20,maxy/2+30, "LA FUNCION") ; outtextxy(20,maxy/2+45,"0bservar que se suprime la portadora"); outtextxy(maxx/2-20,15,~~oM(f)o~~~; outtextxy(maxx-20,maxy/2-3~, I l f l I ) ; outtextxy(maxx-20,maxy-30, I 1 f l 1 ) ; outtextxy(maxx/4,maxy-20, Ir-fc") ; outtextxy(3*maxx/4,maxy-20, ~lfc") ; moveto (maxx/2,30) ; lineto(maxx/2,maxy/2.0-30); /*DIBUJA EL EJE Y DE LA GRAFICA * / moveto(20,maxy/2-30) ; lineto(maxx-35,rnaxy/2-30); / * DIBUJA EL EJE X DE LA GRAFICA*/ moveto(maxx/2,maxy/2.0+30); lineto(maxx/2,maxy -30); /*DIBUJA EL EJE Y DE LA GRAFICA * / moveto(20,maxy -30); lineto(maxx-30,maxy -30); / * DIBUJA EL EJE X DE LA GRAFICA*/ cont = (maxy-30) - (3*maxy/4 ) ; for(ind =l;ind c=cont;ind + = 5 )

{ "

{

1 putpixel(maxx/4,maxy-30-ind,15); putpixel (3*maxx/4,maxy-30-ind,l5) ;

a g f blu0; setcolor (O ) ; outtextxy(maxx/2,maxy-10,"Presionar cualquier tecla"); getch ( ) ; closegraph ( ) ;

" _

1 roid a g f blu( )

double y1 , x1 ; int i,y2,y; moveto(maxx/2-30,maxy/2-30) ; setcolor (14 ) ; for(i=Ó;ic=180;i += 10.0)

{ " _

y1 = 15*sin(i/RAD) - 15*cos (2*i/RAD) ; x1 =(int)20*i/RAD + maxx/2 -30;

y = maxy/2-(int)yl -45; lineto (XI, y) ;

1 setcolor (15) ; outtextxy(maxx/2,maxy -20, I l O l l ) ; outtextxy(x1,y +IO, l1fm") ; outtextxy(maxx/2-50,maxy/2 -20, Il-fmIl) ; moveto(maxx/4-30,maxy-30) ; setcolor (14 ) ;

for(i=O;ic=90;i += 10.0) {

y1 = 15*sin(i/IiAD) - 15*cos (2*i/RAD) ; x1 =(int)20*i/RAD + maxx/4 -30; y = maxy-(int)yl -45; lineto (x1,y) ;

1 setcolor (14) ; moveto(3*maxx/4,y) ; for(i=90;ic=180;i += 10.0)

{ y1 = 15*sin(i/RAD) - 15*cos (2*i/RAD) ; x1 =(int)20*i/RAD + 3*maxx/4 -30; y = maxy -(int)yl -45; lineto (x1,y) ;

1 setcolor (15) ; outtextxy(maxx/2,maxy/2 -20,11011) ; outtextxy(maxx/2,maxy -20, I 1 O 1 ' ) ; outtextxy(x1,y +10,"fm+fc") ; outtextxy(maxx/4-80,maxy -20, ' I - (fm+fC) " ) ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION DE AM BLU MODULACION EN TONO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ lid mt bluAM(void) -

do { menu2(20,10,53,16,BLUT,mens,graf tie,salir,graf-frec,espacio,

switch (c) &c,27,27,84,70,13,15);

-

{ case 84 : intim uno();/* grafica en tiempo es l a misma * /

break: / * de indice menor a uno * / case 70 : g-F-bluT(); / * grafica en frecuencia * /

break; case 27 : c = 27;

break;

1 1

while(c ! = 27) ;

g-F - bluT (void)

int y1 , y2 , ind; initgraph ( &graphdriver , &graphmode , . . \\bgi 11 ) ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( 1 ; setcolor (15) ; setcolor (WHITE) ; outtextxy(maxx/2-2,20, "F(w) I ! ) ; outtextxy(maxx-20,maxy/4, I1w") ; outtextxy (maxx-20 , maxy/2 , I l w l l ) ; outtextxy(rnaxx-20,3*maxy/4,~~~~~); o~ttextxy(20,20,~~ESPECTRO DE BLU DE UN TONOr1); outtextxy(20,30, "CON FRECUENCIA Wm") ; outtextxy(20,maxy-30, "Wm Frecuencia de modulation") ; outtextxy (maxx/2 ,maxy-30 , "Wc Frecuencia de portadora") ; outtextxy(20,maxy-3*maxy/4+30, "Espectro de BLS") ; outtextxy(20,maxy-maxy/2+30, IIEspectro de BLI") ; setcolor (15) ; outtextxy(maxx/2+30,maxy/4+~0, llwmll) ; outtextxy(maxx/2-40,maxy/4+~~,~~-~m~~) ; outtextxy(maxx-3*maxx/16,maxy/2+10, (Wc+Wm) I t ) ; outtextxy(maxx-5*maxx/l6-2O,3*maxy/4+lO,1~(Wc-Wm)1~); outtextxy(maxx-13*maxx/16-30rmaxy/2+10, ' I - (Wc+Wm) I t ) ; outtextxy(maxx-11*maxx/16-20,3*maxy/4+10, (Wc-Wm) 1 1 ) ; setcolor (14) ; outtextxy(3*maxx/4,maxy/2+~~, IIWC") ; setcolor (15) ; moveto (maxx/2,20) ; lineto(maxx/2,maxy/4); /*DIBUJA EL EJE Y DE LA PRIMERA GRAFICA*/ moveto(20,maxy/4) ; lineto(maxx-30,maxy/4); /*DIBUJA EL EJE X DE PRIMERA GRAFICA * / moveto (maxx/2 ,maxy/2) ; lineto(rnaxx/2,maxy-3*maxy/4+20); /*DIBUJA EL EJE Y DE LA SEGUNDA GRAFICA * moveto(2ormaxy/2) ; lineto(maxx-30,maxy/2); / * DIBUJA EL EJE X DE LA SEGUNDA GRAFICA*/ moveto(maxx/2,maxy/2+20) ; lineto(maxx/2,maxy-maxy/4); /*DIBUJA EL EJE Y DE LA TERCERA GRAFICA * / moveto (20,3*maxy/4) ; lineto(maxx-30,3*maxy/4); / * DIBUJA EL EJE X DE LA TERCERA GRAFICA*/ setcolor (14) ; moveto(maxx/2-30,maxy/4); / * dibuja las bandas laterales * / lineto(maxx/2-30,maxy-4*maxy/5); / * del espectro * / moveto(maxx/2+30,maxy/4) ; lineto(maxx/2+30,maxy-4*maxy/5); . . . . . . . . . . . . . . . . . . . . . . . . . . moveto(maxx-3*maxx/l6,maxy/2) ; lineto(maxx-3*maxx/l6,9*maxy/20); moveto(maxx-13*maxx/16,maxy/2); lineto(maxx-13*maxx/16,9*maxy/20); moveto(maxx-ll*maxx/l6,3*maxy/4-maxy/20); lineto(maxx-ll*maxx/l6,3*maxy/4); moveto(maxx-5*rnaxx/l6,3*maxy/4-maxy/4-maxy/20) ; lineto(maxx-5*maxx/l6,3*maxy/4); y1 = maxy/4 - (maxy-7*maxy/8) ; y2 = maxy-7*maxy/8 - (maxy-7*maxy/8)+1; for(ind = y2;ind c= y1;ind +=5)

{ putpixel ( (maxx-maxx/4) , (maxy-5*maxy/8+ind) , 15) ; putpixel((maxx-3*maxx/4), (maxy-5*maxy/8+ind),l5);

putpixel( (maxx-maxx/4), (maxy-3*maxy/8+ind),l5); putpixel ( (maxx-3*maxx/4) , (maxy-3*maxy/8+ind) , 15) ;

1 setcolor (RED) ; outtextxy (maxx/2 , maxy-10 , "Presionar cualquier tecla") ; getch ( ) ; closegraph ( 1 ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BANDA LATERAL RESIDUAL

r * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /

{ )id ba la re(void) "

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , B L R , m e n s , t e o , m t,m a,salir,&c,27,65,84,69,10rll); switch (c)

- -

c . case 6 9 : t b 1 R O ; / * teoria * /

break;

break7

break;

break;

"-

case 6 5 : m blR np();/* modulacion no periodica * / case 84 : mt blRAM(); / * modulacion en tono * /

case 27 : c = 77;

\ 1

J

while (c ! = 77) ; 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION DE MODULACION BLR NO PERIODICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . >id m blR np(void)

{ - -

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , B L R N , m e n s , g r a f - tie,salir,graf frec,espacio,

switch (c) &c,27,27,84,70,9,14);

-

{ case 84 : g t-amcn();/* grafica en tiempo es la misma * /

case 70 : g-F- blRn(); / * grafica en frecuencia * /

case 27 : c = 27;

break; / * de am comercial no periodica * /

break;

break;

} 1

while(c ! = 27) ;

maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( 1 ; setcolor (15) ; outtextxy(20,30, "ESPECTRO DE BANDA LATERAL RESIDUAL") ; outtextxy(20,40, "DE UNA FUNCION NO PERIODICA") ; outtextxy(2O,maxy/2+2O,~~fm ES LA FRECUENCIA MAXIMA DE"); outtextxy(20,maxy/2+30, "LA FUNCION") ; outtextxy(20,maxy/2+45,"0bservar que se suprime la portadora"); outtextxy(maxx/2-20,15,nMo"); outtextxy(maxx-20,maxy/2-3~,~~f~~); outtextxy(maxx-20,maxy-3~,~~f~~); outtextxy(rnaxx/4,maxy-2~,~~-fc~~) ; outtextxy(3*maxx/4,maxy-20, Ilfc") ; moveto (maxx/2 , 30) ; lineto(maxx/2,maxy/2.0-30); /*DIBUJA EL EJE Y DE LA GRAFICA * / moveto(20,maxy/2-30) ; lineto(maxx-35,maxy/2-30); / * DIBUJA EL EJE X DE LA GRAFICA*/ moveto (maxx/2,rnaxy/2.0+30) ; lineto(maxx/2,maxy -30); /*DIBUJA EL EJE Y DE LA GRAFICA * / moveto(20,maxy -30) ; lineto(maxx-30,maxy -30); / * DIBUJA EL EJE X DE LA GRAFICA*/ cont = (maxy-30) - (3*maxy/4 ) ; for(ind =l;ind <=cont;ind +=5)

{

1 putpixel (maxx/4+5,maxy-30-ind, 15) ; putpixel(3*maxx/4-3,maxy-3O-ind,15~;

agf blrN ( ) ; setcolor ( 0 ) ; outtextxy(maxx/2,maxy-10,"Presionar cualquier tecla"); getch ( ) ; closegraph ( ) ;

1 r * * * * * * * * AUXILIAR DE GRAFICA EN FRECUENCIA BLR NO PERIODICA * * * * * * * * * * * * / roid agf blrN(void )

double y1 , x1 ; int i, y2 , y; moveto(maxx/2-30,maxy/2-30) ; setcolor (14) ;

{ -

for(i=O;i<=180;i += 1) {

y1 = 15*sin(i/RAD) - 15*cos(2*i/RAD) ; x1 =(int)20*i/RAD + maxx/2 -30; y = maxy/2-(int)yl -45; putpixel (xl, y, 14) ;

1 setcolor (15) ; outtextxy(maxx/2,maxy - 2 0 , I ~o I I ) ; outtextxy(x1,y + I O , llfm") ; outtextxy(maxx/2-50,maxy/2 -20, I l - f m " ) ; moveto(maxx/4-30,maxy-30); setcolor (14) ;

for(i=O;i<=60;i += 1) {

y1 = 15*sin(i/RAD) - 15*cos (2*i/RAD) ; x1 =(int)20*i/RAD + maxx/4 -30; y = maxy-(int)yl -45;

putpixel (xl,y, 14) ; 1 {

for(i=90;i<=157;i += 1.0)

y1 = 15*sin(i/~~~) - 15*cos RAD) ; x1 =(int)20*i/RAD + maxx/4 -30; y = maxy -(int)yl -45; putpixel(x1-10,y+10,14) ;

}

setcolor (14) ; moveto(3*maxx/4,y) ; for(i=120;ic=180;i += 1.0)

{ y1 = 15*sin(i/~~~) - 15*cos RAD) ; x1 =(int)20*i/RAD + 3*maxx/4 -30; y = maxy -(int)yl -45;

1 {

I putpixel (xl,y, 14) ;

for(i=22;i<=gO;i += 1)

y1 = 15*sin(i/~~~) - 15*cos (2*i/RAD) ; XI =(int)20*i/RAD + 3*maxx/4 -30; y = maxy-(intlyl -45; putpixel (x1+10,y+10,14) ;

1 setcolor (15) ; outtextxy(maxx/2,maxy/2 -20, 1 1 0 1 ' ) ; outtextxy(maxx/2,maxy -20, ' 1 0 1 1 ) ; outtextxy(maxx/2+20,40r "ESPECTRO DE LA FUNCION") ; outtextxy(maxx/2+20,maxy/2 +20, "ESPECTRO TRASLADADO") ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION DE MODULACION BLR EN TONO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . >id mt blRAM(void)

{ -

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , B L R T , m e n s , g r a f - tie,salir,graf frec,espacio,

switch(c) &c,27,27,84,70,4,15); -

. case 84 : intim uno();/* grafica en tiempo es la misma * / break? / * que indice menor a uno * /

break;

break;

case 70 : g-F-blUTO; / * grafica en frecuencia * /

case 27 : c = 27;

1 1

1 while(c ! = 27) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

GRAFICA EN FRECUNCIA DE BLR EN TONO k * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /

3id g " F blUT(void)

case 69 : t am como; / * teoria * /

case 65 : m co amno;/* modulacion no periodica * / case 84 : m co AMTO; / * modulacion en ton0 * /

case 27 : c = 77;

brear;;

break;

break;

break;

1 1

1 while (c ! = 77) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE MODULACION DE AM COMERCIAL NO PERIODICA

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )id m " co amn(void)

do {

menu2(20,10 ,53 ,16 ,AMCN,mens,graf tie,salir,graf frec,espacio,

switch (c)

- - &c,27,27,84,70,4,15);

{ case 84 : g-t-a men();/* grafica en tiempo * / case 70 : g-F-AMcn(); / * grafica en frecuencia * /

case 27 : c = 27;

break;

break;

break; 1

1 while(c ! = 27) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MODULACION DE AM COMERCIAL EN TONO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )id m - - co AMT(void)

case 69 : men l-amo; / * tono comercial menor que uno * /

case 6 5 : may 1 amo; / * tono comercial mayor que uno * /

case 73 : ind 1-amo; / * tono comercial igual a uno * /

case 27 : c = 77;

break ;

break;

break;

break;

"

1 1

while (c !=77) ; 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCIO DE AM COMERCIAL EN TONO CON INDICE MENOR A UNO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )id men " 1 am(void)

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , I M E U , m e n s , g r a f tie,salir,graf-frec,espacio,

switch (c) &c,27,27,84,70,15,14);

-

{ case 84 : intim uno();/* GRAFICA EN TIEMPO * /

case 66 : printf ("ancho de banda") ;

case 70 : g-f-i-m-u(); / * grafica en frecuencia con ind. menor que

case 27 : c = 27;

break;

break;

break;

break;

1 1

while(c ! = 27) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE AM COMERCIAL EN TONO CON INDICE MAYOR A UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

)id may " 1 am(void)

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 6 , I M A U , m e n s , g r a f tie,salir,teo,espacio,

switch (c) &c,27,27,84,69,15,14);

-

{ case 84 : g-t-i-m lo;/* GRAFICA EN TIEMPO * /

case 66 : printf ('!ancho de banda");

case 69 : t i ma-10; / * teoria de indice mayor a uno * /

case 27 : c = 27;

break;

break;

break;

break ;

-

"

1 }

while (c ! = 27) ;

r * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FUNCION DE AM COMERICAL EN TONO CON INDICE IGUAL A UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . >id ind 1 am(void)

do

- -

{ menu2(20,10,53,16,IUNO,mens,graf tie,salir,graf frec,espacio,

switch (c)

- - &c,27,27,84,70,15,14);

{ case 84 : g-t i lo;/* GRAFICA EN TIEMPO * / - -

case 6 6 :

case 70 :

case 27 :

1 1

while(c ! = 27) ;

break; printf ("ancho de banda") ; break; g-f i m-uO; / * grafica en frecuencia con ind. menor que break;

break;

"

c = 27;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCIONES PARA LAS GRAFICAS DE MODULACION EN AM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GRAFICA EN TIEMPO DE AM COMERCIAL NO PERIODICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

rid g " t amcn(void)

x = o; initgraph (&graphdriver, &graphmode, . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ; punt med =maxy/2; marco ( ; moveto(40,punt med) ; mod voz 0 ; port voz ( ) ; outtextxy(30,30, "Signal modulada con una") ; outtextxy(30,40r"funcion no periodica") ; outtextxy(max~/2+10,maxy-50,~~ La grafica punteada es la moduladora"); outtextxy(maxx/2+1o,maxy-40, La grafica continua es la portadora") ; setcolor ( O ) ; outtextxy(maxx/2,maxy-10,"Presionar cualquier tecla"); getch ( 1 ; closegraph ( 1 ;

-

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA MODULADORA DE LA FUNCION NO PERIODICA EN A.M.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . roid mod VOZ l(int a,int b,int ang1,int ang2,int *x,int color )

{ - -

double y1,xl; int iry2,y; for(i=angl;i<=ang2;i += 1 0 . 0 )

y1 = a*sin(i/RAD) ; x1 = b*i/RAD ; *x = (int) x1 + *x; y = punt-med- (int ) y1 ; y2 = punt med + (int) yl; putpixel Fx+40 ,y30 , color) ; putpixel (*x+40,y2+50,color) ;

{

1 I * * * * * * *

SIGNAL MODULADORA DE NO PERIODICA DE A.M. * * * * * * * * * * / -oid mod voz(void)

{ -

mod voz 1(15,2,0,180,&~,14);

mod voz 1-(30,1,370,540,&~,14); mod voz 1(20,1,190,360,&~,14);

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . mod - voz - 1(40,2,550,640,&~,14);

'ROCEDIMIENTO QUE DIBUJA TODA LA PORTADORA DE LA FUNCION NO PER. DE A

)id port voz (void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 voz por(0,180,63); vozpor(190,360,63); voz~por(370,540,55); voz_por(550,720,45); voz por(730,900,33); vozpor(910,1080,30); voz-por(1090,1260,35); voz-por(1270,1440,42); voz-por(1450,1620,52); voz-por(1630,1800,65); voz-por(1810,1980,72); vozpor(1990,2160,80); vozpor (2170,2340,77) ; vozpor (2350,2520,751 ; voz~por(2530,2700,70); voz-por(2710,2880,60); voz-por(2890,3060,53); vozpor(3070,3240,48); vozpor(3250,3420,42); voz-por(3430,3600,35) ; voz-por(3610,3780,30); vozpor(3790,3960,28); voz-por(3970,4140,22); voz-por(4150,4320,20) ; voz-por(4330,4500,16); voz-por(4510,4680,13); voz-por(4690,4860,11) ; voz-por(4870,5040,11); voz~por(5050,5220,10) ; vozpor(5230,5400,10);

1 -

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA PARTE DE LA PORTADORA DE NO PERIODICA DE A.M.

)id voz por (int i, int j , int ind) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ -

int apl, x, y; double y1 , x1 ; for(ap1 = i;aplc=j;apl += 10.0)

c y1 = ind*sin(apl/RAD) ; XI = 5 . 0 * a p l / ~ ~ ~ ; x = (int)xl; y = punt med- (int) yl; setcolorWHITE) ; lineto(x+40,y) ;

M.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GRAFICA EN FRECUENCIA DE AM COMERCIAL NO PERIODICA

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )id g F AMcn(void)

int ind,cont; initgraph (&graphdriver, &graphmode, I ! . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; setlinestyle ( O , Ox3ff, 1) ; outtextxy(maxx/2-20,20,~~°F(w) O ' ' ) ;

outtextxy(3*maxx/4,maxy-25,"fc") ; outtextxy(maxx/4-4,maxy-25, Il-fc") ; outtextxy(maxx-25,maxy/2-30, " w " ) ; outtextxy(rnaxx-25,maxy-30, I rw") ; outtextxy(maxx/2-20,maxy/2+10,"0F(w) Or') ; outtextxy(20,30, "MAGNITUD DEL ESPECTRO EN") ; / * Mensaje especial * / outtextxy(20,40, "FRECUENCIA DE UNA FUNCION") ; outtextxy(20,50,"NO PERIDICA."); outtextxy(20,maxy/2+30, "ESPECTRO TRASLADADO") ; setcolor (15) ; moveto (maxx/2,30) ; lineto(maxx/2,maxy/2.0-30); /*DIBUJA EL EJE Y DE LA PRIMERA GRAFICA * / moveto(20,maxy/2-30) ; lineto(maxx-30,maxy/2-30); / * DIBUJA EL EJE X DE LA GRAFICA*/ moveto(maxx/2,maxy/2.O+3O) ; lineto(maxx/2,maxy -30); /*DIBUJA EL EJE Y DE LA GRAFICA * / moveto(20,maxy -30) ; lineto(maxx-30,maxy -30); / * DIBUJA EL EJE X DE LA GRAFICA*/ cont = (maxy-30) - (3*maxy/4+30) ; for(ind =l;ind c=cont;ind +=1)

{ "

{

1

putpixel (maxx/4,maxy-30-ind,l5) ; putpixel (3*maxx/4,maxy-30-ind,l5) ;

mbd-no-p ( ) ; /* Dibuja las graficas*/ setcolor (O) ; outtextxy (maxx/2 , maxy-10 , "presionar una tecla" ) ; getch ( ) ; closegraph ( ) ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LAS GRAFICAS DEL ESPECTRO DE LA SIGNAL NO PER. DE A.M.

roid mod no-p( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ -

double y1 , x1 ; int i,y2,y; rnoveto(maxx/2-30,maxy/2-30) ; setcolor (14 ) ; for(i=O;ic=l80;i += 10.0)

{ y1 = 15*sin(i/RAD) - 15*cos (2*i/RAD) ; x1 =(int)aO*i/RAD + maxx/2 -30; y = maxy/2-(int)yl -45;

outtextxy(maxx/2-50,maxy/2 -20, Il-fm") ; setcolor (14) ; moveto(maxx/4-30,maxy-30) ; for(i=O;i<=180;i += 10.0)

{ y1 = 15*sin(i/RAD) - 15*cos(2*i/RAD) ; x1 =(int)20*i/RAD + maxx/4 -30; y = maxy-(int)yl -45; lineto (x1 , y) ;

} setcolor (15) ; outtextxy(3*maxx/4-55,maxy - 21, llfc-fmlr) ; setcolor (14) ; moveto (3 *maxx/4 -3 O , maxy - 3 O ) ; for(i=O;ic=l80;i += 10.0)

{ y1 = 15*sin(i/RAD) - 15*cos (2*i/RAD) ; x1 =(int)20*i/RAD + 3*maxx/4 -30; y = maxy -(int)yl -45; lineto(x1,y) ;

1 setcolor (15) ; outtextxy(x1,y +lo, llfc+fm") ;

1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA SENAL DE AM EN TIEMPO CON IND MENOR QUE UNO * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

intim uno (void) -

initgraph(&graphdriver, &graphmode, I ! . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( 1 ; marco ( ) ; punt-med =maxy/2; moveto(40,maxy/2) ; PO am m 1 0 ; mo am m l(14); outtextxy (30 , 30 , "Signal modulada en tono" ) ; 0uttextxy(30,40,~~con indice de modulacion menor a uno") ; outtextxy(rnaxx/2+10,maxy-50,~~ La grafica punteada es la moduladora"); outtextxy(max~/2+10,maxy-40,~~ La grafica continua es la portadora"); setcolor (O) ; outtextxy (maxx/2 , maxy-10 , "Presionar cualquier tecla") ; getch ( 1 ; closegraph ( 1 ;

- - -

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA MODULADORA, INDICE MENOR A UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.aid mo am m 1 (int color) {

- "

double y1 , x1 ; int x, y2 , y, ang; for(ang = O.O;angc=720.0;ang += 10.0)

{ y1 = 3O*cos (ang/RAD) ; x1 = 40.O*ang/RAD ; x = (intlxl; y = punt med-(int)yl - 40; y2 = punt med + (int)yl + 40; putpixel (X+40 , y, color) ; putpixel(x+40,y2,color) ;

1 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PROCEDIMIENTO QUE DIBUJA TODA LA PORTADORA DE IND MENOR A UNO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . lid PO am m l(void)

- {- - po-a am m-l(0,180,70); PO a am m 1(190,360,65); PO a am m 1(370,540,55); PO a am m 1(550,720,45); PO a am m 1(730,900,30); PO a am m 1(910,1080,20); PO a am m 1(1090,1260,15); PO a am m 1(1270,1440,10) ; PO a am m 1(1450,1620,10); PO a am m 1(1630,1800,15); PO a am m 1(1810,1980,20); PO a am m 1(1990,2160,30); PO " a am " m 1(2170,2340,45); PO " a am " m 1(2350,2520,55) ; PO " a am " m 1(2530,2700,65); PO " a am " m 1(2710,2880,70); PO " a am " m 1(2890,3060,70); PO " a am - - m 1(3070,3240,65); PO " a am - - m 1(3250,3420,55); PO " a am " m 1(3430,3600,45); PO a am m 1(3610,3780,30); PO a am m 1(3790,3960,20); PO " a am " m 1(3970,4140,15); PO a am m 1(4150,4320,10); po-a-am-m-~(4330,4500,10) ; po-a-am-m-1(4510,4680,15) " " ; PO a am m 1(4690,4860,20); po-a-arn-m-1(4870,5040,30); PO a am m 1(5050,5220,45); poIa~arn-rnI1(5230,5400,55) ; PO " a a m m " 1 (5410,5580,65) ; PO a am m 1(5590,5760,70) ;

"

" "

" "

" "

" "

" "

" "

" "

" "

" "

" "

" "

" "

" "

" "

1 " "

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA PARTE DE LA PORTADORA DE IND MENOR A UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

)id PO a am m 1 (int i,int j,int ind) { " "

int apl,x,y; double y1 , x1 ; for(ap1 = i;apl<=j;apl += 1 0 . 0 )

{ y1 = ind*sin(apl/RAD) ; x1 = 5.0*apl/RAD ; x = (intlxl; y = punt med- (int) yl; setcolorTWHITE) ; lineto (x+40 , y) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA GRAFICA EN FRECUENCIA PARA INDICE MENOR QUE UNO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid g f i m u(void) c ”” int y1 , y2 , ind; initgraph (&graphdriver, &graphmode, ! I . . \\bgi”) ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; setcolor (WHITE) ; outtextxy(30,3*maxy/4,“Espectro de AM comercial de un tono,con indice ,u 1” outtextxy(30,3*maxy/4+10,”Wc es la frecuencia de la portadora I ! ) ; 0

outtextxy(30,3*maxy/4+20,1~Wm es la frecuencia de la moduladora I ! ) ;

outtextxy(maxx/2-2,20, “ F ( w ) I ! ) ; outtextxy(maxx/2-3,maxy/2+5,”0”) ; outtextxy (maxx-20 , maxy/2 , l l w l l ) ; moveto(maxx/2,40); lineto(maxx/2,maxy/2); /*DIBUJA EL EJE Y DE LA SEGUNDA GRAFICA * / moveto(2otmaxy/2); lineto(maxx-20,maxy/2); / * DIBUJA EL EJE X DE LA SEGUNDA GRAFICA*/ setcolor (14) ; moveto(maxx-ll*maxx/l6,maxy/2); / * dibuja las bandas laterales * / lineto(maxx-ll*maxx/16,9*maxy/20); moveto(maxx-3*maxx/l6,maxy/2); lineto(maxx-3*maxx/l6,9*maxy/20) ; moveto(maxx-13*maxx/l6,maxy/2); lineto(maxx-13*maxx/16,9*maxy/20); moveto(maxx-5*maxx/l6,maxy/2); lineto(maxx-5*rnaxx/l6,9*maxy/20); y1 = maxy/4 - (maxy-7*maxy/8) ; / * contadores para las portadoras * / y2 = maxy-7*maxy/8 - (maxy-7*maxy/8)+1; for(ind = y2;ind e= y1;ind +=1)

{

1 putpixel((maxx-maxx/4),(maxy-5*maxy/8+ind),3); putpixel ( (maxx-3*maxx/4) , (maxy-S*rnaxy/8+ind) , 3) ;

setcolor (15) ; outtextxy (maxx-maxx/4 , maxy/2+5 , IIWC~~ ) ; outtextxy(maxx-3*maxx/4-6,maxy/2+5, Ir-Wc1!) ; outtextxy(maxx-3*maxx/l6,maxy/2+5, II (Wc+Wm) I N ) ; outtextxy(maxx-5*maxx/l6-3O,maxy/2+5,“(Wc-Wm~~1); outtextxy(maxx-13*maxx/l6-5O,maxy/2+5,”- (Wc+Wm) ;

outtextxy(maxx-ll*maxx/l6,maxy/2+5, I I - (Wc-wm) 1 1 ) ; setcolor (O) ;

} closegraph ( 1 ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA SENAL DE AM CON IND DE MODULACION IGUAL A UNO *

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . lid g t i 1 (void) -"

initgraph(&graphdriver, &graphmode, I r . . \\bgi") ; maxx = getmaxx 0 ; maxy = getmaxy ( ) ; punt-med =maxy/2; marco ( ) ;

outte~txy(30,30,~~ Signal modulada en tono") ; outtextxy(30,40, ' I con indice de modulacion igual a uno") ; outtextxy(maxx/2+10,maxy-50,~1 La grafica punteada es la moduladora"); outtextxy(maxx/2+10,maxy-40,~~ La grafica continua es la portadora"); setcolor (O) ; outtextxy (maxx/2 , maxy-10 , "Presionar cualquier tecla" ) ; getch 0 ; closegraph ( ) ;

} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA MODULADORA CON IND. DE MODULACION IGUAL A UNO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .oid m i i 1 (int color)

c -"

double y1 , x1 ; int x, y2 , y, ang; for(ang = O.O;ang<=720.0;ang += 10.0)

{ y1 = 30*cos (ang/RAD) ; x1 = 40.0*ang/RAD ; x = (int)xl + 10; y = punt-med- (int) y1 - 30; y2 = punt med + (int)yl + 30; putpixel (X+40 , y, color) ; putpixel (x+40 , y2 , color) ;

} . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PROCEDIMIENTO QUE DIBUJA TODA LA PORTADORA CON IND. DE MODULACION IGUAL A 1

)id p 1 i 2 (void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

- 7- P-l- ' i - 1(0,180,60) ; P-l- i - 1(190,360,58); P-1- i - 1(370,540,50);

P-1- ' i - 1(730,900,32); p-i " i 1(550,720,40);

p _ " i ip1(1990,2160,20); P-1-1- ' ' 1(2170,2340,31); p-i i 1(2350,2520,40); p-i-i-1(2530,2700,51) ; p-i-i-1(2710,2880,58) - - ;

P-l-1- 1(3070,3240,58); P&$- ' ' 1(2890,3060,60) ;

P&$- ' ' 1(3610,3780,30); P-+-L 1(3790,3960,20) ; P-1- i - 1(3970,4140,12);

P-1-1- ' ' 1(4690,4860,9);

p-i i 1(3250,3420,50); p-i:i-1(3430,3600,40); -

p-i i 1(4150,4320,3) ; p-i-i-1(4510,4680,3); - -

p-i " i 1(4870,5040,20) ; p-i i 1(5050,5220,31) ; p-i-i-1(5230,5400,40) ; p_i~i-1(5410,5580,51); p-i - - i-1(5590,5760,58);

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA PARTE DE LA PORTADORA CON IND. DE MOD. IGUAL A 1

'id p i i 1 (int i, int j,int ind) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ - - -

int apl , x, y; double y1 , x1 ; for(ap1 = i;aplc=j;apl += 10.0)

{ y1 = ind*sin (apl/RAD) ; XI = 5.0*apl/RAD ; x = (int)xl; y = punt med- (int 1 yl; setcolorTWHITE) ; lineto (x+40 , y) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * FUNCION QUE DIBUJA LA SENAL DE AM CON SOBREMODULACION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid g t i m 1 (void) ""

outtextxy(maxx/2,maxy-~~,~~~resionar cualquier tecla"); getch ( ) ; closegraph ( ) ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION QUE DIBUJA LA MODULADORA DE IND. MAYOR QUE UNO

.oid m i m l(int color) {

" -

double y1 , x1 ; int x,y2,y,ang; for(ang = O.O;angc=720.0;ang += 10.0)

{ y1 = 30*cos (ang/W) ; x1 = 40.0*ang/RAD ; x = (int)xl; y = punt med- (int)yl - 20; y2 = punt med + (int)yl + 20; putpixel (X+40 , y, color) ; putpixel (x+40 ,y2 , color) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA PORT. DE IND. MAYOR QUE UNO

id p i m un(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

- 7- p-i " m 1(0,180,50) ;

P-+- ' m - 1(190,360,45); P-+- m - 1(370,540,35); P-+- m - 1(550,720,24);

m 1(730,900,13); p-i m_l(910,1080,5); P-1- -

' 1(1090,1260,5); p-i m 1(1270,1440,10) ; p-1-m-

' 1(1450,1620,10); p-i m 1(1630,1800,5); p-1-m-

' m 1(1810,1980,5) ; p-i m 1(1990,2160,13); P-1- - p-i-m-1(2170,2340,24) ; p-i-m-1(2350,2520,35); - -

-

"

"

P-+-m- ' 1(2530,2700,45); P-l- m - 1(2710,2880,50); P-1- m - 1(2890,3060,50) ;

P-1- ' m - 1(3250,3420,35) ;

P-+- ' m - 1(3610,3780,13) ; P-1- m - 1(3790,3960,5);

p-i - m-l(3070,3240,45);

p-i " m 1(3430,3600,24);

p-i-m-1(3970,4140,5); p-i m 1(4150,4320,10); p-i-m-1(4330,4500,10); "

p-i " m 1(4510,4680,5); P-l- ' m - 1(4690,4860,5) ; P-l- m - 1(4870,5040,13); P-l- m - 1(5050,5220,24); p-1-m- 1(5230,5400,35); p - i-m 1(5410,5580,45); -

1 p-i - - m 1 (5590,5760,50) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA PARTE DE LA PORTADORA CON IND. MAYOR A UNO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id p-i m-1 (int if int j , int ind)

{ -

int apl,x,y; double y1 , x1 ; for(ap1 = i;aplc=j;apl += 10.0)

{ y1 = ind*sin(apl/RAD) ; x1 = 5.0*apl/RAD ; x = (intlxl; y = punt-med- (int) yl; setcolor (WHITE) ; lineto(x+40,y) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCIONES DE LA MODULACION DE FM EN GENERAL

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id frec mod (void) r -

do { menu2(20,10,53,18,espacio,menfm,teo,m a,m t,salir,

&c,69,84,27,65,4,14); - -

switch ( c ) { case 84 :

case 69 :

case 65 :

case 27 :

1 1

while(c ! = 27) ; 1

mt - fm0; / * funcion en tono * /

teo - fm0; / * teoria de fm * /

FM-no-peO; / * FM no periodica * /

break;

break;

break;

break; c = 27;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION PARA LA MODULACION EN TONO DE FM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid mt fm(void1 -

~~~~2(20,10,53,18,menl,menfrnfgraf tie,teo,graf frec,sa~ir,&cf69,70,27,84 switch (c)

- -

{ case 84 : g-t-t-frno; / * grafica en tiempo * /

break; case 69 : te - fm-np();

break;

break; case 70 :g-f t FMO; / * grafica en frecuencia * /

case 27 : c = 77;

- _

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GRAFICA EN TIEMPO DE FM EN TONO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ id g t t fm(void) -"

int i; initgraph(&graphdriver, &graphmode, I ! . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( 1 ; punt med =maxy/2; marco ( ) ; moveto(20,punt med-70) ; for(i=l;i<=140fi + = 5 )

mod f m 0 ; port fm ( 1 ; mod rrec ( ) ; setcolor (15) ; outtextxy(30,30, "Frecuencia modulada de un tonoll) ; outtextxy(maxx/2+15,maxy/4-10, "Signal moduladora") ; outtextxy (3*maxx/4 ,maxy/2 , "Signal Portadora") ; outtextxy(3*maxx/4,maxy/2+60, "Signal de FM") ; setcolor ( O ) ; outtextxy(maxx/2,maxy-10,"Presionar cualquier tecla"); getch ( ) ; closegraph ( ) ;

putpixel(20+i,punt med-70,14); -

1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MODULADORA DE FM DE UNA SIGNAL NO PERIODICA *

id mod fm(void) {

-

int x1 , y1 , x, y, ang; for(ang = O.O;ang<=360.0;ang += 10.0)

{ y1 = 25*sin(ang/~~~) ; x1 = 60.O*ang/RAD ; x = (int)xl + 140; y = punt med- (int) y1 - 70; putpixel7x+20 , y, 14) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{

. . . . . . . . . . . . . . . . . . . . PORTADORA DE UNA SIGNAL EN FM NO PERIODICA

lid port fm(void) -

int x,y,xl,yl,ang; for(ang = 0.0;ang<=3240.0;ang += 10.0)

{ y1 = 25*sin(ang/RAD) ; x1 = 7.0*ang/m ; x = (int)xl + 10; y = punt med- (int) y l ; putpixe1-i;c+20,yrl4);

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA FRECUENCIA MODULADA EN TIEMPO PARA NO PERIOD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id mod frec(void)

{ -

mod aux(0,1080,7,0); mod-aux(1090,1450,6,20); mod-aux(1460,1810,5,44); mod-aux(1820,2170,4,75); mod-aux(2180,2530,3,113); mod-aux(2540,2890,4,70); mod~aux(2900,3250,5,20); mod-aux(3260,3610,6, -36) ; mod-aux(3620,3970,7,-98); mod-aux(3980,4330,8,-165); mod-aux(4340,4690,9,-241) ;

1 -

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION AUXILIAR PARA LA FM COMPLETA DE UN TONO

id mod aux(int a, int b, int xaux, int des) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ -

int x, y, x1 , y1 , ang; for(ang = a;ang e= b;ang += 10.0)

{ y1 = 25*sin(ang/m) ; x1 = xaux*ang/RAD ; x = (intlxl + des + 10; y = punt med- (int)yl + 70; putpixelTx+20,y,l5);

1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA GRAFICA EN FRECUENCIA DE FM CON ESPECTRO CTE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid g f t FM(void) r - - - t

int ind, cont; initgraph (&graphdriver, &graphmode, . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; moveto(20,maxy/2-30); / * DIBUJA EL EJE X DE LA GRAFICA 1 * / lineto(maxx/2-20,maxy/2-30) ; setcolor (YELLOW) ; moveto(maxx/4,20) ; /*DIBUJA LA PORTADORA DE LA GRAFICA 1 * /

lineto(rnaxx/4,maxy/2.0-30); moveto(7*maxx/32,maxy/2-30); /*DIBUJA LAS FREC. LATERALES * / lineto(7*maxx/32,maxy/2-50) ; moveto(9*maxx/32,maxy/2-30) ; lineto(9*rnaxx/32,maxy/2-50); moveto(6*maxx/32,maxy/2-30) ; lineto(6*maxx/32,maxy/2-35) ; moveto(~0*maxx/32,maxy/2-30); lineto(10*maxx/32,maxy/2-35) ; setcolor (15) ; moveto(maxx/2+20,maxy/2.0-30); / * DIBUJA EL EJE X DE LA GRAFICA 2 * / lineto(maxx-20,maxy/2-30) ; setcolor (14) ; rnoveto(3*maxx/4,maxy/2-30); /*DIBUJA LA PORTADORA DE LA GRAFICA 2 * / lineto(3*maxx/4,maxy/2.0-38) ; rnoveto(23*maxx/32,maxy/2-30); /*DIBUJA LAS FREC. LATERALES * / lineto(23*maxx/32,maxy/2-60); moveto(25*maxx/32,maxy/2-30) ; lineto(25*rnaxx/32,maxy/2-60); moveto(22*maxx/32,maxy/2-30) ; lineto(22*maxx/32,maxy/2-55) ; moveto(26*maxx/32,maxy/2-30) ; lineto(26*maxx/32,maxy/2-55) ; moveto(2~*maxx/32,maxy/2-30) ; lineto(21*maxx/32,maxy/2-5O) ; moveto(27*maxx/32,maxy/2-30) ; lineto(27*maxx/32,maxy/2-50) ; moveto(20*maxx/32,maxy/2-30) ; lineto(20*maxx/32,maxy/2-38) ; moveto(28*maxx/32,maxy/2-30) ; lineto(28*maxx/32,maxy/2-38); moveto(~9*rnaxx/32,maxy/2-30); lineto (19*maxx/32, maxy/2-33) ; moveto(29*maxx/32,maxy/2-30) ; lineto(29*maxx/32,maxy/2-33) ; setcolor (15) ; moveto(2O1maxy-30) ; /*DIBUJA EL EJE X DE LA GRAFICA 3 * / lineto(maxx/2-20,maxy -30) ; setcolor (14 ) ; moveto(maxx/4,maxy-3O);/*DIBUJA LA PORTADORA DE LA GRAFICA 3*/ lineto(maxx/4,maxy-65) ; rnoveto(5*maxx/32,maxy-30); /*DIBUJA LAS FREC. LATERALES * / lineto(5*maxx/32,maxy-33); moveto(6*maxx/32,maxy-30) ; lineto(6*maxx/32,maxy-38); moveto(7*maxx/32,maxy-30) ; lineto(7*maxx/32,maxy-45) ; moveto(9*maxx/32,maxy-30) ; lineto(9*maxx/32,maxy-45) ; moveto(~0*maxx/32,maxy-30); lineto(lO*maxx/32,rnaxy-38); moveto(~~*maxx/32,maxy-30); lineto(~~*maxx/32,maxy-33); setcolor (15) ; moveto(maxx/2+20,maxy-30); / * DIBUJA EL EJE X DE LA GRAFICA 4 * / lineto(maxx-20,maxy-30) ; setcolor ( 1 4 ) ; rnoveto(3*maxx/4,maxy-30); /*DIBUJA LA PORTADORA DE LA GRAFICA 4 * / lineto(3*maxx/4,maxy-48); rnoveto(23*maxx/32,maxy-30); /*DIBUJA LAS FREC. LATERALES * /

lineto(23*maxx/32,maxy-43) ; rnoveto(25*maxx/32,maxy-30~; lineto(25*maxx/32,maxy-43) ; moveto(22*maxx/32,maxy-30) ; lineto(22*maxx/32,maxy-53) ; moveto(26*maxx/32,maxy-30); lineto(26*maxx/32,maxy-53) ; moveto(2~*maxx/32,maxy-30) ; lineto(21*maxx/32,maxy-39) ; moveto(27*maxx/32,maxy-30) ; lineto(27*maxx/32,maxy-39) ; moveto(20*maxx/32,maxy-30) ; lineto(20*maxx/32,maxy-35) ; moveto(28*maxx/32,maxy-30) ; lineto(28*maxx/32,maxy-35) ; moveto(~9*maxx/32,maxy-30) ; ~ineto(19*maxx/32,maxy-33); moveto(29*maxx/32,maxy-30) ; ~ineto(29*maxx/32,maxy-33); moveto(l8*maxx/32,maxy-30) ; lineto(l8*maxx/32,maxy-33); moveto (30*maxx/32,maxy-30) ; lineto(30*maxx/32,maxy-33) ; setcolor (15) ; outtextxy(maxx/8,maxy/2-60,r~m = 0.5"); 0uttextxy(maxx/8,maxy-60,~~m = 1.0") ; outtextxy(maxx/2+20,maxy/2-6O,"m = 2.5") ; outtextxy(maxx/2 +20,maxy-60,"m = 4.0"); outt-extxy (maxx/2 +40 , maxy/2 -6 , I1m = Indice de modulation" ) ; outtextxy(maxx/2 +40,maxy/2+8,I1La linea Central de cada 9rafica"); outtextxy (maxx/2 +40, maxy/2+18 , "es la portadora FC") ; setcolor ( 0 ) ; outtextxy(maxx/2-50,maxy-~~,~~Presionar cualquier tecla"); getch 0 ; closegraph ( 1 ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * ****** FUNCION DEL MENU1 ********* /

FUNCIONES PARA LOS MENUS EN PANTALLA

id menul(int 1,int t,int r,int b,char *analog,char *digita,char *salir,

{ int *Clint c1,int c2,int c3,int color)

int bufsize; char *tbuffer; bufsize = 2* (b-t +1) * (r-l+l) ; if ( (tbuffer= (char * ) malloc (bufsize) ) == NULL)

cputs ("error allocating buffer ; {

; if (!gettext(l,t,r,b,tbuffer))

{ cputs ("error salvando text") ; exit (1) ;

l window(l,t,r,b);

textbackground(co1or); clrscr ( ) ; textcolor (BLACK) ; gotoxy(2,2); cputs (analog) ; gotoxy(2,4) ; cputs (digital ; gotoxy(2,6); cputs (salir) ; do

{ *c = getch 0 ; *c = toupper(*c) ;

} while(*c ! = cl && *c ! = c2 && *c ! = c3);

if(!puttext(l,t,r,b,tbuffer)) {

1 cputs ( "error restoring text") ;

free (tbuffer) ;

********* FUNCION DE MENU 2 ************ / id menu2(int 1,int t,int r,int b,char *espacio,char *mens,

char *aux,char *an,char *di,char *sa, int *c,int c1,int c2,int c3,int c4,int colortint col21

{ int bufsize; char *tbuffer; bufsize = 2* (b-t +1) * (r-l+l) ; if ( (tbuffer= (char * ) malloc (bufsize) == NULL)

cputs ("error allocating buffer " 1 ; {

)exit ;

}exit ;

if(!gettext(l,t,r,b,tbuffer)) { cputs ("error salvando text") ;

window(l,t,r,b); textbackground (color) ; clrscr ( ) ; textcolor (col21 ; gotoxy(2,1); cputs (mens) ; gotoxy (2 I2) ; cputs (espacio) ; gotoxy(2,4) ; cputs (aux) ; gotoxy(2,5) ; cputs (di) ; gotoxy(2,6) ; cputs (an) ; gotoxy(2,7) ; cputs (sa) ;

do

{ *c = getcho ; *c = toupper(*c) ;

1 while(*c ! = cl && *c ! = c2 && *c ! = c3 && *c ! = c4);

if(!puttext(l,t,r,b,tbuffer)) {

1 cputs ( "error restoring text ;

1 free (tbuf f er) ;

. . . . . . . . . . . . . . . . . . . . . FmCION DE MENU3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id menu3(int 1,int t,int r,int b,char *A,char *B,char *C, char *D,char *E,char *F,char *G,int *c,int c1,int c2,int c3, int c4,int c5,int c6,int c7,int color,int ~012)

{ int bufsize; char *tbuffer; bufsize = 2* (b-t +1) * (r-l+l) ; if ( (tbuffer= (char * ) malloc (bufsize) ) == NULL)

cputs ("error allocating buffer 1 1 ) ; {

; if(!gettext(l,t,r,b,tbuffer))

{ cputs ("error salvando text") ;

; window(l,t,r,b); textbackground(co1or); clrscr ( 1 ; textcolor (col21 ; gotoxy(2,2); cputs (A) ; gotoxy (2 I 3 ) ; cputs (B) ; gotoxy(2,4) ; cputs (C) ; gotoxy(2,5) ;

gotoxy(2,6) ; cputs (DI ;

cputs (E) ;

gotoxy(2,8) ; cputs ( G ) ; do

{ *c = getch0 ; *c = toupper(*c) ;

1 while(*c!=cl&&*c!=c2&&*~!=~3&&*~!=~4 && *c!=c~ &&*c!=c~&&*c!=c~);

if (!puttext(l,t,r,b,tbuffer) {

I cputs ("error restoring text") ;

1 free (tbuffer) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA UNA ANIMACION

id animacion (void) { int i; char far *image; char buffer [801 ; unsigned numbytes; initgraph (&graphdriver, &graphmode, . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxyo ; setcolor (15) ; moveto(20,20) ; / * dibuja el escape de la nave * / lineto(20,32) ; lineto (30,29) ; lineto (30 23) ; lineto (20,20) ; setfillstyle (1,15) ; / * colorea la nave * / bar3d(69,23,95,29,1,0); setfillstyle (1,7) ; bar3d(20,23,30,29,1,0); for(i = l;i<=8;++i) putpixel (21+i, 26/14) ; setcolor ( C Y A N ) ; for(i=O;i<=24;++i)

{

1 {

1

putpixe1(69+i,30,7) ; putpixe1(69+i,31,15);

for(i=O;i<=22;++i)

putpixe1(69+iJ32,7) ; putpixe1(69+ir33,7);

for(i=O;i<=2O;++i)

for(i=O;i<=17;++i)

for(i=O;i<=14;++i)

for(i=O;i<=lO;++i)

for(i=O;i<=5;++i)

bar3d(30,10,67,40,1,0);/* dibuja el cuerpo de la nave * / moveto(70,lO) ; / * dibuja la cabeza de la nave * / lineto(90,18); lineto(95,23) ; lineto (95,29) ; lineto(90,34); lineto(70,40) ; line(95,26,98,26); numbytes = (unsigned int) imagesize ( O , O, 80,60) ; if ((image = (char far * ) malloc(numbytes)) == (char far *)NULL)

putpixe1(69+i,34,15) ;

putpixel (69+i,35,15) ;

putpixel (69+i, 36/15) ;

putpixe1(69+i,37,15);

putpixel (69+i,37,15) ;

{ closegraph ( ) ; exit ( O ) ;

1 get image(20 ,10 ,98 ,45 , image) ; cleardevice ( 1 ; for(i = O;ic= 1500;++i)

putpixel (random (maxx) , random (maxy) , random ( MAXCOLORS-1 ) +1) ; setfillstyle(SOL1D FILL,BLUE); / * color de la tierra * / fillellipse(maxx/2~maxy+5O,maxx/2,maxy/3); / * dibuja la tierra * / setfillstyle(SOL1D FILL,GREEN); / * color de la tierra * / fillellipse(7*maxx~24+30,maxy+90rmaxx/4,maxy/3); / * dibuja la tierra * / fillellipse(3*maxx/4,maxy+l35,maxx/6,maxx/6,maxy/3); / * dibuja la tierra * / setcolor (15) ; line(maxx/2-~5,maxy/3,maxx/2-5,maxy/3); l ine(maxx/2+5,maxy/3,maxx/2+~~,maxy/3); setfillstyle (1,3) ; bar3d(maxx/2+15,maxy/3-8,maxx/2+35,maxy/3+8,1,0); / * Dibuja las alas * / bar3d(maxx/2-35,maxy/3-8,maxx/2-15,maxy/3+8,1,0~; circle (maxx/2 , maxy/3 , 5 ) ; f loodf ill (maxx/2 , maxy/3 , 15) ; 1ine(maxx/4+10,3*maxy/4+30,maxx/4+10,3"maxy/4+15~;/* bases de antena * / l i n e ( m a x x / ~ + ~ ~ , ~ * m a x y / ~ + ~ ~ , m a x x / ~ + ~ ~ , ~ * m a x y / ~ + ~ ~ ~ ; ~ine(~*maxx/~-~0,3*maxy/~+~0,~*maxx/~-~0,~*maxy/~+~~~; ~ine(~*maxx/~-~~,3*maxy/~+15,3*maxx/~-~~,~*maxy/~+~~~; ellipse(maxx/4+14,3*maxy/4,185,315,15,15~; / * parabola de antena * / ellipse(3*maxx/4-14,3*maxy/4,240,360,15,15~; 1ine(maxx/4+12,3*maxy/4+8,maxx/4+10,3*maxy/4+12); /*punta de la antena * / 1ine(3*maxx/4-12,3*maxy/4+8,3kmaxx/4-10,3*maxy/4+12); / * punta de la anten settextstyle(1,HORIZ DIR,3); outtextxy(20,maxy/2-50, IICOMUNICACION ELECTRONICA" ) ; outtextxy(maxx/2+20,maxy-3O,~~presionar cualquier tecla"); i =O; while(!kbhit() 1 / * ciclo de movumiento de la nave y de la signal * /

{ i +=3; setcolor (14 ) ; moveto (maxx/4+12,3*maxy/4+8) ; lineto (maxx/2, maxy/3) ; lineto(3*maxx/4-10,3*maxy/4+12); if (i c = maxx)

{ putimage(i,lO,image,XOR - PUT); delay(l0) ; setcolor ( 0 ) ; moveto (maxx/4+12 , 3*maxy/4+8) ; lineto (maxx/2,maxy/3) ; lineto(3*maxx/4-10,3*maxy/4+12); put image ( i , 1 O , image , XOR-PUT) ;

} else

1 i=O ;

getch ( ) ; closegraph ( ) ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION QUE DIBUJA UN MARCO DE LA SENAL PARA LAS GRAFICAS * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

)id marco (void) {

setcolor (14) ; setlinestyle(O,Ox3ff,3) ; moveto(2,2); lineto(2,maxy-2) ; moveto(5,2); lineto(5,maxy-2); moveto(maxx-2,2) ; lineto(maxx-2,maxy-2); moveto (maxx-5, 2) ; lineto(maxx-5,maxy-2) ; moveto(6,3); lineto (ma~x-6~3) ; moveto (6,6) ; lineto (maxx-6,6) ; moveto (6,9) ; lineto(maxx-6,9) ; moveto(6,maxy-3) ; lineto(maxx-5,maxy-3); moveto(6,maxy-6); lineto(maxx-5,maxy-6) ; moveto (6, maxy-9) ; lineto(maxx-5,maxy-9) ; setlinestyle ( O , Ox3ff, 1 ) ;

id mensaje (void)

clrscr ( ) ; gotoxy(4,lO) ; printf("Este programa fue hecho empleando el compilador C++, version 1.0" gotoxy (4 / 11) ; printf("en una PC compatible con monitor VGA,cuya resolucion es de 640x480" gotoxy (4 / 12) ; printf("por lo cual es recomendable utilizar un monitor de la misma gotoxy (4,13) ; printf("capacidad,de lo contrario habra errores de visualizacion"); gotoxy(40,18); printf ( "presionar cualquier tecla. . . 1 ; gotoxy(68,18) ; getch ( ) ;

{

1 *-A-********* FTJ&JCION DE MENSAJE 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id mensage2 (void) {

unsigned numbytes; initgraph ( &graphdriver, &graphmode , 'I . . \\bgi" ) ; Errorcode = graphresult ( 1 ; if (Errorcode ! = grOk)

1 printf ("Error en el sitema de graficos I ! ) ; exit (1) ;

settextstyle (3,HORIZ DIR,3) ; outtextxy(20,40, IIMODÜLACION : I ! ) ; settextstyle (3 , HORIZ DIR, 3) ; outtextxy(maxx/4+20,60, "MODULACION ANALOGICAII) ; settextstyle (3 , HORIZ DIR, 3) ; outtextxy(maxx/4+20,80, "MODULACION DIGITAL1') ; settextstyle (1,HORIZ DIR, 1) ; outtextxy(20,maxy/2,~~El programa contiene graficas en tiempo y en frecuenc settextstyle (1,HORIZ DIR. 1) :

-

outtextxy<20,maxy/2+ZO,"Tambien contiene la introduccion teorica de cad settextstyle (1,HORIZ DIR, 1) ;

, P .

outtextxy(20,maxy/2+~0, "tipo de modulacion . ; settextstyle (0,HORIZ DIR, 1) ; outtextxy(maxx/2,maxy-40,"PRESIONAR CUALQUIER TECLA....!!); getch ( ) ; closegraph ( 1 ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE ANALISIS DIGITAL

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id digital ( 1

do {

enu3(20,10,53,18,espacio,ask,fsk,psk,qpsk,qpsk,teo,salir, &c,65,70,80,81,81,69,27,15,0); switch (c)

{ case 69 : TE0 DIG(); / * Teoria de Mod. digital * /

case 65 : mod ask(); / * Modulaion ASK * /

case 70 : mod fsk0; / * Modulaion FSK * /

case 8 0 : mod psk 0 ; / * Modulaion PSK * /

case 81 : mod qpsk0; / * Modulaion QPSK * /

case 27 : c = 77;

break;

break;

break ;

break ;

break ;

break;

1 1

1 while (c ! = 77) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE MODULACION DIGITAL ASK

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . eoid mod - ask(void)

do

menu2(20,10,53,18,espacio~dask,graf tie,teo,graf frec,salir,

switch (c)

- &c,69,70,27,84,1,14); -

I case 84 : m ” d ask() ; / * grafica en tiempo * /

case 69 : teo ask0;

case 7 0 :G F-ASK(); / * grafica en frecuencia * /

case 27 : c = 27;

break;

break;

break;

break;

-

-

while (c ! =27) ; 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE MODULACION DIGITAL FSK

id mod - fsk(void)

do {

m e n u 2 ( 2 0 , 1 0 , 5 3 , 1 8 , e s p a c i o , d f s k , g r a f tie,teo,graf frec,salir,

switch (c)

- - &c,69,70,27,84,1,14);

{ case 84 : G T FSK(); / * grafica en tiempo * /

case 69 : teo fsk0;

case 70 :ES FSK(); / * grafica en frecuencia * /

case 27 : c = 27;

break;

break;

break;

break;

-

-

1 1

while (c ! =27) ; 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE MODULACION DIGITAL PSK

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id mod - psk(void)

do { menu2(20,10t53,18,espacio,dpsk,graf tie,teo,graf frec,salir,

switch (c)

- &c,69,70,27,84,1,14);

-

{ case 84 : g-t-psko; / * grafica en tiempo * / case 69 : TE0 PSKO ;

case 70 :g-f_psk(); / * grafica en frecuencia * /

case 27 : c = 27;

break;

break;

break ;

-

break;

1 1

1 while (c ! =27) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE MODULACION DIGITAL QPSK

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id mod - qpsk(void)

case 71 : g-t-qpsko; / * grafica en tiempo * / break;

case 69 : TE0 QPSKO; break;

case 27 : c = 27; break;

-

1 1

while (c ! =27) ; 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FUNCION QUE DIBUJA LA SENAL DE ASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id m d ask(void) { "

initgraph ( &graphdriver , &graphmode , . . \\bgi" ) ; maxx = getmaxx ( ) ; maxy = getmaxy ( 1 ;

marco ( 1 ; moveto(30,maxy/2) ; setcolor (14) ; m fsk(&k,5,30,0,1080,14); m fsk(&k,10,0,0,720,14); m fsk(&k,5,30,0,1080,14); m fsk(&k,10,0,0,720,14); m fsk(&k,5,30,0,1080,14); setcolor (15) ; outtextxy(30,30,"Modulacion ASK " ) :

k = 30;

- - - -

I .

outtextxy(maxx/2+10,maxy-5O,~~Donde hay signal equivale a ill); outtextxy(maxx/2+10,maxy-4O,~~Ausencia de signal equivale a Oil); setcolor ( 0 ) ; outtextxy(maxx/2-30,maxy-lO,~~PRESIONAR CUALQUIER TECLA"); getch 0 ; closegraph ( ) ;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 'ARTE DE LA FUNCION DE ASK

roid m fsk(int *k,int A,int B,int ang1,int ang2,int color) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ -

double y1 , x1 ; int x,y; setcolor (color) ; for(ang1 = O.O;angl<=ang2;angl += 1 0 . 0 )

{ y1 = B*sin(angl/RAD) ; x1 = A*angl/RAD ; x = (int)xl + *k; y = maxy/2- (int)yl; lineto (x, y) ;

}

}*k = x; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA EL ESPECTRO DE LA SENAL ASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id G F ASK(void) { "

int ind, cont; initgraph(&graphdriver, &graphmode, ' I . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; moveto(20,maxy/2-20); / * Dibuja el eje y de la grafica * / lineto(20,maxy/8) ; moveto(20,maxy/2-20) ; lineto(maxx-30,maxy/2-20); / * DIBUJA EL EJE X DE LA la GRAFICA*/ setcolor (14) ; moveto(maxx/2-2,maxy/2-19); /*Dibuja el pulso de la grafica * / lineto(maxx/2-2,3*maxy/8-3); moveto(maxx/2-6,3*maxy/8-3); / * Dibuja la flecha * / lineto(maxx/2+2,3*maxy/8-3); lineto(maxx/2-2,3*maxy/8-9) ; lineto(maxx/2-6,3*maxy/8-3); ask no P O ; setcolor (15) ; outtextxy(maxx/2+40,maxy/2-8, "Wc+Wb") ; outtextxy(maxx/2-80,maxy/2-8, "Wc-Wb") ; outtextxy(maxx-20,maxy/2-23, "w") ; outtextxy(20,maxy/8-10, "F(w) I t ) ; outtextxy(maxx/2-2,maxy/2-8, IrWc") ; outtextxy(20,maxy/2-8, I l O l l ) ; outtextxy(maxx/4,maxy/2+3O,~~Espectro de potencia de una signal ASK"); setcolor (O ) ; outtextxy (maxx/2 , maxy-10 , "Presionar cualquier tecla") ; getch ( ) ; closegraph ( ) ;

1 * * * * * * * FUNCION QUE AYUDA A GRAFICAR EL ESPECTRO DE ASK **************** /

'id ask no p(void) { "

double y1 , xl; int i,y2,y; setcolor (14 ) ; moveto(97+maxx/8,maxy/2-28); for(i=180;ic=720;i += 10.0)

{

y1 = (30*sin(i/RAD) - 20*cos RAD) ) /I. 5; x1 =(int)30*i/RAD +maxx/8 +3; y = maxy/2- (int)yl-38; lineto (x1 , y) ; if (i==340 1 I i==560)

{

1 l i n e ( x ~ , m a x y / 2 - ~ 5 , x ~ , m a x y / 2 - 2 2 ) ; l i n e ( x ~ , m a x y / 2 - ~ 5 , x ~ , m a x y / 2 - 2 2 ) ;

1 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA LA SENAL DE FSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id G T FSK(void) c "

. . . . . . . . . . . . . . . . . . . . . . . . . . . . ARTE DE LA FUNCION DE FSK

oid aux-fsk(int *k,int A,int ang1,int ang2,int color) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ double y1 , x1 ; int x,y; setcolor (color) ; for(ang1 = O.O;angl<=ang2;angl += 10.0)

{ y1 = 30*sin (angl/RAD) ; x1 = A*angl/RAD ; x = (int)xl + *k; y = maxy/2- (int) yl; lineto (x,y) ;

}

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA EL ESPECTRO DE LA SENAL FSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id ES FSK(void) -

int ind,cont; initgraph (&graphdriver, &graphmode, I r . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ; setcolor (15) ; moveto(20,maxy/2-40) ; lineto(maxx-3O,maxy/2-40); / * DIBUJA EL EJE X DE LA GRAFICA*/ moveto(20,40) ; lineto(2Orrnaxy/2-40); / * DIBUJA EL EJE Y DE LA GRAFICA*/ moveto(maxx/2-35,maxy/2-40) ; lineto(maxx/2-35,maxy/2-45) ; moveto (maxx/2+87,maxy/2-40) ; lineto (maxx/2+87,maxy/2-45) ; outtextxy(20,maxy/2-30, I ! ) ; outtextxy(maxx-20,maxy/2-40, llw") ; outtextxy(20,30, "F(w) ' I ) ; outtextxy(2o,max~/2+6O,~~Dencidad espectral de una signal FSK " 1 ; outtextxy(20,maxy/2+80, IIWco es la frecuencia baja") ; outtextxy(20,maxy/2+~0~, I1Wco es la frecuencia alta") ; outtextxy(rnaxx/2-35,maxy/2-30, "Wco ; outtextxy(maxx/2+75,rnaxy/2-30, "Wcl ' I ) ; outtextxy (maxx/2+10 , maxy/2 , "BW = 4Wb" ) ; AUX FSK ( 1 ; -

setcolor ( O ) ;

closegraph ( 1 ;

** * * * * * * * * * FUNCION QUE AUXILIA A LA GRAFICA ESPECTRAL FSK ******** / oid AUX FSK(void) -

double y1 , x1 ; int i , y2, y; setcolor (14 ) ;

moveto(140,maxy/2-43) ; for(i=180;i<=580;i += 10.0)

{ y1 = (30*sin (i/RAD) - 20*cos (2*i/F!AD) ) /l. 5; x1 = (int) 3O*i/F¿AD-maxx/8; y = maxy/2- (intlyl-58; lineto (x1+127,y) ; if ( i==580)

{

}

setcolor (15) ; line(x~,maxy/2,x~,maxy/2-35);

1

{

moveto(maxx/2+~5,maxy/2-40) ; for(i=320;i<=720;i += 5.0)

setcolor (14) ;

y1 = (30*sin (i/RAD) - 20*cos (2*i/RAD) ) /l. 5; x1 = (int) 30*i/RAD+maxx/2-maxx/8; y = maxy/2- (int)yl-58; lineto(xl-70,y) ; if ( i==435)

{ setcolor (15) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE LA GRAFICA EN TIEMPO DE PSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id g t psk(void) { "

initgraph(&graphdriver, &graphmode, .\\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; marco ( ) ;

moveto(30,maxy/2) ; au " t psk(&k,5,30,0,1440,14); au_t_psk(&k,5, -30,0,1440,14) ; au t psk(&k,5,30,0,1440,14); au t_psk(&k,5,-30,0,1440,14); au-t psk(&k,5,30,0,1440,14); setcolor (15) ; outtextxy (30 , 30 , IIModulacion P S K ' I ) ; outtextxy(maxx/2+~0,maxy-50,~~ f (t) equivale a 1 I ! ) ; outtextxy(maxx/2+~0,maxy-40,~~-f (t) equivale a 01,) ; setcolor ( O ) ; outtextxy(maxx/2-30,maxy-l0, "PRESIONAR CUALQUIER TECLA") ; getch ( ) ; closegraph ( 1 ;

k = 30;

- _

"

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . ARTE DE LA GRAFICA EN TIEMPO DE PSK

oid au t_psk(int *k,int A,int B,int ang1,int ang2,int color) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

{ -

double y1 I x1 ; int x,y; setcolor (color) ; for(ang1 = O.O;anglc=ang2;angl += 10.0)

{ y1 = B*sin(angl/RAD) ; x1 = A*angl/RAD ; x = (intlxl + *k; y = maxy/2- (intlyl; lineto (x, y) ;

1 *k = X;

1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION QUE DIBUJA EL ESPECTRO DE LA SENAL PSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id g-f - psk (void)

int ind, cont; initgraph ( &graphdriver , &graphmode , Ir . . \\bgi I!) ; maxx = getmaxx ( ) ; maxy = getmaxy ( 1 ; marco ( ) ; setcolor (15) ; moveto (maxx/2 , 6 0 ) ; lineto(maxx/2,maxy/2.0-19); /*DIBUJA EL EJE Y DE LA la GRAFICA * / moveto(20,maxy/2-20) ; lineto(maxx-2O,maxy/2-20); / * DIBUJA EL EJE X DE LA la GRAFICA*/ moveto(maxx/2,maxy/2+60~; lineto(maxx/2,maxy-40) ; /*DIBUJA EL EJE Y DE LA 2a GRAFICA * / moveto(20,maxy-40) ; lineto(maxx-2O,maxy-40); / * DIBUJA EL EJE X DE LA 2a GRAFICA*/ psk auxf 0 ; setcolor (15) ; moveto(3*maxx/4-5,maxy-40) ; lineto(3*maxx/4-5,maxy-45) ; moveto(maxx/4-3,maxy-40) ; lineto(maxx/4-3,maxy-45) ; outtextxy(3O,ma~y/2+1O,~~Wo es la frecuencia de la portadorall); outtextxy(3*maxx/4-8,maxy-36, IIWo") ; outtextxy(maxx/4-8,maxy-36, I1-Wo") ; outtextxy(30,30, "Espectro de potencia PSK") ; outtextxy(maxx-20,maxy/2-19, llw") ; outtextxy(maxx-20,maxy-40r l1w1I) ; outtextxy(maxx/2-3,50, " F ( w ) ' I ) ; outtextxy(maxx/2-2,maxy/2-1~,~~~~0 ; outtextxy(maxx/2-15,maxy/2+50, "Fpsk(w) ' I ) ; outtextxy(maxx/2-2,rnaxy-35,"0") ; outtextxy(maxx/2+25,maxy/4-20, IIPotencia de dencidad espectral") ; outtextxy(maxx/2+25,maxy/4-10, "de la funcion binaria") ; outtextxy(maxx/2+25,3*rna~y/4-2O,~~Potencia de dencidad espectral"); outtextxy(maxx/2+25,3*maxy/4-10, "de PSK'I) ; outtextxy(maxx/4-80,maxy-30, "-Wo-Wb") ; outtextxy(rnaxx/4+50,maxy-30, "-Wo+Wb") ; outtextxy(3*maxx/4-70rmaxy-30, "Wo-Wb") ; outtextxy(3*maxx/4+40,maxy-30r flWo+Wbll) ; setcolor ( 0 ) ; outtextxy (maxx/2 , maxy-10 , IIPresionar cualquier tecla") ; getch ( 1 ; closegraph ( 1 ;

1 id

I psk auxf (void) -

double y1 , x1 ; int i,y2,y; setcolor (14) ; moveto(97+maxx/8,maxy/2-28) ; for(i=180;ic=720;i += 10.0)

{ y1 = (30*sin(i/~~~) - ~O*COS(~*~/RAD))/~S; x1 =(int)30*i/RAD +maxx/8 +3; y = maxy/2- (int)yl-38; lineto (x1 , y) ;

moveto(20,maxy-40); for(i=180;ic=720;i += 10.0)

{ setcolor (14 ) ; y1 = (30*sin(i/~~~) - ~O*COS(~*~/RAD) /IS; x1 = (int) 30*i,/RAD-maxx/8; y = maxy- (int)yl-58; lineto (x1 y) ; if (i==320)

{ setcolor (15) ; line(x1+10,maxy-40,~1+10,maxy-50); line(x1+125,maxy-40,xl+125,maxy-50);

1

{

}

moveto(maxx/2+20,maxy-40) ; for(i=180;ic=720;i += 10.0)

setcolor (14 ) ; y1 = (30*sin(i/w) - ~o*cos(~*~/RAD) )/IS; x1 =(int)30*i/RAD+maxx/2-maxx/8; y = maxy- (int)yl-58; lineto (x1 , y) ; if (i==320)

{ setcolor (15) ; line(x~+10,maxy-40,x1+10,maxy-50) ; line(x1+125,maxy-40,x1+125,maxy-50~;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REPRESENTACION GEOMETRICA DE QPSK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id g t qpsk(void) { "

initgraph (&graphdriver, &graphmode, ' I . . \\bgi") ; maxx = getmaxx ( 1 ; maxy = getmaxy ( ) ; marco ( ) ; setcolor ( 3 ) ; outtextxy(30,30,"(Ps) es la amplitud de la signal I t ) ;

outtextxy(30,40, IIb equivale al bit impar ; outte~txy(30,50,~~bl equivale al bit par I f ) ;

setcolor (15) ; outtextxy(maxx/2,maxy/4-2~,~~-~Ps)sen(Wot~11); outtextxy(maxx/2,3*maxy/4+~~,~~ (Ps)sen(Wot) 1 1 ) ; outtextxy(30rmaxy/2, ' I - (Ps) cos (Wot) ; outtextxy(40,maxy/4,I1b = - , I 1 ) ; outtextxy(40,maxy/4+10, "bl = - 1 I l ) ; outtextxy(40,3*maxy/4,"b = , I 1 ) ;

outtextxy(40,3*maxy/4+10,"bl = -1,') ; outtextxy(3*maxx/4+2O,maxy/4, "b = - l 1 I ) ; outtextxy(3*maxx/4+20,maxy/4+10, "bl = - , I f ) ; outtextxy(3*maxx/4+20,3*maxy/4,~~b = , I 1 ) ;

outtextxy(3*maxx/4+20r3*maxy/4+10, "bl = , I 1 ) ; outtextxy(3*maxx/4+2~,maxy/2, (Ps)cos(Wot) ;

moveto(maxx/2,3*maxy/4); / * Dibuja el eje y * / lineto(maxx/2,maxy/4) ; moveto(maxx/2-4,maxy/4); / * Dibuja la flechita * / lineto (maxx/2+4 , maxy/4) ; lineto(maxx/2,maxy/4-8) ; lineto(maxx/2-4,maxy/4) ; moveto(maxx/4,maxy/2); / * Dibuja el eje x * / lineto(3*maxx/4,maxy/2) ; moveto(3*maxx/4,maxy/2-4) ; / * Dibuja la flechita * / lineto(3*maxx/4,maxy/2+4) ; lineto(3*maxx/4+8,maxy/2); lineto(3*maxx/4,maxy/2-4); setcolor (14) ; moveto(maxx/4,3*maxy/4); lineto(3*maxx/4,maxy/4) ; moveto(maxx/4-2,3*maxy/4-2); / * Dibuja flecha inferior izq. * / lineto (maxx/4+2,3*maxy/4+2) ; lineto(maxx/4-4,3*maxy/4+4); lineto(maxx/4-2,3*maxy/4-2); moveto(maxx/4-2,maxy/4+2); / * Dibuja flecha superio izq. * / lineto(maxx/4+2,maxy/4-2); lineto(maxx/4-4,maxy/4-4); lineto(maxx/4-2,maxy/4+2); moveto(3*maxx/4-2,maxy/4-2); / * Dibuja flecha superio der. * / lineto(3*maxx/4+2,maxy/4+2) ; lineto(3*maxx/4+4,maxy/4-4) ; lineto(3*maxx/4-2,maxy/4-2); moveto(3*maxx/4+2,3*maxy/4-2); / * Dibuja flecha inferior der. * / lineto(3*maxx/4-2,3*maxy/4+2); lineto(3*maxx/4+4,3*maxy/4+4); lineto(3*maxx/4+2,3*maxy/4-2); moveto (maxx/4 , maxy/4) ; / * Dibuja el eje diagonal derecho * / lineto(3*maxx/4,3*maxy/4); setcolor (10) ; outtextxy (maxx/2 , maxy-10, "Presionar cualquier tecla I ! ) ; setcolor ( O ) ; outtextxy (maxx/2 , maxy-10 , "presionar cualquier tecla" 1 ; getch ( 1 ; closegraph ( ) ;

1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCIONES DE TODAS LAS TEORIAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

initgraph (&graphdriver, &graphmode, ' l . - \\bgi" ) ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt med =maxy/2; marco ( 1 ; setcolor (15) ; .ttextxy (50 , 40 , llINTRODUCCION TEORICA DE LA MODULACION AM : ; .ttextxy(50,80,11En genara1,la modulacion es proceso por el cual una propiedad o .ttextxy(50,100,11metro de cualquier senal, se hace variar en forma proporcional

tte~txy(50,120,~~gunda senal, el tipo de dependencia se determina con la forma tte~txy(50,140,~~cion empleada.En la modulacion de Amplitud,se hace variar la a tte~txy(50,160,~~una senal senoidal, con frecuencia y fase constantesfen propor tte~txy(50,180,~~senal dada.Este proceso altera la senal trasladando sus compon ttextxy(50,200, "frecuencia a frecuencias mas altas.") ; tte~txy(50,230,~~De este modo, la comunicacion que utiliza modulacion para desp tte~txy(50,250,~~espectro de frecuencia de una senal, se conoce como comunicaci ttext~y(50~270,"tadora.Dependiendo de la aplicacion que se lleve a cabo,la Mod ttextxy(50,290,r1AM se clasifica en las siguientes modalidades : Doble Banda L ttextxy(50,31O,l1Portadora Suprimida (DBLPS),Gran Portadora (AM),Banda Lateral tte~txy(50,330,~~Banda Lateral Residual (BLR).El ancho de banda su principal va tcolor (O) ; ttextxy(maxx/2,maxy-~Or "Presionar una tecla") ; tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE DOBLE BANDA LATERAL DE AM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id t " db la(void)

initgraph (&graphdriver, &graphmode, U . . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt med =maxy/2; marco ( ) ; setcolor (15) ; ttext~y(40,35,~~M0DULACION EN AM:DOBLE BANDA LATERAL CON PORTADORA SUPRIMIDA (D ttext~y(40~60,~~La modulacion de amplitud con portadora suprimida,proporciona u tte~txy(40,80,~~conveniente de transmitir informacion.El procedimiento es como ttextxy(40,100,11La amplitud de la portadora no modulada se hace variar en prop ttext~y(40,12O,~'la signal de banda base (o moduladora).La frecuencia y la fase tte~txy(40,140,~~tienen constantes. La modulacion de amplitud traslada el espec tte~txy(40~160,~~frecuencia de una signal en PWc rad/s,pero deja inalterada su ttextxy(40,180," Este tipo de modulacion de amplitud se llama de portadora su ttextxy(40,200,11porque la densidad espectral de la signal modulada no presenta ttextxy(40,220,"tadora identificable,aunque el espectro se centre en la frecue tte~txy(40,240,~~ A continuacion se describen algunas relaciones matematicas i tte~txy(40,260,~~tes concernientes a la modulacion DBLPS:"); ttextxy(90,282, lIú(t) = f (t) *Cos Wct ; Representa una signal modulada en ttext~y(40,302,~!Donde Cos Wc*t es la signal portadora ; y f(t) la signal modul tte~txy(55,325,~~6(w) = 1/2*F(W + Wc) + 1/2*F(W - Wc) ; Espectro de la signal m tte~txy(40,345,~~De la anterior relacion y de su respectiva grafica en frecuenc tte~txy(40,365,~~que el contenido de frecuencia tanto negativo como positivo de ttextxy(40,385,I1parece como frecuencias positivas.Esto implica que el ANCHO DE ttextxy(40,405,"f(t) SE DUPLICA cuando se emplea este tipo de modulacion de am ttextxy(4O,425,l1contenido espectral de frecuencias positivas por encima de Wc tte~txy(40,445,~~banda lateral superior,^ por debajolbanda lateral inferior de tcolor (BLACK) ; ttextxy(maxx/2 I maxy-10 I "Press any key to continue") ; tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE BANDA LATERAL UNICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lid t "- b 1 u(void)

initgraph(&graphdriver, &graphmode, I r . . \\bgi") ; maxx = getmaxx 0 ; maxy = getmaxy ( ) ; punt-med =maxy/2; marco ( ) ; setcolor (15) ; ttextxy(50,40, "MODULACION EN AMPL1TUD:BANDA LATERAL UNICA (BLU) ' I ) ; tte~txy(50,80,~~Es un esquema de modulacion en el cual, se transmite solo una d tte~txy(50,100,~~bandas laterales denominadas,banda lateral superior (BLS) ,y la ttextxy(50,120,11tera1 inferior (BLI),que se originan al modular una signal en ttextxy(50,140,"de cualquiera de ellas contiene la informacion completa, de la ttextxy(50,16Orf1banda base. Lo mas importante de este tipo de modulacion es qu tte~txy(50,180,~~quiere de la mitad del ancho de banda de una signal(DBL1 . ; ttextxy(50,200,*1La signal original podra recuperarse de nuevo,a partir de cual tte~txy(50,220,~~par de bandas laterales, por medio de una traslacion de frecue ttextxy(50,240,1'cuada,como lo sugieren las relaciones matematicas y sus grafic ttext~y(50,26O,~lpondientes,que a continuacion se describen. I ! ) ;

ttextxy(50,280,l1Aunque l o s siguientes resultados provienen del caso senoida1,s ttextxy(50,30Or1Ipara un caso mas genera1,por la que puede escribirse : I 1 ) ;

ttextxy(50,325, ú(t) = f(t) *COS wc*t p Hf (t)*sen Wc*t ; f (t) es e1 me tte~txy(50,345,~'Hf (t) es la transformada de Hilbert de f (t) ,Ú(t) es la signa ttextxy(50,370," 6 ( w ) = M+ (W - Wc) + M- (W + Wc) ;es el espectro de Ú ttextxy(50,390,1rUna de las ventajas que presenta este tipo de modulacion con r ttextxy(50,410,"la modulacion AM (comercial),es que el desvanecimiento selecti ttextxy(50,430,"nos severo.Il); tcolor (BLACK) ; ttextxy(maxx/2,maxy-~O, "Press any key to continue") ; tch0 ; osegraph ( 1 ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE BLR

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id t b 1 R(void)

initgraph (&graphdriver, &graphmode, . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt-med =maxy/2; marco ( ) ; tcolor (15) ; ttext~y(50,40,~~M0DULACION EN AMPL1TUD:BANDA LATERAL RESIDUAL (BLR)"); tte~txy(50~80,~~Un sistema de banda lateral residual es un compromiso entre la ttext~y(50,10O,~lBLU. Hereda las ventajas de ambos esquemas de modulacion, pero ttext~y(50,12O,~~inconvenientes.Las signals BLR son relativamente faciles de ge ttextxy(50,140,11mismo tiempo, su ancho de banda es tipicamente 25% mayor que tte~txy(50,160,~lEn BLR,en lugar de rechasar por completo una banda lateral com ttextxy(50,180,~~con BLU,se acepta un corte gradual de una banda latera1,como 1 tte~txy(50,200,~~su espectro,la caracteristica de atenuacion del filtro es tal tte~txy(50~220,"presion parcial de la banda lateral transmitida en la vecindad ttextxy(50r240,"tadora,se compensa exactamente por la transmicion parcial de 1 ttextxy(50,26Orf1rrespondiente,de la banda leteral que se suprime.Devido a lo a tte~txy(50,280,~~signal de banda base se puede recuperar exactamente por medio tte~txy(50,300,~~tector sincronizado.En seguida define una exprecion para la si .ttextxy(50,325, ú(t) = f(t) *cos Wc*t p Hf(t) *Sen Wc*t ; f(t) es el me .ttextxy(50,345,"Hf (t) es una funcion de transformacion ,Ú(t) es la signal mod .ttextxy(50,370," 6(w) = [ 1/2*{ M(W - Wc) + M(W + Wc) } l*Hv(w) ;es el espectr .ttextxy(50,390,I1La modulacion de banda lateral residual se usa provechosamente

-"

ttextxy(50,410,"cion de video de los sistemas de television publicos,por su co ttext~y(50,430,~lahorro en ancho de banda.") ; tcolor (BLACK) ; ttextxy(maxx/2,maxy-10,"Press any key to continuell); tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE AM COMERCIAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id t am corn "

(void)

initgraph( &graphdriver, &graphmode, . \\bgi") ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt-med =maxy/2; marco ( ) ; tcolor (15) ; ttextxy(50,40,t~INTRODUCCION TEORICA DE LA MODULACION AM : AM COMERCIAL"); tte~txy(50~80,~~Es un esquema de modulacion de Doble Banda Lateral con Portador ttext~y(50,10O,~~mida,a diferncia del otro esquema de modulacion en AM que llev tte~txy(50,120,~~mo nombrereste tipo de modulacion incorpora una signal portado tte~txy(50,140,~lparte de la signal transmitida y en el mismo ancho espectral d tte~txy(50,160,~~nal deseadareliminando de esta forma la necesidad de generar u tte~txy(50,180,~~portadora en el receptor.De hecho es conveniente hacer que la ttextxy(50,20Or"de este termino portador sea mayor que cualquier otra porcion ttextxy(50,220rt1sidad espectral de la signal.Este tipo de modulacion es el que ttextxy(50,240,"za en difusion comercia1,para el cual existen una mayoria de r ttext~y(50,260,~~mas simples y baratos,~ cuenta con un solo transmisor mas caro ttextxy(50,280r"cado.Ademas de esto para las signals de audio,no se requiere u ttextxy(50,300,"ta de frecuencia cero.Asi,en sistemas que no requieren respues ttextxy(50,320,"cuencia ,se puede situar un termino portador grande en Wc."); ttextxy(50,340," A continuacion se describe matematicamente una signal modulad ttextxy(50,365,I1 Ú(t) = [A + f (t)]*Cos Wc*t ; f (t) signal moduladora ttextxy(50,385,ItLa densidad espectral de Ú(t) es : I t ) ;

ttextxy(50,408," b(w) = 1/2*[ F(W + Wc) + F(W - Wc) 1 + D*A*[ g(W + Wc) + g(W ttextxy(maxx/2+100,maxy-30, Continua en seguida > > I 1 ) ; tcolor (BLACK) ; ttextxy(maxx/2,maxy-10,"Press any key to continuell); tch0 ; eardevice ( 1 ; rco0 ; tcolor (15) ; ttextxy(50,70,1t[A + f (t)] es la envolvente de la signal modulada Ú(t) ,siempre ttextxy(50,90, "envolvente sea moyor que cero ([A + f ( t ) J > O para toda t) ,la r ttextxy (50,110, "de f (t) a partir de U(t) se reduce simplemente a deteccion de ttextxy(50,130,"Para lograr lo anterior A debe ser suficientemente grande para ttextxy(50,15Or"A + f(t) sea positiva para toda t. A continuacion se realiza u tte~txy(50~170,"para el caso senoida1,para una mejor comprension de los concep ttextxy(50,190, A + f (t) > O para toda t ; entonces A -f (tlminimo ttextxy(50,210, i = -f(t)/A cantidad que representa el indice de modulac .ttextxy(50,23Orv1 i p 1 Es la condicion que se requiere para la demodulacio .ttextxy(50,250,1tda de AM mediante un detector de envolvente.Si 4 > 1 entonces .ttextxy(50,270,Itpodra ser recuperada por el metodo de deteccion de envolvente. .ttextxy(50,290,I1que utilizar demodulacion sincronizada,ya que existe sobremodu .ttextxy(50,310,11 Otro parametro importante a considerar es el porcentaje de PO .ttextxy(50,330, "tal que transportan las bandas laterales : S = ( f>>/2+1>>) *loo%

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION DE TEORIA CON INDICE MAYOR A UNO AM COMERCIAL EN TONO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id t i ma l(void) " -

initgraph (&graphdriver , &graphmode , . . \\bgirl ) ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt-med =maxy/2;

rco0; tcolor (15) ; tte~txy(50,40,~~TEORIA DE LA MODULACION AM : INDICE DE MODULACION MAYOR QUE UNO ttextxy(50,80," El analisis que a continuacion se realizales para el caso seno tte~txy(50,100,~~La relacion matematica que a continuacion se presenta es la de ttextxy(50,120, "rial modulada en AM : ttextxy ( 5 0 , 145 , Ú(t) = [A + f (t)] * COS Wc*t tte~txy(50~165,~~ Si A no es bastante grande, la envolvente de Ú(t) no es propo tte~txy(50,185,~~f (t) ,y no se cumple la condicion [A + f (t)] 0,es fundamental tte~txy(50~205,~~desigualdad se cumpla en todo momento,de no ser asi f(t) no pu ttextxy(50,225,"recobrada por el simple proceso de deteccion de la envolvente. ttextxy(50,245,11 El indice de modulacion se define como : i = -f( ttext~y(50,265,~lEntonces la condicion que se requiere para la demodulacion ade tte~txy(50~285,~~AM (comercial),mediante la deteccion de envolvente es: i p 1. ttextxy(50,3O5,l1 Para i > 1 existe una sobremodulacion.Sin embargotla demodula ttextxy(50,325,I1crona demodulara en forma correcta la signal modulada.Recordan ttextxy(50,345,11demodulacion sincrona se puede utilizar para cualquier valor d ttextxy(50,365," Como conclucion podemos decir que para modulacion senoida1,se tte~txy(50~385,~lque : O f o p 1 . I ! ) ; tcolor (BLACK) ; ttextxy(maxx/2,maxy-10, "Press any key to continuerr) ; tch0 ; osegraph ( 1 ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE FM

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 'id teo - fm(void)

initgraph ( &graphdriver , &graphmode , . . \\bgi ) ; maxx = getmaxx ( ) ; maxy = getmaxy ( ) ; punt - med =maxy/2;

marco ( 1 ; setcolor (15) ; ttext~y(37,40,~~1NTRODUCC1ON TEORICA DE LA MODULACION FM : I 1 ) ;

ttext~y(37,80,~ILa modulacion de FM al igual que la de A M , es una modulacion an tte~txy(37,100,~~o,de onda continua.Una onda senoidal se describe mediante tres ttextxy(37,120,I1tros que son amplitud,frecuencia y fase,en la modulacion en fr tte~txy(37,140,~~lo que se hace,es variar la frecuencia en proporcion a la sign tte~txy(37,160,~'ladora m(t).Esto significa que la frecuencia de la portadora v ttext~y(37,18O,~lando continuamente a cada instante. I ! ) ;

ttextxy(37,200,I1Por lo tanto,podemos aprovechar esta peculiar caracteristica p ttextxy(37,220rt1nsmitir informacion,haciendo variar la frecuencia de la portad tte~txy(37,240,~les sabido por todos,en una signal modulada en frecuencia,la in ttextxy(37,260,I1reside en la frecuencia instantanea,como se indica a continuac ttext~y(80,285,~IWi = Wc*t + Kf*m(t). Donde Kf es la constante de modulacio ttextxy(37,310,11A diferencia de la modulacion de A M , la modulacion en FM es un ttext~y(37,330,~~no 1ineal.Esto quiere decir que el principio de superposicion ttextxy(37,350,I1ca,e1 ancho de banda de la signal modulada es mucho mayor que ttextxy(37,370,I1del ancho de banda del mensaje,las componentes del espectro de tte~txy(37,39O,~~modulada,no se relacionadas en forma simple con el espectro de tte~txy(37~410,~~Otra caracteristica importante de la signal modula en frecuenc ttext~y(37~430,~lla amplitud A de la portadora permanece constante."); tcolor (BLACK) ; ttextxy(maxx/2,maxy-~~, Ilpresionar una tecla para continuar'!) ; tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE FM DE UN TONO

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id te " fm np(void)

ni tgraph ( &graphdriver , &graphmode , . . \ \bgi ) ; axx = getmaxx ( ) ; axy = getmaxy ( ) ; unt med =maxy/2; arco ( ; etcolor (15) ; tte~txy(37,40,~~RELACI0NES MATEMATICAS FUNDAMENTALES DE FM : I r ) ; ttextxy(37,80,I1La siguiente relacion representa la signal modulada en FM: , I ) ; ttextxy(100,105,~1ú(t) = A cos (Wct + fi sen Wmt) 1 1 ) ;

tte~txy(37~125,~lDonde fi es el indice de modulacion y, Wc frecuencia de la port ttextxy(37,145,11Para signales FM de banda angosta &el ;para FM de banda ancha ttextxy(100,170, = 6w / Wm y ; ttextxy(37,190,I1Donde 6w es la Desviacion de frecuencia y,Wm frecuencia modu ttextxy(37,210,I1Desviacion de frecuencia : es la cantidad maxima que la frecue ttextxy(37,23O,l1de oscilacion se desvia del valor promedio Wc I f ) ;

ttext~y(37,250,~~Otro parametro importante de la signal es la potencia: I ! ) ;

tte~txy(100,275,~~P(frn) = A>>/2 Donde A es la amplitud de la portadora . ' I ) ;

ttext~y(37~295,~~El ancho de banda de la signal modulada en FM,para el caso sen ttext~y(37,315,~~Teoricamente el ancho de banda es infinitoruna buena aproximac tte~txy(100,340,~~B 3 2(6w + Wm ) I t ) ;

tte~txy(37~360,~lAlgunas de las aplicaciones tipicas son: Radiodifusion ,Radio %color (BLACK) ; .ttextxy(maxx/2,maxy-lO, "Press any key to continue") ; tch0; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FUNCION PARA LA FM NO PERIODICA

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id FM " no pe(void)

initgraph (&graphdriver, &graphmode, I f . . \\bgi") ; maxx = getmaxx ( 1 ; maxy = getmaxy ( ) ; punt med =maxy/2; marco ( ) ; setcolor (15) ; tte~txy(37~40,~lTEORIA SOBRE LA MODULACION NO-PERIODICA EN FM : I f ) ;

tte~txy(37,80,~~Como la modulacion en angulo es un proceso no linea1,la descrip tte~txy(37,100,~lta del espectro de una signal modulada en FM, teniendo como si tte~txy(37,120,~~ladora una signal en general (no senoidal),resulta muy dificul tte~txy(37,140,~lque la transformada de furier de una signal general modulada e tte~txy(37~160,~~no puede evaluarse.En casos especificos,la integracion puede e ttextxy(37,180,I1en forma numerica o en terminos de valores tabulados.Por lo ta ttextxy(37,2OOrt1lisis se lleva a cabo sobre unas cuantas signales moduladoras, ttextxy(37,220,111es se establecen restricciones referentes a la densidad espec ttextxy(37,240,IlHay dos mecanismos identificables en la descripcion del espect tte~txy(37,260,~~signal FM.E1 primero se debe a la tasa de cambio de la signal ttextxy(37,280,1fes decirla su contenido de frecuencia.El segundo,peculiar de 1 tte~txy(37,300,~~proporcionalidad entre la amplitud de la signal moduladora y 1 ttextxy(37,320,Ifinstantanea de la signal de FM. I ! ) ;

ttextxy(37,34Ot1IEn el caso senoidal el indice de modulacion fi = sw/Wm ,da una ttextxy(37,36Or1Ilativa de la importancia de estos dos efectos en FM.La idea de ttextxy(37,38O,l1de modulacion puede extenderse a signales mas generales.para u tte~txy(37,400,~~pulsante en genera1,puede definirse una desviacion de frecuenc ttext~y(37,420,~Iy una duracion T;si la signal es periodica,entonces T es el pe ttextxy(rnaxx/2+100,maxy-30, I t > > > continua enseguida > > > I 1 ) ; tcolor (BLACK) ; ttextxy(maxx/2,maxy-l0, "Press any key to continue") ; tch0 ; eardevice ( ) ; rco0 ; tcolor (15) ; ttext~y(32,7O,~lEl producto fil = (gw/2D)T es un numero adimenciona1,llamado ind ttext~y(32,9O,~~persion,que toma el lugar del indice de modulacion para signals ttext~y(32,11O,~lcion mas genera1es.E~ facil ver que fi1 tiende fi para modulacio tte~txy(32,130,~lPara indices de diepersion muy bajos,el contenido espectral de ttext~y(32,150,~~moduladora controla de manera principal la densidad espectral ttextxy(32,170,11dices de dispersion muy altos, la magnitud de la densidad espe tte~txy(32,190,~~controlada principalmente por la conversion de amplitud a frec ttextxy(32,21or"efectos efectos de la fase no son tan predecibles porque depen ttextxy(32,230,~lse relativa entre signals.Il) ; ttextxy(32,250,I1Para concluir con este analisis introductorio podemos argument ttext~y(32,270,~1ente,corno ya lo dijimos arriba no es posible evaluar la transf ttextxy(32,29Of1Iurier de una signal FM en genera1,por lo que el analisis se re tte~txy(32,310,~~noides puras.Aunque estas son de poco interes en comunicacione tte~txy(32~330,~ltados que se obtienen conducen a concluciones mas generales.") tcolor (BLACK) ; ttextxy(maxx/2,maxy-~O, IIPress any key to continuelf) ; tch0 ; osegraph ( ) ;

* * * * * * * * * * * * * TEORIAS DE MODULACION DIGITAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TEORIA DE LA FUNCION DIGITAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

id TE0 - DIG(void)

itgraph (&graphdriver, &graphmode, . . \\bgi" ) ; xx = getmaxx ( ) ; xy = getmaxy ( 1 ; rco0 ; tcolor (15) ; ttextxy(50,40,~~INTRODUCCION TEORICA ACERCA DE LA MODULACION DIGITAL: I ! ) ;

tte~txy(50,80,~~ Para transmitir informacion digital en un canal pasabanda,se ttextxy(50,100,r~modular la signal de banda base,esto es ,se debe transferir la tte~txy(50,120,~~cion a una portadora de frecuencia apropiada.La informacion di ttextxy(50,14O,"de ser impresa o aderida a una portadora en varias formas dife tte~txy(50,160,~~gunas tecnicas de modulacion digital mas comunmente usadas don ttextxy(50,180,"formacion digital modifica la amplitud,la fase, o la frecuenci ttextxy(50,200,"portadora en forma discreta son:"); tte~txy(50~220,~~ La modulacion en amplitud discreta,^ amplitude-shift keying ttextxy(50,240,"mutacion de frecuencia,^ frecuency-shift keying (FSK),conmutac ttextxy(50,260,"se,o phase-shift keying (PSK) . I ! ) ;

tte~txy(50~280,~~ Ventajas y desventajas que presenta el sistema de modulacion ttextxy(50,300,"comparado con el sistema de modulacion analogico:") ; ttextxy(50,325,I1VENTAJAS: a) Los errores por lo regular son correjidos") ; ttextxy (50 , 345, b) La manipulacion de la signal es simplell) ; ttext~y(50~370,~l c) Es posible un rango dinamico grande"); ttextxy(50,39O,"DESVENTAJAS: a) Generalmente requiere mayor ancho de banda"); ttextxy(50,410, b) Se requiere de sincronizacion. ' I ) ; tcolor (BLACK) ; ttextxy(maxx/2,maxy-~O, "Press any key to continue") ; tch0; osegraph ( ) ;

* * * * * * FUNCION DE TEORIA DE ASK . . . . . . . . . . . . . . . . . . . . id teo - ask(void)

itgraph (&graphdriver, &graphmode, ' I . . \\bgi") ; xx = getmaxxo ; xy = getmaxy() ; nt-med =maxy/2; rco0 ; etcolor (15) ; ttextxy(50,40,~~INTRODUCCION TEORICA DEL ESQUEMA DE MODULACION DIGITAL ASK: I f ) ;

ttextxy(50,80,I1 En el esquema de modulacion digital (ASK), la amplitud de un tte~txy(50,100,~~portadora de alta frecuencia se conmuta entre dos o mas valore ttextxy(50,120,11puesta al codigo PCM.Para el caso binario, la eleccion usual e ttextxy(50,140,llmutacion (encendido-apagado) . La signal modulada en amplitud r tte~txy(50,160,~~ consta de pulsos de RF,llamados marcas,que representan unos b ttextxy(50,180,I1y espacios que representan ceros binarios,en seguida se presen ttextxy(50,200, "presion para la signal modulada:") ; ttextxy(50,220, Ú(t) = D(t) *(A*COS Wc*t) Donde D(t) es una sig tte~txy(50,240,~~sante pasabajaSrque consiste de pulsos rectangulares con nivel ttext~y(50,260,~~ D(t) = d(t - T) . ' I ) ; ttext~y(50,280,~~ La probabilidad de error de la signal modulada es: ; ttextxy(50,300, Pe = Q (<<E/2*y) . I' ) ; tte~txy(50,325,~~ Teoricamente el ancho de banda es infinito,pero para fines p tte~txy(50~345,~~el ancho de banda,es un filtro pasabanda centrado en Wc.Del cu tte~txy(50,370,~lsalida contiene el 95% del promedio de la potencia total. Se .ttextxy(50,390,11puede mostrar que tal ancho de banda es aproximadamente 3Rb Hz tcolor (BLACK) ; .ttextxy(maxx/2,maxy-10, "Press any key to continue") ; tch0 ;

osegraph ( ) ;

id teo fsk (void) -

itgraph (&graphdriver, &graphmode, I ! . . \\bgi") ; xx = getmaxx ( ) ; xy = getmaxy ( ) ; nt med =maxy/2; rcEO ; tcolor (15) ; ttextxy(50,40,r~INTRODUCCION TEORICA DEL ESQUEMA DE MODULACION DIGITAL FSK: ' I ) ;

tte~txy(50,80,~~ En el sistema de modulacion (FSK) la frecuencia instantanea de tte~txy(50,100,~~nal portadora se conmuta entre dos valores ,en respuesta al co tte~txy(50,120,~~ Este esquema de modulacion digital cuenta con un amplio rango ttextxy(50,140,~1caciones en sistemas de transmicion de datos,a baja frecuencia tte~txy(50,160,~~ferencia se debe principalmente al desarroyo que ha tenido el tte~txy(50,180,~len las ultimas decadas,que resulta principalmente en el uso de ttext~y(50,20O,~~ladores no-coherentes,~ la relativa facilidad de generar la S ttextxy(50,220,Ifro por otra parte no es tan eficiente como el esquema (PSK),en tte~txy(50,240,~'de potencia y de su gran ancho de banda (del orden de 2Rb)."); ttextxy(50,260,I1La signal modulada (FSK) binaria,se puede representar matemati ttextxy(50,280rf1 Ú(t) = A*Cos[ Wc*t + Wd*l( D(t) dt + 6 ] ; y simbolo de int ttextxy(50,300,11Donde D(t) es una signal binaria aleatoria con niveles +1 y -1 ttextxy(50,325,11el angulo de fase de la portadora para t=O."); tte~txy(50,345,~lLa energia promedio por digito binario es : I ! ) ;

tte~txy(50,370,~~ E = A*T>>/2. I ! ) ;

tte~txy(50~390,~~Entonces la probabilidad de error en el receptor queda:Il); tte~txy(50,410,~~ Pe = Q * [ <<E/y l . tcolor (BLACK) ; ttextxy(maxx/2,maxy-~O, "Press any key to continue") ; tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE PSK

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . oid TEO-PSK (void)

itgraph ( &graphdriver , &graphmode , . . \\bgi II ) ; xx = getmaxx ( ) ; xy = getmaxy ( ) ; rco0 ; tcolor (15) ; ttext~y(50,35,~~1NTRODUCC1ON TEORICA DEL ESQUEMA DE MODULACION DIGITAL PSK: ' I ) ;

ttextxy(50,70,11 la modulacion de fase discreta orphase-shift kaying (PSK) es o tte~txy(50,90,~lnica de modulacion dispinible para la comunicacion de informaci tte~txy(50,110,~~tal sobre canales pasabanda."); tte~txy(50,130,~~ Las signals sl(t) = - A*Cos Wc*t y s2(t) = A*Cos Wc*t ; Son tte~txy(50~150,~~das para transportar digitos binarios O y 1,respectivamente.El ttextxy(50,170,11banda requerido,para la signal PSK,es el mismo para ASK 3Rb Hz tte~txy(50,190,~~ Pero la ventaja principal del esquema PSK sobre el ASK, es su tte~txy(50~210,~~miento superior,bajo las mismas condiciones de potencia pico, ttextxy(50,230, "el medio ambiente. I ! ) ; .ttextxy(50,250,11 La signal modulada (PSK),se puede representar matematicamente .ttextxy(50,270,I1 Ú(t) = D(t)*(A*Cos Wc*t) ; Donde D(t) es una signal binaria .ttextxy(50,290,Ircon periodo Tb y niveles -1 y 1.Con la portadora conmutando en

ttextxy(50r315,"niveles + A y - A-"); ttextxy(50,335, "La potencia promedio de la signal es : ; ttextxy(50,360," S = A>>/2. ' I ) ; ttextxy(50,380, "La Energia de la signal por bit e s : " ) ; ttextxy(50,400, E = S*Tb. ; ttextxy(50,420,"La probabilidad de error en terminos de S y E : I 1 ) ;

tte~txy(50,440,~~ Pe = Q (<<2E/y) ; y densidad espectral de tcolor (BLACK) ; ttextxy (maxx/2 , maxy-10 , "Press any key to continue") ; tch0 ; osegraph ( ) ;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TEORIA DE QPSK

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . id TE0 - QPSK(void)

initgraph (&graphdriver, &graphmode , U . . \\bgi" ; rnaxx = getmaxx ( ) ; maxy = getmaxy 0 ;

rco0 ; tcolor (15) ; ttext~y(50,35,~~1NTRODUCC1ON TEORICA DEL ESQUEMA DE MODULACION DIGITAL QPSK: I I )

tte~txy(50,70,~~ En la modulacion (QPSK),se transmite una de cuatro posibles si ttext~y(50~90,~Idurante cada intervalo de simbolo Ts.Estas signals son las sigu ttextxy(50,110, S1 (t) =(<<PSI *cos Wc*t tte~txy(50~130,~~ s2 (t) =- (<<PSI *Sen Wc*t ttext~y(50,150,~~ S3 (t) =- (<<PS) *cos Wc*t ttextxy(50,170, s4 (t) = (<<Ps)*Sen Wc*t. ttextxy(50,190,11 Estas signals corresponden a desfasamientos de 0%,90H,180Hy 2 tte~txy(50,210,~~se muestra en el diagrama fasorial. ttextxy(50,23Or1I En la modulacion QPSK se transmiten simbolos de dos digitos,l tte~txy(50,250,~lcon ello aumentar la velocidad de transmicion.La signal modula ttextxy(50,275,I1Ú(t) = <<Ps * b-imp(t) * Sen Wot + <<Ps * b par(t) * Cos Wot tte~txy(50~300,~~b imp(t) = p 1 ; b_par(t) = 'p 1 ; <<Ps representa la amp1 tte~txy(50,320,~lla portadora .Tales digitos son enviados a una frecuencia fb/2 ttextxy(50,340, "tanto S-par (t) y S-imp(t) requieren de la mitad del ancho de b tte~txy(50~360,~~querido por PSK.La recepcion de QPSK se lleva a cabo a traves ttextxy(5O,38Orf1ccion sincrona."); ttextxy(50,400,11 La probabilidad de error en el receptor para QPSK es : I 1 ) ; ttextxy(50,420,"Pe W 2*Q{ <<Es/y } Donde Es es la energia por simbolo. tcolor (BLACK) ; ttextxy(maxx/2,maxy-10, "Press any key to continuell) ; tch0 ; osegraph ( ) ;

BIBLIOGRAFIA

Sistemas de comunicación .......................... B. P. LATH1

Editorial Interamericana.

Sistemas de comunicación ........................... F. G. STREMLER

Editorial Addison-Wesley Iberoamericana

Priciples of commnication systems ................ TAUB - SCHILLING Editorial McGraw-Hill international editions

modulacion digital ( apuntes ............................ en C. Fausto Casco Sanchez

M.en C. Ricardo Marcelín J.

UAMI. julio 1991.