PolyMatAnalyticEVDTest

PURPOSE ^

PolyMatAnalyticEVDTest.m

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 PolyMatAnalyticEVDTest.m

 Demonstrate the use of the functions PolyMatAnalyticEigValues() and 
 PolyMatAnalyticEigVectors().

 S. Weiss 11/5/2022

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % PolyMatAnalyticEVDTest.m
0002 %
0003 % Demonstrate the use of the functions PolyMatAnalyticEigValues() and
0004 % PolyMatAnalyticEigVectors().
0005 %
0006 % S. Weiss 11/5/2022
0007 
0008 clear all; close all;
0009 
0010 %--------------------------------------------------------------
0011 %   parameters
0012 %--------------------------------------------------------------
0013 M = 3;       % spatial dimension
0014 Ll = 3;      % length of eigenvalues (must be odd)
0015 Lq = 3;      % length of eigenvectors
0016 
0017 %--------------------------------------------------------------
0018 %   construct a parahermitian matrix
0019 %--------------------------------------------------------------
0020 Lambda=zeros(M,M,Ll); 
0021 for i = 1:M,
0022   dummy = randn((Ll+1)/2,1);
0023   Lambda(i,i,:) = conv(dummy,conj(flipud(dummy)));
0024 end;   
0025 Q = zeros(3,3,1);
0026 Q(:,:,1) = eye(3);
0027 for i = 1:Lq-1,
0028    dummy = randn(M,1);
0029    dummy = dummy/norm(dummy);
0030    U = zeros(M,M,2);
0031    U(:,:,1) = eye(3)-dummy*dummy';
0032    U(:,:,2) = dummy*dummy';
0033    Q = PolyMatConv(Q,U);
0034 end;   
0035 R = PolyMatConv(Q,PolyMatConv(Lambda,ParaHerm(Q)));
0036 
0037 %--------------------------------------------------------------
0038 %   Analytic EVD
0039 %--------------------------------------------------------------
0040 L_hat = PolyMatAnalyticEigValues(R);
0041 Q_hat = PolyMatAnalyticEigVectors(R,L_hat);
0042 Lambda_hat = zeros(M,M,size(L_hat,2));
0043 for m = 1:M,
0044    Lambda_hat(m,m,:) = L_hat(m,:);
0045 end;
0046    
0047 %--------------------------------------------------------------
0048 %   Diagnostics
0049 %--------------------------------------------------------------
0050 figure(1); PolyMatDisplay(real(Lambda));
0051 figure(2); PolyMatDisplay(real(Q));
0052 disp('ground truth in Figs. 1 and 2');
0053 figure(3); PolyMatDisplay(real(Lambda_hat));
0054 figure(4); PolyMatDisplay(real(Q_hat));
0055 disp('extractions in Figs. 3 and 4');
0056

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