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.

validaFrec(fs,fi,Rb);
function [fs, fi] = validaFrec(fs,fi,Rb);


% 1.- Relacion entre frecuencias
%-------------------------------
   FS_FI = 1; % Constantes
   FI_RB = 2; 
   relacion = [0 0];
   
     % 1.1.-La relacion fi/Rb ha de ser un numero
     %        entero y mayor de 2 
   relacion(FI_RB) = ceil(fi/Rb);   
   if relacion(FI_RB) < 2, 
      relacion(FI_RB) = 2;
   end;
   fi = relacion(FI_RB)*Rb;
   
     % 1.2.- La relacion fs/fi debera ser constante
     %         y mayor de 2        
   relacion(FS_FI) = floor(fs/fi);
   if relacion(FS_FI) < 2,
      relacion(FS_FI) = 4;
   end;
   fs = relacion(FS_FI)*fi;
     

Contact us at files@mathworks.com