No BSD License  

Highlights from
BPSK Simulator for Low Rate Transmisions

image thumbnail
from BPSK Simulator for Low Rate Transmisions by César Delgado González
BPSK Simulator for didactical purposes. Systemic coding style.

capturaPLL.m
%------------------------------------------------------------------------
%|   capturaPLL
%------------------------------------------------------------------------
%|      Script que captura todos los parmetros los filtros del RX
%-------------------------------------------------------------------------
%|   Autor: Cesar Delgado
%|   Fecha: 19-Abril-2.004
%-------------------------------------------------------------------------

% 1.- Captura de Unidades
%------------------------
aux(pWN) = get(udsRX(3,1),'value');
aux(pKV) = get(udsRX(4,1),'value');

% 2.- Captura de Valores
%------------------------
parPLL(pWN)  = str2num(get(paramRX(3,1),'string'));
parPLL(pPSI) = str2num(get(paramRX(3,2),'string'));
parPLL(pKV)  = str2num(get(paramRX(4,1),'string'));

if (evento==26), % Si cambiamos de unidades 
   if (aux(pWN)>1),
      parPLL(pWN) = parPLL(pWN)*1000;
      set(paramRX(3,1),'string', num2str(fix(parPLL(pWN)*1000)/1e6));   
   else,      
      set(paramRX(3,1),'string', num2str(fix(parPLL(pWN)*1000)/1e3));
   end;
else           % En el resto de los casos
   if aux(pWN)>1         
      parPLL(pWN)=parPLL(pWN)*1000; 
      set(udsRX(3,1),'value',2);
   end;
end;
   
if (evento==29), % Si cambiamos de Unidades 
   if (aux(pKV)>1),
      parPLL(pKV) = parPLL(pKV)*1000;
      set(paramRX(4,1),'string', num2str(fix(parPLL(pKV)*1000)/1e6));
   else,
      set(paramRX(4,1),'string', num2str(fix(parPLL(pKV)*1000)/1e3));
   end;
else,         % En el resto de los casos   
   if aux(pKV)>1,   
      parPLL(pKV)=parPLL(pKV)*1000; 
      set(udsRX(4,1),'value',2);
   end;
end;



% 3.- Eleccin de unidades apropiadas
%-------------------------------------

if (parPLL(pWN)>10e3),
   set(paramRX(3,1),'string', num2str(fix(parPLL(pWN)*1000)/1e6));
   set(udsRX(3,1),'value',2);
elseif parPLL(pWN)< 1000,
   set(paramRX(3,1),'string', num2str(fix(parPLL(pWN)*1000)/1000));
   set(udsRX(3,1),'value',1);   
end;

if (parPLL(pKV)>10e3),
   set(paramRX(4,1),'string', num2str(fix(parPLL(pKV)*1000)/1e6));
   set(udsRX(4,1),'value',2);
elseif parPLL(pKV)< 1000,
   set(paramRX(4,1),'string', num2str(fix(parPLL(pKV)*1000)/1000));
   set(udsRX(4,1),'value',1);
end;

clear aux

Contact us at files@mathworks.com