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.

capturaIQ.m
%------------------------------------------------------------------------
%|   capturaIQ
%------------------------------------------------------------------------
%|      Script que captura todos los parmetros del modulador IQ
%-------------------------------------------------------------------------
%|   Autor: Cesar Delgado
%|   Fecha: 19-Abril-2.004
%-------------------------------------------------------------------------

% 1.- Captura de datos del Modulador I-Q
%---------------------------------------
IQ(pPOT)     = str2num(get(paramTX(1,1),'String'));
IQ(pS_N)     = str2num(get(paramTX(1,2),'String'));
IQ(pFASE)    = str2num(get(paramTX(2,1),'String'));
IQ(pDESV)    = str2num(get(paramTX(2,2),'String'));
IQ(pROLLOFF) = str2num(get(paramTX(3,1),'String'));

% 2.- Validacin de datos del Modulador I-Q
%-------------------------------------------
%     2.1.- Factor de Roll Off: < 1 
if IQ(pROLLOFF) > 1, IQ(pROLLOFF) = 1; end;
set(paramTX(3,1),'String',num2str(IQ(pROLLOFF)));

%     2.2.- Potencia con precisin de 2 decimales
IQ(pPOT) = fix(IQ(pPOT)*100)/100;
set(paramTX(1,1),'String',num2str(IQ(pPOT)));

%     2.3.- S/N > 0 y con precisin de 2 decimales
if IQ(pS_N)<0, 
   IQ(pS_N)=abs(IQ(pS_N));    
end;
IQ(pS_N) = fix(IQ(pS_N)*100)/100;
set(paramTX(1,2),'String',num2str(IQ(pS_N)));


%     2.4.- Origen de Fases comprendido entre +180 y -180
%           Precisin de 2 decimales
if (IQ(pFASE)<-180) | (IQ(pFASE)>180), 
   IQ(pFASE)=IQ(pFASE)-round((IQ(pFASE)/360))*360;    
end;
IQ(pFASE)=fix(IQ(pFASE)*100)/100;
set(paramTX(2,1),'String',num2str(IQ(pFASE)));

%     2.5.- Desviacin de frecuencia del modulador entre 100% y -100
%           Precisin de 2 decimales
if (IQ(pDESV)>100) | (IQ(pDESV)<-100) , 
   IQ(pDESV)=0;    
end;
IQ(pDESV)=fix(IQ(pDESV)*100)/100;
set(paramTX(2,2),'String',num2str(IQ(pDESV)));

Contact us at files@mathworks.com