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.

capturaBitsTrama.m
%------------------------------------------------------------------------
%|   capturaBitsTrama
%------------------------------------------------------------------------
%|      Script que captura la barra desliznte de n de trama
%-------------------------------------------------------------------------
%|   Autor: Cesar Delgado
%|   Fecha: 19-Abril-2.004
%-------------------------------------------------------------------------

aux    = round(str2num(get(editBitsTrama,'string')));
nTrama = bitsTrama*nTrama;
nTrama = floor(nTrama/aux);
nTrama = nTrama + (nTrama==0); 
bitsTrama = aux;
set(editBitsTrama,'string',num2str(bitsTrama));
set(editTrama,'string',num2str(nTrama));

load([ruta 'paramTX.mat'],'lonSignal');
nBitsTot  = lonSignal/(f(3)/f(1));
maxTrama  = ceil(nBitsTot/bitsTrama);
textoBar = sprintf('1........%d........%d',round(maxTrama/2), maxTrama);
set(textoBarra,'string',textoBar);

if maxTrama <= 1,
   set(editTrama,'Enable','Off');
   set(barraTrama,'Enable','Off');
   set(editTrama,'Max',2);
elseif exist([ruta, 'tramas.tx']),
   set(editTrama,'Enable','On');
   set(barraTrama,'Enable','Off');
   set(barraTrama,'Visible','Off');
   Texto = get(barraTrama,'Callback');
   
   clear barraTrama
   
   barraTrama = uicontrol('Style','Slider', ...
	             'Units','normalized', ...
                'Position',[0.8675, 0.3200, 0.1300, 0.0350], ...
                 'Background',[.8 .8 .8],...                 
                 'SliderStep', [1/maxTrama 1.01/maxTrama],...
                 'Min',1,...
                 'Max',maxTrama,...
                 'Value',nTrama,...
                 'Callback',Texto);
end;       
  
clear textoBar Texto
           
           

Contact us