PEVDToyProblem

PURPOSE ^

[R,Lambda,Q] = PEVDToyProblem(Num,Disp);

SYNOPSIS ^

function [R,Lambda,Q] = PEVDToyProblem(ToyIndex,DisplayOn);

DESCRIPTION ^

[R,Lambda,Q] = PEVDToyProblem(Num,Disp);

  [R,Lambda,Q] = PEVDToyProblem(Num,Disp) implements a number of defined toy
  problems for a parahermitian matrix EVD. The parameter Num determines the
  scenario; for Disp='on', the power spectra of the eigenvalues will be
  displayed.

  PEVDToyProblem(1) returns a 2x2 parahermitian matrix with spectrally 
  majorised eigenvalues; all factors are polynomial matrices.

  PEVDToyProblem(2) is a 2x2 example from [Icart & Common, 2013] and [Weiss, 
  Pestana, & Proudler, TSP draft] with spectrally majorised eigenvalues. All 
  factors are transcendental matrices. The returned approximate eigenvectors 
  are NOT normalised, but can serve as a comparison w.r.t. subspace angles
  of an alternative solution.

  PEVDToyProblem(3) is another 2x2 exampled from [Icart & Common, 2013] and 
  [Weiss, Pestana, & Proudler, TSP draft] with spectrally unmajorised 
  eigenvalues. All factors are polynomial matrices.

  PEVDToyProblem(4) is an `easy' 3x3 parahermitian matrix with spectrally 
  unmajorised eigenvalues. There are only pair-wise overlaps that are well-
  separated. All factors are polynomial matrices.

  PEVDToyProblem(5) is a `difficult' 3x3 parahermitian matrix, with 
  polynomial matrix factors but algebraic multiplicities up to 3, and some
  closely-spaced intersections.

  Input parameter:
     Num        toy problem number/index
     Disp       displays characteristics (optional for Disp='on')

  Output parameter:
     R          parahermitian matrix
     Lambda     matrix of eigenvalues
     Q          parahermitian matrix

  S. Weiss, UoS, 1/12/2017

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [R,Lambda,Q] = PEVDToyProblem(ToyIndex,DisplayOn);
0002 %[R,Lambda,Q] = PEVDToyProblem(Num,Disp);
0003 %
0004 %  [R,Lambda,Q] = PEVDToyProblem(Num,Disp) implements a number of defined toy
0005 %  problems for a parahermitian matrix EVD. The parameter Num determines the
0006 %  scenario; for Disp='on', the power spectra of the eigenvalues will be
0007 %  displayed.
0008 %
0009 %  PEVDToyProblem(1) returns a 2x2 parahermitian matrix with spectrally
0010 %  majorised eigenvalues; all factors are polynomial matrices.
0011 %
0012 %  PEVDToyProblem(2) is a 2x2 example from [Icart & Common, 2013] and [Weiss,
0013 %  Pestana, & Proudler, TSP draft] with spectrally majorised eigenvalues. All
0014 %  factors are transcendental matrices. The returned approximate eigenvectors
0015 %  are NOT normalised, but can serve as a comparison w.r.t. subspace angles
0016 %  of an alternative solution.
0017 %
0018 %  PEVDToyProblem(3) is another 2x2 exampled from [Icart & Common, 2013] and
0019 %  [Weiss, Pestana, & Proudler, TSP draft] with spectrally unmajorised
0020 %  eigenvalues. All factors are polynomial matrices.
0021 %
0022 %  PEVDToyProblem(4) is an `easy' 3x3 parahermitian matrix with spectrally
0023 %  unmajorised eigenvalues. There are only pair-wise overlaps that are well-
0024 %  separated. All factors are polynomial matrices.
0025 %
0026 %  PEVDToyProblem(5) is a `difficult' 3x3 parahermitian matrix, with
0027 %  polynomial matrix factors but algebraic multiplicities up to 3, and some
0028 %  closely-spaced intersections.
0029 %
0030 %  Input parameter:
0031 %     Num        toy problem number/index
0032 %     Disp       displays characteristics (optional for Disp='on')
0033 %
0034 %  Output parameter:
0035 %     R          parahermitian matrix
0036 %     Lambda     matrix of eigenvalues
0037 %     Q          parahermitian matrix
0038 %
0039 %  S. Weiss, UoS, 1/12/2017
0040 
0041 switch ToyIndex
0042   case 1,
0043     %---------------------------------------------------------------------
0044     %   2x2 spectrally majorised matrix with polynomial factors
0045     %---------------------------------------------------------------------
0046     % one eigenvalue constant, the other highpass
0047     Lambda = zeros(2,2,3);
0048     Lambda(:,:,1) = [0 0; 0 -.2];
0049     Lambda(:,:,2) = [1 0; 0 0.5];
0050     Lambda(:,:,3) = Lambda(:,:,1)';
0051     % eigenvectors via an elementary paraunitary operation
0052     v = [1 -1]'/sqrt(2);
0053     Q = zeros(2,2,2);
0054     Q(:,:,1) = eye(2) - v*v';
0055     Q(:,:,2) = v*v';
0056     % construction of the `space-time covariance' matrix
0057     R = PolyMatConv(Q,PolyMatConv(Lambda,ParaHerm(Q)));
0058   case 2,
0059     %---------------------------------------------------------------------
0060     %   2x2 spectrally majorised matrix with transcendental factors
0061     %---------------------------------------------------------------------
0062     % problem by Sylvie Icart, also in our TSP16 draft
0063     R = zeros(2,2,3);
0064     R(:,:,1) = [0 0; 0 -2];
0065     R(:,:,2) = [1 1; 1 6];
0066     R(:,:,3) = R(:,:,1)';
0067     % determinant etc.
0068     R11 = [0 1 0]';  R12 = [0 1 0]'; R22 = [-2 6 -2]';
0069     T = R11+R22;
0070     S2 = conv(R11-R22,R11-R22) + 4*conv(R12,flipud(conj(R12)));
0071     % transcendental eigenvalues ... truncated
0072     N = 20;
0073     a = ones(N+1,1);
0074     for n = 0:N,                 % MacLaurin series
0075        for i = 0:n,
0076           a(n+1) = a(n+1)*(0.5-i);
0077        end;
0078        a(n+1) = a(n+1)/factorial(n+1);
0079     end;
0080     a = [1; a];
0081     xi = -0.355302 + j*0.198559;
0082     h1 = a.*(xi.^(0:N+1)');
0083     h2 = a.*(conj(xi).^(0:N+1)');
0084     h = conv(h1,h2);
0085     S = 2./abs(xi)*conv(h,flipud(conj(h)));
0086     L1 = S/2;
0087     L1(2*(N+1):2*(N+1)+2) = L1(2*(N+1):2*(N+1)+2) + T/2;
0088     L2 = -S/2;
0089     L2(2*(N+1):2*(N+1)+2) = L2(2*(N+1):2*(N+1)+2) + T/2;
0090     Lambda(1,1,:) = L1;
0091     Lambda(2,2,:) = L2;
0092     % transcendental eigenvectors ... truncated / approximated
0093     LL = (length(L1)-1)/2;
0094     Q = zeros(2,2,2*LL+1);
0095     % first EV
0096     Q(1,1,:) = L1;
0097     dummy = zeros(1,1,3); 
0098     dummy(1,1,:) = R22;
0099     Q(1,1,LL:LL+2) = Q(1,1,LL:LL+2) - dummy;
0100     Q(2,1,LL:LL+2) = R12;
0101     % 2nd EV
0102     Q(1,2,LL:LL+2) = R12;
0103     Q(2,2,:) = L2;
0104     dummy(1,1,:) = R11;
0105     Q(2,2,LL:LL+2) = Q(2,2,LL:LL+2) - dummy;
0106     % these would now need normalisation -- divide by the square root :-(
0107   case 3,
0108     %---------------------------------------------------------------------
0109     %   2x2 spectrally unmajorised matrix with polynomial factors
0110     %---------------------------------------------------------------------
0111     Q = zeros(2,2,2);
0112     Q(:,:,1) = [1 1; 0 0]/sqrt(2);
0113     Q(:,:,2) = [0 0; 1 -1]/sqrt(2);
0114     Lambda = zeros(2,2,3);
0115     Lambda(:,:,1) = [1 0; 0 -j];
0116     Lambda(:,:,2) = [3 0; 0 3];
0117     Lambda(:,:,3) = Lambda(:,:,1)';
0118     R = PolyMatConv(Q,PolyMatConv(Lambda,ParaHerm(Q)));
0119   case 4,
0120     %---------------------------------------------------------------------
0121     %   'easy' 3x3 spectrally unmajorised matrix with polynomial factors
0122     %---------------------------------------------------------------------
0123     Lambda = zeros(3,3,3);
0124     Lambda(1,1,:) = [j 4 -j]/4;
0125     Lambda(2,2,:) = [1/3 3 1/3]/4;  
0126     Lambda(3,3,:) = [j 2 -j]/4;
0127     Q = zeros(3,3,2);
0128     v = [1 1 1]'/sqrt(3);
0129     Q(:,:,1) = eye(3) - v*v';
0130     Q(:,:,2) = v*v';
0131     R = PolyMatConv(Q,PolyMatConv(Lambda,ParaHerm(Q)));
0132   case 5,
0133     %---------------------------------------------------------------------
0134     %   'hard' 3x3 spectrally unmajorised matrix with polynomial factors
0135     %---------------------------------------------------------------------
0136     Lambda = zeros(3,3,5);
0137     Lambda(1,1,:) = [1 0 2 0 1]/4;
0138     Lambda(2,2,:) = [0 -1 2 -1 0]/4;  
0139     Lambda(3,3,:) = [0 -j 4 j 0]/4;
0140     % eigenvectors via an elementary paraunitary operation
0141     V = [1 0 -1; 1 1 0; 1 0 1; -1 1 0]'/sqrt(2);
0142     Q = zeros(3,3,1);
0143     Q(:,:,1) = eye(3);
0144     Qi = zeros(3,3,2);
0145     for i = 1:size(V,2),
0146       Qi(:,:,1) = eye(3) - V(:,i)*V(:,i)';
0147       Qi(:,:,2) = V(:,i)*V(:,i)';
0148       Q = PolyMatConv(Q,Qi);
0149     end;
0150     % space-time covariance matrix
0151     R = PolyMatConv(Q,PolyMatConv(Lambda,ParaHerm(Q)));
0152   otherwise, 
0153     disp('toy case not implemented');
0154     R = 1; Lambda = 1; Q = 1;
0155 end;
0156 
0157 %-------------------------------------------------------------------------
0158 %  check for display option
0159 %-------------------------------------------------------------------------
0160 if exist('DisplayOn'),
0161    if strcmp(DisplayOn,'on')==1,
0162       P = PolyMatDiagSpec(Lambda,1024);
0163       plot((0:1023)/1024,abs(P));
0164       xlabel('normalised frequency'); ylabel('magnitude');
0165    end;
0166 end;
0167 
0168

Generated on Mon 03-Jul-2023 19:45:57 by m2html © 2005