No BSD License  

Highlights from
BPSK Simulator for Low Rate Transmisions

image thumbnail

BPSK Simulator for Low Rate Transmisions

by

 

01 Jun 2004 (Updated )

BPSK Simulator for didactical purposes. Systemic coding style.

actualizaInterfaz.m
%------------------------------------------------------------------------
%|  	actualizaInterfaz
%------------------------------------------------------------------------
%|      Script que actualiza la GUI del sistema BPSK.
%|   
%-------------------------------------------------------------------------
%|   Autor: Cesar Delgado
%|   Fecha: 19-Abril-2.004
%-------------------------------------------------------------------------

switch evento,
   
%########################################################################
%####### 0.- ARRANQUE DE GUI
%########################################################################     
case 0,
   actMarcoVisu;
   capturaGenerales;         
   capturaFiltros;
   capturaPLL;
   if ~exist([ruta 'texto.tx']),   
      capturaTexto;
   else
      textoTX = char(cargar(ruta,'texto.tx',1,inf,0));
      set(textoIn,'String',textoTX);
      clear textoTX
   end;   
   evento = 1;
   clc;
  % break;
   
%########################################################################
%####### 1.- PARMETROS GENERALES
%########################################################################
case {1, 2, 4}    % 1.1. - Editables: Rb, FI, Fs
   capturaGenerales;   
   %validaGenerales;
   %capturaGenerales;
   clc;
  % break;
case {3, 5}   % 1.2.- Desplegables con unidades de frecuencia
   capturaGenerales;
   clc;
  % break;
   
%########################################################################
%####### 2.- PARMETROS DEL TRANSMISOR
%########################################################################

%%%%%%%%%%%%%%%% MOD. I-Q
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {6, 7, 8, 9, 10}  % 2.1.- Editables: Pot.Tx, S/N, Phi, w, RollOff
   capturaIQ;
   clc;
  % break;
    
%%%%%%%%%%%%%%%% CRC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 11, % 2.2.- Desplegable con mtodo de CRC  
   capturaCRC;
   validaGuiCRC;
   clc;
  % break;
case {12, 13} % 2.3.- Editable: longitud tramo CRC y clave CRC
   capturaCRC;
   validaGuiCRC;
   clc;
  % break;
  
%%%%%%%%%%%%%%%% ENTRELAZADO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {14, 15} % 2.9.- Editables: filas y columnas del Entrelazado
   capturaEntrelazado;
   clc;
  % break;
   
%%%%%%%%%%%%%%%% ENVO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 16, % 2.11.- Editable con texto a enviar
   capturaTexto; 
   clc;
  % break;
case 17, % 2.12.- Botn Reestablecer Valores
   clc;
  % break;
case 18, % 2.13.- Botn Envo del Texto
   capturaTexto;
   enviaFichero;
   recibeFichero;
   capturaBitsTrama;
   capturaGrafSup;   
   capturaGrafInf;
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
               verF, f, color, [0 0], [1 1]);      
   zoom(figura,'on');     
   presenTXT(ruta);
   actMarcoVisu;
   clc;
  % break;
   
%########################################################################
%####### 3.- PARMETROS DEL RECEPTOR
%########################################################################

%%%%%%%%%%%%%%%% FILTROS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {19, 20, 21, 22, 23, 24} % 3.1.- Orden FI, BW FI, Uds. FI   
   capturaFiltros;           % 3.2.- Orden BB, BW BB, Uds. BB

   clc;
  % break;
   
%%%%%%%%%%%%%%%% PLL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {25, 26, 27, 28, 29} % 3.3.- Wn | Uds. Wn | Psi | Kv | Uds. Kv
   capturaPLL;    
   clc;
  % break;
   
%%%%%%%%%%%%%%%% RELOJ
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 30,  % 3.4- Editable con n Flancos para recuperacin de Reloj
   nFlancos = get(paramRX(4,2),'value')+9;
   clc;
  % break;
   
%%%%%%%%%%%%%%%% RECEPCIN
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 31, % 3.5.- Ver Texto Recibido
   presenTXT(ruta);
   clc;
   %break;
case 32,  % 3.5- Botn con Recepcin del Mensaje
   recibeFichero;
   presenTXT(ruta);
   actMarcoVisu;
   clc;
  % break;
   
   
%########################################################################
%####### 4.- PARMETROS DE LA VISUALIZACIN
%########################################################################   

%%%%%%%%%%%%%%%% GRFICA SUPERIOR
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 33,  % 4.1- CheckBox de la Grfica Superior   
   capturaGrafInf;
   capturaGrafSup;
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
               verF, f, color, [0 0], [1 1]);   
   actMarcoVisu;      
   capturaGrafSup;   
   capturaGrafInf;  
   zoom on;   
   
   clc;
  % break;
case {34, 35, 36}  % 4.2- Desplegable del Pt. de Obsv en la Grfica Superior
   capturaGrafSup;
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
               verF, f, color, [0 0], [1 0]);              
   capturaGrafSup;   
   capturaGrafInf;  
   zoom on;  
   clc;  

case {37, 38, 39}  % 4.4- Radio Button con mantenimiento de Grfica Superior   
   capturaGrafSup;  
   zoom on;   
   clc;
 
   
%%%%%%%%%%%%%%%% GRFICA INFERIOR
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

case 40,  % 4.5.- CheckBoxes indicando en que grafica visualizar
   capturaGrafSup;   
   capturaGrafInf;  
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
            verF, f, color, [0 0], [1 1]);  
   actMarcoVisu;
   capturaGrafSup;   
   capturaGrafInf;  
   zoom(figura,'on');   
   clc;
 
case {41,42, 43}  % 4.6- Desplegable del Pt. de Observacion  de la grafica inferior
   capturaGrafInf;   
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
               verF, f, color, [0 0], [0 1]);   
   capturaGrafInf;
   zoom(figura,'on');   
   clc;   
    
case {44, 45, 46}  % 4.10- Radio Buttons de las grficas inferior   
   capturaGrafInf;
   clc; 
   
   
%%%%%%%%%%%%%%%% N TRAMA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

case 47,   % 4.13.- Editable con nmero de trama a visualizar   
   evento = 0;
   capturaBarra;
   capturaGrafSup;   
   capturaGrafInf;    
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
            verF, f, color, [0 0], [1 1]);         
   capturaGrafSup;   
   capturaGrafInf;
    zoom(figura,'on');   
   clc;
   %break;
case 48,    % 4.14- Editable con nmero de bits / trama
   capturaBitsTrama;
   capturaGrafSup;   
   capturaGrafInf; 
   hold off;
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
            verF, f, color, [0 0], [1 1]);   
   capturaGrafSup;   
   capturaGrafInf;
   zoom(figura,'on');   
   clc;
   
case 49,    % 4.15.- Barra de desplazamiento con trama a visualizar    
   capturaBarra;
   capturaGrafSup;   
   capturaGrafInf;   
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
            verF, f, color, [0 0], [1 1]);    
   capturaGrafSup;   
   capturaGrafInf;
   zoom(figura,'on');
   clc;   
   %break;
 
   
%########################################################################
%####### 5.- MARCO INFERIOR: SEALES PROPUESTAS EN EL LABORATORIO
%########################################################################   
case {50,51}
   capturaLab;
   presenTXT(ruta);
   capturaBitsTrama;
   capturaGrafSup;   
   capturaGrafInf;
   hold off;
   representa(grafActivas, ruta, obsv, nTrama, bitsTrama, ... 
               verF, f, color, [0 0], [1 1]);  
   capturaGrafSup;   
   capturaGrafInf; 
   zoom on;
   clc;
%########################################################################
%####### 6.- MENUS
%########################################################################   
case {52,53,54,55,56,57} % Respuestas de los filtros
   capturaMenuFiltro;  
   zoom on;
   clc;
case {58,59,60,61} % Diagramas de Ojos
   diagramaOjos(ruta, evento-58 + 4*get(verSignalLab,'Value'),...
       IQ(pFASE), nTrama, bitsTrama, f);      
   zoom on;
   clc;
case {62}       % Constelaciones
    constelacion(ruta, get(verSignalLab,'value'), IQ(pFASE), nTrama, bitsTrama, f)
    zoom on;
    clc;
case {63,64}       % Diagramas de Bloque con sus Ptos. de Observacion
    if get(verSignalLab,'value'),
        diagramaBloques([ruta '..\Imagenes\'], evento-63);
    else
        diagramaBloques([ruta 'Imagenes\'], evento-63);
    end;    
    clc;          
end;


Contact us