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.

capturaGenerales.m
%------------------------------------------------------------------------
%|   capturaGenerales
%------------------------------------------------------------------------
%|      Script que captura todos los parmetros generales
%-------------------------------------------------------------------------
%|   Autor: Cesar Delgado
%|   Fecha: 19-Abril-2.004
%-------------------------------------------------------------------------

% 1.- Captura de datos
%----------------------
f(pRB) = str2num(get(botFrec(pRB),'String'));
f(pFI) = str2num(get(botFrec(pFI),'String'));
f(pFS) = str2num(get(botFrec(pFS),'String'));



% 2.- Comprobacin unidades
%---------------------------
   % 2.1.- Comprobamos las unidades de desplegables
aux = get(udsFrec(pFI),'value');
   
if (evento==3), %%%%%%%%%%% Si cambiamos de unidades
   if (aux>1),  % kHz
      f(pFI) = f(pFI)*1000;
      set(botFrec(pFI),'string', num2str(fix(f(pFI)*1000)/1e6));   
   else,        % Hz
      set(botFrec(pFI),'string', num2str(fix(f(pFI)*1000)/1e3));
   end;
else,       %%%%%%%%%% Si actualizamos editable
   if aux>1,   % kHz
      f(pFI) = f(pFI)*1000;
      aux = fix(f(pFI)*1000)/1000; % Precisin de 3 decimales
      set(botFrec(pFI),'String',num2str(aux/1e3));            
   end;
end;


aux = get(udsFrec(pFS),'value');
if (evento==5), % Si cambiamos de unidades
  if (aux>1),
      f(pFS) = f(pFS)*1000;
      set(botFrec(pFS),'string', num2str(fix(f(pFS)*1000)/1e6));   
   else,      
      set(botFrec(pFS),'string', num2str(fix(f(pFS)*1000)/1e3));
   end;
else,  % Si actualizamos editable
   if aux>1,
      f(pFS) = f(pFS)*1000;
      aux = fix(f(pFS)*1000)/1000;
      set(botFrec(pFS),'String',num2str(aux/1e3));
   end;
end;


   % 2.2.- Comprobamos uds. ptimas  
if f(pFI)>1e4,
   aux = fix(f(pFI)/1000)/1000;
   set(botFrec(pFI),'String',num2str(aux/1e3));
   set(udsFrec(pFI),'value',2);
elseif f(pFI)<1000,
   aux = fix(f(pFI)*1000)/1000;
   set(botFrec(pFI),'String',num2str(aux));
   set(udsFrec(pFI),'value',1);
end; 


if f(pFS)>1e4,
   aux = fix(f(pFS)*1000)/1000;
   set(botFrec(pFS),'String',num2str(aux/1e3));
   set(udsFrec(pFS),'value',2);
elseif f(pFS)<1000,
   aux = fix(f(pFS)*1000)/1000;
   set(botFrec(pFS),'String',num2str(aux));
   set(udsFrec(pFS),'value',1);
end; 


clear aux
 

Contact us