create_PSI

PURPOSE ^

Arrange LOT syntheis matrices over P overlapping windows (edges ignored)

SYNOPSIS ^

function PSI = create_PSI(in)

DESCRIPTION ^

 Arrange LOT syntheis matrices over P overlapping windows (edges ignored)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function PSI = create_PSI(in)
0002 % Arrange LOT syntheis matrices over P overlapping windows (edges ignored)
0003 
0004 % Input
0005 %   P -- desired number of LOT window
0006 %   Psi -- a fixed matrix or a function handle to create Psi over one LOT window
0007 %   Lp -- length of pth interval
0008 %           Example: Lp = [N, N, N, ... ]
0009 %   ETA -- list of eta values on the Lp
0010 
0011 P = in.P;
0012 
0013 if ~isfield(in,'Lp');
0014     Psi = in.Psi; 
0015     L = size(Psi,2); 
0016     eta = (size(Psi,1)-L)/(2);
0017     
0018     % time at the edge of the matrices...
0019     %   tle -- time at the left edge of the first window
0020     %   tre -- time at the right edge of the last window
0021     % if isfield(in,'tle'); tle = in.tle; else tle = -eta; end
0022     % if isfield(in,'tre'); tre = in.tre; else tre = L+eta; end
0023     %
0024     % Psi_1 = Psi; Psi_e = Psi;
0025     % if tle > -eta; Psi_1 = Psi(tle+eta+1:end,:); end
0026     % if tre < L+eta; Psi_e = Psi(1:tre,:); end
0027     % Pr = P*L+2*eta-(tle+eta)-(L+eta-tre);
0028     
0029     Pr = P*L+2*eta;
0030     PSI = zeros(Pr,P*L);
0031     for p = 1:P
0032         PSI((p-1)*L+1:p*L+2*eta,(p-1)*L+1:p*L) = Psi;
0033         % if p == 1
0034         %     PSI(1:size(Psi_1,1),(p-1)*L+1:p*L) = Psi_1;
0035         % elseif p==P
0036         %     PSI(end-size(Psi_e,1)+1:end,(p-1)*L+1:p*L) = Psi_e;
0037     end
0038 else
0039     Lp = in.Lp; 
0040     ETA = in.ETA; 
0041     if length(Lp)+1 ~= length(ETA)
0042         error('number of LOT parameters is not correct');
0043     end
0044     Pr = sum(Lp)+ETA(1)+ETA(end);
0045     Pc = sum(Lp);
0046     PSI = zeros(Pr,Pc);
0047     pr = 1; pc = 1;
0048     for p = 1:length(Lp)
0049         L = Lp(p);
0050         if L < ETA(p)+ETA(p+1)
0051             error('LOT interval partition parameters are not workable');
0052         end
0053         in_Psi = []; in_Psi.L = L; in_Psi.eta = ETA(p); in_Psi.eta1 = ETA(p+1);
0054         Psi = create_LOT(in_Psi); % LOT synthesis matrix over a window
0055         PSI(pr:pr+L+ETA(p)+ETA(p+1)-1,pc:pc+L-1) = Psi;
0056         pc = pc+L;
0057         pr = pr+L+ETA(p)-ETA(p+1);
0058     end
0059 end

Generated on Mon 10-Jun-2013 23:03:23 by m2html © 2005