Source Code
Infrared Signal Coding Schemes
home top contents previous up next

%addpath("C:\\T\\ECLIPSE\\M28\\OpticalPulses\\src\\MatLab");
%savepath("C:\\T\\ECLIPSE\\M28\\OpticalPulses\\src\\MatLab");


g=[.01:.01:1.81];
lim=size(g,2);

%======================================================
% DAPPM
%----------------------------------------------------------------------------
    DAPPM=[1:lim];
    global DAPPM_A
    global DAPPM_L
    global DAPPM_LIM
    global rDAPPM=[1:DAPPM_LIM+1];
    %Average amplitude:
	global amean
    amean = 0.0; %To avoid compiler's warning of unset variable.
    %Autocorrelation at infinity:
	global rinf
    rinf = 0.0; %To avoid compiler's warning of unset variable.
    
    DAPPM_A=2;
    DAPPM_L=4;
    DAPPM_LIM=80;

    prepareDAPPM();
    %rDAPPM
    for i=1:lim
       DAPPM(i)=functionDAPPM(g(i));
    end
%----------------------------------------------------------------------------
% DAPPM
%======================================================
  
  
%======================================================
% PPM
%----------------------------------------------------------------------------
PPM_L=8;
PPM=[1:lim];
for i=1:lim
    PPM(i)=functionPPMFast(g(i),PPM_L);
    %if (PPM(i)<0)
    %     PPM(i)=0;
    %end
end
%======================================================


%======================================================
% OOK
%----------------------------------------------------------------------------
OOK=[1:lim];
for i=1:lim
    OOK(i)=functionOOK(g(i));
end
%======================================================

plot(g,OOK,'r');
legend("OOK");
hold on
plot(g,PPM,'b');
legend("PPM");
hold on
plot(g,DAPPM,'m');
legend("DAPPM");
DAPPM



Copyright (C) 2009 Konstantin Kirillov